[RFC 11/12] Add a usb1 & usb2 qemuxml2argv test

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

 



---
 tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.args |   14 ++++
 tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.xml  |   74 ++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |    6 ++
 3 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.args b/tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.args
new file mode 100644
index 0000000..8e48783
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.args
@@ -0,0 +1,14 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
+-device piix3-usb-uhci,id=usb,bus=pci.0,multifunction=on,addr=0x1.0x3 \
+-device ich9-usb-ehci1,id=usb1,bus=pci.0,multifunction=on,addr=0x4.0x7 \
+-device ich9-usb-uhci1,id=usb2,masterbus=usb1.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4.0x0 \
+-device ich9-usb-uhci2,id=usb3,masterbus=usb1.0,firstport=2,bus=pci.0,multifunction=on,addr=0x4.0x1 \
+-device ich9-usb-uhci3,id=usb4,masterbus=usb1.0,firstport=4,bus=pci.0,multifunction=on,addr=0x4.0x2 \
+-device ich9-usb-ehci1,id=usb5,bus=pci.0,multifunction=on,addr=0x5.0x7 \
+-device ich9-usb-uhci1,id=usb6,masterbus=usb5.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5.0x0 \
+-device ich9-usb-uhci2,id=usb7,masterbus=usb5.0,firstport=2,bus=pci.0,multifunction=on,addr=0x5.0x1 \
+-device ich9-usb-uhci3,id=usb8,masterbus=usb5.0,firstport=4,bus=pci.0,multifunction=on,addr=0x5.0x2 \
+-device usb-hub,id=hub0,bus=usb1.0,port=1 -device usb-tablet,id=input0,bus=usb.0,port=2 \
+-device usb-host,hostbus=14,hostaddr=6,id=hostdev0,bus=usb5.0,port=1 \
+-device usb-host,hostbus=14,hostaddr=7,id=hostdev1,bus=usb5.0,port=2 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,multifunction=on,addr=0x3.0x0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.xml
new file mode 100644
index 0000000..e78260d
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.xml
@@ -0,0 +1,74 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219136</memory>
+  <currentMemory>219200</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <memballoon model='virtio'/>
+
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <address type='pci' domain='0' bus='0' slot='1' function='3'/>
+    </controller>
+
+    <controller type='usb' index='1' model='ich9-ehci1'>
+      <address type='pci' domain='0' bus='0' slot='4' function='7'/>
+    </controller>
+    <controller type='usb' index='2' model='ich9-uhci1'>
+      <master bus='1' startport='0'/>
+      <address type='pci' domain='0' bus='0' slot='4' function='0'/>
+    </controller>
+    <controller type='usb' index='3' model='ich9-uhci2'>
+      <master bus='1' startport='2'/>
+      <address type='pci' domain='0' bus='0' slot='4' function='1'/>
+    </controller>
+    <controller type='usb' index='4' model='ich9-uhci3'>
+      <master bus='1' startport='4'/>
+      <address type='pci' domain='0' bus='0' slot='4' function='2'/>
+    </controller>
+
+    <controller type='usb' index='5' model='ich9-ehci1'>
+      <address type='pci' domain='0' bus='0' slot='5' function='7'/>
+    </controller>
+    <controller type='usb' index='6' model='ich9-uhci1'>
+      <master bus='5' startport='0'/>
+      <address type='pci' domain='0' bus='0' slot='5' function='0'/>
+    </controller>
+    <controller type='usb' index='7' model='ich9-uhci2'>
+      <master bus='5' startport='2'/>
+      <address type='pci' domain='0' bus='0' slot='5' function='1'/>
+    </controller>
+    <controller type='usb' index='8' model='ich9-uhci3'>
+      <master bus='5' startport='4'/>
+      <address type='pci' domain='0' bus='0' slot='5' function='2'/>
+    </controller>
+
+    <input type='tablet' bus='usb'>
+      <address type='usb' bus='0' port='2'/>
+    </input>
+
+    <hub type='usb'>
+      <address type='usb' bus='1' port='1'/>
+    </hub>
+
+    <hostdev mode='subsystem' type='usb'>
+      <source>
+        <address bus='14' device='6'/>
+      </source>
+      <address type='usb' bus='5' port='1'/>
+    </hostdev>
+
+    <hostdev mode='subsystem' type='usb'>
+      <source>
+        <address bus='14' device='7'/>
+      </source>
+      <address type='usb' bus='5' port='2'/>
+    </hostdev>
+
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 1d08da3..923937b 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -506,6 +506,12 @@ mymain(void)
     DO_TEST("usb-ports", false,
             QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_USB_HUB,
             QEMU_CAPS_NODEFCONFIG);
+    DO_TEST("usb1-usb2", false,
+            QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_PIIX3_USB_UHCI,
+            QEMU_CAPS_USB_HUB, QEMU_CAPS_ICH9_USB_EHCI1,
+            QEMU_CAPS_ICH9_USB_UHCI1, QEMU_CAPS_ICH9_USB_UHCI2,
+            QEMU_CAPS_ICH9_USB_UHCI3);
 
     DO_TEST("smbios", false, QEMU_CAPS_SMBIOS_TYPE);
 
-- 
1.7.6

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