From 565524fb5fd537678447b37c1d8b0999df799fcb Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Thu, 25 Nov 2021 19:57:49 +0100 Subject: [PATCH] tests: Add tests for hyperv-passthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko --- .../hyperv-passthrough.x86_64-6.1.0.args | 32 +++++++++++++++++++ .../hyperv-passthrough.x86_64-latest.args | 32 +++++++++++++++++++ tests/qemuxml2argvdata/hyperv-passthrough.xml | 27 ++++++++++++++++ tests/qemuxml2argvtest.c | 2 ++ .../qemuxml2xmloutdata/hyperv-passthrough.xml | 31 ++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 6 files changed, 125 insertions(+) create mode 100644 tests/qemuxml2argvdata/hyperv-passthrough.x86_64-6.1.0.args create mode 100644 tests/qemuxml2argvdata/hyperv-passthrough.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/hyperv-passthrough.xml create mode 100644 tests/qemuxml2xmloutdata/hyperv-passthrough.xml diff --git a/tests/qemuxml2argvdata/hyperv-passthrough.x86_64-6.1.0.args b/tests/qemuxml2argvdata/hyperv-passthrough.x86_64-6.1.0.args new file mode 100644 index 0000000000..87755b5042 --- /dev/null +++ b/tests/qemuxml2argvdata/hyperv-passthrough.x86_64-6.1.0.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-i386 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc-i440fx-6.1,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-accel tcg \ +-cpu qemu64,hv-passthrough=on \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 6,sockets=6,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/hyperv-passthrough.x86_64-latest.args b/tests/qemuxml2argvdata/hyperv-passthrough.x86_64-latest.args new file mode 100644 index 0000000000..aab8c09d71 --- /dev/null +++ b/tests/qemuxml2argvdata/hyperv-passthrough.x86_64-latest.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-i386 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-accel tcg \ +-cpu qemu64,hv-passthrough=on \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 6,sockets=6,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/hyperv-passthrough.xml b/tests/qemuxml2argvdata/hyperv-passthrough.xml new file mode 100644 index 0000000000..9d6a872a41 --- /dev/null +++ b/tests/qemuxml2argvdata/hyperv-passthrough.xml @@ -0,0 +1,27 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 6 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0fe3fa9f76..0b88b580c5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1304,6 +1304,8 @@ mymain(void) DO_TEST_CAPS_LATEST("hyperv-off"); DO_TEST_CAPS_VER("hyperv-panic", "4.0.0"); DO_TEST_CAPS_LATEST("hyperv-panic"); + DO_TEST_CAPS_VER("hyperv-passthrough", "6.1.0"); + DO_TEST_CAPS_LATEST("hyperv-passthrough"); DO_TEST_CAPS_LATEST("hyperv-stimer-direct"); DO_TEST_NOCAPS("kvm-features"); diff --git a/tests/qemuxml2xmloutdata/hyperv-passthrough.xml b/tests/qemuxml2xmloutdata/hyperv-passthrough.xml new file mode 100644 index 0000000000..f833860997 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hyperv-passthrough.xml @@ -0,0 +1,31 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 6 + + hvm + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + +
+ + + + +