summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2008-08-08 14:27:05 +0000
committerDaniel Veillard <veillard@redhat.com>2008-08-08 14:27:05 +0000
commitd1710d35ea9d2074b95c2a7de06fd67de955c5ec (patch)
treeb56e37f1f8a72d3bbf5947c84bc9a7f470aa5207 /tests
parentfix typos in docs (diff)
downloadlibvirt-d1710d35ea9d2074b95c2a7de06fd67de955c5ec.tar.gz
libvirt-d1710d35ea9d2074b95c2a7de06fd67de955c5ec.tar.bz2
libvirt-d1710d35ea9d2074b95c2a7de06fd67de955c5ec.zip
Extend parser and add support for USB devices in QEmu/KVM
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c src/qemu_driver.c: Patch from Guido Günther allowing to pass usb devices to qemu/kvm * docs/libvirt.rng: add the new functionality to the grammar * tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c: adding examples to the regression tests * libvirt.spec.in: fix the licence tag Daniel
Diffstat (limited to 'tests')
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args1
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml27
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args1
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml28
-rw-r--r--tests/qemuxml2argvtest.c3
-rw-r--r--tests/qemuxml2xmltest.c3
6 files changed, 63 insertions, 0 deletions
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
new file mode 100644
index 000000000..0b89999ec
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
@@ -0,0 +1 @@
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:014.006 \ No newline at end of file
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
new file mode 100644
index 000000000..0c044e178
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>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</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ <hostdev mode='subsystem' type='usb'>
+ <source>
+ <address bus='14' device='6'/>
+ </source>
+ </hostdev>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
new file mode 100644
index 000000000..b993ae56f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
@@ -0,0 +1 @@
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:0204:6025 \ No newline at end of file
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
new file mode 100644
index 000000000..aecad4ca2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>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</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ <hostdev mode='subsystem' type='usb'>
+ <source>
+ <vendor id='0x0204'/>
+ <product id='0x6025'/>
+ </source>
+ </hostdev>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d136a1346..458201b9c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -179,6 +179,9 @@ mymain(int argc, char **argv)
DO_TEST("console-compat", 0);
DO_TEST("sound", 0);
+ DO_TEST("hostdev-usb-product", 0);
+ DO_TEST("hostdev-usb-address", 0);
+
virCapabilitiesFree(driver.caps);
return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 9e380e426..536c9bd87 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -118,6 +118,9 @@ mymain(int argc, char **argv)
DO_TEST("parallel-tcp");
DO_TEST("console-compat");
+ DO_TEST("hostdev-usb-product");
+ DO_TEST("hostdev-usb-address");
+
virCapabilitiesFree(driver.caps);
return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);