diff mbox

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

Message ID 2cd4c68e4ee5d25d6a405b1e09af57953eb55ee2.1453489952.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson Jan. 22, 2016, 7:30 p.m. UTC
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(-)

-- 
2.5.0

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

Patch

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 */