summaryrefslogtreecommitdiffstats
path: root/savevm.c
Commit message (Collapse)AuthorAgeFilesLines
* fix savevm command without id or tagMarcelo Tosatti2010-01-261-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>
* savevm.c: fix warning with _FORTIFY_SOURCEKirill A. Shutemov2009-12-251-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>
* 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>
* live migration: Propagate output monitor to callback handlerJan Kiszka2009-12-031-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>
* live migration: Allow cleanup after cancellation or errorJan Kiszka2009-12-031-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>
* vmstate: Add support for multiplying size for a constantJuan Quintela2009-12-031-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>
* vmstate: Add support for VBUFFERSJuan Quintela2009-12-031-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>
* vmstate: fix missing ARRAY_OF_POINTERS support on save stateJuan Quintela2009-12-031-0/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: Avoid seekingJan Kiszka2009-12-031-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>
* net: fix qemu_announce_self()Mark McLoughlin2009-12-031-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>
* Add support for GNU/kFreeBSDAurelien Jarno2009-11-291-4/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Block live migrationlirans@il.ibm.com2009-11-171-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>
* savevm: Delete existing snapshots in all imagesKevin Wolf2009-11-121-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>
* Fix incoming migrationJuan Quintela2009-11-121-1/+6
| | | | | | | | | commit b04c4134d6de28c249277de19e523bfbe4aebbd6 broke incoming migration. After talking with Gleb, code was intended to be the way is in this fix. This fixes migration here. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: use qemu_send_packet_raw() in qemu_announce_self()Gleb Natapov2009-10-271-6/+1
| | | | | | | | | | | | | Use qemu_send_packet_raw to send gratuitous arp. This will ensure that vnet header is handled properly. Also, avoid sending the gratuitous packet to the guest. There doesn't appear to be any reason for doing that and the code will currently just crash if the NIC is not associated with a vlan. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: remove unused includes of if_tun.h and if_tap.hMark McLoughlin2009-10-271-6/+0
| | | | | | | Looks like these are just artifacts of vl.c being split up. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: Add VMSTATE_BUFFER_UNUSEDJuan Quintela2009-10-271-0/+20
| | | | | | It allows to have 'things' in savevm format not backed in the device state Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: add VMS_VARRAY_UINT16_UNSAFE (varrays with uint16 indexes)Juan Quintela2009-10-271-0/+4
| | | | | | It don't check types. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: Rename VMS_VARRAY to VMS_VARRAY_INT32Juan Quintela2009-10-271-4/+4
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: add VMSTATE_UINT16_EQUAL[_V]Juan Quintela2009-10-271-0/+20
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnmstate: fix name for uint8_equalJuan Quintela2009-10-271-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Send a RARP packet after migration.Nolan2009-10-271-16/+30
| | | | | | | | | | | | | | | | | | | Currently, after a migration qemu sends a broadcast packet to update switches' MAC->port mappings. Unfortunately, it picks a random (constant) ethertype and crosses its fingers that no one else is using it. This patch causes it to send a RARP packet instead. RARP was chosen for 2 reasons. One, it is always harmless, and will continue to be so even as new ethertypes are allocated. Two, it is what VMware ESX sends, so people who write filtering rules for switches already know about it. I also changed the code to send SELF_ANNOUNCE_ROUNDS packets, instead of SELF_ANNOUNCE_ROUNDS + 1, and added a simple backoff scheme. Signed-off-by: Nolan Leake <nolan <at> sigbus.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: use qtailq for vlan and client listsMark McLoughlin2009-10-151-1/+1
| | | | | | Patchworks-ID: 35507 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: Add suppot for field_exist() testJuan Quintela2009-10-051-17/+23
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: add support for arrays of pointersJuan Quintela2009-10-051-0/+3
| | | | | | | We need this to send arrays of timers Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: add version_id argument to post_loadJuan Quintela2009-10-051-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: remove const for put operationsJuan Quintela2009-10-051-23/+23
| | | | | | | | | | 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 each use with a cast Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix sys-queue.h conflict for goodBlue Swirl2009-09-121-29/+28
| | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Include sys-queue.h early to override system queue definitions on BSDBlue Swirl2009-09-121-0/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vmstate: add support for uint8_t equalJuan Quintela2009-09-111-0/+20
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: Add pre/post_save() hooksJuan Quintela2009-09-111-0/+6
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: Add pre_load() hookJuan Quintela2009-09-111-0/+5
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: rename run_after_load() -> post_load()Juan Quintela2009-09-111-2/+3
| | | | | | | This naming was used in kvm tree, and is easier to remember Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: add sensible arguments to vmstate_unregister()Juan Quintela2009-09-111-2/+9
| | | | | | | vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd). Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove SaveVM v2 supportJuan Quintela2009-09-111-43/+4
| | | | | | | | | | In previosu series I remove v2 support for RAM (that was the version that was supported 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 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* savevm: Convert loadvm handlers list to LISTJuan Quintela2009-09-091-9/+12
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* savevm: Convert savevm handlers list to TAILQJuan Quintela2009-09-091-52/+42
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Port handler_1 to use QDictLuiz Capitulino2009-09-041-2/+4
| | | | | | | | This commit ports command handlers that receive one argument to use the 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 versioningJuan Quintela2009-09-041-1/+1
| | | | | | | We can't check the version in a substruct, it is not stored anywhere Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support to run a function after loadJuan Quintela2009-08-271-0/+2
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for int32_t check valueJuan Quintela2009-08-271-0/+20
| | | | | | | | We read the saved value and check that it is less or equal than the one stored in the structure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for static sized buffers (uint_8)Juan Quintela2009-08-271-0/+21
| | | | | | | This patch adds support for static sized buffer and typecheks that the buffer is right. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for variable sized arraysJuan Quintela2009-08-271-0/+4
| | | | | | | | This patch add supports for variable sized arrays whose size is another field of the state. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for int32_t check valueJuan Quintela2009-08-271-0/+20
| | | | | | | | We read the saved value and check that it is the same that the one is stored in the structure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for structsJuan Quintela2009-08-271-2/+13
| | | | | | | | This patch adds support for saving one VMStateDescription from other VMStateDescription. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for arraysJuan Quintela2009-08-271-9/+22
| | | | | | | This patch adds support for saving arrays inside the struct Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for pointersJuan Quintela2009-08-271-0/+28
| | | | | | | This patch adds support for saving pointers to values Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* New VMstate save/load infrastructureJuan Quintela2009-08-271-5/+268
| | | | | | | | | | | | | | | This patch introduces VMState infrastructure, to convert the save/load functions of devices to a table approach. This new approach has the following advantages: - it is type-safe - you can't have load/save functions out of sync - will allows us to have new interesting commands, like dump <device>, that shows all its internal state. - Just now, the only added type is arrays, but we can add structures. - Uses old load_state() function for loading old state. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add vmstate_load() and vmstate_save() functionsJuan Quintela2009-08-271-4/+15
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Use return value from load_state() call backJuan Quintela2009-08-271-2/+12
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud