]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vl: Error messages need to go to stderr, fix some
authorMarkus Armbruster <armbru@redhat.com>
Tue, 31 May 2016 08:31:38 +0000 (10:31 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 20 Jun 2016 14:36:29 +0000 (16:36 +0200)
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

diff --git a/vl.c b/vl.c
index 2f63eb448f4b3d7f4dc77d9eec5e7fe25a758cc9..18af70afb7ac988e2749aeb494706a0c038bf06d 100644 (file)
--- 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;