Re: [PATCH v2] test_driver: implement virDomainGetNumaParameters

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

 



On Fri, Jun 28, 2019 at 09:54:13PM +0200, Ilias Stamatis wrote:
> Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
> ---
>  src/test/test_driver.c | 52 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 4b1f2724a0..dc6d3b078c 100755
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -2405,6 +2405,57 @@ testDomainCoreDump(virDomainPtr domain,
>  }
>
>
> +static int
> +testDomainGetNumaParameters(virDomainPtr dom,
> +                            virTypedParameterPtr params,
> +                            int *nparams,
> +                            unsigned int flags)
> +{
> +    virDomainObjPtr vm = NULL;
> +    virDomainDefPtr def = NULL;
> +    virDomainNumatuneMemMode mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT;
> +    VIR_AUTOFREE(char *) nodeset = NULL;
> +    int ret = -1;
> +
> +    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
> +                  VIR_DOMAIN_AFFECT_CONFIG |
> +                  VIR_TYPED_PARAM_STRING_OKAY, -1);
> +
> +    if ((*nparams) == 0) {
> +        *nparams = 2;
> +        return 0;
> +    }
> +
> +    if (!(vm = testDomObjFromDomain(dom)))
> +        goto cleanup;
> +
> +    if (!(def = virDomainObjGetOneDef(vm, flags)))
> +        goto cleanup;
> +
> +    ignore_value(virDomainNumatuneGetMode(def->numa, -1, &mode));
> +    if (*nparams > 0 &&
> +        virTypedParameterAssign(&params[0], VIR_DOMAIN_NUMA_MODE, VIR_TYPED_PARAM_INT, mode) < 0)

I'll split the arguments to ^this function before merging. It would be cool if
you introduced the corresponding setter counterpart soon.

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

--
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