summaryrefslogtreecommitdiff
path: root/savevm.c
AgeCommit message (Collapse)AuthorFilesLines
2009-09-12Fix sys-queue.h conflict for goodBlue Swirl1-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>
2009-09-12Include sys-queue.h early to override system queue definitions on BSDBlue Swirl1-0/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-11vmstate: add support for uint8_t equalJuan Quintela1-0/+20
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11vmstate: Add pre/post_save() hooksJuan Quintela1-0/+6
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11vmstate: Add pre_load() hookJuan Quintela1-0/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11vmstate: rename run_after_load() -> post_load()Juan Quintela1-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>
2009-09-11vmstate: add sensible arguments to vmstate_unregister()Juan Quintela1-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>
2009-09-11Remove SaveVM v2 supportJuan Quintela1-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>
2009-09-09savevm: Convert loadvm handlers list to LISTJuan Quintela1-9/+12
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09savevm: Convert savevm handlers list to TAILQJuan Quintela1-52/+42
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_1 to use QDictLuiz Capitulino1-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>
2009-09-04VMState: Fix sub-structs versioningJuan Quintela1-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>
2009-08-27Add VMState support to run a function after loadJuan Quintela1-0/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for int32_t check valueJuan Quintela1-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>
2009-08-27Add VMState support for static sized buffers (uint_8)Juan Quintela1-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>
2009-08-27Add VMState support for variable sized arraysJuan Quintela1-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>
2009-08-27Add VMState support for int32_t check valueJuan Quintela1-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>
2009-08-27Add VMState support for structsJuan Quintela1-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>
2009-08-27Add VMState support for arraysJuan Quintela1-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>
2009-08-27Add VMState support for pointersJuan Quintela1-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>
2009-08-27New VMstate save/load infrastructureJuan Quintela1-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>
2009-08-27Add vmstate_load() and vmstate_save() functionsJuan Quintela1-4/+15
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Use return value from load_state() call backJuan Quintela1-2/+12
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27make load_vmstate() return errorsJuan Quintela1-5/+7
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27move do_loadvm() to monitor.cJuan Quintela1-11/+0
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27split do_loadvm() into do_loadvm() and load_vmstate()Juan Quintela1-9/+13
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27add file descriptor migrationPaolo Bonzini1-0/+28
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Chris Lalancette <clalance@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24unify popen/fopen qemu wrappersPaolo Bonzini1-49/+50
While reading Chris's code for fd migration I noticed the duplication between QEMUFilePopen and QEMUFileStdio. This fixes it, and makes qemu_fopen more similar qemu_popen. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27rename HOST_BSD to CONFIG_BSDJuan Quintela1-2/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27kill drives_tableGerd Hoffmann1-14/+18
First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16fix segfault in setting migration speedGlauber Costa1-1/+3
Hi, Whoever wrote this migrate_set_speed function is totally stupid. Any failed or completed migration keeps its state to allow probing of migration data, but has no associated file anymore. It is, thus, possible to crash qemu by calling migrate_set_speed after a migration is finished (or failed, or cancelled), but before another one starts. This patch fixes it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16replace bdrv_{get, put}_buffer with bdrv_{load, save}_vmstateChristoph Hellwig1-39/+7
The VM state offset is a concept internal to the image format. Replace the old bdrv_{get,put}_buffer method that require an index into the image file that is constructed from the VM state offset and an offset into the vmstate with the bdrv_{load,save}_vmstate that just take an offset into the VM state. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-13exec-migration: handle EINTR in popen_get_buffer()Uri Lublin1-1/+8
Sometimes, upon interrupt, fread returns with no data, and the (incoming exec) migration fails. Fix by retrying on such a case. Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-13Fix mingw32 build warningsBlue Swirl1-1/+1
Work around buffer and ioctlsocket argument type signedness problems Suppress a prototype which is unused on mingw32 Expand a macro to avoid warnings from some GCC versions Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09net: pass VLANClientState* as first arg to receive handlersMark McLoughlin1-1/+1
Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-09net: re-name vc->fd_read() to vc->receive()Mark McLoughlin1-1/+1
VLANClientState's fd_read() handler doesn't read from file descriptors, it adds a buffer to the client's receive queue. Re-name the handlers to make things a little less confusing. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-05-27Allow monitor interaction when using migrate -execChris Lalancette1-1/+11
All, I've recently been playing around with migration via exec. Unfortunately, when starting the incoming qemu process with "-incoming exec:cmd", it suffers the same problem that -incoming tcp used to suffer; namely, that you can't interact with the monitor until after the migration has happened. This causes problems for libvirt usage of -incoming exec, since libvirt expects to be able to access the monitor ahead of time. This fairly simple patch allows you to access the monitor both before and after the migration has completed using exec. (note: developed/tested with qemu-kvm, but applies perfectly fine to qemu) Signed-off-by: Chris Lalancette <clalance@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22introduce set_rate_limit function for QEMUFileGlauber Costa1-8/+19
This patch converts the current callers of qemu_fopen_ops(). Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Don't send all gratuitous packets at once.Gleb Natapov1-5/+19
Use timer to separate them in time. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Minimal ethernet frame length is 64 bytes.Gleb Natapov1-1/+2
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01Make sure not to fall through on error in loadvmAnthony Liguori1-0/+1
This is from the KVM tree Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-04-17Add unregister_savevm() (Mark McLoughlin)aliguori1-0/+16
Currently there's no way to unregister a savevm callback, so e.g. if a NIC is hot-unplugged and a savevm is issued, we'll segfault. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7148 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-05create qemu_file_set_error (Glauber Costa)aliguori1-0/+5
This is mainly for consistency, since we don't want anything outside of savevm setting it explicitly. There are current no users of that in qemu tree, but there are potential candidates on kvm-userspace. And avi is a nice guy, let's be nice with him. Based on a patch by Yaniv Kamay Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6998 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-05Fix savevm after BDRV_FILE size enforcementaliguori1-6/+6
We now enforce that you cannot write beyond the end of a non-growable file. qcow2 files are not growable but we rely on them being growable to do savevm/loadvm. Temporarily allow them to be growable by introducing a new API specifically for savevm read/write operations. Reported-by: malc Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6994 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-13make qemu_announce_self handle non contiguous net tables (Marcelo Tosatti)aliguori1-1/+3
With hotplug nd_table might contain holes. Noticed by Eduardo Habkost. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6844 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-08Fix windows build and clean up use of <windows.h>aliguori1-0/+1
We want to globally define WIN_LEAN_AND_MEAN and WINVER to particular values so let's do it in OS_CFLAGS. Then, we can pepper in windows.h includes where using #includes that require it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6783 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-08Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configureblueswir11-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-07Support for DragonFly BSD (Hasso Tepper)blueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-07Fix BSD breakage from r6736blueswir11-0/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6742 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-07Sparse fixes: NULL use, header order, ANSI prototypes, staticblueswir11-12/+12
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162