From d192bd4d5b58be8151c42ac9f3a822d894dcfb78 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 6 Sep 2019 19:45:33 +0200 Subject: [PATCH] cfg2cmd tests: improve hostpci test by marking some as PCIe and add a linux based one, which acts a bit different Signed-off-by: Thomas Lamprecht --- test/cfg2cmd/q35-linux-hostpci.conf | 20 +++++++++++++++ test/cfg2cmd/q35-linux-hostpci.conf.cmd | 34 +++++++++++++++++++++++++ test/cfg2cmd/q35-win10-hostpci.conf | 2 ++ test/cfg2cmd/q35-win10-hostpci.conf.cmd | 3 +++ 4 files changed, 59 insertions(+) create mode 100644 test/cfg2cmd/q35-linux-hostpci.conf create mode 100644 test/cfg2cmd/q35-linux-hostpci.conf.cmd diff --git a/test/cfg2cmd/q35-linux-hostpci.conf b/test/cfg2cmd/q35-linux-hostpci.conf new file mode 100644 index 00000000..ff6c1c6c --- /dev/null +++ b/test/cfg2cmd/q35-linux-hostpci.conf @@ -0,0 +1,20 @@ +# TEST: Config with q35, NUMA, hostpci passthrough, EFI & Windows +bios: ovmf +bootdisk: scsi0 +cores: 1 +efidisk0: local:100/vm-100-disk-1.qcow2,size=128K +hostpci0: 00:12 +hostpci1: 00:13,pcie=1 +hostpci2: 00:14 +hostpci3: 00:15,pcie=1 +hostpci4: 00:17,pcie=1,rombar=0 +hostpci7: 00:15,pcie=1 +machine: q35 +memory: 512 +net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 +numa: 1 +ostype: l26 +scsihw: virtio-scsi-pci +smbios1: uuid=3dd750ce-d910-44d0-9493-525c0be4e687 +sockets: 2 +vmgenid: 54d1c06c-8f5b-440f-b5b2-6eab1380e13d diff --git a/test/cfg2cmd/q35-linux-hostpci.conf.cmd b/test/cfg2cmd/q35-linux-hostpci.conf.cmd new file mode 100644 index 00000000..42988da4 --- /dev/null +++ b/test/cfg2cmd/q35-linux-hostpci.conf.cmd @@ -0,0 +1,34 @@ +/usr/bin/kvm \ + -id 8006 \ + -name vm8006 \ + -chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server,nowait' \ + -mon 'chardev=qmp,mode=control' \ + -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' \ + -mon 'chardev=qmp-event,mode=control' \ + -pidfile /var/run/qemu-server/8006.pid \ + -daemonize \ + -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ + -drive 'if=pflash,unit=0,format=raw,readonly,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \ + -drive 'if=pflash,unit=1,format=qcow2,id=drive-efidisk0,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \ + -smp '2,sockets=2,cores=1,maxcpus=2' \ + -nodefaults \ + -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \ + -vnc unix:/var/run/qemu-server/8006.vnc,password \ + -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce \ + -m 512 \ + -object 'memory-backend-ram,id=ram-node0,size=256M' \ + -numa 'node,nodeid=0,cpus=0,memdev=ram-node0' \ + -object 'memory-backend-ram,id=ram-node1,size=256M' \ + -numa 'node,nodeid=1,cpus=1,memdev=ram-node1' \ + -device 'vmgenid,guid=54d1c06c-8f5b-440f-b5b2-6eab1380e13d' \ + -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \ + -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \ + -device 'vfio-pci,host=00:12.0,id=hostpci0,bus=pci.0,addr=0x10' \ + -device 'pcie-root-port,id=ich9-pcie-port-5,addr=10.0,x-speed=16,x-width=32,multifunction=on,bus=pcie.0,port=5,chassis=5' \ + -device 'pcie-root-port,id=ich9-pcie-port-8,addr=10.3,x-speed=16,x-width=32,multifunction=on,bus=pcie.0,port=8,chassis=8' \ + -device 'VGA,id=vga,bus=pcie.0,addr=0x1' \ + -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \ + -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \ + -netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \ + -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \ + -machine 'type=q35' diff --git a/test/cfg2cmd/q35-win10-hostpci.conf b/test/cfg2cmd/q35-win10-hostpci.conf index 9db3f0cb..4cb55851 100644 --- a/test/cfg2cmd/q35-win10-hostpci.conf +++ b/test/cfg2cmd/q35-win10-hostpci.conf @@ -4,6 +4,8 @@ bootdisk: scsi0 cores: 1 efidisk0: local:100/vm-100-disk-1.qcow2,size=128K hostpci0: 00:12 +hostpci1: 00:12,pcie=1 +hostpci4: 00:12,pcie=1 machine: q35 memory: 512 net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 diff --git a/test/cfg2cmd/q35-win10-hostpci.conf.cmd b/test/cfg2cmd/q35-win10-hostpci.conf.cmd index 1d5e7c42..b4a1e076 100644 --- a/test/cfg2cmd/q35-win10-hostpci.conf.cmd +++ b/test/cfg2cmd/q35-win10-hostpci.conf.cmd @@ -25,6 +25,9 @@ -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \ -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \ -device 'vfio-pci,host=00:12.0,id=hostpci0,bus=pci.0,addr=0x10' \ + -device 'vfio-pci,host=00:12.0,id=hostpci1,bus=ich9-pcie-port-2,addr=0x0' \ + -device 'pcie-root-port,id=ich9-pcie-port-5,addr=10.0,x-speed=16,x-width=32,multifunction=on,bus=pcie.0,port=5,chassis=5' \ + -device 'vfio-pci,host=00:12.0,id=hostpci4,bus=ich9-pcie-port-5,addr=0x0' \ -device 'VGA,id=vga,bus=pcie.0,addr=0x1' \ -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \ -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \