From: Martin Kletzander Date: Thu, 28 May 2015 09:38:43 +0000 (+0200) Subject: qemu: Check for qemu capability when calling virDomainGetBlockIoTune() X-Git-Tag: v1.2.17-rc1~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f833c70b85993f024be4afc4dfbfc2fb9c2d6cd9;p=thirdparty%2Flibvirt.git qemu: Check for qemu capability when calling virDomainGetBlockIoTune() 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 478cee4709..e031a1728a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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); }