[libvirt] [PATCH] Fix blkdeviotune for shutoff domain

Jiri Denemark jdenemar at redhat.com
Fri May 24 09:41:45 UTC 2013


On Thu, May 23, 2013 at 14:37:31 +0200, Martin Kletzander wrote:
> Function qemuDomainSetBlockIoTune() was creating job and checking QEMU
> capabilities even when !(flags & VIR_DOMAIN_AFFECT_LIVE) and the
> domain was shutoff.  Fix this with a little cleanup.

Actually, the job needs to be hold for the whole function, not just when
the domain is running...

> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 3df26b8..49432f0 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -13921,27 +13921,12 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
>      priv = vm->privateData;
>      cfg = virQEMUDriverGetConfig(driver);
> 
> -    if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
> -        goto cleanup;
> -
> -    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) {
> -        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> -                       _("block I/O throttling not supported with this "
> -                         "QEMU binary"));
> -        goto cleanup;
> -    }
> -
> -    device = qemuDiskPathToAlias(vm, disk, &idx);
> -    if (!device) {
> -        goto cleanup;
> -    }
> -
> -    if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
> +    if (!(device = qemuDiskPathToAlias(vm, disk, &idx)))
>          goto cleanup;

... however, you're right qemuDomainObjBeginJob was not called in the
right place. But rather than moving it further in the code, it should be
moved before qemuDiskPathToAlias.

Jirka




More information about the libvir-list mailing list