[libvirt] [PATCH] blkdeviotune: trigger tunable event for blkdeviotune updates

Jiri Denemark jdenemar at redhat.com
Thu Sep 25 09:07:08 UTC 2014


On Wed, Sep 24, 2014 at 10:24:03 +0200, Pavel Hrdina wrote:
> With the blkdeviotune event this patch also fixes a bug that the updated
> live values weren't saved to the live XML so they won't survive
> restarting the libvirtd.

Hmm, could you fix the bug in a separate patch (just in case it needs to
be backported somewhere)?

> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  include/libvirt/libvirt.h.in | 56 ++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_driver.c       | 54 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 110 insertions(+)
> 
...
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index d1a0657..173333a 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
...
> @@ -16405,6 +16443,20 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
>          if (ret < 0)
>              goto endjob;
>          vm->def->disks[idx]->blkdeviotune = info;
> +
> +        ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm);
> +        if (ret < 0) {
> +            virReportError(VIR_ERR_OPERATION_FAILED, "%s",
> +                           _("Saving live XML config failed"));
> +            goto endjob;
> +        }
> +
> +        if (eventNparams) {
> +            event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
> +            eventNparams = 0;
> +            if (event)
> +                qemuDomainEventQueue(driver, event);

eventNparams = 0 should only be done if event != NULL

> +        }
>      }
>  
>      if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
> @@ -16437,6 +16489,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
>      VIR_FREE(device);
>      if (vm)
>          virObjectUnlock(vm);
> +    if (eventNparams)
> +        virTypedParamsFree(eventParams, eventNparams);
>      virObjectUnref(caps);
>      virObjectUnref(cfg);
>      return ret;

Jirka




More information about the libvir-list mailing list