mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: Error out if iothread id is missing in iothreadpin
Defining a domain with the following config: <domain ...> ... <iothreads>1</iothreads> <cputune> <iothreadpin cpuset='1'/> will result in the following config formatted back: <domain type='kvm'> ... <iothreads>1</iothreads> <cputune> <iothreadpin iothread='0' cpuset='1'/> After restart the VM would vanish. Since our schema requires the @iothread field to be present in <iothreadpin> make it required by the code too.
This commit is contained in:
parent
0532ec3faa
commit
78d1b0f9b3
@ -13253,7 +13253,12 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node,
|
||||
|
||||
ctxt->node = node;
|
||||
|
||||
if ((tmp = virXPathString("string(./@iothread)", ctxt))) {
|
||||
if (!(tmp = virXPathString("string(./@iothread)", ctxt))) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("missing iothread id in iothreadpin"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virStrToLong_uip(tmp, NULL, 10, &iothreadid) < 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("invalid setting for iothread '%s'"), tmp);
|
||||
@ -13276,7 +13281,6 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node,
|
||||
}
|
||||
|
||||
def->id = iothreadid;
|
||||
}
|
||||
|
||||
if (!(tmp = virXMLPropString(node, "cpuset"))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user