[Qemu-devel] [PATCH 10/15] vl: Make -machine $TYPE, help and -accel help print to stdout

Markus Armbruster posted 15 patches 6 years, 10 months ago
Maintainers: "Dr. David Alan Gilbert" <dgilbert@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, Aleksandar Rikalo <arikalo@wavecomp.com>, Kevin Wolf <kwolf@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paul Burton <pburton@wavecomp.com>, Aurelien Jarno <aurelien@aurel32.net>, Halil Pasic <pasic@linux.ibm.com>, Aleksandar Markovic <amarkovic@wavecomp.com>, Paolo Bonzini <pbonzini@redhat.com>, Max Reitz <mreitz@redhat.com>, Markus Armbruster <armbru@redhat.com>, David Hildenbrand <david@redhat.com>, "Richard W.M. Jones" <rjones@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Richard Henderson <rth@twiddle.net>
There is a newer version of this series
[Qemu-devel] [PATCH 10/15] vl: Make -machine $TYPE, help and -accel help print to stdout
Posted by Markus Armbruster 6 years, 10 months ago
Command line help help explicitly requested by the user should be
printed to stdout, not stderr.  We do elsewhere.  Adjust -machine
$TYPE,help and -accel help to match: use printf() instead of
error_printf().

Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 vl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vl.c b/vl.c
index c696ad2a13..792ef36001 100644
--- a/vl.c
+++ b/vl.c
@@ -1556,12 +1556,12 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine)
             continue;
         }
 
-        error_printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name,
-                     prop->name, prop->type);
+        printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name,
+                    prop->name, prop->type);
         if (prop->description) {
-            error_printf(" (%s)\n", prop->description);
+            printf(" (%s)\n", prop->description);
         } else {
-            error_printf("\n");
+            printf("\n");
         }
     }
 
@@ -3643,7 +3643,7 @@ int main(int argc, char **argv, char **envp)
                                                      optarg, true);
                 optarg = qemu_opt_get(accel_opts, "accel");
                 if (!optarg || is_help_option(optarg)) {
-                    error_printf("Possible accelerators: kvm, xen, hax, tcg\n");
+                    printf("Possible accelerators: kvm, xen, hax, tcg\n");
                     exit(0);
                 }
                 opts = qemu_opts_create(qemu_find_opts("machine"), NULL,
-- 
2.17.2


Re: [Qemu-devel] [PATCH 10/15] vl: Make -machine $TYPE, help and -accel help print to stdout
Posted by Marcel Apfelbaum 6 years, 10 months ago
Hi Markus,

On 4/8/19 11:36 AM, Markus Armbruster wrote:
> Command line help help explicitly requested by the user should be
> printed to stdout, not stderr.  We do elsewhere.  Adjust -machine
> $TYPE,help and -accel help to match: use printf() instead of
> error_printf().
>
> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   vl.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index c696ad2a13..792ef36001 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1556,12 +1556,12 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine)
>               continue;
>           }
>   
> -        error_printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name,
> -                     prop->name, prop->type);
> +        printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name,
> +                    prop->name, prop->type);

Does the line above have an alignment issue?

Anyway,

Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>

Thanks,
Marcel

>           if (prop->description) {
> -            error_printf(" (%s)\n", prop->description);
> +            printf(" (%s)\n", prop->description);
>           } else {
> -            error_printf("\n");
> +            printf("\n");
>           }
>       }
>   
> @@ -3643,7 +3643,7 @@ int main(int argc, char **argv, char **envp)
>                                                        optarg, true);
>                   optarg = qemu_opt_get(accel_opts, "accel");
>                   if (!optarg || is_help_option(optarg)) {
> -                    error_printf("Possible accelerators: kvm, xen, hax, tcg\n");
> +                    printf("Possible accelerators: kvm, xen, hax, tcg\n");
>                       exit(0);
>                   }
>                   opts = qemu_opts_create(qemu_find_opts("machine"), NULL,


Re: [Qemu-devel] [PATCH 10/15] vl: Make -machine $TYPE, help and -accel help print to stdout
Posted by Markus Armbruster 6 years, 10 months ago
Marcel Apfelbaum <marcel.apfelbaum@gmail.com> writes:

> Hi Markus,
>
> On 4/8/19 11:36 AM, Markus Armbruster wrote:
>> Command line help help explicitly requested by the user should be
>> printed to stdout, not stderr.  We do elsewhere.  Adjust -machine
>> $TYPE,help and -accel help to match: use printf() instead of
>> error_printf().
>>
>> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   vl.c | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index c696ad2a13..792ef36001 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -1556,12 +1556,12 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine)
>>               continue;
>>           }
>>   -        error_printf("%s.%s=%s",
>> MACHINE_GET_CLASS(machine)->name,
>> -                     prop->name, prop->type);
>> +        printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name,
>> +                    prop->name, prop->type);
>
> Does the line above have an alignment issue?

Oops!  Will fix.

> Anyway,
>
> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>

Thank you!