From: Li XueLei <li.xuelei1(a)zte.com.cn>
During making disk snapshot in an active domain, sometimes we
should update the domain's persistent definition.We must check if
the domain is defined, before we update the persistent definition
file.
First,we create a vm.Then,define the vm and undefine the vm.Last create a
--memspec snapshot for the vm.Now,we will find a persistent definition
file in the config directory if we don't use this patch.
Signed-off-by: Li XueLei <li.xuelei1(a)zte.com.cn>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e32257f..94dcb97 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15330,7 +15330,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
if (ret == 0 || !do_transaction) {
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps)
< 0 ||
- (persist && virDomainSaveConfig(cfg->configDir, driver->caps,
+ (vm->persistent && persist &&
virDomainSaveConfig(cfg->configDir, driver->caps,
vm->newDef) < 0))
ret = -1;
}
--
1.8.3.1