Re: [PATCH v2 1/4] test_driver: introduce TEST_SET_PARAM macro

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

 



On Tue, Jul 02, 2019 at 03:49:41PM +0200, Ilias Stamatis wrote:
> This macro can be used by most or all of the DomainGetXXXParameters APIs.

Technically okay, but usually we introduce such helper macros with the first
function that needs it, solely because a patch such as this is effectively a
NOP wit the #undef, so I'll squash this patch into 2/4.

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

>
> Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
> ---
>  src/test/test_driver.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 4b1f2724a0..c0608a4bea 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -2844,6 +2844,16 @@ static char *testDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
>      return ret;
>  }
>
> +
> +#define TEST_SET_PARAM(index, name, type, value) \
> +    if (index < *nparams && \
> +        virTypedParameterAssign(&params[index], name, type, value) < 0) \
> +        goto cleanup
> +
> +
> +#undef TEST_SET_PARAM
> +
> +
>  static int testConnectNumOfDefinedDomains(virConnectPtr conn)
>  {
>      testDriverPtr privconn = conn->privateData;
> --
> 2.22.0
>
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

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