Statistics
| Branch: | Revision:

root / savevm.c @ 5b50e790

History | View | Annotate | Download (64.9 kB)

# Date Author Comment
de7b685c 07/23/2013 12:11 pm Michael R. Hines

rdma: bugfix: ram_control_save_page()

We were not checking for a valid 'bytes_sent' pointer before accessing it.

Reviewed-by: Eric Blake <>
Signed-off-by: Michael R. Hines <>
Signed-off-by: Juan Quintela <>

9f05d0c3 06/27/2013 03:38 am Michael R. Hines

rdma: export yield_until_fd_readable()

The RDMA event channel can be made non-blocking just like a TCP
socket. Exporting this function allows us to yield so that the
QEMU monitor remains available.

Reviewed-by: Juan Quintela <>
Reviewed-by: Paolo Bonzini <>...

bc1256f7 06/27/2013 03:38 am Michael R. Hines

rdma: introduce qemu_file_mode_is_not_valid()

QEMUFileRDMA also has read and write modes. This function is now
shared to reduce code duplication.

Reviewed-by: Juan Quintela <>
Reviewed-by: Paolo Bonzini <>
Reviewed-by: Chegu Vinod <>...

be903b2a 06/27/2013 03:38 am Michael R. Hines

rdma: export qemu_fflush()

RDMA uses this to flush the control channel before sending its
own message to handle page registrations.

Reviewed-by: Juan Quintela <>
Reviewed-by: Paolo Bonzini <>
Reviewed-by: Chegu Vinod <>...

43487c67 06/27/2013 03:38 am Michael R. Hines

rdma: new QEMUFileOps hooks

These are the prototypes and implementation of new hooks that
RDMA takes advantage of to perform dynamic page registration.

An optional hook is also introduced for a custom function
to be able to override the default save_page function....

2b0ce079 06/27/2013 03:38 am Michael R. Hines

rdma: introduce qemu_update_position()

RDMA writes happen asynchronously, and thus the performance accounting
also needs to be able to occur asynchronously. This allows anybody
to call into savevm.c to update both f->pos as well as into arch_init.c
to update the acct_info structure with up-to-date values when...

4f080057 06/21/2013 09:52 pm Stefan Weil

savevm: Fix potential memory leak

The leak was reported by cppcheck. Fix it by moving the g_malloc0 after
the argument validity check.

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

1befce96 06/17/2013 06:01 pm Luiz Capitulino

savevm: qmp_xen_save_devices_state(): use error_setg_file_open()

Signed-off-by: Luiz Capitulino <>
Acked-by: Kevin Wolf <>

de08c606 06/04/2013 02:56 pm Wenchao Xia

block: move snapshot code in block.c to block/snapshot.c

All snapshot related code, except bdrv_snapshot_dump() and
bdrv_is_snapshot(), is moved to block/snapshot.c. bdrv_snapshot_dump()
will be moved to another file later. bdrv_is_snapshot() is not related...

f364ec65 06/04/2013 02:56 pm Wenchao Xia

block: move qmp and info dump related code to block/qapi.c

This patch is a pure code move patch, except following modification:
1 get_human_readable_size() is changed to static function.
2 dump_human_image_info() is renamed to bdrv_image_info_dump().
3 in qmp_query_block() and qmp_query_blockstats, use bdrv_next(bs)...

5b917044 06/04/2013 02:56 pm Wenchao Xia

block: dump snapshot and image info to specified output

bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer now,
some internal buffers are still used for format control, which have no
chance to be truncated. As a result, these two functions have no more issue...

29d78271 06/04/2013 02:56 pm Stefan Hajnoczi

block: drop bs_snapshots global variable

The bs_snapshots global variable points to the BlockDriverState which
will be used to save vmstate. This is really a savevm.c concept but was
moved into block.c:bdrv_snapshots() when it became clear that hotplug
could result in a dangling pointer....

a4cc73d6 06/01/2013 01:25 pm Paolo Bonzini

do not check pointers after dereferencing them

Two instances, both spotted by Coverity. In one, two blocks were
swapped. In the other, the check is not needed anymore.

Cc:
Cc:
Signed-off-by: Paolo Bonzini <>...

e9d8fbf5 04/17/2013 12:44 pm Paolo Bonzini

qemu-file: do not use stdio for qemu_fdopen

This uses system calls directly for Unix file descriptors, so that the
efficient writev_buffer can be used. Pay attention to the possibility
of partial writes in writev.

Reviewed-by: Juan Quintela <>...

15711565 04/17/2013 12:43 pm Paolo Bonzini

qemu-file: drop socket_put_buffer

It is enough to implement one of socket_writev_buffer and
socket_put_buffer.

Reviewed-by: Juan Quintela <>
Reviewed-by: Orit Wassermann <>
Signed-off-by: Paolo Bonzini <>

db08dc21 04/15/2013 04:02 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/block' into staging

  • stefanha/block:
    rbd: add an asynchronous flush
    iotests: Add 'check -ssh' option to test Secure Shell block device.
    block: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk....
05fcc848 04/15/2013 09:26 am Kevin Wolf

savevm: Implement block_writev_buffer()

Instead of breaking up RAM state into many small chunks, pass the iovec
to the block layer for better performance.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

af74db72 04/09/2013 04:00 pm Paolo Bonzini

migration: set f->is_write and flush in add_to_iovec

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

7ce51f1b 04/09/2013 04:00 pm Paolo Bonzini

migration: use a single I/O operation when writev_buffer is not defined

The recent patches to use vectored I/O for RAM migration caused a
regression in savevm speed. To restore previous performance,
add data to the buffer in qemu_put_buffer_async whenever writev_buffer...

d9658c47 04/09/2013 04:00 pm Paolo Bonzini

migration: drop is_write complications

The same QEMUFile is never used for both read and write. Simplify
the logic to simply look for presence or absence of the right ops.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

4d117247 04/09/2013 04:00 pm Paolo Bonzini

migration: simplify writev vs. non-writev logic

Check f->iovcnt in add_to_iovec, f->buf_index in qemu_put_buffer/byte.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

f9e8cacc 04/02/2013 06:47 pm Stefan Hajnoczi

oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()

The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.
Rename to qemu_set_nonblock() just like qemu_set_cloexec().

Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>...

28085f7b 03/26/2013 02:32 pm Orit Wasserman

Add socket_writev_buffer function

Signed-off-by: Orit Wasserman <>
Signed-off-by: Juan Quintela <>

7d8a30bb 03/26/2013 02:32 pm Orit Wasserman

Update bytes_xfer in qemu_put_byte

Signed-off-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Juan Quintela <>

b3ea2bdb 03/26/2013 02:32 pm Orit Wasserman

Store the data to send also in iovec

All data is still copied into the static buffer.
Adjacent iovecs are coalesced so we send one big buffer
instead of many small buffers.

Signed-off-by: Orit Wasserman <>
Signed-off-by: Juan Quintela <>

cb88aa88 03/26/2013 02:32 pm Orit Wasserman

Use writev ops if available

Update qemu_fflush and stdio_close to use writev ops if they are available
Use the buffers stored in the iovec.

Signed-off-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Juan Quintela <>

6181ec24 03/26/2013 02:32 pm Orit Wasserman

Add qemu_put_buffer_async

This allows us to add a buffer to the iovec to send without copying it
into the static buffer, the buffer will be sent later when qemu_fflush is called.

Signed-off-by: Orit Wasserman <>
Signed-off-by: Juan Quintela <>

213945e4 03/26/2013 02:30 pm David Gibson

savevm: Add VMSTATE_FLOAT64 helpers

The current savevm code includes VMSTATE helpers for a number of commonly
used data types, but not for the float64 type used by the internal floating
point emulation code. This patch fixes the deficiency.

Signed-off-by: David Gibson <>...

e344b8a1 03/26/2013 02:30 pm David Gibson

savevm: Add VMSTATE_UINT64_EQUAL helpers

The savevm code already includes a number of *_EQUAL helpers which act as
sanity checks verifying that the configuration of the saved state matches
that of the machine we're loading into to work. Variants already exist...

d7650eab 03/12/2013 11:35 am Andreas Färber

vmstate: Make vmstate_register() static inline

This avoids adding a duplicate stub for CONFIG_USER_ONLY.

Suggested-by: Eduardo Habkost <>
Reviewed-by: Eduardo Habkost <>
Reviewed-by: Juan Quintela <>...

edaae611 03/11/2013 02:32 pm Paolo Bonzini

migration: yay, buffering is gone

Buffering was needed because blocking writes could take a long time
and starve other threads seeking to grab the big QEMU mutex.

Now that all writes (except within _complete callbacks) are done
outside the big QEMU mutex, we do not need buffering at all....

05f28b83 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: make qemu_fflush and qemu_file_set_error private again

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

817b9ed5 03/11/2013 02:32 pm Paolo Bonzini

migration: merge qemu_popen_cmd with qemu_popen

There is no reason for outgoing exec migration to do popen manually
anymore (the reason used to be that we needed the FILE* to make it
non-blocking). Use qemu_popen_cmd.

Reviewed-by: Orit Wasserman <>...

ce39ee31 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: fsync a writable stdio QEMUFile

This is what fd_close does. Prepare for switching to a QEMUFile.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

13c7b2da 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: check exit status when closing a pipe QEMUFile

This is what exec_close does. Move this to the underlying QEMUFile.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

0cc3f3cc 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: add writable socket QEMUFile

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

3f2d38fa 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: simplify and export qemu_ftell

Force a flush when qemu_ftell is called. This simplifies the buffer magic
(it also breaks qemu_ftell for input QEMUFiles, but we never use it).

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>...

f8bbc128 03/11/2013 02:32 pm Paolo Bonzini

migration: use QEMUFile for migration channel lifetime

As a start, use QEMUFile to store the destination and close it.
qemu_get_fd gets a file descriptor that will be used by the write
callbacks.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>...

1964a397 03/11/2013 02:32 pm Paolo Bonzini

migration: move rate limiting to QEMUFile

Rate limiting is now simply a byte counter; client call
qemu_file_rate_limit() manually to determine if they have to exit.
So it is possible and simple to move the functionality to QEMUFile.

This makes the remaining functionality of s->file redundant;...

93bf2104 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: pass errno from qemu_fflush via f->last_error

This is done by almost all callers of qemu_fflush, move the code
directly to qemu_fflush.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

47c8c17a 03/11/2013 02:32 pm Paolo Bonzini

migration: use qemu_file_set_error to pass error codes back to qemu_savevm_state

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

4eb93810 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: temporarily expose qemu_file_set_error and qemu_fflush

Right now, migration cannot entirely rely on QEMUFile's automatic
drop of I/O after an error, because it does its "real" I/O outside
the put_buffer callback. To fix this until buffering is gone, expose...

9b095037 03/11/2013 02:32 pm Paolo Bonzini

migration: run setup callbacks out of big lock

Only the migration_bitmap_sync() call needs the iothread lock.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

04943eba 03/11/2013 02:32 pm Paolo Bonzini

migration: push qemu_savevm_state_cancel out of qemu_savevm_state_*

This is useful, because it lets us keep the cancellation callbacks
inside the big lock while pushing the others out.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>...

ad55ab42 02/13/2013 12:26 am Stefan Hajnoczi

migration: make qemu_ftell() public and support writable files

Migration .save_live_iterate() functions return the number of bytes
transferred. The easiest way of doing this is by calling qemu_ftell(f)
at the beginning and end of the function to calculate the difference....

d7cd3694 02/11/2013 09:22 pm Stefan Hajnoczi

migration: restrict scope of incoming fd read handler

The incoming migration is processed in a coroutine and uses an fd read
handler to enter the yielded coroutine when data becomes available.

The read handler was set too broadly, so that spurious coroutine entries...

b356f76d 02/01/2013 07:02 pm Jason Wang

net: introduce qemu_get_queue()

To support multiqueue, the patch introduce a helper qemu_get_queue()
which is used to get the NetClientState of a device. The following patches would
refactor this helper to support multiqueue.

Signed-off-by: Jason Wang <>...

ba2e28e8 02/01/2013 09:32 am Orit Wasserman

Move XBZRLE encoding code to a separate file to allow testing

Signed-off-by: Orit Wasserman <>
Reviewed-by: Paolo Bonzini <>

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>

016c7182 01/21/2013 09:22 pm Anthony Liguori

Merge remote-tracking branch 'quintela/thread.next' into staging

  1. By Juan Quintela (7) and Paolo Bonzini (6)
  2. Via Juan Quintela
    • quintela/thread.next:
      migration: remove argument to qemu_savevm_state_cancel
      migration: Only go to the iterate stage if there is anything to send...
6522773f 01/17/2013 02:54 pm Juan Quintela

migration: remove argument to qemu_savevm_state_cancel

Signed-off-by: Juan Quintela <>

Reviewed-by: Reviewed-by: Eric Blake <>
Reviewed-by: Paolo Bonzini <>

afe41931 01/17/2013 02:54 pm Juan Quintela

qemu-file: Only set last_error if it is not already set

Signed-off-by: Juan Quintela <>

Reviewed-by: Reviewed-by: Eric Blake <>
Reviewed-by: Paolo Bonzini <>

84f2d0ea 01/17/2013 02:24 pm Wenchao Xia

HMP: add QDict to info callback handler

This patch change all info call back function to take
additional QDict * parameter, which allow those command
take parameter. Now it is set to NULL at default case.

Signed-off-by: Wenchao Xia <>...

68b891ec 01/11/2013 10:35 am Stefan Weil

savevm: Remove MinGW specific code which is no longer needed

QEMU provides a portable function qemu_gettimeofday instead of
gettimeofday and also an implementation of localtime_r for MinGW.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

74e91370 01/02/2013 09:32 pm Michael Tokarev

savevm.c: cleanup system includes

savevm.c suffers from the same problem as some other files.
Some years ago savevm.c was created from vl.c, moving some
code from there into a separate file. At that time, all
includes were just copied from vl.c to savevm.c, without...

dd217b87 12/21/2012 12:09 am Juan Quintela

migration: make writes blocking

Move all the writes to the migration_thread, and make writings
blocking. Notice that are still using the iothread for everything
that we do.

Signed-off-by: Juan Quintela <>

e4ed1541 12/21/2012 12:09 am Juan Quintela

savevm: New save live migration method: pending

Code just now does (simplified for clarity)

if (qemu_savevm_state_iterate(s->file) == 1) {
vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
qemu_savevm_state_complete(s->file);
}

Problem here is that qemu_savevm_state_iterate() returns 1 when it...

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

Signed-off-by: Paolo Bonzini <>

caf71f86 12/19/2012 09:31 am Paolo Bonzini

migration: move include files to include/migration/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

1422e32d 12/19/2012 09:31 am Paolo Bonzini

net: reorganize headers

Move public headers to include/net, and leave private headers in net/.
Put the virtio headers in include/net/tap.h, removing the multiple copies
that existed. Leave include/net/tap.h as the interface for NICs, and
net/tap_int.h as the interface for OS-specific parts of the tap backend....

f8fe7964 12/19/2012 09:29 am Paolo Bonzini

janitor: do not include qemu-char everywhere

Touching char/char.h basically causes the whole of QEMU to
be rebuilt. Avoid this, it is usually unnecessary.

Signed-off-by: Paolo Bonzini <>

ab52a824 11/02/2012 07:35 pm Paolo Bonzini

migration: close socket QEMUFile from socket_close

The common suffix now is process_incoming_migration+qemu_fclose.

Reviewed-by: Orit Wasserman <>
Signed-off-by: Paolo Bonzini <>

595ab641 11/02/2012 07:35 pm Paolo Bonzini

migration: handle EAGAIN while reading QEMUFile

This will never happen right now (the assertion would fail). The
next patch will set the socket or pipe in non-blocking mode, thus
enabling this part of the code.

Coroutines can just stop whenever they want with qemu_coroutine_yield....

d263a20b 11/02/2012 07:35 pm Paolo Bonzini

migration: replace qemu_stdio_fd with qemu_get_fd

Reviewed-by: Orit Wasserman <>
Signed-off-by: Paolo Bonzini <>

5f0ebf1b 11/02/2012 07:34 pm Paolo Bonzini

migration: unify stdio-based QEMUFile operations

Now that qemu_fseek does not exist anymore, there is no reason to do
an fseek before fread/fwrite when operating on an stdio file.
Thus, unify the get/put_buffer callbacks used by qemu_fopen
with those used for pipes....

9229bf3c 11/02/2012 07:34 pm Paolo Bonzini

migration: consolidate QEMUFile methods in a single QEMUFileOps struct

Reviewed-by: Orit Wasserman <>
Signed-off-by: Paolo Bonzini <>

70eb6330 11/02/2012 07:34 pm Paolo Bonzini

migration: add qemu_get_fd

Reviewed-by: Orit Wasserman <>
Signed-off-by: Paolo Bonzini <>

08e99e29 10/30/2012 09:45 am Peter Maydell

vmstate: Add support for saving/loading bitmaps

Add support for saving/loading bitmap.h bitmaps in vmstate.

Signed-off-by: Peter Maydell <>
Tested-by: Igor Mitsyanko <>
Reviewed-by: Juan Quintela <>

a2b41351 10/17/2012 07:35 pm Juan Quintela

savevm: make qemu_file_put_notify() return errors

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

ffbfc74d 10/17/2012 07:34 pm Juan Quintela

savevm: unexport qemu_fflush

It is not used outside of savevm.c

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

e5ae97ce 10/17/2012 07:34 pm Juan Quintela

savevm: Remove qemu_fseek()

It has no users, and is only half implemented.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

7311bea3 10/17/2012 07:34 pm Juan Quintela

savevm: make qemu_fflush() return an error code

Adjust all the callers. We moved the set of last_error from inside
qemu_fflush() to all the callers.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

29eee86f 10/17/2012 07:34 pm Juan Quintela

savevm: unfold qemu_fclose_internal()

It was used only one, and was only one if. It makes error handling
saner.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

3aee4be1 10/17/2012 07:34 pm Juan Quintela

savevm: unexport qemu_ftell()

It was unused out of savevm.c.

Signed-off-by: Juan Quintela <>

02c4a051 10/17/2012 07:34 pm Juan Quintela

savevm: make qemu_fill_buffer() be consistent

It was setting last_error directly once, and with the helper the other time.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

c10682cb 10/17/2012 07:34 pm Juan Quintela

savevm: Only qemu_fflush() can generate errors

Move the error check to the beggining of the callers. Once this is fixed
qemu_file_set_if_error() is not used anymore, so remove it.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

6f121ff5 10/17/2012 07:34 pm Juan Quintela

savevm: un-export qemu_file_set_error()

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

4d5b97da 10/05/2012 04:10 pm Amos Kong

cleanup useless return sentence

This patch cleans up return sentences in the end of void functions.

Reported-by: Paolo Bonzini <>
Signed-off-by: Amos Kong <>
Signed-off-by: Stefan Hajnoczi <>

0d16fdd7 08/15/2012 10:59 pm Anthony Liguori

Merge remote-tracking branch 'agraf/ppc-for-upstream' into staging

  • agraf/ppc-for-upstream: (24 commits)
    openpic: Added BRR1 register
    pseries: Update SLOF firmware image
    pseries dma: DMA window params added to PHB and DT population changed
    pseries: Add PCI MSI/MSI-X support...
a5b71725 08/15/2012 08:43 pm Alexander Graf

xbzrle: fix compilation on ppc32

When compiling the xbzrle code on my ppc32 user space, I hit the following
gcc compiler warning (treated as an error):

cc1: warnings being treated as errors
savevm.c: In function ‘xbzrle_encode_buffer’:
savevm.c:2476: error: overflow in implicit constant conversion...
2e1e79da 08/15/2012 11:48 am Corey Bryant

block: Convert close calls to qemu_close

This patch converts all block layer close calls, that correspond
to qemu_open calls, to qemu_close.

Signed-off-by: Corey Bryant <>
Signed-off-by: Kevin Wolf <>

302dfbeb 08/08/2012 02:51 pm Orit Wasserman

Add xbzrle_encode_buffer and xbzrle_decode_buffer functions

For performance we are encoding long word at a time.
For nzrun we use long-word-at-a-time NULL-detection tricks from strcmp():
using ((lword - 0x0101010101010101) & (~lword) & 0x8080808080808080) test...

22ea40f4 07/20/2012 09:19 am Juan Quintela

savevm: Use a struct to pass all handlers

This would make easier to add more operations in the next patches.

Signed-off-by: Juan Quintela <>

7908c78d 07/20/2012 09:19 am Juan Quintela

savevm: Live migration handlers register the struct directly

Notice that the live migration users never unregister, so no problem
about freeing the ops structure.

Signed-off-by: Juan Quintela <>

9b5bfab0 07/20/2012 09:19 am Juan Quintela

savevm: Refactor cancel operation in its own operation

Intead of abusing stage with value -1.

Signed-off-by: Juan Quintela <>

6bd68781 07/20/2012 09:19 am Juan Quintela

savevm: introduce is_active method

Enable the creation of a method to tell migration if that section is
active and should be migrate. We use it for blk-migration, that is
normally not active. We don't create the method for RAM, as setups
without RAM are very strange O:-)...

d1315aac 07/20/2012 09:19 am Juan Quintela

savevm: split save_live_setup from save_live_state

This patch splits stage 1 to its own function for both save_live
users, ram and block. It is just a copy of the function, removing the
parts of the other stages. Optimizations would came later.

Signed-off-by: Juan Quintela <>

16310a3c 07/20/2012 09:19 am Juan Quintela

savevm: split save_live into stage2 and stage3

We split it into 2 functions, foo_live_iterate, and foo_live_complete.
At this point, we only remove the bits that are for the other stage,
functionally this is equivalent to previous code.

Signed-off-by: Juan Quintela <>

517a13c9 06/29/2012 02:27 pm Juan Quintela

Add tracepoints for savevm section start/end

This allows to know how long each section takes to save.

An awk script like this tells us sections that takes more that 10ms

$1 ~ /savevm_state_iterate_end/ {
/* Print savevm_section_end line when > 10ms duration */...

aac844ed 06/29/2012 02:27 pm Juan Quintela

No need to iterate if we already are over the limit

If buffers are full, don't iterate, just exit.

Signed-off-by: Juan Quintela <>

6607ae23 06/29/2012 02:18 pm Isaku Yamahata

Add MigrationParams structure

Signed-off-by: Isaku Yamahata <>

8aca5215 06/18/2012 06:35 pm Anthony Liguori

Merge remote-tracking branch 'afaerber-or/qom-next-2' into staging

  • afaerber-or/qom-next-2: (22 commits)
    qom: Push error reporting to object_property_find()
    qdev: Remove qdev_prop_exists()
    qbus: Initialize in standard way
    qbus: Make child devices links...
09e5ab63 06/18/2012 04:14 pm Anthony Liguori

qdev: Use wrapper for qdev_get_path

This makes it easier to remove it from BusInfo.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>
[AF: Drop now unnecessary NULL initialization in scsibus_get_dev_path()]...

ad492c92 06/15/2012 03:03 pm Paolo Bonzini

savevm: flush after saving vm state

Writing vm state uses bdrv_pwrite, so it will automatically get flushes
in writethrough mode. But doing a flush at the end in writeback mode
is probably a good idea anyway.

Signed-off-by: Paolo Bonzini <>...

55dd9ffa 04/15/2012 10:25 pm Stefan Weil

w64: Fix time conversion for some versions of MinGW-w64

tb.time is a time value, but not necessarily of the same size as time_t:
while time_t is 64 bit for w64, tb.time still is 32 bit only.

Therefore we need en explicit conversion.

Signed-off-by: Stefan Weil <>

33cf629a 03/19/2012 08:39 pm Anthony Liguori

Merge remote-tracking branch 'sstabellini/saverestore-8' into staging

  • sstabellini/saverestore-8:
    xen: do not allocate RAM during INMIGRATE runstate
    xen mapcache: check if memory region has moved.
    xen: record physmap changes to xenstore
    Set runstate to INMIGRATE earlier...
a7ae8355 03/19/2012 08:21 pm Stefano Stabellini

Introduce "xen-save-devices-state"

- add an "is_ram" flag to SaveStateEntry;

- register_savevm_live sets is_ram for live_savevm devices;

- introduce a "xen-save-devices-state" QAPI command that can be used to save
the state of all devices, but not the RAM or the block devices of the...

b8b3e756 03/19/2012 03:51 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/memory/urgent' into staging

  • qemu-kvm/memory/urgent: (42 commits)
    memory: check for watchpoints when getting code ram_addr
    exec: fix write tlb entry misused as iotlb
    Sparc: avoid AREG0 wrappers for memory access helpers...