[libvirt] [PATCH] qemu: Check for qemu capability when calling virDomainGetBlockIoTune()

Martin Kletzander mkletzan at redhat.com
Thu Jun 4 08:50:50 UTC 2015


ping

On Thu, May 28, 2015 at 08:18:31PM +0200, Martin Kletzander wrote:
>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 at redhat.com>
>---
> src/qemu/qemu_driver.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>index d1b00a2014ba..8f8ad8ba5bf5 100644
>--- a/src/qemu/qemu_driver.c
>+++ b/src/qemu/qemu_driver.c
>@@ -18065,6 +18065,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);
>     }
>
>--
>2.4.2
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150604/0c551d8f/attachment-0001.sig>


More information about the libvir-list mailing list