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

[libvirt] [PATCH 10/11] qemu: Remove virDomainLiveConfigHelperMethod from qemuDomainSetBlockIoTune



---
 src/qemu/qemu_driver.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 71d25a4..0fbce1b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17090,6 +17090,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
     virQEMUDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm = NULL;
     qemuDomainObjPrivatePtr priv;
+    virDomainDefPtr def = NULL;
     virDomainDefPtr persistentDef = NULL;
     virDomainBlockIoTuneInfo info;
     virDomainBlockIoTuneInfo *oldinfo;
@@ -17105,7 +17106,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
     bool set_size_iops = false;
     bool supportMaxOptions = true;
     virQEMUDriverConfigPtr cfg = NULL;
-    virCapsPtr caps = NULL;
     virObjectEventPtr event = NULL;
     virTypedParameterPtr eventParams = NULL;
     int eventNparams = 0;
@@ -17158,11 +17158,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,

     priv = vm->privateData;

-    if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
-        goto endjob;
-
-    if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
-                                        &persistentDef) < 0)
+    if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0)
         goto endjob;

     if (virTypedParamsAddString(&eventParams, &eventNparams, &eventMaxparams,
@@ -17330,7 +17326,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         goto endjob;
     }

-    if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
+    if (persistentDef) {
         if (!(conf_disk = virDomainDiskByName(persistentDef, path, true))) {
             virReportError(VIR_ERR_INVALID_ARG,
                            _("missing persistent configuration for disk '%s'"),
@@ -17339,7 +17335,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         }
     }

-    if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+    if (def) {
         supportMaxOptions = virQEMUCapsGet(priv->qemuCaps,
                                            QEMU_CAPS_DRIVE_IOTUNE_MAX);
         if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) {
@@ -17357,7 +17353,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
              goto endjob;
         }

-        if (!(disk = qemuDomainDiskByName(vm->def, path)))
+        if (!(disk = qemuDomainDiskByName(def, path)))
             goto endjob;

         if (!(device = qemuAliasFromDisk(disk)))
@@ -17409,7 +17405,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         }
     }

-    if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
+    if (persistentDef) {
         oldinfo = &conf_disk->blkdeviotune;
         if (!set_bytes) {
             info.total_bytes_sec = oldinfo->total_bytes_sec;
@@ -17436,7 +17432,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
     virDomainObjEndAPI(&vm);
     if (eventNparams)
         virTypedParamsFree(eventParams, eventNparams);
-    virObjectUnref(caps);
     virObjectUnref(cfg);
     return ret;
 }
-- 
2.8.2


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