summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build for mingw32 on windows ($@ in macro)Stefan Weil2009-12-031-4/+5
| | | | | | | | | | | | | | | | | | Make using mingw32 on windows does not preserve $@ in macros when they are modified using this pattern: target: macro += something This behaviour results in an error when QEMU_CFLAGS containing "-MMD -MP -MT $@" is modified for compilation of source files which use SDL: $@ will expand to nothing, -MT no longer has the correct argument (it will take the next one from the command line) and the build will fail or run with a wrong command line. The problem is fixed by using a new macro QEMU_DGFLAGS which is not modified by a target rule. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: Fix warning from code reviewStefan Weil2009-12-031-1/+3
| | | | | | | | | | | | | A code review run by Steve Grubb complained about code in e1000.c: In hw/e1000.c at line 89, vlan is declared to be 4 bytes. At line 382 is an attempt to do a memmove over it with a size of 12. This was fixed by splitting the memmove in two calls and adding a comment to the declaration of vlan and data. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* multiboot: Fix module loading and setting of mmap.Adam Lackorzynski2009-12-033-2/+5
| | | | | | Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make -kernel for linux work with bochsbiosAlexander Graf2009-12-031-5/+5
| | | | | | | | | | | | | | While trying to run -kernel with -bios pc-bios/pcbios.bin, I realized that I was actually writing data to %es, but only set up %ds to a 32-bit segment we want to write to. So at the end of the day the data hasn't actually been copied. Oops. So here's a fix to set ES instead of DS, which makes -kernel work with BOCHS bios again (and actually makes the code do the correct thing)! Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix recently introduced bugs in -usbdevice hostMarkus Armbruster2009-12-031-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 26a9e82a has the following flaws: * It enabled DEBUG. * It referenced two properties by the wrong name in usb_host_device_open(), which crashes with "qdev_prop_set: property "USB Host Device.bus" not found". * It broke "-usbdevice host:auto:..." by calling parse_filter() incorrectly. * It broke parsing of "-usbdevice host:BUS.ADDR" and "-usbdevice host:VID:PRID" with a trivial pasto. * It broke wildcards in "-usbdevice host:auto:...". Before, the four filter components were stored as int, and the wildcard was encoded as -1. The faulty commit changed storage to uint32_t, and the wildcard encoding to 0. But it failed to update parse_filter() accordingly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix description of size parameter in qemu-img's help textPierre Riteau2009-12-031-3/+3
| | | | | | | | Valid description taken from qemu-img.texi, although it would be better to have this information recorded in only one place. Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Suppress optionrom build on Solaris x86Andreas Faerber2009-12-031-1/+1
| | | | | | | | | | | | | | | | | | To avoid the build failing with: gcc -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno- builtin -I/export/home/andreas/QEMU/qemu -Wall -Wstrict-prototypes - Werror -fomit-frame-pointer -fno-builtin -I/export/home/andreas/QEMU/ qemu -c -o multiboot.o multiboot.S /var/tmp//ccd3aWyk.s: Assembler messages: /var/tmp//ccd3aWyk.s:15: Error: value of 512 too large for field of 1 bytes at 0000000000000002 gmake[1]: *** [multiboot.o] Error 1 disable recursion into pc-bios/optionrom, as done for Darwin already. Signed-off-by: Andreas Faerber <andreas.faerber@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename DriveInfo.onerror to on_write_errorKevin Wolf2009-12-031-0/+4
| | | | | | | | Either rename variables and functions to refer to write errors (which is what they actually do) or introduce a parameter to distinguish reads and writes. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* SCSI: Fix Standard INQUIRY dataLaszlo Ast2009-12-031-3/+3
| | | | | | | | | | Vendor identification, product identification and product revision level should be padded with spaces without a terminating NULL character, see SCSI-2 standard, 8.2.5.1 Standard INQUIRY data. Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: x86: Add support for VCPU event statesJan Kiszka2009-12-035-0/+100
| | | | | | | | | This patch extends the qemu-kvm state sync logic with support for KVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception, interrupt and NMI states. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: x86: Fix merge artifact of f8d926e9 about mp_stateJan Kiszka2009-12-031-4/+4
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* targe-ppc: Sync CPU state for KVMAlexander Graf2009-12-032-0/+8
| | | | | | | | | | | Some recent change made PPC guests always start at address 0x0 because env isn't synced to kvm_state on first bootup. I'm not sure if this is the correct bugfix, but at least it makes PPC boot again with KVM enabled. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-ppc: Get MMU state on register syncAlexander Graf2009-12-031-0/+30
| | | | | | | | | | | | While x86 only needs to sync cr0-4 to know all about its MMU state and enable qemu to resolve virtual to physical addresses, we need to sync all of the segment registers on PPC to know which mapping we're in. So let's grab the segment register contents to be able to use the "x" monitor command and also enable the gdbstub to resolve virtual addresses. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* qemu: cleanup unused macros in cirrusMichael S. Tsirkin2009-12-031-35/+0
| | | | | | | | | | | Cirrus vga has a copy of many PCI macros, and it doesn't even use them. Clean up. We also don't need to override header type as it is NORMAL by default. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu: make cirrus init value pci spec compliantMichael S. Tsirkin2009-12-031-1/+0
| | | | | | | | | | | | | | | | | PCI memory should be disabled at reset, otherwise we might claim transactions at address 0. I/O should also be disabled, although for cirrus it is harmless to enable it as we do not have I/O bar. Note: bios fix needed for this patch to work was already applied: previously bios incorrently assumed that it does not need to enable i/o unless device has i/o bar. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Don't leak file descriptorsKevin Wolf2009-12-0320-34/+178
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-img: There is more than one host device driverKevin Wolf2009-12-033-2/+9
| | | | | | | | I haven't heard yet of anyone using qemu-img to copy an image to a real floppy, but it's a valid use case. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qcow2: Fix some more qemu_malloc falloutKevin Wolf2009-12-032-8/+21
| | | | | | | Oh joy... Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qcow2: Store exact backing format lengthKevin Wolf2009-12-031-7/+9
| | | | | | | | | | | | | Currently qcow2 unnecessarily rounds up the length of the backing format string to the next multiple of 8. At the same time, the array in BlockDriverState can only hold 15 characters, so in effect backing formats with 9 characters or more don't work (e.g. host_device). Save the real string length and things start to work for all valid image format names. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-blk: Implement rerror optionKevin Wolf2009-12-032-6/+9
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: Implement rerror optionKevin Wolf2009-12-033-18/+39
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce rerror option for drivesKevin Wolf2009-12-033-19/+44
| | | | | | | | | | | | | rerror controls the action to be taken when an error occurs while accessing the guest image file. It corresponds to werror which already controls the action take for write errors. This purely introduces parsing rerror command line option into the right structures, real support for it in the device emulation is added in the following patches. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename DriveInfo.onerror to on_write_errorKevin Wolf2009-12-035-8/+16
| | | | | | | | Either rename variables and functions to refer to write errors (which is what they actually do) or introduce a parameter to distinguish reads and writes. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ram migration: Properly reset statisticsJan Kiszka2009-12-031-1/+3
| | | | | | | | As we may do more than one migration (cancellation, live backup), reset bytes_transferred on stage 1. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-opts: Release id on deletionJan Kiszka2009-12-031-1/+2
| | | | | | | | The opts id is always allocated via qemu_strdup, so it need not be const, but it has to be released on opts deletion. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* live migration: Serialize vmstate saving in stage 2Jan Kiszka2009-12-031-1/+8
| | | | | | | | | | | | | | | | | | | | The effect of this patch with current block migration is that its stage 2, ie. the first full walk-through of the block devices will be performed completely before RAM migration starts. This ensures that continuously changing RAM pages are not re-synchronized all the time while block migration is not completed. Future versions of block migration which will respect the specified downtime will generate a different pattern: After RAM migration has started as well, block migration may also continue to inject dirty blocks into the RAM stream once it detects that the number of pending blocks would extend the downtime unacceptably. Note that all this relies on the current registration order: block before RAM migration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Skip zero-sized disksJan Kiszka2009-12-031-2/+8
| | | | | | | No need to migrate emptiness (risking divide by zero later on). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Increase dirty chunk size to 1MJan Kiszka2009-12-031-1/+1
| | | | | | | | 4K is too small for efficiently saving and restoring multi-GB block devices. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Add support for restore progress reportingJan Kiszka2009-12-031-8/+22
| | | | | | | | Inject progress report in percentage into the block live stream. This can be read out and displayed easily on restore. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Report progress also via info migrationJan Kiszka2009-12-033-0/+45
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Fix outgoing progress outputJan Kiszka2009-12-031-24/+30
| | | | | | | | Report progress of an outgoing live migration to the monitor instead of stdout. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* live migration: Propagate output monitor to callback handlerJan Kiszka2009-12-0311-59/+73
| | | | | | | | | In order to allow proper progress reporting to the monitor that initiated the migration, forward the monitor reference through the migration layer down to SaveLiveStateHandler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Report overall migration progressJan Kiszka2009-12-031-16/+30
| | | | | | | | | | So far progress reporting only works for the first block device. Fix this by keeping an overall sum of sectors to be migratated, calculating the sum of all processed sectors, and finally basing the progress display on those values. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* live migration: Allow cleanup after cancellation or errorJan Kiszka2009-12-035-8/+54
| | | | | | | | | | Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a live migration. This gives the involved subsystems a chance to clean up dynamically allocated resources. Namely, the block migration layer can now free its device descriptors and pending blocks. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ram migration: Stop loading on errorJan Kiszka2009-12-031-1/+5
| | | | | | | | Besides catching real errors, this also allows to interrrupt the qemu process during restore. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Add error handling/propagationJan Kiszka2009-12-031-16/+41
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Consolidate block transmissionJan Kiszka2009-12-031-65/+39
| | | | | | | | Based on the original patch by Pierre Riteau: Use a common blk_send function to transmit a block. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Consolidate mig_read_device_bulk into mig_save_device_bulkJan Kiszka2009-12-031-99/+50
| | | | | | | Both functions share a lot of code, so make them one. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Clean up use of total_sectorsJan Kiszka2009-12-031-3/+3
| | | | | | | | We already save total_sectors in BlkMigDevState, let's use this value during the migration and avoid to recalculate it needlessly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Initialize remaining BlkMigState fieldsJan Kiszka2009-12-031-0/+5
| | | | | | | | In case we restart a migration, submitted, read_done, transferred, and print_completion need to be reinitialized to 0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Switch device and block lists to QSIMPLEQJan Kiszka2009-12-031-35/+22
| | | | | | | Based on the original patch by Pierre Riteau. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Import a simple queue implementation from NetBSDPierre Riteau2009-12-031-4/+105
| | | | | | Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Drop dead codeJan Kiszka2009-12-032-25/+1
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Avoid indirection of block_mig_stateJan Kiszka2009-12-031-47/+44
| | | | | | | | No need to push block_mig_state to the heap and, thus, establish an indirection. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Avoid large stack bufferJan Kiszka2009-12-031-5/+9
| | | | | | | Move a potentially large buffer from stack to heap. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Cleanup dirty tracking codeJan Kiszka2009-12-032-22/+25
| | | | | | | | | | | This switches the dirty bitmap to a true bitmap, reducing its footprint (specifically in caches). It moreover fixes off-by-one bugs in set_dirty_bitmap (nb_sectors+1 were marked) and bdrv_get_dirty (limit check allowed one sector behind end of drive). And is drops redundant dirty_tracking field from BlockDriverState. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Rework constants APIJan Kiszka2009-12-033-72/+58
| | | | | | | | | Instead of duplicating the definition of constants or introducing trivial retrieval functions move the SECTOR constants into the public block API. This also obsoletes sector_per_block in BlkMigState. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block migration: Fix coding style and whitespacesJan Kiszka2009-12-034-241/+212
| | | | | | | No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* migration: Catch multiple start commandsJan Kiszka2009-12-031-1/+7
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* migration: Fix use of file after releaseJan Kiszka2009-12-031-3/+3
| | | | | | | | | qemu_fclose frees the passed file structure, but do_migrate_set_speed may access it later on. Fix it by setting file NULL in migrate_fd_cleanup and checking for this. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud