qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 1/7] vl: Error messages need to go to stderr, fix some
Date: Mon, 20 Jun 2016 17:00:17 +0200	[thread overview]
Message-ID: <1466434823-22789-2-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1466434823-22789-1-git-send-email-armbru@redhat.com>

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 <armbru@redhat.com>
Message-Id: <1464683498-28779-1-git-send-email-armbru@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
---
 vl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vl.c b/vl.c
index 2f63eb4..18af70a 100644
--- a/vl.c
+++ b/vl.c
@@ -3068,7 +3068,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) {
@@ -3846,21 +3846,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;
-- 
2.5.5

  reply	other threads:[~2016-06-20 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 15:00 [Qemu-devel] [PULL 0/7] Error reporting patches for 2016-06-20 Markus Armbruster
2016-06-20 15:00 ` Markus Armbruster [this message]
2016-06-20 15:00 ` [Qemu-devel] [PULL 2/7] error: Remove NULL checks on error_propagate() calls Markus Armbruster
2016-06-20 15:00 ` [Qemu-devel] [PULL 3/7] error: Remove unnecessary local_err variables Markus Armbruster
2016-06-20 15:00 ` [Qemu-devel] [PULL 4/7] coccinelle: Remove unnecessary variables for function return value Markus Armbruster
2016-06-20 15:00 ` [Qemu-devel] [PULL 5/7] log: Plug memory leak on multiple -dfilter Markus Armbruster
2016-06-20 15:00 ` [Qemu-devel] [PULL 6/7] log: Fix qemu_set_dfilter_ranges() error reporting Markus Armbruster
2016-06-20 15:00 ` [Qemu-devel] [PULL 7/7] log: Fix qemu_set_log_filename() error handling Markus Armbruster
2016-06-20 17:08 ` [Qemu-devel] [PULL 0/7] Error reporting patches for 2016-06-20 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466434823-22789-2-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).