[PATCH v2 03/12] qemu: Move setting of conf_disk in qemuDomainSetBlockIoTune

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

 



Since persistent_def is the only place that uses it, let's just keep
it closer to where it's used.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3ce3f2d..78e917e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17449,15 +17449,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         goto endjob;
     }
 
-    if (persistentDef) {
-        if (!(conf_disk = virDomainDiskByName(persistentDef, path, true))) {
-            virReportError(VIR_ERR_INVALID_ARG,
-                           _("missing persistent configuration for disk '%s'"),
-                           path);
-            goto endjob;
-        }
-    }
-
     if (def) {
         supportMaxOptions = virQEMUCapsGet(priv->qemuCaps,
                                            QEMU_CAPS_DRIVE_IOTUNE_MAX);
@@ -17550,6 +17541,12 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
     }
 
     if (persistentDef) {
+        if (!(conf_disk = virDomainDiskByName(persistentDef, path, true))) {
+            virReportError(VIR_ERR_INVALID_ARG,
+                           _("missing persistent configuration for disk '%s'"),
+                           path);
+            goto endjob;
+        }
         oldinfo = &conf_disk->blkdeviotune;
         if (!set_bytes) {
             info.total_bytes_sec = oldinfo->total_bytes_sec;
-- 
2.7.4

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