mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
qemu: reject blockiotune if qemu too old
Commit4c82f09e
added a capability check for qemu per-device io throttling, but only applied it to domain startup. As mentioned in the previous commit (98cec05
), the user can still get an 'internal error' message during a hotplug attempt, when the monitor command doesn't exist. It is confusing to allow tuning on inactive domains only to then be rejected when starting the domain. * src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Reject offline tuning if online can't match it. (cherry picked from commit13f9a19326
)
This commit is contained in:
parent
282bd9dc61
commit
b5f86fc038
@ -11848,6 +11848,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
|||||||
_("no domain with matching uuid '%s'"), uuidstr);
|
_("no domain with matching uuid '%s'"), uuidstr);
|
||||||
goto cleanup;
|
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);
|
device = qemuDiskPathToAlias(vm, disk, &idx);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
@ -11919,7 +11926,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
|||||||
info.read_iops_sec = oldinfo->read_iops_sec;
|
info.read_iops_sec = oldinfo->read_iops_sec;
|
||||||
info.write_iops_sec = oldinfo->write_iops_sec;
|
info.write_iops_sec = oldinfo->write_iops_sec;
|
||||||
}
|
}
|
||||||
priv = vm->privateData;
|
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||||
ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info);
|
ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info);
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user