]> git.proxmox.com Git - qemu.git/blobdiff - qemu-option.c
qemu-option: Move the implied first name into QemuOptsList
[qemu.git] / qemu-option.c
index 24bb19b76aeaa0496e7e5a062cafb64c6051d2de..dc340b8dc7db89a1674311218f8d6c614e98e651 100644 (file)
@@ -753,12 +753,17 @@ int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname
     return 0;
 }
 
-QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, const char *firstname)
+QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params,
+                          int permit_abbrev)
 {
+    const char *firstname;
     char value[1024], *id = NULL;
     const char *p;
     QemuOpts *opts;
 
+    assert(!permit_abbrev || list->implied_opt_name);
+    firstname = permit_abbrev ? list->implied_opt_name : NULL;
+
     if (strncmp(params, "id=", 3) == 0) {
         get_opt_value(value, sizeof(value), params+3);
         id = qemu_strdup(value);