[PATCH 10/17] qemu: command: drop QEMU_CAPS_DEVICE for serial/parallel cli

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

 



-serial none and -parallel none are never required anymore, even
platforms that can't use -device abide -nodefaults.

Additionally we conditionalized the cli building on nparallels != 0,
but that was pointless.
---
 src/qemu/qemu_command.c | 50 ++++++++++++++++++++-----------------------------
 1 file changed, 20 insertions(+), 30 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 55c869e..e3c6a51 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10403,38 +10403,28 @@ qemuBuildCommandLine(virConnectPtr conn,
         actualSerials++;
     }
 
-    /* If we have -device, then we set -nodefault already */
-    if (!actualSerials && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
-            virCommandAddArgList(cmd, "-serial", "none", NULL);
-
-    if (!def->nparallels) {
-        /* If we have -device, then we set -nodefault already */
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
-            virCommandAddArgList(cmd, "-parallel", "none", NULL);
-    } else {
-        for (i = 0; i < def->nparallels; i++) {
-            virDomainChrDefPtr parallel = def->parallels[i];
-            char *devstr;
+    for (i = 0; i < def->nparallels; i++) {
+        virDomainChrDefPtr parallel = def->parallels[i];
+        char *devstr;
 
-            /* Use -chardev with -device if they are available */
-            if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
-                virCommandAddArg(cmd, "-chardev");
-                if (!(devstr = qemuBuildChrChardevStr(&parallel->source,
-                                                      parallel->info.alias,
-                                                      qemuCaps)))
-                    goto error;
-                virCommandAddArg(cmd, devstr);
-                VIR_FREE(devstr);
+        /* Use -chardev with -device if they are available */
+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
+            virCommandAddArg(cmd, "-chardev");
+            if (!(devstr = qemuBuildChrChardevStr(&parallel->source,
+                                                  parallel->info.alias,
+                                                  qemuCaps)))
+                goto error;
+            virCommandAddArg(cmd, devstr);
+            VIR_FREE(devstr);
 
-                if (qemuBuildChrDeviceCommandLine(cmd, def, parallel, qemuCaps) < 0)
-                    goto error;
-            } else {
-                virCommandAddArg(cmd, "-parallel");
-                if (!(devstr = qemuBuildChrArgStr(&parallel->source, NULL)))
-                    goto error;
-                virCommandAddArg(cmd, devstr);
-                VIR_FREE(devstr);
-            }
+            if (qemuBuildChrDeviceCommandLine(cmd, def, parallel, qemuCaps) < 0)
+                goto error;
+        } else {
+            virCommandAddArg(cmd, "-parallel");
+            if (!(devstr = qemuBuildChrArgStr(&parallel->source, NULL)))
+                goto error;
+            virCommandAddArg(cmd, devstr);
+            VIR_FREE(devstr);
         }
     }
 
-- 
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]