diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4b23ee061b..7cde099ebd 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11848,6 +11848,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } + priv = vm->privateData; + if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) { + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("block I/O throttling not supported with this " + "QEMU binary")); + goto cleanup; + } device = qemuDiskPathToAlias(vm, disk, &idx); if (!device) { @@ -11919,7 +11926,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, info.read_iops_sec = oldinfo->read_iops_sec; info.write_iops_sec = oldinfo->write_iops_sec; } - priv = vm->privateData; qemuDomainObjEnterMonitorWithDriver(driver, vm); ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info); qemuDomainObjExitMonitorWithDriver(driver, vm);