All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>
Subject: Re: [Qemu-devel] command line error handling broken?
Date: Mon, 8 Feb 2016 09:48:23 +0100	[thread overview]
Message-ID: <56B85657.4070900@redhat.com> (raw)
In-Reply-To: <20160207123001-mutt-send-email-mst@redhat.com>

On 02/07/16 11:32, Michael S. Tsirkin wrote:
> ./x86_64-softmmu/qemu-system-x86_64 -M q35-1.5 -redir tcp:8022::22
> 
> qemu-system-x86_64: -redir tcp:8022::22: unsupported machine type
> Use -machine help to list supported machines
> 
> It should say q35-1.5 is unsupported, of course.
> 
> Anyone knows what's going on?
> 

Don't know what triggered it (and when), but the following should fix it:

> diff --git a/vl.c b/vl.c
> index c581e39..0830f98 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4031,7 +4031,12 @@ int main(int argc, char **argv, char **envp)
>      opts = qemu_get_machine_opts();
>      optarg = qemu_opt_get(opts, "type");
>      if (optarg) {
> +        Location loc;
> +
> +        loc_push_none(&loc);
> +        qemu_opts_loc_restore(opts);
>          machine_class = machine_parse(optarg);
> +        loc_pop(&loc);
>      }
>
>      if (machine_class == NULL) {

The problem is probably that the last location has moved farther due to
the option parsing loop, by the time we realize this error. So the
location should be restored for error reporting.

Thanks
Laszlo

      parent reply	other threads:[~2016-02-08  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07 10:32 [Qemu-devel] command line error handling broken? Michael S. Tsirkin
2016-02-07 16:25 ` Marcel Apfelbaum
2016-02-08  8:48 ` Laszlo Ersek [this message]

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=56B85657.4070900@redhat.com \
    --to=lersek@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@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.