[PATCH 4/7] qemu: Fix job handling in qemuDomainSetMemoryParameters

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

 



The code modifies the domain configuration but doesn't take a MODIFY
type job to do so.
---
 src/qemu/qemu_driver.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ecb3693..f6b2967 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9043,6 +9043,9 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
         }
     }

+    if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
+        goto cleanup;
+
 #define QEMU_SET_MEM_PARAMETER(FUNC, VALUE)                                     \
     if (set_ ## VALUE) {                                                        \
         if (flags & VIR_DOMAIN_AFFECT_LIVE) {                                   \
@@ -9050,7 +9053,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
                 virReportSystemError(-rc, _("unable to set memory %s tunable"), \
                                      #VALUE);                                   \
                                                                                 \
-                goto cleanup;                                                   \
+                goto endjob;                                                   \
             }                                                                   \
             vm->def->mem.VALUE = VALUE;                                         \
         }                                                                       \
@@ -9078,10 +9081,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,

     if (flags & VIR_DOMAIN_AFFECT_CONFIG &&
         virDomainSaveConfig(cfg->configDir, persistentDef) < 0)
-        goto cleanup;
+        goto endjob;

     ret = 0;

+ endjob:
+    qemuDomainObjEndJob(driver, vm);
+
  cleanup:
     qemuDomObjEndAPI(&vm);
     virObjectUnref(caps);
-- 
2.2.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]