Add page flipping support on unix outgoing part by stopping VM with the new RunState RUN_STATE_MEMORY_STALE before invoking migration if unix_page_flipping enabled.
Signed-off-by: Lei Li <li...@linux.vnet.ibm.com> --- migration-unix.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index 9beeafe..cbf2087 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -19,6 +19,7 @@ #include "migration/migration.h" #include "migration/qemu-file.h" #include "block/block.h" +#include "sysemu/sysemu.h" //#define DEBUG_MIGRATION_UNIX @@ -33,6 +34,7 @@ static void unix_wait_for_connect(int fd, void *opaque) { MigrationState *s = opaque; + int ret; if (fd < 0) { DPRINTF("migrate connect error\n"); @@ -47,6 +49,15 @@ static void unix_wait_for_connect(int fd, void *opaque) goto fail; } + /* Stop VM before invoking migration if unix_page_flipping enabled */ + if (migrate_unix_page_flipping()) { + ret = vm_stop_force_state(RUN_STATE_MEMORY_STALE); + if (ret < 0) { + DPRINTF("failed to stop VM\n"); + goto fail; + } + } + migrate_fd_connect(s); return; } -- 1.7.7.6