Re: [PATCH 4/4] test_driver: implement virDomainGetIOThreadInfo

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

 



On Tue, Jul 23, 2019 at 12:17:57PM +0200, Ilias Stamatis wrote:
> Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
> ---
>  src/test/test_driver.c | 74 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 47e28a01ec..4c6f3db8de 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -2774,6 +2774,79 @@ testDomainPinIOThread(virDomainPtr dom,
>  }
>
>
> +static int
> +testDomainGetIOThreadInfo(virDomainPtr dom,
> +                          virDomainIOThreadInfoPtr **info,
> +                          unsigned int flags)
> +{
> +    virDomainObjPtr vm = NULL;
> +    virDomainDefPtr def = NULL;
> +    virBitmapPtr cpumask = NULL;
> +    virBitmapPtr bitmap = NULL;
> +    virDomainIOThreadInfoPtr *info_ret = NULL;
> +    size_t i;
> +    int hostcpus;
> +    int ret = -1;
> +
> +    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
> +                  VIR_DOMAIN_AFFECT_CONFIG, -1);
> +
> +    if (!(vm = testDomObjFromDomain(dom)))
> +        goto cleanup;
> +
> +    if (!(def = virDomainObjGetOneDef(vm, flags)))
> +        goto cleanup;
> +
> +    if (def->niothreadids == 0)
> +        return 0;

^This will leave the object locked, so once you do Info, anything else after
that will deadlock, so goto is needed.

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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