]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Move setting of conf_disk in qemuDomainSetBlockIoTune
authorJohn Ferlan <jferlan@redhat.com>
Thu, 6 Oct 2016 18:21:29 +0000 (14:21 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 25 Oct 2016 20:09:24 +0000 (16:09 -0400)
Since persistent_def is the only place that uses it, let's just keep
it closer to where it's used.

src/qemu/qemu_driver.c

index f971e65fde7cb4bb55e3630b95b24985149b58de..93c3d4ad421916325a9fc534f64e1e0513aed4db 100644 (file)
@@ -17455,15 +17455,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);
@@ -17556,6 +17547,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;