Skip to contentSkip to conversation

command line error handling broken?

Qemu-devel Michael S. Tsirkin 3 participants 3 messages Feb 7, 2016 – Feb 8, 2016

lore
Share & tools
lore
#0 lore raw

./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?

Signature · 1 line
MST
#1 lore raw
Quoted 8 lines · Michael S. Tsirkin

./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?

Sent a patch to fix this: "vl.c: fixed regression of machine error message".

Thanks for reporting it,
Marcel

Quoted 1 line
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 9 lines · Michael S. Tsirkin

./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:

Quoted 7 lines
vl.c +0 -0
index c581e39..0830f98 100644
@@ -4031,7 +4031,12 @@ int main(int argc, char **argv, char **envp)
     opts = qemu_get_machine_opts();
     optarg = qemu_opt_get(opts, "type");

vl.c int main(int argc, char **argv, char **envp) · line 4042

Quoted 10 lines
vl.c +5 -0
     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