]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: ignore -nodefconfig and -nodefaults when parsing commandline
authorLaine Stump <laine@laine.org>
Fri, 6 Jun 2014 13:03:58 +0000 (16:03 +0300)
committerLaine Stump <laine@laine.org>
Mon, 9 Jun 2014 10:53:06 +0000 (13:53 +0300)
The qemu driver always adds these options to the qemu commandlines,
but the commandline parser didn't recognize them, so sending a
libvirt-generated qemu commandline to its own argvtoxml would always
result in a warning message and a qemu namespace added to the
xml. Since the options don't add any functionality to the domain, they
should just be ignored (similar to -S).

Note that we can't yet add a test for this to qemuargv2xmltest,
because we would have to add QEMU_CAPS_NODEFCONFIG and
QEMU_CAPS_DEVICE to the capabilities for any corresponding
xml2argvtest, and QEMU_CAPS_DEVICE would necessitate having support
for parsing a memballoon device in order for qemuargv2xmltest to
pass. So we wait to add a test for -nodefconfig and -nodefaults until
after adding support for parsing -device virtio-balloon-*.

src/qemu/qemu_command.c

index 3cf279e41ed7b2b3148f78da29dbe390bf5ec0b1..2caee6665e8bd6dfcde0e66b8de1ba8851467c99 100644 (file)
@@ -11515,7 +11515,9 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
                                _("cannot parse nvram's address '%s'"), val);
                 goto error;
             }
-        } else if (STREQ(arg, "-S")) {
+        } else if (STREQ(arg, "-S") ||
+                   STREQ(arg, "-nodefaults") ||
+                   STREQ(arg, "-nodefconfig")) {
             /* ignore, always added by libvirt */
         } else {
             char *tmp = NULL;