5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-07 17:17:57 +03:00

tests: add tests for various combinations of configs for usb

q35 + usb passthrough
q35 + usb3 passthrough
q35 + usb3 passthrough with new xhci controller
old machine type + new usb config error
old machine type + q35 + new usb config error
old ostype (w2k) + new usb config error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2022-11-11 07:59:55 +01:00 committed by Thomas Lamprecht
parent f6b24f427d
commit b1099442b6
9 changed files with 170 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# TEST: Test error for old ostype type with newer usb config
# QEMU_VERSION: 7.1.0
# EXPECT_ERROR: using usb13 is only possible with machine type >= 7.1 and ostype l26 or windows > 7
cores: 2
memory: 768
name: q35-usb3-error
net0: virtio=A2:C0:43:77:08:A1,bridge=vmbr0
ostype: w2k
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
vga: qxl
usb13: spice

View File

@ -0,0 +1,14 @@
# TEST: Test usb error for q35 and older machine type
# QEMU_VERSION: 4.0.0
# EXPECT_ERROR: using usb13 is only possible with machine type >= 7.1 and ostype l26 or windows > 7
cores: 2
memory: 768
name: q35-usb3-error
net0: virtio=A2:C0:43:77:08:A1,bridge=vmbr0
ostype: l26
machine: q35
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
vga: qxl
usb13: spice

View File

@ -0,0 +1,13 @@
# TEST: Test Q35 USB2 passthrough combination
# QEMU_VERSION: 4.0.0
cores: 2
memory: 768
name: q35-usb2
net0: virtio=A2:C0:43:77:08:A1,bridge=vmbr0
ostype: l26
machine: q35
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
vga: qxl
usb1: spice

View File

@ -0,0 +1,31 @@
/usr/bin/kvm \
-id 8006 \
-name 'q35-usb2,debug-threads=on' \
-no-shutdown \
-chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \
-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=7b10d7af-b932-4c66-b2c3-3996152ec465' \
-smp '2,sockets=1,cores=2,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=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
-device 'vmgenid,guid=c773c261-d800-4348-9f5d-167fadd53cf8' \
-chardev 'spicevmc,id=usbredirchardev1,name=usbredir' \
-device 'usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=ehci.0' \
-device 'qxl-vga,id=vga,bus=pcie.0,addr=0x1' \
-device 'virtio-serial,id=spice,bus=pci.0,addr=0x9' \
-chardev 'spicevmc,id=vdagent,name=vdagent' \
-device 'virtserialport,chardev=vdagent,name=com.redhat.spice.0' \
-spice 'tls-port=61000,addr=127.0.0.1,tls-ciphers=HIGH,seamless-migration=on' \
-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=A2:C0:43:77:08:A1,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \
-machine 'type=q35'

View File

@ -0,0 +1,13 @@
# TEST: Test Q35 USB3 passthrough combination
# QEMU_VERSION: 4.0.0
cores: 2
memory: 768
name: q35-usb3
net0: virtio=A2:C0:43:77:08:A1,bridge=vmbr0
ostype: l26
machine: q35
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
vga: qxl
usb1: spice,usb3=1

View File

@ -0,0 +1,32 @@
/usr/bin/kvm \
-id 8006 \
-name 'q35-usb3,debug-threads=on' \
-no-shutdown \
-chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \
-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=7b10d7af-b932-4c66-b2c3-3996152ec465' \
-smp '2,sockets=1,cores=2,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=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
-device 'vmgenid,guid=c773c261-d800-4348-9f5d-167fadd53cf8' \
-device 'nec-usb-xhci,id=xhci,bus=pci.1,addr=0x1b' \
-chardev 'spicevmc,id=usbredirchardev1,name=usbredir' \
-device 'usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci.0' \
-device 'qxl-vga,id=vga,bus=pcie.0,addr=0x1' \
-device 'virtio-serial,id=spice,bus=pci.0,addr=0x9' \
-chardev 'spicevmc,id=vdagent,name=vdagent' \
-device 'virtserialport,chardev=vdagent,name=com.redhat.spice.0' \
-spice 'tls-port=61000,addr=127.0.0.1,tls-ciphers=HIGH,seamless-migration=on' \
-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=A2:C0:43:77:08:A1,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \
-machine 'type=q35'

View File

@ -0,0 +1,12 @@
# TEST: Test Q35 USB passthrough combination with qemu-xhci
# QEMU_VERSION: 7.1.0
cores: 2
memory: 768
name: q35-qemu-xhci
net0: virtio=A2:C0:43:77:08:A1,bridge=vmbr0
ostype: l26
machine: pc-q35-7.1
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
usb1: spice

View File

@ -0,0 +1,29 @@
/usr/bin/kvm \
-id 8006 \
-name 'q35-qemu-xhci,debug-threads=on' \
-no-shutdown \
-chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \
-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=7b10d7af-b932-4c66-b2c3-3996152ec465' \
-smp '2,sockets=1,cores=2,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=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
-device 'vmgenid,guid=c773c261-d800-4348-9f5d-167fadd53cf8' \
-device 'qemu-xhci,p2=15,p3=15,id=xhci,bus=pci.1,addr=0x1b' \
-device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \
-chardev 'spicevmc,id=usbredirchardev1,name=usbredir' \
-device 'usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci.0,port=2' \
-device 'VGA,id=vga,bus=pcie.0,addr=0x1' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-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=A2:C0:43:77:08:A1,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \
-machine 'type=pc-q35-7.1+pve0'

View File

@ -0,0 +1,13 @@
# TEST: Test error for old machine type with newer usb config
# QEMU_VERSION: 4.0.0
# EXPECT_ERROR: using usb13 is only possible with machine type >= 7.1 and ostype l26 or windows > 7
cores: 2
memory: 768
name: q35-usb3-error
net0: virtio=A2:C0:43:77:08:A1,bridge=vmbr0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
vga: qxl
usb13: spice