All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	lersek@redhat.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/4] vl: Reset location after handling command-line arguments
Date: Fri, 12 Feb 2016 21:34:40 +0200	[thread overview]
Message-ID: <56BE33D0.6020201@redhat.com> (raw)
In-Reply-To: <1455303747-19776-3-git-send-email-ehabkost@redhat.com>

On 02/12/2016 09:02 PM, Eduardo Habkost wrote:
> 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 <ehabkost@redhat.com>
> ---
>   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();
> +
>       replay_configure(icount_opts);
>
>       set_machine_options(&machine_class);
>
>       set_memory_options(&ram_slots, &maxram_size, machine_class);
>
> -    loc_set_none();
> -
>       os_daemonize();
>
>       if (qemu_init_main_loop(&main_loop_err)) {
>


Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>


Thanks,
Marcel

  reply	other threads:[~2016-02-12 19:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 19:02 [Qemu-devel] [PATCH v2 0/4] Error location reporting fixes Eduardo Habkost
2016-02-12 19:02 ` [Qemu-devel] [PATCH v2 1/4] vl.c: Fix regression in machine error message Eduardo Habkost
2016-02-15 10:20   ` Markus Armbruster
2016-02-15 10:54     ` Marcel Apfelbaum
2016-02-15 11:53       ` Laszlo Ersek
2016-02-15 14:30       ` Markus Armbruster
2016-02-16 12:46         ` Markus Armbruster
2016-02-12 19:02 ` [Qemu-devel] [PATCH v2 2/4] vl: Reset location after handling command-line arguments Eduardo Habkost
2016-02-12 19:34   ` Marcel Apfelbaum [this message]
2016-02-15 10:29   ` Markus Armbruster
2016-02-15 15:22     ` Eduardo Habkost
2016-02-12 19:02 ` [Qemu-devel] [PATCH v2 3/4] replay: Set error location properly when parsing options Eduardo Habkost
2016-02-12 19:34   ` Marcel Apfelbaum
2016-02-12 19:02 ` [Qemu-devel] [PATCH v2 4/4] vl: Set error location when parsing memory options Eduardo Habkost
2016-02-12 19:35   ` Marcel Apfelbaum
2016-02-15 10:33 ` [Qemu-devel] [PATCH v2 0/4] Error location reporting fixes Markus Armbruster
2016-02-16 14:57 ` [Qemu-devel] [PATCH 5/4] vl: Clean up machine selection in main() Markus Armbruster
2016-02-16 15:34   ` Laszlo Ersek
2016-02-16 19:56     ` Markus Armbruster
2016-02-16 16:27   ` Marcel Apfelbaum
2016-02-16 19:52     ` Markus Armbruster
2016-02-16 20:03 ` [Qemu-devel] [PATCH v2 0/4] Error location reporting fixes Markus Armbruster

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=56BE33D0.6020201@redhat.com \
    --to=marcel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.