Received: from eggs.gnu.org ([2001:4830:134:3::10]:41412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCNxN-0008QN-RW for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:14:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCNxI-0004N8-MP for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:14:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCNxI-0004N3-Gm for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:14:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 333CE486AA for ; Mon, 13 Jun 2016 09:14:48 +0000 (UTC) References: <1464683498-28779-1-git-send-email-armbru@redhat.com> <87shwhzcj1.fsf@dusky.pond.sub.org> From: Paolo Bonzini Message-ID: <5851760a-cebf-46e3-381e-a348d2b4f262@redhat.com> Date: Mon, 13 Jun 2016 11:14:44 +0200 MIME-Version: 1.0 In-Reply-To: <87shwhzcj1.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 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 On 13/06/2016 11:03, Markus Armbruster wrote: > Paolo, will you pick this up, or do you want me to take it through my > (currently empty) error-next branch? I can pick it up. Paolo > Markus Armbruster writes: > >> 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;