]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: fix migration flags undefinesource cannot work
authorLuyao Huang <lhuang@redhat.com>
Tue, 27 Oct 2015 08:53:59 +0000 (16:53 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 27 Oct 2015 09:43:52 +0000 (10:43 +0100)
In commit f41be296, we moved vm->persistent check into
qemuDomainRemoveInactive, but we didn't change the vm->persistent
before call qemuDomainRemoveInactive in some place before and just
call it to remove the inactive vm.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/qemu/qemu_migration.c

index b53491a3ea4f20eccdf2a9e2042325a57ffdb9b4..2abf2eea8dcf0ad4be92405611df217388006fcd 100644 (file)
@@ -3912,8 +3912,10 @@ qemuMigrationConfirm(virConnectPtr conn,
 
     qemuMigrationJobFinish(driver, vm);
     if (!virDomainObjIsActive(vm)) {
-        if (flags & VIR_MIGRATE_UNDEFINE_SOURCE)
+        if (flags & VIR_MIGRATE_UNDEFINE_SOURCE) {
             virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm);
+            vm->persistent = 0;
+        }
         qemuDomainRemoveInactive(driver, vm);
     }
 
@@ -5405,8 +5407,10 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver,
 
     qemuMigrationJobFinish(driver, vm);
     if (!virDomainObjIsActive(vm) && ret == 0) {
-        if (flags & VIR_MIGRATE_UNDEFINE_SOURCE)
+        if (flags & VIR_MIGRATE_UNDEFINE_SOURCE) {
             virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm);
+            vm->persistent = 0;
+        }
         qemuDomainRemoveInactive(driver, vm);
     }