[PATCH 2/6] qemu: blockjob: Always save config XML when a blockjob is finished

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For VMs with persistent config the config may change upon successful
completion of a job. Save it always if a persistent VM finishes a
blockjob. This will simplify further additions.
---
 src/qemu/qemu_blockjob.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index f061bb743..c1b46f7d0 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -194,11 +194,11 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
     if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
         VIR_WARN("Unable to save status on vm %s after block job", vm->def->name);

-    if (persistDisk && virDomainSaveConfig(cfg->configDir,
-                                           driver->caps,
-                                           vm->newDef) < 0)
-        VIR_WARN("Unable to update persistent definition on vm %s "
-                 "after block job", vm->def->name);
+    if (status == VIR_DOMAIN_BLOCK_JOB_COMPLETED && vm->newDef) {
+        if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->newDef) < 0)
+            VIR_WARN("Unable to update persistent definition on vm %s "
+                     "after block job", vm->def->name);
+    }

     qemuDomainEventQueue(driver, event);
     qemuDomainEventQueue(driver, event2);
-- 
2.14.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux