qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] command line error handling broken?


From: Laszlo Ersek
Subject: Re: [Qemu-devel] command line error handling broken?
Date: Mon, 8 Feb 2016 09:48:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]