Re: [PATCH v2 1/4] domain_conf: always set primary video device as primary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 23, 2016 at 05:58:08PM +0100, Pavel Hrdina wrote:
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 <phrdina@xxxxxxxxxx>
---

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3b15cb4..5e9c096 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11918,7 +11918,7 @@ virDomainVideoDefParseXML(xmlNodePtr node,

                if ((primary = virXMLPropString(cur, "primary")) != NULL) {
                    if (STREQ(primary, "yes"))
-                        def->primary = 1;
+                        def->primary = true;
                    VIR_FREE(primary);
                }


So we already had this property, support it and behave based on it, we
just don't document it or use it very much, nice.  If I could, I would
put it somewhere else than in the <model/>, but that's gone...

@@ -16060,6 +16060,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;
+

We basically used the first video as primary and we reorder them in
order for this to be true.  So this is true even if primaryVideo ==
true.  Anyway, I still see it as a good way to save that info as well.

ACK,

Martin

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]