conf: useserial: drop useless check for serial devices

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.
This commit is contained in:
Ján Tomko 2017-08-18 17:05:35 +02:00
parent 0f1993aa15
commit bad14fbbed

View File

@ -16135,7 +16135,7 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
int n; int n;
char *tmp = NULL; char *tmp = NULL;
int ret = -1; int ret = -1;
unsigned long deviceBoot, serialPorts; unsigned long deviceBoot;
if (virXPathULong("count(./devices/disk[boot]" if (virXPathULong("count(./devices/disk[boot]"
"|./devices/interface[boot]" "|./devices/interface[boot]"
@ -16212,18 +16212,10 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
if ((node = virXPathNode("./os/bios[1]", ctxt))) { if ((node = virXPathNode("./os/bios[1]", ctxt))) {
tmp = virXMLPropString(node, "useserial"); tmp = virXMLPropString(node, "useserial");
if (tmp) { if (tmp) {
if (STREQ(tmp, "yes")) { 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;
}
def->os.bios.useserial = VIR_TRISTATE_BOOL_YES; def->os.bios.useserial = VIR_TRISTATE_BOOL_YES;
} else { else
def->os.bios.useserial = VIR_TRISTATE_BOOL_NO; def->os.bios.useserial = VIR_TRISTATE_BOOL_NO;
}
VIR_FREE(tmp); VIR_FREE(tmp);
} }