Re: [PATCH 12/16] qemu: Wire up new virDomainSetIOThreadParams parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 02, 2022 at 09:18:02 +0200, Michal Privoznik wrote:
> Introduced in previous commit, QEMU driver needs to be taught how
> to set VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and
> VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX parameters on given IOThread.
> Fortunately, this is fairly trivial to do and since these two
> parameters are exposed in domain XML too the update of inactive
> XML can be wired up too.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_driver.c       | 63 +++++++++++++++++++++++++++++++++---
>  src/qemu/qemu_monitor.h      |  4 +++
>  src/qemu/qemu_monitor_json.c |  2 ++
>  3 files changed, 64 insertions(+), 5 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index fb63e6550f..d6f9fa99a8 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -5313,6 +5313,26 @@ qemuDomainHotplugModIOThread(virQEMUDriver *driver,
>  }
>  
>  
> +static int
> +qemuDomainHotplugModIOThreadIDDef(virDomainIOThreadIDDef *def,
> +                                  qemuMonitorIOThreadInfo mondef)
> +{
> +    if (mondef.set_thread_pool_min)
> +        def->pool_min = mondef.thread_pool_min;
> +
> +    if (mondef.set_thread_pool_max)
> +        def->pool_max = mondef.thread_pool_max;
> +
> +    /* These have no representation in domain XML */
> +    if (mondef.set_poll_grow ||
> +        mondef.set_poll_max_ns ||
> +        mondef.set_poll_shrink)
> +        return -1;

These checks should be first, so that you don't modify the definition
and then report an error while the XML was already partially modified.

> +
> +    return 0;
> +}

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux