From 119cd06ef729e3c6b093d9df441678f2a61258bc Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Tue, 23 Feb 2016 13:00:24 +0100 Subject: [PATCH] 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 --- src/conf/domain_conf.c | 6 +++++- src/qemu/qemu_command.c | 17 ++++++++++------- ...uhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2xmlout-graphics-listen-network.xml | 2 +- .../qemuxml2xmlout-graphics-listen-network2.xml | 2 +- .../qemuxml2xmlout-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2xmlout-graphics-sdl.xml | 2 +- ...emuxml2xmlout-graphics-spice-compression.xml | 2 +- .../qemuxml2xmlout-graphics-spice-qxl-vga.xml | 2 +- .../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +- .../qemuxml2xmlout-graphics-spice.xml | 2 +- .../qemuxml2xmlout-graphics-vnc-sasl.xml | 2 +- .../qemuxml2xmlout-graphics-vnc-tls.xml | 2 +- .../qemuxml2xmlout-graphics-vnc-websocket.xml | 2 +- .../qemuxml2xmlout-graphics-vnc.xml | 2 +- .../qemuxml2xmlout-interface-server.xml | 2 +- .../qemuxml2xmlout-net-bandwidth.xml | 2 +- .../qemuxml2xmlout-net-bandwidth2.xml | 2 +- .../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +- .../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +- .../qemuxml2xmlout-pci-bridge.xml | 2 +- .../qemuxml2xmlout-pcie-root-port.xml | 2 +- ...muxml2xmlout-pcie-switch-downstream-port.xml | 2 +- ...qemuxml2xmlout-pcie-switch-upstream-port.xml | 2 +- .../qemuxml2xmlout-pcihole64-q35.xml | 2 +- .../qemuxml2xmlout-q35-usb2-multi.xml | 2 +- .../qemuxml2xmlout-q35-usb2-reorder.xml | 2 +- .../qemuxml2xmlout-q35-usb2.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- ...xml2xmlout-seclabel-dynamic-none-relabel.xml | 2 +- .../qemuxml2xmlout-serial-spiceport.xml | 2 +- .../qemuxml2xmlout-video-virtio-gpu-device.xml | 2 +- ...qemuxml2xmlout-video-virtio-gpu-spice-gl.xml | 2 +- .../qemuxml2xmlout-video-virtio-gpu-virgl.xml | 2 +- 35 files changed, 48 insertions(+), 41 deletions(-) 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