qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH REPOST v3 79/80] tests:numa-test: make top level args dynamic


From: Thomas Huth
Subject: Re: [PATCH REPOST v3 79/80] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
Date: Thu, 23 Jan 2020 17:33:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 23/01/2020 12.38, Igor Mammedov wrote:
> Use GString to pass argument to make_cli() so that it would be easy
> to dynamically change test case arguments from main(). The follow up
> patch will use it to change RAM size options depending on target.
> 
> While at it cleanup 'cli' freeing, using g_autofree annotation.
> 
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
[...]
> @@ -539,11 +539,11 @@ static void pc_hmat_erange_cfg(const void *data)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *args = NULL;
> +    g_autoptr(GString) args = g_string_new("");

Nit: You could use g_string_new(NULL) here to save two bytes ;-)

>      const char *arch = qtest_get_arch();
>  
> -    if (strcmp(arch, "aarch64") == 0) {
> -        args = "-machine virt";
> +    if (g_str_equal(arch, "aarch64")) {
> +        g_string_append(args, " -machine virt");
>      }
>  
>      g_test_init(&argc, &argv, NULL);
> 

Reviewed-by: Thomas Huth <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]