qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] vl: Error messages need to go to stderr, fix so


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH] vl: Error messages need to go to stderr, fix some
Date: Tue, 31 May 2016 11:50:55 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 05/31/2016 11:31 AM, Markus Armbruster wrote:
We print a few fatal error messages to stdout instead of stderr.
Reproducer:

     $ qemu-system-x86_64 -g 1024x768
     Option g not supported for this target
     $ qemu-system-x86_64 -g 1024x768 >/dev/null

Fix by printing them with error_report().  This also improves the messages.
The above one becomes

     qemu-system-x86_64: -g 1024x768: Option not supported for this target

Reported-by: Tobi {github.com/tobimensch}
Signed-off-by: Markus Armbruster <address@hidden>
---
  vl.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vl.c b/vl.c
index 18d1423..7800b31 100644
--- a/vl.c
+++ b/vl.c
@@ -3075,7 +3075,7 @@ int main(int argc, char **argv, char **envp)

              popt = lookup_opt(argc, argv, &optarg, &optind);
              if (!(popt->arch_mask & arch_type)) {
-                printf("Option %s not supported for this target\n", 
popt->name);
+                error_report("Option not supported for this target");
                  exit(1);
              }
              switch(popt->index) {
@@ -3849,21 +3849,21 @@ int main(int argc, char **argv, char **envp)
                  break;
              case QEMU_OPTION_xen_domid:
                  if (!(xen_available())) {
-                    printf("Option %s not supported for this target\n", 
popt->name);
+                    error_report("Option not supported for this target");
                      exit(1);
                  }
                  xen_domid = atoi(optarg);
                  break;
              case QEMU_OPTION_xen_create:
                  if (!(xen_available())) {
-                    printf("Option %s not supported for this target\n", 
popt->name);
+                    error_report("Option not supported for this target");
                      exit(1);
                  }
                  xen_mode = XEN_CREATE;
                  break;
              case QEMU_OPTION_xen_attach:
                  if (!(xen_available())) {
-                    printf("Option %s not supported for this target\n", 
popt->name);
+                    error_report("Option not supported for this target");
                      exit(1);
                  }
                  xen_mode = XEN_ATTACH;



Reviewed-by: Marcel Apfelbaum <address@hidden>


Thanks,
Marcel



reply via email to

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