aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2010-01-29 18:07:04 +0000
committerDaniel P. Berrange <berrange@redhat.com>2010-02-02 16:31:47 +0000
commit49a0f6cd999232491138423e50707c9aff7f0db0 (patch)
tree6620ada617c3d11eceac46532e52ad7b77a6f1b9 /tests
parentAssign PCI addresses before hotplugging devices (diff)
downloadlibvirt-49a0f6cd999232491138423e50707c9aff7f0db0.tar.gz
libvirt-49a0f6cd999232491138423e50707c9aff7f0db0.tar.bz2
libvirt-49a0f6cd999232491138423e50707c9aff7f0db0.zip
Remove use of -netdev arg with QEMU
The QEMU 0.12.x tree has the -netdev command line argument, but not corresponding monitor command. We can't enable the former, without the latter since it will break hotplug/unplug. * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Disable -netdev usage until 0.13 at earliest * tests/qemuxml2argvtest.c: Add test for -netdev syntax * tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args, tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml: Test data files for -netdev syntax
Diffstat (limited to 'tests')
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args2
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args1
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml26
-rw-r--r--tests/qemuxml2argvtest.c1
4 files changed, 29 insertions, 1 deletions
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args
index 698ad3aa2..32d28435f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args
@@ -1 +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 -hda /dev/HostVG/QEMUGuest1 -netdev user,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=virtio-nic0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x4 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
+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 -hda /dev/HostVG/QEMUGuest1 -device virtio-net-pci,vlan=0,id=virtio-nic0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x4 -net user,vlan=0,name=netdev0 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args
new file mode 100644
index 000000000..698ad3aa2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.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 -hda /dev/HostVG/QEMUGuest1 -netdev user,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=virtio-nic0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x4 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml
new file mode 100644
index 000000000..5d34bd492
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.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>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 90c1cb06b..67dc47e27 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -280,6 +280,7 @@ mymain(int argc, char **argv)
DO_TEST("net-user", 0);
DO_TEST("net-virtio", 0);
DO_TEST("net-virtio-device", QEMUD_CMD_FLAG_DEVICE);
+ DO_TEST("net-virtio-netdev", QEMUD_CMD_FLAG_DEVICE | QEMUD_CMD_FLAG_NETDEV);
DO_TEST("net-eth", 0);
DO_TEST("net-eth-ifname", 0);
DO_TEST("net-eth-names", QEMUD_CMD_FLAG_NET_NAME);