* [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr
@ 2019-04-23 16:06 Thomas Huth
2019-04-23 17:52 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Huth @ 2019-04-23 16:06 UTC (permalink / raw)
To: Jason Wang, qemu-devel; +Cc: qemu-trivial
We are printing all other help output to stdout already (e.g. "-help",
"-cpu help" and "-machine help" output). So the "-net nic,model=help"
output should go to stdout instead of stderr, too. And while we're at
it, also print the NICs line by line, like we do it e.g. with the
"-cpu help" or "-M help" output, too.
Buglink: https://bugs.launchpad.net/qemu/+bug/1574327
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
net/net.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/net.c b/net/net.c
index f3a3c5444c..2cf5e76469 100644
--- a/net/net.c
+++ b/net/net.c
@@ -837,9 +837,10 @@ int qemu_show_nic_models(const char *arg, const char *const *models)
return 0;
}
- fprintf(stderr, "qemu: Supported NIC models: ");
- for (i = 0 ; models[i]; i++)
- fprintf(stderr, "%s%c", models[i], models[i+1] ? ',' : '\n');
+ printf("Supported NIC models:\n");
+ for (i = 0 ; models[i]; i++) {
+ printf("%s\n", models[i]);
+ }
return 1;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr
2019-04-23 16:06 [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr Thomas Huth
@ 2019-04-23 17:52 ` Eric Blake
2019-04-23 22:34 ` Philippe Mathieu-Daudé
2019-05-02 9:07 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2019-04-23 17:52 UTC (permalink / raw)
To: Thomas Huth, Jason Wang, qemu-devel; +Cc: qemu-trivial, Markus Armbruster
[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]
[adding Markus, as he send a recent batch of similar patches]
On 4/23/19 11:06 AM, Thomas Huth wrote:
> We are printing all other help output to stdout already (e.g. "-help",
> "-cpu help" and "-machine help" output). So the "-net nic,model=help"
> output should go to stdout instead of stderr, too. And while we're at
> it, also print the NICs line by line, like we do it e.g. with the
> "-cpu help" or "-M help" output, too.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1574327
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> net/net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/net/net.c b/net/net.c
> index f3a3c5444c..2cf5e76469 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -837,9 +837,10 @@ int qemu_show_nic_models(const char *arg, const char *const *models)
> return 0;
> }
>
> - fprintf(stderr, "qemu: Supported NIC models: ");
> - for (i = 0 ; models[i]; i++)
> - fprintf(stderr, "%s%c", models[i], models[i+1] ? ',' : '\n');
> + printf("Supported NIC models:\n");
> + for (i = 0 ; models[i]; i++) {
> + printf("%s\n", models[i]);
> + }
> return 1;
> }
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr
2019-04-23 16:06 [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr Thomas Huth
2019-04-23 17:52 ` Eric Blake
@ 2019-04-23 22:34 ` Philippe Mathieu-Daudé
2019-05-02 9:07 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-04-23 22:34 UTC (permalink / raw)
To: Thomas Huth, Jason Wang, qemu-devel; +Cc: qemu-trivial
On 4/23/19 6:06 PM, Thomas Huth wrote:
> We are printing all other help output to stdout already (e.g. "-help",
> "-cpu help" and "-machine help" output). So the "-net nic,model=help"
> output should go to stdout instead of stderr, too. And while we're at
> it, also print the NICs line by line, like we do it e.g. with the
> "-cpu help" or "-M help" output, too.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1574327
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> net/net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/net/net.c b/net/net.c
> index f3a3c5444c..2cf5e76469 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -837,9 +837,10 @@ int qemu_show_nic_models(const char *arg, const char *const *models)
> return 0;
> }
>
> - fprintf(stderr, "qemu: Supported NIC models: ");
> - for (i = 0 ; models[i]; i++)
> - fprintf(stderr, "%s%c", models[i], models[i+1] ? ',' : '\n');
> + printf("Supported NIC models:\n");
> + for (i = 0 ; models[i]; i++) {
> + printf("%s\n", models[i]);
> + }
> return 1;
> }
>
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr
2019-04-23 16:06 [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr Thomas Huth
2019-04-23 17:52 ` Eric Blake
2019-04-23 22:34 ` Philippe Mathieu-Daudé
@ 2019-05-02 9:07 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2019-05-02 9:07 UTC (permalink / raw)
To: Thomas Huth, Jason Wang, qemu-devel; +Cc: qemu-trivial
On 23/04/2019 18:06, Thomas Huth wrote:
> We are printing all other help output to stdout already (e.g. "-help",
> "-cpu help" and "-machine help" output). So the "-net nic,model=help"
> output should go to stdout instead of stderr, too. And while we're at
> it, also print the NICs line by line, like we do it e.g. with the
> "-cpu help" or "-M help" output, too.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1574327
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> net/net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/net/net.c b/net/net.c
> index f3a3c5444c..2cf5e76469 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -837,9 +837,10 @@ int qemu_show_nic_models(const char *arg, const char *const *models)
> return 0;
> }
>
> - fprintf(stderr, "qemu: Supported NIC models: ");
> - for (i = 0 ; models[i]; i++)
> - fprintf(stderr, "%s%c", models[i], models[i+1] ? ',' : '\n');
> + printf("Supported NIC models:\n");
> + for (i = 0 ; models[i]; i++) {
> + printf("%s\n", models[i]);
> + }
> return 1;
> }
>
>
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-05-02 9:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 16:06 [Qemu-devel] [PATCH] net: Print output of "-net nic, model=help" to stdout instead of stderr Thomas Huth
2019-04-23 17:52 ` Eric Blake
2019-04-23 22:34 ` Philippe Mathieu-Daudé
2019-05-02 9:07 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.