From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7fOC-00014c-Jp for qemu-devel@nongnu.org; Tue, 31 May 2016 04:51:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7fO7-0008LA-M7 for qemu-devel@nongnu.org; Tue, 31 May 2016 04:51:03 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:36644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7fO7-0008Kz-El for qemu-devel@nongnu.org; Tue, 31 May 2016 04:50:59 -0400 Received: by mail-lf0-x243.google.com with SMTP id h68so9192246lfh.3 for ; Tue, 31 May 2016 01:50:59 -0700 (PDT) Reply-To: marcel@redhat.com References: <1464683498-28779-1-git-send-email-armbru@redhat.com> From: Marcel Apfelbaum Message-ID: <574D506F.2050803@gmail.com> Date: Tue, 31 May 2016 11:50:55 +0300 MIME-Version: 1.0 In-Reply-To: <1464683498-28779-1-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vl: Error messages need to go to stderr, fix some List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org, pbonzini@redhat.com 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 > --- > 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 Thanks, Marcel