提交 35e3c4a6 编写于 作者: J Ján Tomko

conf: delete useless primaryVideo variable

If we encounter a video device with primary=yes, we insert it
at def->videos[0].

There is no need to record this in a separate variable,
just check if there already is a primary video at def->videos[0].
上级 b2b8fc91
...@@ -15088,7 +15088,6 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -15088,7 +15088,6 @@ virDomainDefParseXML(xmlDocPtr xml,
bool usb_none = false; bool usb_none = false;
bool usb_other = false; bool usb_other = false;
bool usb_master = false; bool usb_master = false;
bool primaryVideo = false;
char *netprefix = NULL; char *netprefix = NULL;
if (flags & VIR_DOMAIN_DEF_PARSE_VALIDATE) { if (flags & VIR_DOMAIN_DEF_PARSE_VALIDATE) {
...@@ -16427,7 +16426,7 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -16427,7 +16426,7 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error; goto error;
if (video->primary) { if (video->primary) {
if (primaryVideo) { if (def->nvideos != 0 && def->videos[0]->primary) {
virDomainVideoDefFree(video); virDomainVideoDefFree(video);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only one primary video device is supported")); _("Only one primary video device is supported"));
...@@ -16435,7 +16434,6 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -16435,7 +16434,6 @@ virDomainDefParseXML(xmlDocPtr xml,
} }
insertAt = 0; insertAt = 0;
primaryVideo = true;
} }
if (VIR_INSERT_ELEMENT_INPLACE(def->videos, if (VIR_INSERT_ELEMENT_INPLACE(def->videos,
insertAt, insertAt,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册