mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
conf: error out for multiple protocol elements while parsing chardev
Remove check whether a variable was already set because the element is parsed only once now. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
23482e4b1e
commit
209fa11b02
@ -10926,6 +10926,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
|
||||
char *haveTLS = NULL;
|
||||
char *tlsFromConfig = NULL;
|
||||
bool logParsed = false;
|
||||
bool protocolParsed = false;
|
||||
int sourceParsed = 0;
|
||||
|
||||
for (; cur; cur = cur->next) {
|
||||
@ -11040,8 +11041,14 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
|
||||
logfile = virXMLPropString(cur, "file");
|
||||
logappend = virXMLPropString(cur, "append");
|
||||
} else if (virXMLNodeNameEqual(cur, "protocol")) {
|
||||
if (!protocol)
|
||||
protocol = virXMLPropString(cur, "type");
|
||||
if (protocolParsed) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("only one log element is allowed for "
|
||||
"character device"));
|
||||
goto error;
|
||||
}
|
||||
protocolParsed = true;
|
||||
protocol = virXMLPropString(cur, "type");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user