diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 049a7a775d3955e953640db3c9dc9e6bead93248..1f6bc75f30e84c1aab60fb404bc9f3157bd05029 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