]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: useserial: drop useless check for serial devices
authorJán Tomko <jtomko@redhat.com>
Fri, 18 Aug 2017 15:05:35 +0000 (17:05 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 22 Aug 2017 07:44:28 +0000 (09:44 +0200)
Since its introduction in commit 874e65aa, if someone requests:
<os><bios useserial="yes"/><os/>
we report an error if we cannot successfully count the number
of serial devices via an XPath query.

Instead of fixing the check (and moving it to the validation phase,
to prevent existing domains from disappearing), drop it completely.
For QEMU, the number of serials is checked when building the command
line.

src/conf/domain_conf.c

index 00d977cd95bcd4f655d405a39282a16c4a1d61de..6f0f038b773ef711531cc255b0424628664c08e7 100644 (file)
@@ -16135,7 +16135,7 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
     int n;
     char *tmp = NULL;
     int ret = -1;
-    unsigned long deviceBoot, serialPorts;
+    unsigned long deviceBoot;
 
     if (virXPathULong("count(./devices/disk[boot]"
                       "|./devices/interface[boot]"
@@ -16212,18 +16212,10 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
     if ((node = virXPathNode("./os/bios[1]", ctxt))) {
         tmp = virXMLPropString(node, "useserial");
         if (tmp) {
-            if (STREQ(tmp, "yes")) {
-                if (virXPathULong("count(./devices/serial)",
-                                  ctxt, &serialPorts) < 0) {
-                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                                   _("need at least one serial port "
-                                     "for useserial"));
-                    goto cleanup;
-                }
+            if (STREQ(tmp, "yes"))
                 def->os.bios.useserial = VIR_TRISTATE_BOOL_YES;
-            } else {
+            else
                 def->os.bios.useserial = VIR_TRISTATE_BOOL_NO;
-            }
             VIR_FREE(tmp);
         }