]> git.proxmox.com Git - qemu.git/blobdiff - vl.c
vl.c: Fail gracefully if no machine is found
[qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index f169aac1f9256350b297fe561ed7783c90dd424b..16fa222f1a56f675cf28bef93406bf56162b8302 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3089,6 +3089,11 @@ int main(int argc, char **argv, char **envp)
         data_dir = CONFIG_QEMU_DATADIR;
     }
 
+    if (machine == NULL) {
+        fprintf(stderr, "No machine found.\n");
+        exit(1);
+    }
+
     /*
      * Default to max_cpus = smp_cpus, in case the user doesn't
      * specify a max_cpus value.