]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: start domain paused on migration dst
authorJim Fehlig <jfehlig@suse.com>
Thu, 13 Nov 2014 00:15:37 +0000 (17:15 -0700)
committerJim Fehlig <jfehlig@suse.com>
Fri, 21 Nov 2014 20:11:47 +0000 (13:11 -0700)
During the perform phase of migration, the domain is started on
the dst host in a running state if VIR_MIGRATE_PAUSED flag is not
specified.  In the finish phase, the domain is also unpaused if
VIR_MIGRATE_PAUSED flag is unset.  I've noticed this second unpause
fails if the domain was already unpaused following the perform phase.

This patch changes the perform phase to always start the domain
paused, and defers unpausing, if requested, to the finish phase.
Unpausing should occur in the finish phase anyhow, where the domain
can be properly destroyed if the perform phase fails and migration
is cancelled.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_migration.c

index fa80a0cca73bb64278bd63fe62438ac1aab372e5..6f83b08f052d3d23c63b98c59662b4d4a36f12c5 100644 (file)
@@ -90,14 +90,17 @@ libxlDoMigrateReceive(void *opaque)
     virDomainObjPtr vm = args->vm;
     virNetSocketPtr *socks = args->socks;
     size_t nsocks = args->nsocks;
-    bool paused = args->flags & VIR_MIGRATE_PAUSED;
     libxlDriverPrivatePtr driver = args->conn->privateData;
     int recvfd = args->recvfd;
     size_t i;
     int ret;
 
+    /*
+     * Always start the domain paused.  If needed, unpause in the
+     * finish phase, after transfer of the domain is complete.
+     */
     virObjectLock(vm);
-    ret = libxlDomainStart(driver, vm, paused, recvfd);
+    ret = libxlDomainStart(driver, vm, true, recvfd);
     virObjectUnlock(vm);
 
     if (ret < 0 && !vm->persistent)