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 <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2015-05-28 11:38:43 +02:00
parent 50a9d0e67d
commit f833c70b85

View 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);
}