]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Check for qemu capability when calling virDomainGetBlockIoTune()
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 28 May 2015 09:38:43 +0000 (11:38 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 4 Jun 2015 09:30:41 +0000 (11:30 +0200)
When getting block device I/O tuning data there is no check for whether
QEMU supports such options and the call fails on
qemuMonitorGetBlockIoThrottle() when getting the particular throttle
data.  So try reporting a better error when blkdeviotune is not
supported.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1224053

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_driver.c

index 478cee4709f40f23cf26d16dff94454d7c53911b..e031a1728adae5b4786d49e91f086c8688dfdc39 100644 (file)
@@ -17812,6 +17812,12 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
          * because we need vm->privateData which need
          * virDomainLiveConfigHelperMethod to do so. */
         priv = vm->privateData;
+        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) {
+            virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("block I/O throttling not supported with this "
+                         "QEMU binary"));
+            goto endjob;
+        }
         supportMaxOptions = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE_MAX);
     }