]> git.proxmox.com Git - qemu.git/commitdiff
Allow to leave type on default in -machine
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 25 Jul 2011 16:11:20 +0000 (18:11 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 29 Jul 2011 14:33:56 +0000 (09:33 -0500)
This allows to specify -machine options without setting an explicit
machine type. We will pick the default machine in this case. Requesting
the list of available machines is still possible via '-machine ?' e.g.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl.c

diff --git a/vl.c b/vl.c
index a3d8d77bf86fd021c91b4ce654af9fe033b158e2..73316cf17e149ef0eb28cbc87b939e034991b3e3 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2724,7 +2724,10 @@ int main(int argc, char **argv, char **envp)
                     fprintf(stderr, "parse error: %s\n", optarg);
                     exit(1);
                 }
-                machine = machine_parse(qemu_opt_get(opts, "type"));
+                optarg = qemu_opt_get(opts, "type");
+                if (optarg) {
+                    machine = machine_parse(optarg);
+                }
                 break;
             case QEMU_OPTION_usb:
                 usb_enabled = 1;