[PATCH 1/2] qemu: blockjob: Save config only in qemuBlockJobEventProcessLegacyCompleted

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

 



There's no need to do it if the job is not completed. The new helper
allows to do this with much less hassle in the correct place.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index c102417e43..097d87f663 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -315,6 +315,7 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver,
     ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true));
     ignore_value(qemuBlockNodeNamesDetect(driver, vm, asyncJob));
     qemuBlockJobUnregister(job);
+    qemuDomainSaveConfig(vm);
 }


@@ -381,12 +382,6 @@ qemuBlockJobEventProcessLegacy(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 (job->state == 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);
-    }
 }


-- 
2.21.0

--
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