History | View | Annotate | Download (54.5 kB)
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'kraxel/migration.2' into staging
Wrap recv to avoid warnings
Avoid warnings like these by wrapping recv(): CC slirp/ip_icmp.o/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]...
vmstate: add no_migrate flag to VMStateDescription
This allows to easily tag devices as non-migratable,so any attempt to migrate a virtual machine with thedevice in question active will make migration fail.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reset system before loadvm
In case we load the vmstate during incoming migration, we start from aclean, default machine state as we went through system reset before. Butif we load from a snapshot, the machine can be in any state. That cancause troubles if loading an older image which does not carry all state...
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix some typos in comments and documentation
helpfull -> helpfulusefull -> usefulcotrol -> control
and a grammar fix.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Move CPU related functions to cpus.h
Move declarations of CPU related functions to cpus.h. Adjust the only user.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix migration uint8 arrys handled
commit 82fa39b75181b730d6d4d09f443bd26bcfcd045c
only contains half of the fix. It forgots the save state fix forUINT8 indexes.
Anthony, please apply, without this migration using hpet is broken.(only current user)....
Merge branch 'for-anthony' of git://github.com/bonzini/qemu
change all rt_clock references to use millisecond resolution accessors
This was done with:
sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
change all other clock references to use nanosecond resolution accessors
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
Add error message for loading snapshot without VM state
It already fails, but it didn't tell the user why.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>
vmstate: Fix varrays with uint8 indexes
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: add UINT32 VARRAYS
vmstate: add VMSTATE_UINT32_EQUAL
Improve vm_stop reason declarations
Define and use dedicated constants for vm_stop reasons, they actuallyhave nothing to do with the EXCP_* defines used so far. At this chance,specify more detailed reasons so that VM state change handlers canevaluate them....
savevm: fix corruption in vmstate_subsection_load().
Although it's rare to happen in live migration, when the head of abyte stream contains 0x05 which is the marker of subsection, theloader gets corrupted because vmstate_subsection_load() continues even...
blockdev: Fix regression in -drive if=scsi,index=N
Before commit 622b520f, index=12 meant bus=1,unit=5.
Since the commit, it means bus=0,unit=12. The drive is created, butnot the guest device. That's because the controllers we use withif=scsi drives (lsi53c895a and esp) support only 7 units, and...
savevm: Fix no_migrate
The no_migrate save state flag is currently only checked in thelast phase of migration. This means that we potentially wastea lot of time and bandwidth with the live state handlers beforewe ever check the no_migrate flags. The error message printed...
migration/savevm: no need to flush requests
There's no need to flush requests after vmstopas vmstop does it for us automatically now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Tested-by: Jason Wang <jasowang@redhat.com>
migration: allow rate > 4g
I'd like to disable bandwidth limit or make it very high,Use int64_t all over to make values >= 4g work.
add VMSTATE_BOOL
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
Delete write only variables
Compiling with GCC 4.6.0 20100925 produced warnings like:/src/qemu/net/tap-win32.c: In function 'tap_win32_open':/src/qemu/net/tap-win32.c:582:12: error: variable 'hThread' set but not used [-Werror=unused-but-set-variable]...
Fix OpenBSD build warning
Fix this warning: CC savevm.o/src/qemu/savevm.c: In function `do_savevm':/src/qemu/savevm.c:1900: warning: passing arg 1 of `localtime_r' from incompatible pointer type
It looks like on OpenBSD the type of tv_sec in struct timeval is still...
monitor: make 'info snapshots' show only fully available snapshots
The output generated by 'info snapshots' shows only snapshots that exist on theblock device that saves the VM state. This output can cause an user toerroneously try to load an snapshot that is not available on all block devices....
savevm: Generate a name when run without one
When savevm is run without a name, the name stays blank and the snapshot issaved anyway.
The new behavior is when savevm is run without parameters a name will becreated automaticaly, so the snapshot is accessible to the user without needing...
Support marking a device as non-migratable
A non-migratable device should be removed before migration and re-added after.
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
loadvm: improve tests before bdrv_snapshot_goto()
This patch improves the resilience of the load_vmstate() function, doingfurther and better ordered tests.
In load_vmstate(), if there is any error on bdrv_snapshot_goto(), except if theerror is on VM state device, load_vmstate() will return zero and the VM will be...
savevm: Fix memory leak of compat struct
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>
vmstate: add subsections code
This commit adds subsections for each device section.Subsections is the way to handle information that don't need to be sentto de destination of a migration because its values are not needed. It isthe way to handle optional information. Notice that only the source can...
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
savevm: Make use of DeviceState
For callers that pass a device we can traverse up the qdev tree andmake use of the BusInfo.get_dev_path information for creating uniquesavevm id strings. This avoids needing to rely on the instance number,which can cause problems with device initialization order and hotplug....
savevm: Survive hot-unplug of snapshot device
savevm.c keeps a pointer to the snapshot block device. If you manageto get that device deleted, the pointer dangles, and the next snapshotoperation will crash & burn. Unplugging a guest device that uses it...
block: Decouple savevm from DriveInfo
We find snapshots by iterating over the list of drives defined withdrive_init(). This misses host block devices defined by other means.Such means don't exist now, but will be introduced later in thisseries.
Iterate over all host block devices instead, with bdrv_next()....
savevm: Really verify if a drive supports snapshots
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 thingand have exactly the same code. Maybe copied and pasted and forgotten?...
blockdev: Collect block device code in new blockdev.c
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>
migration: respect exit status with exec:
This patch makes sure that if the exec: process exits with a non-zero returnstatus, we treat the migration as failed.
This fixes https://bugs.launchpad.net/qemu/+bug/391879
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manageinstance IDs on their own, and that unfortunately in a way that isincompatible with automatically generated ones. This so far preventsswitching those users to vmstates that are registered by qdev....
vmstate: Drop unused post_save handler
No device makes use of it anymore.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix the RARP protocol ID
The packet(s) sent out after migration are supposed to be RAPR type ofpackets. If they are supposed to go anywhere useful, the RAPR ethernetidentifier needs to be fix.
Also see http://www.iana.org/assignments/ethernet-numbers for 0x8035 for...
Merge remote branch 'markus/qerror' into staging
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
savevm: Fix -loadvm to report errors to stderr, not the monitor
A monitor may not even exist.
Change load_vmstate() to use qemu_error() instead of monitor_printf().Parameter mon is now unused, remove it.
Fix a typo in error message
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
fix savevm command without id or tag
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...
savevm.c: fix warning with _FORTIFY_SOURCE
CC savevm.occ1: warnings being treated as errorssavevm.c: In function 'file_put_buffer':savevm.c:342: error: ignoring return value of 'fwrite', declared with attribute warn_unused_resultmake: *** [savevm.o] Error 1...
live migration: Serialize vmstate saving in stage 2
The effect of this patch with current block migration is that its stage2, ie. the first full walk-through of the block devices will beperformed completely before RAM migration starts. This ensures that...
live migration: Allow cleanup after cancellation or error
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel alive migration. This gives the involved subsystems a chance to clean updynamically allocated resources. Namely, the block migration layer can...
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor thatinitiated the migration, forward the monitor reference through themigration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
vmstate: Add support for VBUFFERS
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 thebuffer, as now it is a pointer, not the offset of the 1st field....
vmstate: Add support for multiplying size for a constant
When the size that we want to transmit is in another field, but in anunit different that bytes
vmstate: Avoid seeking
Seeking on vmstate save/load does not work if the underlying file is astream. We could try to make all QEMUFile* forward-seek-aware, but firstattempts in this direction indicated that it's saner to convert the fewqemu_fseek-on-vmstates users to plain reads/writes....
vmstate: fix missing ARRAY_OF_POINTERS support on save state
net: fix qemu_announce_self()
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>
Add support for GNU/kFreeBSD
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Block live migration
This patch introduces block migration called during live migration. Blockare being copied to the destination in an async way. First the code willtransfer the whole disk and then transfer all dirty blocks accumulted duringthe migration....
Fix incoming migration
commit b04c4134d6de28c249277de19e523bfbe4aebbd6broke incoming migration. After talking with Gleb, code was intendedto be the way is in this fix. This fixes migration here.
savevm: Delete existing snapshots in all images
When creating a snapshot we can run into the situation that the first diskdoesn't have a snapshot, but the second one does have one with the same name asthe new snapshot.
In this case, qemu doesn't recognize that there is a snapshot to be...
net: use qemu_send_packet_raw() in qemu_announce_self()
Use qemu_send_packet_raw to send gratuitous arp. This will ensure thatvnet header is handled properly.
Also, avoid sending the gratuitous packet to the guest. There doesn'tappear to be any reason for doing that and the code will currently just...
net: remove unused includes of if_tun.h and if_tap.h
Looks like these are just artifacts of vl.c being split up.
vmstate: add VMS_VARRAY_UINT16_UNSAFE (varrays with uint16 indexes)
It don't check types.Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Add VMSTATE_BUFFER_UNUSED
It allows to have 'things' in savevm format not backed in the device stateSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Rename VMS_VARRAY to VMS_VARRAY_INT32
vnmstate: fix name for uint8_equal
vmstate: add VMSTATE_UINT16_EQUAL[_V]
Send a RARP packet after migration.
Currently, after a migration qemu sends a broadcast packet to updateswitches' MAC->port mappings.
Unfortunately, it picks a random (constant) ethertype and crosses itsfingers that no one else is using it.
This patch causes it to send a RARP packet instead. RARP was chosen for...
net: use qtailq for vlan and client lists
Patchworks-ID: 35507Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Add suppot for field_exist() test
vmstate: add support for arrays of pointers
We need this to send arrays of timers
vmstate: remove const for put operations
In a later patch, we introduce pre_save() and post_save() functions.The whole point of that operation is to change things in the state.Without this patch, we have to remove the const qualifier in eachuse with a cast...
vmstate: add version_id argument to post_load
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
Include sys-queue.h early to override system queue definitions on BSD
vmstate: add support for uint8_t equal
vmstate: add sensible arguments to vmstate_unregister()
vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd).
vmstate: rename run_after_load() -> post_load()
This naming was used in kvm tree, and is easier to remember
vmstate: Add pre_load() hook
vmstate: Add pre/post_save() hooks
Remove SaveVM v2 support
In previosu series I remove v2 support for RAM (that was the version that wassupported when SaveVM v3 appeared). Now we can't load RAM for any image saved in SaveVM v2, we can as well remove SaveVM v2 entirely.
Note: That SaveVM RAM was at v2 when General SaveVM support went from v2 to v3 makes talking about versions confusing at least...
savevm: Convert savevm handlers list to TAILQ
savevm: Convert loadvm handlers list to LIST
monitor: Port handler_1 to use QDict
This commit ports command handlers that receive one argument to usethe new monitor's dictionary.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
VMState: Fix sub-structs versioning
We can't check the version in a substruct, it is not stored anywhere
Add VMState support for variable sized arrays
This patch add supports for variable sized arrays whose size isanother field of the state.
Add VMState support for static sized buffers (uint_8)
This patch adds support for static sized buffer and typecheks that the buffer is right.
Add VMState support for int32_t check value
We read the saved value and check that it is less or equal than the onestored in the structure.
Add VMState support to run a function after load
Use return value from load_state() call back
Add vmstate_load() and vmstate_save() functions
New VMstate save/load infrastructure
This patch introduces VMState infrastructure, to convert the save/loadfunctions of devices to a table approach. This new approach has thefollowing advantages:- it is type-safe- you can't have load/save functions out of sync...
Add VMState support for pointers
This patch adds support for saving pointers to values
Add VMState support for arrays
This patch adds support for saving arrays inside the struct
Add VMState support for structs
This patch adds support for saving one VMStateDescription from otherVMStateDescription.
We read the saved value and check that it is the same that the oneis stored in the structure.
split do_loadvm() into do_loadvm() and load_vmstate()
do_loadvm() is now called from the monitor.load_vmstate() is called by do_loadvm() and when -loadvm command line is used.Command line don't have to play games with vmstop()/vmstart()
Signed-off-by: Juan Quintela <quintela@redhat.com>...
move do_loadvm() to monitor.c
make load_vmstate() return errors
add file descriptor migration
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Chris Lalancette <clalance@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>