aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2009-12-14 19:15:05 +0000
committerDaniel P. Berrange <berrange@redhat.com>2010-01-18 13:55:56 +0000
commit73370e9868346d170e67ee908d5fa8fa9e0c9f99 (patch)
tree1a72ac60b0aec131d0b147864d8f6cccbdee4a7f /tests
parentConvert NICs over to use -device & -netdev where possible (diff)
downloadlibvirt-73370e9868346d170e67ee908d5fa8fa9e0c9f99.tar.gz
libvirt-73370e9868346d170e67ee908d5fa8fa9e0c9f99.tar.bz2
libvirt-73370e9868346d170e67ee908d5fa8fa9e0c9f99.zip
Convert USB disks over to -device
The previous syntax was severely limited in its options -usbdevice disk:/home/berrange/output.img The new syntax is the same as for other disk types -drive file=/home/berrange/output.img,if=none,id=usb-1,index=1 -device usb-storage,drive=usb-1 Again, the index= arg is wrong here, and will be removed in a later merge
Diffstat (limited to 'tests')
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args1
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.xml26
-rw-r--r--tests/qemuxml2argvtest.c1
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args
new file mode 100644
index 000000000..d12d61c5c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args
@@ -0,0 +1 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/tmp/usbdisk.img,if=none,id=drive-usb-disk0 -device usb-storage,drive=drive-usb-disk0,id=usb-disk0 -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.xml
new file mode 100644
index 000000000..d59e1c0a2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.xml
@@ -0,0 +1,26 @@
+<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>
+ <disk type='file' device='disk'>
+ <source file='/tmp/usbdisk.img'/>
+ <target dev='sda' bus='usb'/>
+ </disk>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 645f6b4de..8c88a7921 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -235,6 +235,7 @@ mymain(int argc, char **argv)
DO_TEST("disk-drive-cache-v2-none", QEMUD_CMD_FLAG_DRIVE |
QEMUD_CMD_FLAG_DRIVE_CACHE_V2 | QEMUD_CMD_FLAG_DRIVE_FORMAT);
DO_TEST("disk-usb", 0);
+ DO_TEST("disk-usb-device", QEMUD_CMD_FLAG_DRIVE | QEMUD_CMD_FLAG_DEVICE);
DO_TEST("graphics-vnc", 0);
driver.vncSASL = 1;