summaryrefslogtreecommitdiff
path: root/savevm.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-02Merge remote branch 'upstream' into nextAvi Kivity1-0/+6
* upstream: (43 commits) Initialize a variable in all cases Fix uint8_t comparison with negative value Fix a warning on OpenSolaris Correctly identify multiple cpus in SMP systems Remove unused constant jazz led: Fix debug prints xilinx-s3adsp: Add support for loading u-boot images. xilinx-s3adsp: Fix loading of raw binaries. Remove unused eventfd.h migration: Accept 'cont' only after successful incoming migration mips64el: fulong: PCI_DEVFN() clean up. remove pointless if from vl.c fix variable type in qemu-io.c remove dead code from hw/loader.c savevm: Fix memory leak of compat struct virtio-serial: Check if more max_ports specified than we can handle linux-user: fix build on hosts not using guest base linux-user: Protect against allocation failure in load_symbols. cris: Correct settls1 testcase. cris: Correct ADDO and ADDOQ testcases. ... Signed-off-by: Avi Kivity <avi@redhat.com>
2010-08-01Merge commit 'fd2f659ee3f6f991f4f194f3fde5c9f957fd663d' into upstream-mergeAvi Kivity1-1/+85
* commit 'fd2f659ee3f6f991f4f194f3fde5c9f957fd663d': (58 commits) Update version for 0.13.0-rc0 vnc: better default values for VNC options vnc: tight: split send_sub_rect vnc: tight: fix rgb_prepare_row vnc: add missing lock for vnc_cursor_define() vnc: threaded VNC server qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit vnc: fix tight png memory leak vnc: encapsulate encoding members vnc: tight: stop using qdict for palette stuff vnc: tight: specific zlib level and filters for each compression level vnc: tight add PNG encoding vnc: tight: remove a memleak in send_jpeg_rect() vnc: tight: don't forget do at the last color vnc: rename vnc-encoding-* vnc-enc-* ui: move all ui components in ui/ vnc: add lossy option vnc: JPEG should be disabled if the client don't set tight quality vnc: tight: add JPEG and gradient subencoding with smooth image detection Initial documentation for migration ... Merge 0.13 branch point. Signed-off-by: Avi Kivity <avi@redhat.com>
2010-07-30savevm: Fix memory leak of compat structAlex Williamson1-0/+6
Forgot to check for and free these. Found-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-26vmstate: add subsections codeJuan Quintela1-1/+85
This commit adds subsections for each device section. Subsections is the way to handle information that don't need to be sent to de destination of a migration because its values are not needed. It is the way to handle optional information. Notice that only the source can decide if the information is optional or not. The destination needs to understand all subsections that it receives to have a sucessful load. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-13Merge commit '1724f04985367b15751f11f4a9558f8736b2ab59' into upstream-mergeMarcelo Tosatti1-5/+79
* commit '1724f04985367b15751f11f4a9558f8736b2ab59': qemu_ram_alloc: Add DeviceState and name parameters virtio-net: Incorporate a DeviceState pointer and let savevm track instances eepro100: Add a dev field to eeprom new/free functions savevm: Make use of DeviceState Conflicts: cpu-common.h exec.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-07-13Merge commit '0be71e324f774a77243f1a1487f468232d69542b' into upstream-mergeMarcelo Tosatti1-9/+13
* commit '0be71e324f774a77243f1a1487f468232d69542b': savevm: Add DeviceState param pci: Implement BusInfo.get_dev_path() qdev: Add a get_dev_path() function to BusInfo pc: Allocate all ram in a single qemu_ram_alloc() Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-07-13Merge commit 'd17b5288d91c935cc8795fa0620721da0a3865e1' into upstream-mergeMarcelo Tosatti1-27/+4
* commit 'd17b5288d91c935cc8795fa0620721da0a3865e1': (54 commits) Remove uses of ram.last_offset (aka last_ram_offset) make rtc alatm work scsi: Fix SCSI bus reset Fix io-thread build breakage of a88790a14f Include sys/mman.h before qemu-options.h cris: Avoid debug clobbering for both I & D MMU state. cris: Dont clobber the MMU state across calls to cpu_get_phys_page_debug. cris: Break out rand LFSR update into a separate func. block: Handle multiwrite errors only when all requests have completed block: Fix early failure in multiwrite qemu-img: avoid calling exit(1) to release resources properly pc: Fix CMOS info for drives defined with -device ide: Make PIIX and ISA IDE init functions return the qdev block: Fix virtual media change for if=none block: Clean up bdrv_snapshots() savevm: Survive hot-unplug of snapshot device blkdebug: Initialize state as 1 blkdebug: Free QemuOpts after having read the config blkdebug: Fix set_state_opts definition qemu-option: New qemu_opts_reset() ... Conflicts: exec.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-07-06savevm: Add DeviceState paramAlex Williamson1-9/+13
When available, we'd like to be able to access the DeviceState when registering a savevm. For buses with a get_dev_path() function, this will allow us to create more unique savevm id strings. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-06savevm: Make use of DeviceStateAlex Williamson1-5/+79
For callers that pass a device we can traverse up the qdev tree and make use of the BusInfo.get_dev_path information for creating unique savevm id strings. This avoids needing to rely on the instance number, which can cause problems with device initialization order and hotplug. For compatibility, we also store away the old id string and instance so we can accept migrations from VMs as we add new get_dev_path implementations. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-02savevm: Survive hot-unplug of snapshot deviceMarkus Armbruster1-27/+4
savevm.c keeps a pointer to the snapshot block device. If you manage to get that device deleted, the pointer dangles, and the next snapshot operation will crash & burn. Unplugging a guest device that uses it does the trick: $ MALLOC_PERTURB_=234 qemu-system-x86_64 [...] QEMU 0.12.50 monitor - type 'help' for more information (qemu) info snapshots No available block device supports snapshots (qemu) drive_add auto if=none,file=tmp.qcow2 OK (qemu) device_add usb-storage,id=foo,drive=none1 (qemu) info snapshots Snapshot devices: none1 Snapshot list (from none1): ID TAG VM SIZE DATE VM CLOCK (qemu) device_del foo (qemu) info snapshots Snapshot devices: Segmentation fault (core dumped) Move management of that pointer to block.c, and zap it when the device it points becomes unusable. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-21Merge commit 'c9b62a7ee14f51c9fa473a5bbefe264c904613ee' into upstream-mergeAvi Kivity1-40/+50
* commit 'c9b62a7ee14f51c9fa473a5bbefe264c904613ee': blockdev: Give drives internal linkage block: Decouple savevm from DriveInfo block: New bdrv_next() monitor: Make "commit FOO" complain when FOO doesn't exist block: Decouple block device "commit all" from DriveInfo block: Move error actions from DriveInfo to BlockDriverState cow: use qemu block API cow: stop using mmap cow: use pread/pwrite qcow2: Restore L1 entry on l2_allocate failure Fix regression for "-drive file=" savevm: Really verify if a drive supports snapshots qcow2: Return real error code in load_refcount_block qcow2: Allow alloc_clusters_noref to return errors qcow2: Allow get_refcount to return errors vpc: Read/write multiple sectors at once Conflicts: blockdev.c Signed-off-by: Avi Kivity <avi@redhat.com>
2010-06-21Merge commit '666daa68234b5b1758652633cab07d5ca6046a5b' into upstream-mergeAvi Kivity1-1/+1
* commit '666daa68234b5b1758652633cab07d5ca6046a5b': blockdev: Collect block device code in new blockdev.c qdev: Move declaration of qdev_init_bdrv() into qdev.h blockdev: Hide QEMUMachine from drive_init() block: call the snapshot handlers of the protocol drivers close all the block drivers before the qemu process exits block: Assume raw for drives without media Fix error message in drive_init scsi: Fix info qtree for scsi-disk.ver scsi: Turn drive serial into a qdev property scsi-disk.serial ide: Fix info qtree for ide-drive.ver ide: Turn drive serial into a qdev property ide-drive.serial qdev: Don't leak string property value on hot unplug qdev: New qdev_prop_set_string() ide: Split non-qdev code off ide_init2() ide: Change ide_init_drive() to require valid dinfo argument ide: Split ide_init1() off ide_init2() ide: Remove redundant IDEState member conf ide: Remove useless IDEDeviceInfo members unit, drive usb: Remove unused usb_device_add() parameter is_hotplug Conflicts: hw/pc.c sysemu.h vl.c Signed-off-by: Avi Kivity <avi@redhat.com>
2010-06-15block: Decouple savevm from DriveInfoMarkus Armbruster1-22/+18
We find snapshots by iterating over the list of drives defined with drive_init(). This misses host block devices defined by other means. Such means don't exist now, but will be introduced later in this series. Iterate over all host block devices instead, with bdrv_next(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-15savevm: Really verify if a drive supports snapshotsMiguel Di Ciurcio Filho1-22/+36
Both bdrv_can_snapshot() and bdrv_has_snapshot() does not work as advertized. First issue: Their names implies different porpouses, but they do the same thing and have exactly the same code. Maybe copied and pasted and forgotten? bdrv_has_snapshot() is called in various places for actually checking if there is snapshots or not. Second issue: the way bdrv_can_snapshot() verifies if a block driver supports or not snapshots does not catch all cases. E.g.: a raw image. So when do_savevm() is called, first thing it does is to set a global BlockDriverState to save the VM memory state calling get_bs_snapshots(). static BlockDriverState *get_bs_snapshots(void) { BlockDriverState *bs; DriveInfo *dinfo; if (bs_snapshots) return bs_snapshots; QTAILQ_FOREACH(dinfo, &drives, next) { bs = dinfo->bdrv; if (bdrv_can_snapshot(bs)) goto ok; } return NULL; ok: bs_snapshots = bs; return bs; } bdrv_can_snapshot() may return a BlockDriverState that does not support snapshots and do_savevm() goes on. Later on in do_savevm(), we find: QTAILQ_FOREACH(dinfo, &drives, next) { bs1 = dinfo->bdrv; if (bdrv_has_snapshot(bs1)) { /* Write VM state size only to the image that contains the state */ sn->vm_state_size = (bs == bs1 ? vm_state_size : 0); ret = bdrv_snapshot_create(bs1, sn); if (ret < 0) { monitor_printf(mon, "Error while creating snapshot on '%s'\n", bdrv_get_device_name(bs1)); } } } bdrv_has_snapshot(bs1) is not checking if the device does support or has snapshots as explained above. Only in bdrv_snapshot_create() the device is actually checked for snapshot support. So, in cases where the first device supports snapshots, and the second does not, the snapshot on the first will happen anyways. I believe this is not a good behavior. It should be an all or nothing process. This patch addresses these issues by making bdrv_can_snapshot() actually do what it must do and enforces better tests to avoid errors in the middle of do_savevm(). bdrv_has_snapshot() is removed and replaced by bdrv_can_snapshot() where appropriate. bdrv_can_snapshot() was moved from savevm.c to block.c. It makes more sense to me. The loadvm_state() function was updated too to enforce that when loading a VM at least all writable devices must support snapshots too. Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-04Merge commit '358c360feb346dff8f911e2d1dbcdd6319393f1d' into upstream-mergeMarcelo Tosatti1-2/+3
* commit '358c360feb346dff8f911e2d1dbcdd6319393f1d': (64 commits) migration: respect exit status with exec: tcg-i386: fix a typo tcg-i386: declare tcg_out_tlb_load() inline tcg-i386: Remove some ifdefs in qemu_ld/st. tcg-i386: Split out tlb load function. tcg-i386: Swap order of TLB hit and miss paths. tcg-i386: Split out TLB Hit path from qemu_ld/st. tcg-i386: Tidy data16 prefixes. sparc64: fix umul and smul insns sparc64: fix udiv and sdiv insns sparc64: improve ldf and stf insns sparc64: use symbolic name for MMU index v1 sparc64: fix ldxfsr insn sparc64: fix 32bit load sign extension sparc64: fix missing address masking v1 sparc64: fix tag access register on mmu traps vnc: add missing target for vnc-encodings-*.o vnc: tight: don't forget the third color vnc: tight: don't forget last pixel in tight_encode_indexed_rect Monitor: Drop QMP documentation from code ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-06-04blockdev: Collect block device code in new blockdev.cMarkus Armbruster1-1/+1
Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-03migration: respect exit status with exec:Anthony Liguori1-2/+3
This patch makes sure that if the exec: process exits with a non-zero return status, we treat the migration as failed. This fixes https://bugs.launchpad.net/qemu/+bug/391879 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-16Merge commit 'fc0bdd995ca36a34cc576ee706df239dd5ff79a9' into upstream-mergeAvi Kivity1-6/+17
* commit 'fc0bdd995ca36a34cc576ee706df239dd5ff79a9': acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c mc146818rtc: Register vmstate via qdev fdc: Register vmstate via qdev serial: Register vmstate via qdev vmstate: Add support for alias ID vmstate: Drop unused post_save handler sh: sm501: add 2D engine support tmp105: update the register in post_load where it needs updating. cpus: add one 'const' e1000: make some tables 'const' ide: make a table 'const' vga: make some tables 'const' Compile virtio-9p-debug and virtio-9p-local once Update SeaBIOS pckbd: don't use any static state apb: don't use any static state target-sparc: Fix wrong printf argument Update OpenBIOS images to r771 kvm: fix 80000001.EDX supported bit filtering Conflicts: Makefile.target Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-15vmstate: Add support for alias IDJan Kiszka1-3/+17
Some legacy users (mostly PC devices) of vmstate_register manage instance IDs on their own, and that unfortunately in a way that is incompatible with automatically generated ones. This so far prevents switching those users to vmstates that are registered by qdev. To establish a migration path, this patch introduces the concept of alias IDs. They can be passed to an extended vmstate registration service, and qdev provides a set service to be used during device init. find_se will consider the alias in addition to the default ID. We can then start generating the default ID automatically and writing it on vmsave, thus converting that format without breaking support for upward migration. The user is required specify the highest vmstate version for which the alias is required. Once this version falls behind the minimum required for a specific vmstate, an assertion triggers to motivate cleaning up the obsolete alias. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15vmstate: Drop unused post_save handlerJan Kiszka1-3/+0
No device makes use of it anymore. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-03Merge commit '74db920c32cea5b52a91b81f2bfd467fc070e942' into upstream-mergeMarcelo Tosatti1-1/+1
* commit '74db920c32cea5b52a91b81f2bfd467fc070e942': (34 commits) virtio-9p: Create a commandline option -fsdev virtio-serial: Fix check for 'assert'; prevent NULL derefs Fix the RARP protocol ID Fix tiny leak in qemu_opts_parse lsi: Properly initialize controller state on reset lsi: Purge request queue on soft reset Fix boot once option vnc: split encoding in specific files vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 block: Release allocated options after bdrv_open qemu-img rebase: Fix output image corruption block: Add wr_highest_sector blockstat qcow2: Implement bdrv_truncate() for growing images qcow2: Remove abort on free_clusters failure qemu-img: Add 'resize' command to grow/shrink disk images block: Cache total_sectors to reduce bdrv_getlength calls raw-posix: Use pread/pwrite instead of lseek+read/write qcow2: Avoid shadowing variable in alloc_clusters_noref() block: Set backing_hd to NULL after deleting it vmdk: Convert to bdrv_open ... Conflicts: vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-05-03Fix the RARP protocol IDStefan Berger1-1/+1
The packet(s) sent out after migration are supposed to be RAPR type of packets. If they are supposed to go anywhere useful, the RAPR ethernet identifier needs to be fix. Also see http://www.iana.org/assignments/ethernet-numbers for 0x8035 for RARP. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-05Merge commit '1ecda02b24a13f501e747b8442934829d82698ae' into upstream-mergeMarcelo Tosatti1-11/+12
* commit '1ecda02b24a13f501e747b8442934829d82698ae': error: Replace qemu_error() by error_report() error: Don't abuse qemu_error() for non-error in scsi_hot_add() error: Don't abuse qemu_error() for non-error in qbus_find() error: Don't abuse qemu_error() for non-error in qdev_device_help() error: New error_printf() and error_vprintf() Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-05Merge commit '2f7920166d1aa402104d7b30d0225e71588f91f9' into upstream-mergeMarcelo Tosatti1-13/+11
* commit '2f7920166d1aa402104d7b30d0225e71588f91f9': error: Move qemu_error & friends into their own header error: Simplify error sink setup error: Move qemu_error() & friends from monitor.c to own file monitor: Factor monitor_set_error() out of qemu_error_internal() block: Simplify usb_msd_initfn() test for "can read bdrv key" monitor: Separate "default monitor" and "current monitor" cleanly tools: Remove unused cur_mon from qemu-tool.c pc: Factor common code out of pc_boot_set() and cmos_init() pc: Fix error reporting for -boot once savevm: Fix -loadvm to report errors to stderr, not the monitor usb: Remove disabled monitor_printf() in usb_read_file() Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-17Merge remote branch 'markus/qerror' into stagingAnthony Liguori1-14/+13
2010-03-16error: Replace qemu_error() by error_report()Markus Armbruster1-11/+12
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
2010-03-16savevm: Fix -loadvm to report errors to stderr, not the monitorMarkus Armbruster1-13/+11
A monitor may not even exist. Change load_vmstate() to use qemu_error() instead of monitor_printf(). Parameter mon is now unused, remove it.
2010-03-15Merge commit 'c6dc6f63bf7ee418c0a430a8b3386817ede69940' into upstream-mergeMarcelo Tosatti1-1/+1
* commit 'c6dc6f63bf7ee418c0a430a8b3386817ede69940': (24 commits) x86/cpuid: move CPUID functions into separate file Fix build with -DNDEBUG in CFLAGS Fix a typo in error message fdc: fix drive property handling. install: honor DESTDIR on sysconfdir population configure: fix --sysconfdir specification target-arm: make RFE usable with any register tcg/arm: implement andc op tcg: update README with const and pure helpers tcg/arm: correctly save/restore registers in prologue/epilogue target-i386: fix commit c22549204a6edc431e8e4358e61bd56386ff6957 target-mips: update address space definitions Fix Sparc host build breakage Fix more wrong usermode virtual address types Fix usermode virtual address type FreeBSD ppc_init_cacheline_sizes(): add missing #includes tcg/ppc[64]: Only define addend load helpers in softmmu case Remove userspace target_phys_addr_t Target specific usermode cleanup Remove cpu_get_phys_page_debug from userspace emulation ... Conflicts: target-i386/helper.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-13Fix a typo in error messageBlue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-04KVM: Rework VCPU state writeback APIJan Kiszka1-0/+4
This grand cleanup drops all reset and vmsave/load related synchronization points in favor of four(!) generic hooks: - cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave) - cpu_synchronize_all_post_init in qemu_loadvm_state (writeback after vmload) - cpu_synchronize_all_post_init in main after machine init - cpu_synchronize_all_post_reset in qemu_system_reset (writeback after system reset) These writeback points + the existing one of VCPU exec after cpu_synchronize_state map on three levels of writeback: - KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run) - KVM_PUT_RESET_STATE (on synchronous system reset, all VCPUs stopped) - KVM_PUT_FULL_STATE (on init or vmload, all VCPUs stopped as well) This level is passed to the arch-specific VCPU state writing function that will decide which concrete substates need to be written. That way, no writer of load, save or reset functions that interact with in-kernel KVM states will ever have to worry about synchronization again. That also means that a lot of reasons for races, segfaults and deadlocks are eliminated. cpu_synchronize_state remains untouched, just as Anthony suggested. We continue to need it before reading or writing of VCPU states that are also tracked by in-kernel KVM subsystems. Consequently, this patch removes many cpu_synchronize_state calls that are now redundant, just like remaining explicit register syncs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-01qemu-kvm: Rework VCPU state writeback APIJan Kiszka1-0/+4
This grand cleanup drops all reset and vmsave/load related synchronization points in favor of four(!) generic hooks: - cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave) - cpu_synchronize_all_post_init in qemu_loadvm_state (writeback after vmload) - cpu_synchronize_all_post_init in main after machine init - cpu_synchronize_all_post_reset in qemu_system_reset (writeback after system reset) These writeback points + the existing one of VCPU exec after cpu_synchronize_state map on three levels of writeback: - KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run) - KVM_PUT_RESET_STATE (on synchronous system reset, all VCPUs stopped) - KVM_PUT_FULL_STATE (on init or vmload, all VCPUs stopped as well) This level is passed to the arch-specific VCPU state writing function that will decide which concrete substates need to be written. That way, no writer of load, save or reset functions that interact with in-kernel KVM states will ever have to worry about synchronization again. That also means that a lot of reasons for races, segfaults and deadlocks are eliminated. cpu_synchronize_state remains untouched, just as Anthony suggested. We continue to need it before reading or writing of VCPU states that are also tracked by in-kernel KVM subsystems. Consequently, this patch removes many cpu_synchronize_state calls that are now redundant, just like remaining explicit register syncs. It does not touch qemu-kvm's special hooks for mpstate, vcpu_events, or tsc loading. They will be cleaned up by individual patches. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-01-31Merge commit '625a5befc2e3200b396594f002218d235e375da5' into upstream-mergeMarcelo Tosatti1-1/+1
* commit '625a5befc2e3200b396594f002218d235e375da5': virtio: Add memory statistics reporting to the balloon driver New API for asynchronous monitor commands block: avoid creating too large iovecs in multiwrite_merge vnc_refresh: calling vnc_update_client might free vs block/raw-posix: Abort on pread beyond end of non-growable file win32: pair qemu_memalign() with qemu_vfree() win32/sdl: Fix toggle full screen Tell users about out-of-memory errors PCI: fix bridge configuration fix savevm command without id or tag qcow2: rename two QCowAIOCB members block: kill BDRV_O_CREAT block: clean up bdrv_open2 structure a bit virtio-console: Automatically use virtio-serial-bus for the older -virtioconsole invocation virtio-console: Rename virtio-serial.c back to virtio-console.c Fix generation of config-host.h ide save/restore current transfer fields PCI: do_pci_info(): PCI bridge devices support Conflicts: hw/virtio-balloon.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-01-26fix savevm command without id or tagMarcelo Tosatti1-1/+1
savevm without id or tag segfaults in: (gdb) bt #0 0x00007f600a83bf8a in __strcmp_sse42 () from /lib64/libc.so.6 #1 0x00000000004745b6 in bdrv_snapshot_find (bs=<value optimized out>, sn_info=0x7fff996be280, name=0x0) at savevm.c:1631 #2 0x0000000000475c80 in del_existing_snapshots (name=<value optimized out>, mon=<value optimized out>) at savevm.c:1654 #3 do_savevm (name=<value optimized out>, mon=<value optimized out>) Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-07Merge commit '19e65b47f60c68d7e8c96aa0a36223c5a0d3422b' into upstream-mergeMarcelo Tosatti1-2/+1
* commit '19e65b47f60c68d7e8c96aa0a36223c5a0d3422b': Add missing newline at the end of options list Update Sparc64 OpenBIOS image to r649. Sparc64: move APB PCI memory base to correct location PCI: Fix bus address conversion sparc: make command line available also via firmware configuration device tcg: Add tcg_unsigned_cond. block/bochs: improve format checking block.c: fix warning with _FORTIFY_SOURCE block/bochs.c: fix warning with _FORTIFY_SOURCE savevm.c: fix warning with _FORTIFY_SOURCE slirp/misc.c: fix warning with _FORTIFY_SOURCE hw/pc.c: fix warnings with _FORTIFY_SOURCE path.c fix warning with _FORTIFY_SOURCE PCI: partially revert 2e01c8cf4b076b05013c87723e3fc710b50a0a7a Conflicts: qemu-options.hx Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2009-12-25savevm.c: fix warning with _FORTIFY_SOURCEKirill A. Shutemov1-2/+1
CC savevm.o cc1: warnings being treated as errors savevm.c: In function 'file_put_buffer': savevm.c:342: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result make: *** [savevm.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-07Merge commit 'e9b2e81889d9877415710484b876ee57a42b0bcb' into upstream-mergeAvi Kivity1-35/+89
* commit 'e9b2e81889d9877415710484b876ee57a42b0bcb': (140 commits) Introduce rerror option for drives Rename DriveInfo.onerror to on_write_error ram migration: Properly reset statistics qemu-opts: Release id on deletion live migration: Serialize vmstate saving in stage 2 block migration: Skip zero-sized disks block migration: Increase dirty chunk size to 1M block migration: Add support for restore progress reporting block migration: Report progress also via info migration block migration: Fix outgoing progress output live migration: Propagate output monitor to callback handler block migration: Report overall migration progress live migration: Allow cleanup after cancellation or error ram migration: Stop loading on error block migration: Add error handling/propagation block migration: Consolidate block transmission block migration: Consolidate mig_read_device_bulk into mig_save_device_bulk block migration: Clean up use of total_sectors block migration: Initialize remaining BlkMigState fields block migration: Switch device and block lists to QSIMPLEQ ... Conflicts: vl.c Signed-off-by: Avi Kivity <avi@redhat.com>
2009-12-03live migration: Serialize vmstate saving in stage 2Jan Kiszka1-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>
2009-12-03live migration: Propagate output monitor to callback handlerJan Kiszka1-15/+16
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>
2009-12-03live migration: Allow cleanup after cancellation or errorJan Kiszka1-2/+17
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>
2009-12-03vmstate: Add support for multiplying size for a constantJuan Quintela1-0/+6
When the size that we want to transmit is in another field, but in an unit different that bytes Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03vmstate: Add support for VBUFFERSJuan Quintela1-6/+14
Support for buffer that are pointed by a pointer (i.e. not embedded) where the size that we want to use is a field in the state. We also need a new place to store where to start in the middle of the buffer, as now it is a pointer, not the offset of the 1st field. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03vmstate: fix missing ARRAY_OF_POINTERS support on save stateJuan Quintela1-0/+3
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03vmstate: Avoid seekingJan Kiszka1-3/+17
Seeking on vmstate save/load does not work if the underlying file is a stream. We could try to make all QEMUFile* forward-seek-aware, but first attempts in this direction indicated that it's saner to convert the few qemu_fseek-on-vmstates users to plain reads/writes. This fixes various subtle vmstate corruptions where unused fields were involved. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03net: fix qemu_announce_self()Mark McLoughlin1-13/+13
Now that we have a way to iterate NICs. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-02Merge commit '365369847f2827b14b96c52d0fbaf9cce404e68a' into upstream-mergeAvi Kivity1-4/+1
* commit '365369847f2827b14b96c52d0fbaf9cce404e68a': tcg: increase TCG_MAX_OP_SIZE to 192 tcg: initial mips support target-mips: use physical address in lladdr target-mips: add a function to do virtual -> physical translations target-mips: split code raising MMU exception in a separate function target-mips: factorize load/store code in op_helper.c Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18 Add support for GNU/kFreeBSD Signed-off-by: Avi Kivity <avi@redhat.com>
2009-11-29Add support for GNU/kFreeBSDAurelien Jarno1-4/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-22Merge commit '0e607a80d323ba9f46dee71cd07380c4eb5c2b0a' into upstream-mergeAvi Kivity1-16/+46
* commit '0e607a80d323ba9f46dee71cd07380c4eb5c2b0a': (22 commits) kvm: x86: Refactor use of interrupt_bitmap kvm: Add arch reset handler Enable migration without shared storage from the monitor Block live migration Expose a mechanism to trace block writes char: rename qemu_chr_reset to qemu_chr_generic_open char: Remove special init_reset handling char: don't limit data sent to backends to 1k per buffer ARM PB-A8 support LAN9118 emulation mips_r4k: fix reset PPC64: map Uni-North AGP bus aka fix Linux boot PPC64: Partial fix to Linux crash: revert to old devfn PCI: make duplicate devfn allocation fatal Do not execute shell scripts directly mips malta: fix indentation target-mips: fix indentation mips-malta: fix reset mips: fix cpu_reset memory leak fix make clean targets ... Carry changes to qemu-kvm-x86.c. Signed-off-by: Avi Kivity <avi@redhat.com>
2009-11-22Merge commit '91011d4f3b7c311a42b842f6682ac64a2372d2b7' into upstream-mergeAvi Kivity1-19/+39
* commit '91011d4f3b7c311a42b842f6682ac64a2372d2b7': pci: Fix function pci_default_write_config mips: fix CPU reset Fix PPC crash ARM MPCore tweaks Realview/EB procid hacks pci: fix the conversion of config field from array to pointer qemu_system_reset: we need to call it before loadvm/migration fdc: fix vmstate variable passed vnc: improve capslock handling. e1000 fix: read access to some registers is missing. Fix 32-bit overflow in parallels image support kvm ppc: Remove unused label kvm: Move KVM mp_state accessors to i386-specific code virtio-blk: Pass read errors to the guest savevm: Delete existing snapshots in all images Fix incoming migration fix type in CFLAGS name Conflicts: hw/pci.c Signed-off-by: Avi Kivity <avi@redhat.com>
2009-11-17Block live migrationlirans@il.ibm.com1-16/+46
This patch introduces block migration called during live migration. Block are being copied to the destination in an async way. First the code will transfer the whole disk and then transfer all dirty blocks accumulted during the migration. Still need to improve transition from the iterative phase of migration to the end phase. For now transition will take place when all blocks transfered once, all the dirty blocks will be transfered during the end phase (guest is suspended). Changes from v4: - Global variabels moved to a global state structure allocated dynamically. - Minor coding style issues. - Poll block.c for tracking of dirty blocks instead of manage it here. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12savevm: Delete existing snapshots in all imagesKevin Wolf1-19/+39
When creating a snapshot we can run into the situation that the first disk doesn't have a snapshot, but the second one does have one with the same name as the new snapshot. In this case, qemu doesn't recognize that there is a snapshot to be overwritten, so it starts to save the new snapshot and errors out later when it tries to snapshot the second image. With this patch, snapshots on secondary images are overwritten just like on the first image. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>