qemu: Avoid removing persistent config if migration fails

When migration fails in qemuMigrationPrepareAny, we unconditionally call
qemuDomainRemoveInactive, which should only be called for transient
domains. The check for !vm->persistent was accidentally removed by
commit 540c339.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Luyao Huang 2015-06-25 09:38:57 +08:00 committed by Jiri Denemark
parent 84d0286ef0
commit 09444724bc

View File

@ -3432,7 +3432,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
VIR_FREE(priv->origname);
virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
priv->nbdPort = 0;
qemuDomainRemoveInactive(driver, vm);
if (!vm->persistent)
qemuDomainRemoveInactive(driver, vm);
}
virDomainObjEndAPI(&vm);
if (event)