From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVKyZ-0006ow-4c for qemu-devel@nongnu.org; Mon, 15 Feb 2016 10:22:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVKyV-0003Ah-7X for qemu-devel@nongnu.org; Mon, 15 Feb 2016 10:22:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVKyV-0003AW-2n for qemu-devel@nongnu.org; Mon, 15 Feb 2016 10:22:07 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id C5115C0BBE62 for ; Mon, 15 Feb 2016 15:22:06 +0000 (UTC) Date: Mon, 15 Feb 2016 13:22:04 -0200 From: Eduardo Habkost Message-ID: <20160215152204.GP6239@thinpad.lan.raisama.net> References: <1455303747-19776-1-git-send-email-ehabkost@redhat.com> <1455303747-19776-3-git-send-email-ehabkost@redhat.com> <87bn7i5krr.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bn7i5krr.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH v2 2/4] vl: Reset location after handling command-line arguments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Marcel Apfelbaum , Paolo Bonzini , lersek@redhat.com, qemu-devel@nongnu.org On Mon, Feb 15, 2016 at 11:29:44AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > After looping through all command-line arguments, error location > > info becomes obsolete, and any function calling error_report() > > will print misleading information. This breaks error reporting > > for some option handling, like: > > > > $ qemu-system-x86_64 -icount rr=x -vnc :0 > > qemu-system-x86_64: -vnc :0: Invalid icount rr option: x > > > > $ qemu-system-x86_64 -m size= -vnc :0 > > qemu-system-x86_64: -vnc :0: missing 'size' option value > > > > Fix this by resetting location info as soon as we exit the > > command-line handling loop. > > > > With this, replay_configure() and set_memory_options() won't > > print any location info yet, but at least they won't print > > incorrect information. > > > > Signed-off-by: Eduardo Habkost > > --- > > vl.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/vl.c b/vl.c > > index afbf13f..50cd018 100644 > > --- a/vl.c > > +++ b/vl.c > > @@ -4053,14 +4053,14 @@ int main(int argc, char **argv, char **envp) > > } > > } > > > > + loc_set_none(); > > + > > When I added loc_set_none() in commit 0f0bc3f, I intentionally put no > empty line between the loop's closing brace and the loc_set_none(), to > reduce the chance of people sticking something in between unthinkingly. > It failed. Let's try again with a billboard: > > } > /* > * Clear error location left behind by the loop. > * Best done right after the loop. Do not insert code here! > */ > loc_set_none() ACK. -- Eduardo