mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
qemu: Check empty drives in block I/O throttle API
Provide a proper user facing error when attempting to query block I/O throttling settings for an empty drive. Without this patch, a less meaningful internal error produced by qemuMonitorJSONBlockIoThrottleInfo would be propagated to the user. Signed-off-by: Fabian Leditzky <fabian@ldsoft.dev> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
fce24e433b
commit
00f9f2ca1f
@ -15368,6 +15368,14 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
||||
if (!qemuDomainDiskBlockIoTuneIsSupported(disk))
|
||||
goto endjob;
|
||||
|
||||
/* qemu won't return block IO throttle settings for an empty cd-rom drive */
|
||||
if (virStorageSourceIsEmpty(disk->src)) {
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("disk '%1$s' does not currently have a source assigned"),
|
||||
path);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
qemuDomainObjEnterMonitor(vm);
|
||||
rc = qemuMonitorGetBlockIoThrottle(priv->mon, QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName, &reply);
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user