From 2645c6dcaf6ea2a51a3b6dfa407dd203004e4d11 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Mon, 25 Jul 2011 18:11:20 +0200 Subject: [PATCH] Allow to leave type on default in -machine 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 Signed-off-by: Anthony Liguori --- vl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index a3d8d77bf8..73316cf17e 100644 --- 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;