render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From ea26b477bbb8d6f93af2b12840ac6ff0b0deca17 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <ea26b477bbb8d6f93af2b12840ac6ff0b0deca17@dist-git>
3e5111
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
3e5111
Date: Fri, 9 Jun 2017 12:49:08 +0200
3e5111
Subject: [PATCH] qemuxml2argvtest: add virtio-options test case
3e5111
MIME-Version: 1.0
3e5111
Content-Type: text/plain; charset=UTF-8
3e5111
Content-Transfer-Encoding: 8bit
3e5111
3e5111
Add a test case to demonstrate the addition of new command line options
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1283251
3e5111
3e5111
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3e5111
(cherry picked from commit 56a28fbb57daa96fc7fe8f0516c8ee937ec3b39b)
3e5111
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3e5111
3e5111
Conflicts:
3e5111
  Downstream still normalizes machine names.
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 .../qemuxml2argv-virtio-options.args               | 41 ++++++++++++++++++++++
3e5111
 tests/qemuxml2argvtest.c                           |  9 +++++
3e5111
 2 files changed, 50 insertions(+)
3e5111
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args
3e5111
3e5111
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args
3e5111
new file mode 100644
3e5111
index 0000000000..f9f3c2cbad
3e5111
--- /dev/null
3e5111
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args
3e5111
@@ -0,0 +1,41 @@
3e5111
+LC_ALL=C \
3e5111
+PATH=/bin \
3e5111
+HOME=/home/test \
3e5111
+USER=test \
3e5111
+LOGNAME=test \
3e5111
+QEMU_AUDIO_DRV=none \
3e5111
+/usr/bin/qemu-system-x86_64 \
3e5111
+-name QEMUGuest1 \
3e5111
+-S \
3e5111
+-M pc-0.11 \
3e5111
+-m 214 \
3e5111
+-smp 1,sockets=1,cores=1,threads=1 \
3e5111
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
3e5111
+-nographic \
3e5111
+-nodefaults \
3e5111
+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
3e5111
+-no-acpi \
3e5111
+-boot c \
3e5111
+-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x8 \
3e5111
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x9 \
3e5111
+-usb \
3e5111
+-drive file=/var/lib/libvirt/images/img1,format=raw,if=none,\
3e5111
+id=drive-virtio-disk0 \
3e5111
+-device virtio-blk-pci,bus=pci.0,addr=0xa,drive=drive-virtio-disk0,\
3e5111
+id=virtio-disk0 \
3e5111
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
3e5111
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.0,addr=0x3 \
3e5111
+-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\
3e5111
+path=/export/fs2 \
3e5111
+-device virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,bus=pci.0,addr=0x4 \
3e5111
+-device virtio-net-pci,vlan=0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6 \
3e5111
+-net user,vlan=0,name=hostnet0 \
3e5111
+-device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe \
3e5111
+-device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10 \
3e5111
+-device virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11 \
3e5111
+-device virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,\
3e5111
+addr=0x12 \
3e5111
+-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \
3e5111
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \
3e5111
+-object rng-random,id=objrng0,filename=/dev/random \
3e5111
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0xd
3e5111
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
3e5111
index bff32200d7..c186780ef1 100644
3e5111
--- a/tests/qemuxml2argvtest.c
3e5111
+++ b/tests/qemuxml2argvtest.c
3e5111
@@ -2550,6 +2550,15 @@ mymain(void)
3e5111
             QEMU_CAPS_DEVICE_INTEL_IOMMU);
3e5111
 
3e5111
     DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
3e5111
+    DO_TEST("virtio-options", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_KEYBOARD,
3e5111
+            QEMU_CAPS_VIRTIO_MOUSE, QEMU_CAPS_VIRTIO_TABLET,
3e5111
+            QEMU_CAPS_VIRTIO_INPUT_HOST,
3e5111
+            QEMU_CAPS_FSDEV, QEMU_CAPS_FSDEV_WRITEOUT,
3e5111
+            QEMU_CAPS_DEVICE_VIRTIO_GPU,
3e5111
+            QEMU_CAPS_VIRTIO_GPU_VIRGL,
3e5111
+            QEMU_CAPS_DEVICE_VIRTIO_RNG,
3e5111
+            QEMU_CAPS_OBJECT_RNG_RANDOM,
3e5111
+            QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
3e5111
 
3e5111
     DO_TEST("fd-memory-numa-topology", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_FILE,
3e5111
             QEMU_CAPS_KVM);
3e5111
-- 
3e5111
2.13.1
3e5111