tcg: improve output log
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-i386: fix ARPL
The arpl implementation in target-i386/translate.c uses cpu_A0temporary across a brcond op. This patch fixes that issue.
Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
configure and Makefile are not generated in qemu
Just say it to make
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: move comment
Move comment back next to main_system_bus to avoid confusion.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
AIOLIBS is not used anywhere
optionrom: remove use of implicit RM variable
add build-all to .PHONY rules
optionrom: create .PHONY variable
Don't use implicit rules for Makefile
This remove implicit rules + implicit variables.Explicit rules like the generation of %.h and %.c from %.hx still worksas expected.
As an added bonus, now the output of make -d is readable.
As another added bonus, time spend on Makefiles is way smaller....
Port host_net_add monitor command to QemuOpts
Here is where we rely on qemu_opts_parse() to handle an empty string.We could alternatively explicitly handle this here by usingqemu_opts_create() when we're not supplied any parameters, but itscleaner this way....
Port usb net to QemuOpts
We need net_client_init_from_opts() exported for this
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Port PCI NIC hotplug to QemuOpts
Final net cleanup after conversion to QemuOpts
Now that net_client_init() has no users, kill it off and renamenet_client_init_from_opts().
There is no further need for the old code in net_client_parse() either.We use qemu_opts_parse() 'firstname' facitity for that. Instead, move...
qemu/pci: clarify pci config load routine
PCI load routine has to be called with size equal to 256 (otherwise itwill crash in weird ways). So assert this, making code clearer.Also avoid dynamically sized array on stack - good for portability.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
qemu/pci: make pci not depend on msix
Making pci device cleanup msix automatically makes pci.c depend onmsix.c, which is IMO messy. Since devices do msix_init it's easy andnatural for them to also do msix_uninit.
Port -net none and -net nic to QemuOpts
We use a table of network types to look up the initialization functionand parameter descriptions in net_client_init().
For now, we use QemuOpts for the 'none' and 'nic' types. Subsequentpatches port the other types too and the special casing is removed....
Port -net user to QemuOpts
The handling of guestfwd and hostfwd requires the previous changesto allow multiple values for each parameter. The only way to accessthose multiple values is to use qemu_opt_foreach().
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
Port -net tap to QemuOpts
Some parameters are not valid with fd=. Rather than having a separateparameter description table for validating fd=, it's easir to justcheck for those invalid parameters later.
Note, the need to possible lookup a file descriptor name from the...
Port -net socket to QemuOpts
Port -net vde to QemuOpts
The net_vde_init() change is needed because we now pass NULL pointersinstead of empty strings for group/sock if they're not set.
Port -net dump to QemuOpts
Note, not incrementing nb_host_devs in net_init_dump() is intentional.
Clean up legacy code in net_client_init()
Now that we've ported everything over to QemuOpts, we can kill offall the cruft in net_client_init().
Note, the 'channel' type requires special handling as it uses aformat that QemuOpts can't parse
Drop config_error(), use qemu_error() instead
Diagnostic output goes to stderr, except when we're in a monitorcommand, when it goes to the monitor instead.
config_error() implements this with a monitor argument: if it'snon-null, report there, else to stderr. This obliges us to pass the...
Remove bogus error message from qemu_opts_set()
The only way qemu_opts_create() can fail is if a QemuOpts with that idalready exists and fail_if_exists=1. In that case, we already printan error which makes more sense than the one in qemu_opts_set().
Remove double error message in qemu_option_set()
qemu_opt_set() prints an error message in all failure cases, soqemu_set_option() doesn't need to print another error.
Remove double error message for -device option parsing
qemu_opts_parse() gives a suitable error message in all failure casesso we can remove the error message from the caller.
Make qemu_opts_parse() handle empty strings
Rather than making callers explicitly handle empty strings by usingqemu_opts_create(), we can easily have qemu_opts_parse() handleempty parameter strings.
Add qemu_opts_validate() for post parsing validation
Several qemu command line options have a parameter whose value affectswhat other parameters are accepted for the option.
In these cases, we can have an empty description table in theQemuOptsList and once the option has been parsed we can use a suitable...
Never overwrite a QemuOpt
Rather than overwriting a QemuOpt, just add a new one to the tail andalways do a reverse search for parameters to preserve the samebehaviour. We use this order so that foreach() iterates over the optsin their original order....
Add qemu_net_opts
The first step in porting -net to QemuOpts. We do not include parameterdescriptions in the QemuOptsList because we use the first parameter tochoose which descriptions validate against.
Use qemu_strdup() for NICInfo string fields
Don't assign a static string to NICInfo::model
Make NICInfo string fields non-const
We now only assign strdup()ed strings to these fields, never staticstrings.
aliguori: fix build for ppc_prep and mips_jazz
Move memset() from net_client_uninit() to net_client_init()
zeroing a structure before using it is more common than zeroing afterusing it. Also makes the setting of nd->used more obvious.
Use qemu_strdup() for VLANClientState string fields
Make net_client_init() consume slirp_configs even on error
net_slirp_init() walks slirp_configs, and stops when it encounters onethat doesn't work. Instead of consuming slirp_configs members there,consume them in the sole caller. This makes sure all are consumed....
Don't exit() in config_error()
Propagating errors up the call chain is tedious. In startup code, wecan take a shortcut: terminate the program. This is wrong elsewhere,the monitor in particular.
config_error() tries to cater for both customers: it terminates the...
add host_device format description to qemu-img manpage
Converting files using "qemu-img convert" onto logical volumes (or anyblock device) you need to use the currently undocumented "host_device" format. This patch adds the required documentation to the manpage....
offer right-ctrl as a grab option
Add support for -ctrl-grab to use the right-ctrl button to grab/releasethe mouse in SDL.
The multi-button ctrl-alt and ctrl-alt-shift grab buttons present anaccessibility problem to users who cannot press more than one button...
Revert "Fix exit on 'pci_add' Monitor command"
This reverts commit 0148fde54c2478ea8a47c8dbfe4c0fb8bda4d996.
As requested by Luiz.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Register rtc options for -set
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: support 16 bit read from SCBCmd (== 2)
This is necessary to support OpenBSD 4.2 install, withoutthis change it triggers an assert.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Reorganize option rom (+linux kernel) loading.
This patch adds infrastructure to maintain memory regions which must berestored on reset. That includes roms (vga bios and option roms on pc),but is also used when loading linux kernels directly. Features:...
target-i386: move recently added vmstate fields at the end of the structure
This reduce the impact on hosts that have addressing modes with limitedoffsets. Suggested by Laurent Desnogues.
block/raw: Add create_options for host_device
Today host_devices have a create function, so they also need a create_optionsfield to prevent qemu-img from complaining.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Improve error reporting on file access
By making the error reporting include strerror(errno), it gives the usera bit more indication as to why qemu failed. This is particularlyimportant for people running qemu as a non root user.
Signed-off-by: Justin M. Forbes <jforbes@redhat.com>...
x86: fix miss merge
There was a missmerge, and then we got a tail recursive call to cpu_post_loadwithout case base :)
Win32: Fix vnc support.
Without this patch, qemu on windows crashes as soonas a vnc client connects.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-pci: return error if virtio_console_init fails
Currently only one virtio_console device is supported. Trying to addmultiple devices fails and such failure should be reported back to theqdev init functions.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
restore CFLAGS check for conflict and fix recursive CFLAGS issue
cc-option uses more make-syntax to replace the shell "if/else".
Issue with recursive += is fixed by doing the first assignmentsimply-expanded, as explained inhttp://www.gnu.org/software/make/manual/html_node/Appending.html...
Set revision in eeprom correctly for 82557 versions.
This is necessary to make FreeBSD recognize the device as 82557 - otherwise itsdriver will use unsupported features and fail to work.
set correct CS seg limit and flags on sipi
TCG works with incorrect values somehow.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix pci_vga_init() not to ignore bus argument
Commit a414c306 converted all VGA devices to qdev. It usedpci_create_simple() for all devices, except for this one it usedpci_create(). That's wrong, because it uses PCI bus#0 regardless ofthe bus argument. Fix by switching to pci_create_noinit()....
Fix pci_add storage not to exit on bad first argument
Monitor command "pci_add ADDR storage ..." does its work inqemu_pci_hot_add_nic(). It called pci_create(..., ADDR) to create thedevice. That's wrong, because pci_create() terminates the programwhen ADDR is invalid....
Make it obvious that pci_nic_init() can't fail
Before this patch, pci_nic_init() returns NULL when it can't find themodel in pci_nic_models[]. Except this can't happen, becauseqemu_check_nic_model_list() just searched for model inpci_nic_models[], and terminated the program on failure....
Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() tocreate the NIC. When MODEL is unknown or "?", this prints to stderrand terminates the program.
Change pci_nic_init() not to treat "?" specially, and to return NULL...
pci_create() is now unused, remove it
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rename pci_create_noinit() to pci_create()
It's qdev_create() specialized for PCI, so name it accordingly.
qemu: clean up target page usage in msix
Since cpu_register_phys_memory does not require size to be a multiple oftarget page size, simply make msix page size 0x1000. Do this in msix,reverting part of 5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we nolonger have to pass target page around....
qemu/virtio-pci: remove unnecessary check
it's safe to call msix_write_config if msixis disabled, so call it unconditionally onpci config write.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qcow2: Increase maximum cluster size to 2 MB
This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128kclusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bittruncation and wraparound of signed integers. Therefore some variables need to...
eepro100: Don't allow guests to fail assertions
The idea of using assert() for input validation is rather questionable.Let's remove it from eepro100, so that guests need to find more interestingways if they want to crash qemu.
This patch replaces asserts that are directly dependent on guest-accessible...
vnc: Set invalid buffer pointers to NULL
After qemu_free, the pointers for input and outputbuffers are no longer valid, so set them to NULL(most other calls of qemu_free in vnc.c use thispattern, too).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
qdev: show name of device that fails init
When initialising a device fails, show the name of the failing device.
The current behaviour is to silently exit on such errors.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/pci: refactor code/symbolic constants
refactor code slightly, adding symbolic constants and functions, andusing macros where possible. This will also make following resetpatches easier.
No functional changes.
qemu/pci: reset device registers on bus reset
Reset BARs and a couple of other registers on bus reset, as per PCIspec.
fix comment on cpu_register_physical_memory_offset
We don't require full pages in cpu_register_physical_memory,except for RAM.
floppy: move dma setup + drive connect to fdctrl_init_common()
isa-fdc is completely qdev-ified with this patch applied, allconfiguration uses properties.
sysbus-fdc needs dma_channel config fixed. There is only one user(mips_jazz) which uses dma channel 0. Can anyone knowing this...
qdev: don't crash on unset drive properties.
serial: convert isa to qdev
Everything using standard isa I/O ports and IRQ windup is considerdbeing an actual isa device. That are all serial_init() users exceptmips_mipssim() which seems to have a non-standard IRQ windup.
baud rate is fixed at 115200 now as no caller passed in something else....
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them asDeviceState * rather than void *.
qemu/virtio: fix reset with device removal
virtio pci registers its own reset handler, but fails to unregister it,which will lead to crashes after device removal. Solve this problem byswitching to qdev reset handler, which is automatically unregistered....
scsi: hotplug windup
pci: hotplug windup
Create qdev infrastructure for pci hotplug. PCI bus implementationsmust register a handler for hotplug. Creating a new PCI device willautomagically hot-plug it in case the PCI bus in question supports this.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
pci: windup acpi-based hotplug
Switch over acpi-based PCI hotplug for pc over to the newqdev-based pci hotplugging.
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
refactor drive_hot_add
move pci device lookup into the "case IF_SCSI" section, so wecan do something else for other interface types.
allow if=none for drive_add
Allow adding unconnected host drives by specifying if=none like it ispossible with -drive. They can be put in use with drive attributes,like this:
drive_add dummy if=none,id=mydisk,file=/some/disk.img device_add virtio-blk-pci,drive=mydisk...
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
floppy: add drive properties.
qdev: device free fixups.
Two bug fixes: * When freeing a device we unregister even stuff we didn't register in the first place because the ->init() callback failed. * When freeing a device with child busses attached, we fail to zap the child bus (and the devices attached to it)....
Add exit callback to DeviceInfo.
This adds a exit callback for device destruction to DeviceInfo, sowe can hook cleanups into qdev device destruction.
Followup patches will put that into use.
Implement scsi device destruction
pci: use qdev for device destruction.
pci_unregister_device is static now and hooked into Devicestate->exit.qdev_free(pci_device) works now.
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
usb: hook unplug into qdev, cleanups + fixes.
Hook into DeviceInfo->exit().
handle_destroy() must not free the state struct, this is handledby the new usb_qdev_exit() function now.
qdev_free(usb_device) works now.
Fix usb hub to qdev_free() all connected devices on unplug....
switch qemu-config to qemu_error
qdev hotplug: infrastructure and monitor commands.
Adds device_add and device_del commands. device_add accepts acceptsthe same syntax like the -device command line switch. device_delexpects a device id. So you should tag your devices with ids if you...
usb: hotplug windup
switch ide bus to inplace allocation.
support inplace allocation for pci bus, split irq init.
convert pci bridge to qdev
piix_pci: kill PIIX3IrqState
update pcbios submodule to current master
update pc-bios/bios.bin
parallel: convert isa to qdev
switch scsi bus to inplace allocation.
switch usb bus to inplace allocation.
temporary fix for on_vcpu
Recent changes made on_vcpu hit the abort() path, even with the IO threaddisabled. This is because cpu_single_env is no longer set when we call thisfunction. Although the correct fix is a little bit more complicated that that,...
allow qdev busses allocations be inplace