File ca5c5b99-qemu-remove-old-parallel.patch of Package libvirt.8586

commit ca5c5b997b348e650a086965c5e975c7101ee40e
Author: Cole Robinson <crobinso@redhat.com>
Date:   Mon Jun 26 10:26:28 2017 -0400

    qemu: command: Remove old style -parallel building
    
    AFAIK there aren't any qemu arch/machine types with platform parallel
    devices that would require old style -parallel config, so we shouldn't
    ever need this nowadays.
    
    Remove a now redundant test
    
    Reviewed-by: Andrea Bolognani <abologna@redhat.com>
    Signed-off-by: Cole Robinson <crobinso@redhat.com>

Index: libvirt-3.3.0/src/qemu/qemu_command.c
===================================================================
--- libvirt-3.3.0.orig/src/qemu/qemu_command.c
+++ libvirt-3.3.0/src/qemu/qemu_command.c
@@ -9156,27 +9156,18 @@ qemuBuildParallelsCommandLine(virLogMana
         virDomainChrDefPtr parallel = def->parallels[i];
         char *devstr;
 
-        /* Use -chardev with -device if they are available */
-        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
-            if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def,
-                                                  parallel->source,
-                                                  parallel->info.alias,
-                                                  qemuCaps, true)))
-                return -1;
-            virCommandAddArg(cmd, "-chardev");
-            virCommandAddArg(cmd, devstr);
-            VIR_FREE(devstr);
+        if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def,
+                                              parallel->source,
+                                              parallel->info.alias,
+                                              qemuCaps, true)))
+            return -1;
+        virCommandAddArg(cmd, "-chardev");
+        virCommandAddArg(cmd, devstr);
+        VIR_FREE(devstr);
 
-            if (qemuBuildChrDeviceCommandLine(cmd, def, parallel,
-                                              qemuCaps) < 0)
-                return -1;
-        } else {
-            virCommandAddArg(cmd, "-parallel");
-            if (!(devstr = qemuBuildChrArgStr(parallel->source, NULL)))
-                return -1;
-            virCommandAddArg(cmd, devstr);
-            VIR_FREE(devstr);
-        }
+        if (qemuBuildChrDeviceCommandLine(cmd, def, parallel,
+                                          qemuCaps) < 0)
+            return -1;
     }
 
     return 0;
Index: libvirt-3.3.0/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
===================================================================
--- libvirt-3.3.0.orig/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
+++ /dev/null
@@ -1,22 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--M pc \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--nographic \
--nodefaults \
--monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--parallel tcp:127.0.0.1:9999,server,nowait
Index: libvirt-3.3.0/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
===================================================================
--- libvirt-3.3.0.orig/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='i686' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-i686</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <parallel type='tcp'>
-      <source mode='bind' host='127.0.0.1' service='9999'/>
-      <protocol type='raw'/>
-      <target port='0'/>
-    </parallel>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
Index: libvirt-3.3.0/tests/qemuxml2argvtest.c
===================================================================
--- libvirt-3.3.0.orig/tests/qemuxml2argvtest.c
+++ libvirt-3.3.0/tests/qemuxml2argvtest.c
@@ -1180,7 +1180,6 @@ mymain(void)
             QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEPORT);
     DO_TEST("serial-spiceport-nospice", NONE);
 
-    DO_TEST("parallel-tcp", NONE);
     DO_TEST("console-compat", NONE);
     DO_TEST("console-compat-auto", NONE);
 
Index: libvirt-3.3.0/tests/qemuxml2xmltest.c
===================================================================
--- libvirt-3.3.0.orig/tests/qemuxml2xmltest.c
+++ libvirt-3.3.0/tests/qemuxml2xmltest.c
@@ -543,7 +543,6 @@ mymain(void)
     DO_TEST("serial-many", NONE);
     DO_TEST("serial-spiceport", NONE);
     DO_TEST("serial-spiceport-nospice", NONE);
-    DO_TEST("parallel-tcp", NONE);
     DO_TEST("console-compat", NONE);
     DO_TEST("console-compat2", NONE);
     DO_TEST("console-virtio-many", NONE);
openSUSE Build Service is sponsored by