From: Pavel Hrdina Date: Tue, 23 Feb 2016 12:00:24 +0000 (+0100) Subject: domain_conf: always set primary video device as primary X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=119cd06ef729e3c6b093d9df441678f2a61258bc;p=libvirt.git domain_conf: always set primary video device as primary We always place primary video device at first place, to make it easier to create a qemu command or format an xml, but we should also set the primary boolean for primary video device to 'true'. Signed-off-by: Pavel Hrdina --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 049a7a775d..1f6bc75f30 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11938,7 +11938,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, if ((primary = virXMLPropString(cur, "primary")) != NULL) { if (STREQ(primary, "yes")) - def->primary = 1; + def->primary = true; VIR_FREE(primary); } @@ -16074,6 +16074,10 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } } + /* if not specified by user mark the first video as primary */ + if (n && !primaryVideo) + def->videos[0]->primary = true; + VIR_FREE(nodes); /* For backwards compatibility, if no