[PATCH 12/17] qemu: command: drop QEMU_CAPS_DEVICE for video cli

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

 



The whole block was also conditionalized on nvideos >= 1, which the
loop will handle fine after the QEMU_CAPS_DEVICE check is dropped.
---
 src/qemu/qemu_command.c | 35 +++++++++++++----------------------
 1 file changed, 13 insertions(+), 22 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 516f351..d48f173 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10706,33 +10706,24 @@ qemuBuildCommandLine(virConnectPtr conn,
                                        dev, vram / 1024);
             }
 
-            if (def->nvideos > 1) {
-                if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
-                    for (i = 1; i < def->nvideos; i++) {
-                        char *str;
-                        if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
-                            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                                           _("video type %s is only valid as primary video card"),
-                                           virDomainVideoTypeToString(def->videos[0]->type));
-                            goto error;
-                        }
-
-                        virCommandAddArg(cmd, "-device");
-
-                        if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], qemuCaps, false)))
-                            goto error;
-
-                        virCommandAddArg(cmd, str);
-                        VIR_FREE(str);
-                    }
-                } else {
+            for (i = 1; i < def->nvideos; i++) {
+                char *str;
+                if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
                     virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                                   "%s", _("only one video card is currently supported"));
+                                   _("video type %s is only valid as primary video card"),
+                                   virDomainVideoTypeToString(def->videos[0]->type));
                     goto error;
                 }
+
+                virCommandAddArg(cmd, "-device");
+
+                if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], qemuCaps, false)))
+                    goto error;
+
+                virCommandAddArg(cmd, str);
+                VIR_FREE(str);
             }
         }
-
     }
 
     /* Add sound hardware */
-- 
2.5.0

--
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]