]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: format CCID controllers after USB hubs
authorJán Tomko <jtomko@redhat.com>
Tue, 15 Jan 2019 15:50:22 +0000 (16:50 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 25 Jan 2019 13:58:35 +0000 (14:58 +0100)
Since they go on the USB bus, format them after USB hubs.

https://bugzilla.redhat.com/show_bug.cgi?id=1375402

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/chardev-reconnect.args
tests/qemuxml2argvdata/controller-order.args
tests/qemuxml2argvdata/name-escape.args
tests/qemuxml2argvdata/smartcard-controller.args
tests/qemuxml2argvdata/smartcard-host-certificates-database.args
tests/qemuxml2argvdata/smartcard-host-certificates.args
tests/qemuxml2argvdata/smartcard-host.args
tests/qemuxml2argvdata/smartcard-passthrough-spicevmc.args
tests/qemuxml2argvdata/smartcard-passthrough-tcp.args
tests/qemuxml2argvdata/user-aliases.args

index 9c0a2566ae51fe06129dde7ea38cbbe86af5b92d..361a345fe5c31fefa6d751f17a9562128f0ff6ad 100644 (file)
@@ -3225,6 +3225,9 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
          * one. Likewise, we don't do anything for the primary IDE
          * controller on an i440fx machine or primary SATA on q35, but
          * we do add those beyond these two exceptions.
+         *
+         * CCID controllers are formatted separately after USB hubs,
+         * because they go on the USB bus.
          */
         VIR_DOMAIN_CONTROLLER_TYPE_PCI,
         VIR_DOMAIN_CONTROLLER_TYPE_USB,
@@ -3232,7 +3235,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
         VIR_DOMAIN_CONTROLLER_TYPE_IDE,
         VIR_DOMAIN_CONTROLLER_TYPE_SATA,
         VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
-        VIR_DOMAIN_CONTROLLER_TYPE_CCID,
     };
     int ret = -1;
 
@@ -10629,6 +10631,10 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
     if (qemuBuildHubCommandLine(cmd, def, qemuCaps) < 0)
         goto error;
 
+    if (qemuBuildControllersByTypeCommandLine(cmd, def, qemuCaps,
+                                              VIR_DOMAIN_CONTROLLER_TYPE_CCID) < 0)
+        goto error;
+
     if (qemuBuildDisksCommandLine(cmd, def, qemuCaps) < 0)
         goto error;
 
index e88e0832915ae7ed33f40626c2b987f98ae81cf0..baff469c7b180cf681510c6e8ba4b676f2c1ec2f 100644 (file)
@@ -22,8 +22,8 @@ server,nowait \
 -no-acpi \
 -device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \
 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -chardev socket,id=charsmartcard0,path=/tmp/channel/asdf,reconnect=20 \
 -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \
 -chardev socket,id=charchannel0,host=localhost,port=1234,reconnect=10 \
index 2477cd2e1c63c0cbc1d404030632ae99e0a6f378..6bb4942223e4c2e079cfe38d5f97c3e36ba28bf7 100644 (file)
@@ -21,8 +21,8 @@ nowait \
 -boot menu=off \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 \
--device usb-ccid,id=ccid0,bus=usb.0,port=1.1 \
 -device usb-hub,id=hub0,bus=usb.0,port=1 \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1.1 \
 -drive file=/tmp/fdr.img,format=raw,if=none,id=drive-virtio-disk0,cache=none,\
 aio=native \
 -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,\
index 58f284014c985bb194776187eb914418a16b50f3..d314ed409a1e9cccdd1436e489420480ddb37976 100644 (file)
@@ -22,8 +22,8 @@ bar=2/monitor.sock,server,nowait \
 -no-shutdown \
 -no-acpi \
 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\
 cache=none,throttling.bps-total=5000,throttling.iops-total=6000,\
 throttling.bps-total-max=10000,throttling.iops-total-max=11000,\
index 1a654cb4e186a754c73291234b601c6ccd09f619..4c5286dd8705c251805a5633f30abe1f124fe4eb 100644 (file)
@@ -20,7 +20,7 @@ server,nowait \
 -rtc base=utc \
 -no-shutdown \
 -no-acpi \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ccid0.0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 17fb50699aab2f60e133c5cd347dc3bfafb03b45..1056f52cfa00fa7643ce70a6f144d430ae2580f9 100644 (file)
@@ -20,8 +20,8 @@ server,nowait \
 -rtc base=utc \
 -no-shutdown \
 -no-acpi \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -device ccid-card-emulated,backend=certificates,cert1=cert1,cert2=cert2,\
 cert3=cert3,db=/tmp/foo,id=smartcard0,bus=ccid0.0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 489299a475a3c44eff0fc6f0346ef3d4d9783969..6bfb56b94b0f9517a5d877fdf88e11bd3ee5bb87 100644 (file)
@@ -20,8 +20,8 @@ server,nowait \
 -rtc base=utc \
 -no-shutdown \
 -no-acpi \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -device ccid-card-emulated,backend=certificates,cert1=cert1,cert2=cert2,\
 cert3=cert3,db=/etc/pki/nssdb,id=smartcard0,bus=ccid0.0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 1a654cb4e186a754c73291234b601c6ccd09f619..4c5286dd8705c251805a5633f30abe1f124fe4eb 100644 (file)
@@ -20,7 +20,7 @@ server,nowait \
 -rtc base=utc \
 -no-shutdown \
 -no-acpi \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ccid0.0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 8784a3ffaa7d439ee35e172af91e8929be553a1a..9fbc86bce79a046b0aa258b56171ca227e73f932 100644 (file)
@@ -20,8 +20,8 @@ server,nowait \
 -rtc base=utc \
 -no-shutdown \
 -no-acpi \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -chardev spicevmc,id=charsmartcard0,name=smartcard \
 -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index e55126c2068c68443e414908d2e6124803fa475d..12c03ad4b6da8e39cae4b82ff60de82c5a7af673 100644 (file)
@@ -20,8 +20,8 @@ server,nowait \
 -rtc base=utc \
 -no-shutdown \
 -no-acpi \
--device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -chardev socket,id=charsmartcard0,host=127.0.0.1,port=2001,server,nowait \
 -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 089a7d8d4b5f84c7c0e4ab747371701ee9de1abe..7fd3b4a6e191624d97708e709c15a4d5b74bf95b 100644 (file)
@@ -35,9 +35,9 @@ server,nowait \
 -global PIIX4_PM.disable_s3=0 \
 -global PIIX4_PM.disable_s4=0 \
 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x8 \
+-usb \
 -device usb-ccid,id=ua-myCCID,bus=ua-SomeWeirdController.0,port=1 \
 -device usb-ccid,id=ua-myCCID2,bus=ua-SomeWeirdController.0,port=2 \
--usb \
 -drive file=/var/lib/libvirt/images/fd.img,format=raw,if=none,\
 id=drive-ua-myDisk1,cache=none \
 -drive file=/var/lib/libvirt/images/gentoo.qcow2,format=qcow2,if=none,\