提交 23482e4b 编写于 作者: P Pavel Hrdina

conf: error out for multiple log elements while parsing chardev

Remove check whether a variable was already set because the element
is parsed only once now.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 21bfd1e9
......@@ -10925,6 +10925,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
char *append = NULL;
char *haveTLS = NULL;
char *tlsFromConfig = NULL;
bool logParsed = false;
int sourceParsed = 0;
for (; cur; cur = cur->next) {
......@@ -11029,10 +11030,15 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
ctxt->node = saved_node;
}
} else if (virXMLNodeNameEqual(cur, "log")) {
if (!logfile)
logfile = virXMLPropString(cur, "file");
if (!logappend)
logappend = virXMLPropString(cur, "append");
if (logParsed) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("only one protocol element is allowed for "
"character device"));
goto error;
}
logParsed = true;
logfile = virXMLPropString(cur, "file");
logappend = virXMLPropString(cur, "append");
} else if (virXMLNodeNameEqual(cur, "protocol")) {
if (!protocol)
protocol = virXMLPropString(cur, "type");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册