all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server v2 2/6] tests: hotplug: add some test cases
Date: Mon, 14 Sep 2026 10:54:31 +0200	[thread overview]
Message-ID: <20260914085725.1299009-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260914085725.1299009-1-d.csapak@proxmox.com>

Add multiple test cases for a variety of situations. Includes test cases
that are expected to fail too.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/test/Makefile                             |  8 +++++++-
 .../aarch64/disk-add-default-machine.conf     | 20 +++++++++++++++++++
 .../disk-add-default-machine.conf.expected    |  6 ++++++
 src/test/hotplug/aarch64/disk-add-virtio.conf | 20 +++++++++++++++++++
 .../aarch64/disk-add-virtio.conf.expected     |  6 ++++++
 .../hotplug/aarch64/net-add-pci-bridge.conf   | 20 +++++++++++++++++++
 .../aarch64/net-add-pci-bridge.conf.expected  |  5 +++++
 src/test/hotplug/aarch64/net-add.conf         | 20 +++++++++++++++++++
 .../hotplug/aarch64/net-add.conf.expected     |  5 +++++
 src/test/hotplug/aarch64/tablet-disable.conf  | 20 +++++++++++++++++++
 .../aarch64/tablet-disable.conf.expected      |  2 ++
 .../hotplug/aarch64/x86-guest-net-add.conf    | 18 +++++++++++++++++
 .../aarch64/x86-guest-net-add.conf.expected   |  5 +++++
 src/test/hotplug/agent-fstrim.conf            | 17 ++++++++++++++++
 src/test/hotplug/balloon.conf                 | 18 +++++++++++++++++
 src/test/hotplug/balloon.conf.expected        |  1 +
 src/test/hotplug/cdrom-eject.conf             | 17 ++++++++++++++++
 src/test/hotplug/cdrom-eject.conf.expected    |  4 ++++
 src/test/hotplug/cpu-add-too-many.conf        | 20 +++++++++++++++++++
 src/test/hotplug/cpu-add.conf                 | 18 +++++++++++++++++
 src/test/hotplug/cpu-add.conf.expected        |  2 ++
 src/test/hotplug/cpu-remove.conf              | 18 +++++++++++++++++
 src/test/hotplug/cpu-remove.conf.expected     |  2 ++
 src/test/hotplug/cpulimit.conf                | 16 +++++++++++++++
 src/test/hotplug/cpulimit.conf.expected       |  1 +
 .../hotplug/disk-add-default-machine.conf     | 16 +++++++++++++++
 .../disk-add-default-machine.conf.expected    |  6 ++++++
 src/test/hotplug/disk-add-legacy-drive.conf   | 16 +++++++++++++++
 .../disk-add-legacy-drive.conf.expected       |  3 +++
 src/test/hotplug/disk-add-scsi-single.conf    | 16 +++++++++++++++
 .../disk-add-scsi-single.conf.expected        |  7 +++++++
 src/test/hotplug/disk-add-virtio.conf         | 16 +++++++++++++++
 .../hotplug/disk-add-virtio.conf.expected     |  6 ++++++
 src/test/hotplug/disk-remove-bootdisk.conf    | 18 +++++++++++++++++
 src/test/hotplug/disk-remove-busy.conf        | 20 +++++++++++++++++++
 .../hotplug/disk-remove-busy.conf.expected    |  1 +
 src/test/hotplug/disk-remove-scsi-single.conf | 17 ++++++++++++++++
 .../disk-remove-scsi-single.conf.expected     |  5 +++++
 src/test/hotplug/disk-remove-virtio.conf      | 17 ++++++++++++++++
 .../hotplug/disk-remove-virtio.conf.expected  |  4 ++++
 src/test/hotplug/disk-skip-ide.conf           | 17 ++++++++++++++++
 src/test/hotplug/disk-throttle.conf           | 16 +++++++++++++++
 src/test/hotplug/disk-throttle.conf.expected  |  1 +
 src/test/hotplug/fast-plug.conf               | 17 ++++++++++++++++
 src/test/hotplug/memory-add.conf              | 18 +++++++++++++++++
 src/test/hotplug/memory-add.conf.expected     |  4 ++++
 src/test/hotplug/memory-remove.conf           | 18 +++++++++++++++++
 src/test/hotplug/memory-remove.conf.expected  |  4 ++++
 src/test/hotplug/net-add-fail.conf            | 19 ++++++++++++++++++
 src/test/hotplug/net-add-fail.conf.expected   |  5 +++++
 src/test/hotplug/net-add-pci-bridge.conf      | 16 +++++++++++++++
 .../hotplug/net-add-pci-bridge.conf.expected  |  5 +++++
 src/test/hotplug/net-add.conf                 | 16 +++++++++++++++
 src/test/hotplug/net-add.conf.expected        |  5 +++++
 src/test/hotplug/net-change-bridge.conf       | 16 +++++++++++++++
 .../hotplug/net-change-bridge.conf.expected   |  6 ++++++
 src/test/hotplug/net-change-model.conf        | 16 +++++++++++++++
 .../hotplug/net-change-model.conf.expected    |  8 ++++++++
 src/test/hotplug/net-change-rate.conf         | 16 +++++++++++++++
 .../hotplug/net-change-rate.conf.expected     |  1 +
 src/test/hotplug/net-hotplug-disabled.conf    | 18 +++++++++++++++++
 src/test/hotplug/net-remove.conf              | 17 ++++++++++++++++
 src/test/hotplug/net-remove.conf.expected     |  3 +++
 src/test/hotplug/tablet-disable.conf          | 16 +++++++++++++++
 src/test/hotplug/tablet-disable.conf.expected |  1 +
 src/test/hotplug/tablet-enable.conf           | 17 ++++++++++++++++
 src/test/hotplug/tablet-enable.conf.expected  |  1 +
 src/test/hotplug/usb-add-spice.conf           | 17 ++++++++++++++++
 src/test/hotplug/usb-add-spice.conf.expected  |  2 ++
 src/test/hotplug/usb-add.conf                 | 16 +++++++++++++++
 src/test/hotplug/usb-add.conf.expected        |  2 ++
 src/test/hotplug/usb-remove-last.conf         | 17 ++++++++++++++++
 .../hotplug/usb-remove-last.conf.expected     |  2 ++
 73 files changed, 809 insertions(+), 1 deletion(-)
 create mode 100644 src/test/hotplug/aarch64/disk-add-default-machine.conf
 create mode 100644 src/test/hotplug/aarch64/disk-add-default-machine.conf.expected
 create mode 100644 src/test/hotplug/aarch64/disk-add-virtio.conf
 create mode 100644 src/test/hotplug/aarch64/disk-add-virtio.conf.expected
 create mode 100644 src/test/hotplug/aarch64/net-add-pci-bridge.conf
 create mode 100644 src/test/hotplug/aarch64/net-add-pci-bridge.conf.expected
 create mode 100644 src/test/hotplug/aarch64/net-add.conf
 create mode 100644 src/test/hotplug/aarch64/net-add.conf.expected
 create mode 100644 src/test/hotplug/aarch64/tablet-disable.conf
 create mode 100644 src/test/hotplug/aarch64/tablet-disable.conf.expected
 create mode 100644 src/test/hotplug/aarch64/x86-guest-net-add.conf
 create mode 100644 src/test/hotplug/aarch64/x86-guest-net-add.conf.expected
 create mode 100644 src/test/hotplug/agent-fstrim.conf
 create mode 100644 src/test/hotplug/balloon.conf
 create mode 100644 src/test/hotplug/balloon.conf.expected
 create mode 100644 src/test/hotplug/cdrom-eject.conf
 create mode 100644 src/test/hotplug/cdrom-eject.conf.expected
 create mode 100644 src/test/hotplug/cpu-add-too-many.conf
 create mode 100644 src/test/hotplug/cpu-add.conf
 create mode 100644 src/test/hotplug/cpu-add.conf.expected
 create mode 100644 src/test/hotplug/cpu-remove.conf
 create mode 100644 src/test/hotplug/cpu-remove.conf.expected
 create mode 100644 src/test/hotplug/cpulimit.conf
 create mode 100644 src/test/hotplug/cpulimit.conf.expected
 create mode 100644 src/test/hotplug/disk-add-default-machine.conf
 create mode 100644 src/test/hotplug/disk-add-default-machine.conf.expected
 create mode 100644 src/test/hotplug/disk-add-legacy-drive.conf
 create mode 100644 src/test/hotplug/disk-add-legacy-drive.conf.expected
 create mode 100644 src/test/hotplug/disk-add-scsi-single.conf
 create mode 100644 src/test/hotplug/disk-add-scsi-single.conf.expected
 create mode 100644 src/test/hotplug/disk-add-virtio.conf
 create mode 100644 src/test/hotplug/disk-add-virtio.conf.expected
 create mode 100644 src/test/hotplug/disk-remove-bootdisk.conf
 create mode 100644 src/test/hotplug/disk-remove-busy.conf
 create mode 100644 src/test/hotplug/disk-remove-busy.conf.expected
 create mode 100644 src/test/hotplug/disk-remove-scsi-single.conf
 create mode 100644 src/test/hotplug/disk-remove-scsi-single.conf.expected
 create mode 100644 src/test/hotplug/disk-remove-virtio.conf
 create mode 100644 src/test/hotplug/disk-remove-virtio.conf.expected
 create mode 100644 src/test/hotplug/disk-skip-ide.conf
 create mode 100644 src/test/hotplug/disk-throttle.conf
 create mode 100644 src/test/hotplug/disk-throttle.conf.expected
 create mode 100644 src/test/hotplug/fast-plug.conf
 create mode 100644 src/test/hotplug/memory-add.conf
 create mode 100644 src/test/hotplug/memory-add.conf.expected
 create mode 100644 src/test/hotplug/memory-remove.conf
 create mode 100644 src/test/hotplug/memory-remove.conf.expected
 create mode 100644 src/test/hotplug/net-add-fail.conf
 create mode 100644 src/test/hotplug/net-add-fail.conf.expected
 create mode 100644 src/test/hotplug/net-add-pci-bridge.conf
 create mode 100644 src/test/hotplug/net-add-pci-bridge.conf.expected
 create mode 100644 src/test/hotplug/net-add.conf
 create mode 100644 src/test/hotplug/net-add.conf.expected
 create mode 100644 src/test/hotplug/net-change-bridge.conf
 create mode 100644 src/test/hotplug/net-change-bridge.conf.expected
 create mode 100644 src/test/hotplug/net-change-model.conf
 create mode 100644 src/test/hotplug/net-change-model.conf.expected
 create mode 100644 src/test/hotplug/net-change-rate.conf
 create mode 100644 src/test/hotplug/net-change-rate.conf.expected
 create mode 100644 src/test/hotplug/net-hotplug-disabled.conf
 create mode 100644 src/test/hotplug/net-remove.conf
 create mode 100644 src/test/hotplug/net-remove.conf.expected
 create mode 100644 src/test/hotplug/tablet-disable.conf
 create mode 100644 src/test/hotplug/tablet-disable.conf.expected
 create mode 100644 src/test/hotplug/tablet-enable.conf
 create mode 100644 src/test/hotplug/tablet-enable.conf.expected
 create mode 100644 src/test/hotplug/usb-add-spice.conf
 create mode 100644 src/test/hotplug/usb-add-spice.conf.expected
 create mode 100644 src/test/hotplug/usb-add.conf
 create mode 100644 src/test/hotplug/usb-add.conf.expected
 create mode 100644 src/test/hotplug/usb-remove-last.conf
 create mode 100644 src/test/hotplug/usb-remove-last.conf.expected

diff --git a/src/test/Makefile b/src/test/Makefile
index aab0789e..702c9c03 100644
--- a/src/test/Makefile
+++ b/src/test/Makefile
@@ -1,6 +1,6 @@
 all: test
 
-test: test_snapshot test_cfg_to_cmd test_cfg_to_cmd_aarch64 test_pci_addr_conflicts test_pci_reservation test_qemu_img_convert test_migration test_restore_config test_parse_config
+test: test_snapshot test_cfg_to_cmd test_cfg_to_cmd_aarch64 test_hotplug test_hotplug_aarch64 test_pci_addr_conflicts test_pci_reservation test_qemu_img_convert test_migration test_restore_config test_parse_config
 
 test_snapshot: run_snapshot_tests.pl
 	./run_snapshot_tests.pl
@@ -12,6 +12,12 @@ test_cfg_to_cmd: run_config2command_tests.pl TestsCommon/*.pm cfg2cmd/*.conf
 test_cfg_to_cmd_aarch64: run_config2command_tests.pl TestsCommon/*.pm cfg2cmd/aarch64/*.conf
 	perl -I../ ./run_config2command_tests.pl cfg2cmd/aarch64
 
+test_hotplug: run_hotplug_tests.pl TestsCommon/*.pm hotplug/*.conf
+	perl -I../ ./run_hotplug_tests.pl
+
+test_hotplug_aarch64: run_hotplug_tests.pl TestsCommon/*.pm hotplug/aarch64/*.conf
+	perl -I../ ./run_hotplug_tests.pl hotplug/aarch64
+
 test_qemu_img_convert: run_qemu_img_convert_tests.pl
 	perl -I../ ./run_qemu_img_convert_tests.pl
 
diff --git a/src/test/hotplug/aarch64/disk-add-default-machine.conf b/src/test/hotplug/aarch64/disk-add-default-machine.conf
new file mode 100644
index 00000000..a6641772
--- /dev/null
+++ b/src/test/hotplug/aarch64/disk-add-default-machine.conf
@@ -0,0 +1,20 @@
+# TEST: hotplug a disk into an aarch64 VM without explicit machine type uses the default virt machine
+# HOST_ARCH: aarch64
+# QEMU_VERSION: 10.1.0
+arch: aarch64
+bios: ovmf
+bootdisk: scsi0
+cores: 2
+efidisk0: local:8006/vm-8006-disk-2.qcow2,efitype=4m
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
diff --git a/src/test/hotplug/aarch64/disk-add-default-machine.conf.expected b/src/test/hotplug/aarch64/disk-add-default-machine.conf.expected
new file mode 100644
index 00000000..a96885df
--- /dev/null
+++ b/src/test/hotplug/aarch64/disk-add-default-machine.conf.expected
@@ -0,0 +1,6 @@
+storage activate_volumes ["local:8006/vm-8006-disk-1.qcow2"]
+qmp object-add {"id":"iothread-virtio1","qom-type":"iothread"}
+qmp object-del {"id":"throttle-drive-virtio1"}
+qmp object-add {"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}
+qmp blockdev-add {"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-1.qcow2","node-name":"ef4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"ff4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}
+hmp device_add driver=virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pcie.0,addr=0xb,iothread=iothread-virtio1,write-cache=on
diff --git a/src/test/hotplug/aarch64/disk-add-virtio.conf b/src/test/hotplug/aarch64/disk-add-virtio.conf
new file mode 100644
index 00000000..929f7537
--- /dev/null
+++ b/src/test/hotplug/aarch64/disk-add-virtio.conf
@@ -0,0 +1,20 @@
+# TEST: hotplug a VirtIO block disk into an aarch64 VM uses the pcie root bus
+# HOST_ARCH: aarch64
+arch: aarch64
+bios: ovmf
+bootdisk: scsi0
+cores: 2
+efidisk0: local:8006/vm-8006-disk-2.qcow2,efitype=4m
+machine: virt-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
diff --git a/src/test/hotplug/aarch64/disk-add-virtio.conf.expected b/src/test/hotplug/aarch64/disk-add-virtio.conf.expected
new file mode 100644
index 00000000..a96885df
--- /dev/null
+++ b/src/test/hotplug/aarch64/disk-add-virtio.conf.expected
@@ -0,0 +1,6 @@
+storage activate_volumes ["local:8006/vm-8006-disk-1.qcow2"]
+qmp object-add {"id":"iothread-virtio1","qom-type":"iothread"}
+qmp object-del {"id":"throttle-drive-virtio1"}
+qmp object-add {"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}
+qmp blockdev-add {"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-1.qcow2","node-name":"ef4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"ff4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}
+hmp device_add driver=virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pcie.0,addr=0xb,iothread=iothread-virtio1,write-cache=on
diff --git a/src/test/hotplug/aarch64/net-add-pci-bridge.conf b/src/test/hotplug/aarch64/net-add-pci-bridge.conf
new file mode 100644
index 00000000..3e5fcc33
--- /dev/null
+++ b/src/test/hotplug/aarch64/net-add-pci-bridge.conf
@@ -0,0 +1,20 @@
+# TEST: hotplug a network device on the second PCI bridge of an aarch64 VM
+# HOST_ARCH: aarch64
+arch: aarch64
+bios: ovmf
+bootdisk: scsi0
+cores: 2
+efidisk0: local:8006/vm-8006-disk-2.qcow2,efitype=4m
+machine: virt-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net6: virtio=BA:DC:0F:FE:E0:06,bridge=vmbr0
diff --git a/src/test/hotplug/aarch64/net-add-pci-bridge.conf.expected b/src/test/hotplug/aarch64/net-add-pci-bridge.conf.expected
new file mode 100644
index 00000000..40aa47c5
--- /dev/null
+++ b/src/test/hotplug/aarch64/net-add-pci-bridge.conf.expected
@@ -0,0 +1,5 @@
+sdn add_next_free_cidr ["vmbr0","hotplug","BA:DC:0F:FE:E0:06","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","BA:DC:0F:FE:E0:06","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net6","ifname":"tap8006i6","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap","vhost":true}
+hmp device_add driver=virtio-net-pci,mac=BA:DC:0F:FE:E0:06,netdev=net6,bus=pci.1,addr=0x1,id=net6,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500
+qmp set_link {"name":"net6","up":true}
diff --git a/src/test/hotplug/aarch64/net-add.conf b/src/test/hotplug/aarch64/net-add.conf
new file mode 100644
index 00000000..31f43011
--- /dev/null
+++ b/src/test/hotplug/aarch64/net-add.conf
@@ -0,0 +1,20 @@
+# TEST: hotplug a network device into an aarch64 VM uses the pcie root bus
+# HOST_ARCH: aarch64
+arch: aarch64
+bios: ovmf
+bootdisk: scsi0
+cores: 2
+efidisk0: local:8006/vm-8006-disk-2.qcow2,efitype=4m
+machine: virt-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0,firewall=1
diff --git a/src/test/hotplug/aarch64/net-add.conf.expected b/src/test/hotplug/aarch64/net-add.conf.expected
new file mode 100644
index 00000000..8d552121
--- /dev/null
+++ b/src/test/hotplug/aarch64/net-add.conf.expected
@@ -0,0 +1,5 @@
+sdn add_next_free_cidr ["vmbr0","hotplug","BA:DC:0F:FE:E0:01","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","BA:DC:0F:FE:E0:01","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net1","ifname":"tap8006i1","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap","vhost":true}
+hmp device_add driver=virtio-net-pci,mac=BA:DC:0F:FE:E0:01,netdev=net1,bus=pcie.0,addr=0x13,id=net1,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500
+qmp set_link {"name":"net1","up":true}
diff --git a/src/test/hotplug/aarch64/tablet-disable.conf b/src/test/hotplug/aarch64/tablet-disable.conf
new file mode 100644
index 00000000..5dccd220
--- /dev/null
+++ b/src/test/hotplug/aarch64/tablet-disable.conf
@@ -0,0 +1,20 @@
+# TEST: disabling the tablet device on aarch64 also hot-unplugs the keyboard
+# HOST_ARCH: aarch64
+arch: aarch64
+bios: ovmf
+bootdisk: scsi0
+cores: 2
+efidisk0: local:8006/vm-8006-disk-2.qcow2,efitype=4m
+machine: virt-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+tablet: 0
diff --git a/src/test/hotplug/aarch64/tablet-disable.conf.expected b/src/test/hotplug/aarch64/tablet-disable.conf.expected
new file mode 100644
index 00000000..fc5a5751
--- /dev/null
+++ b/src/test/hotplug/aarch64/tablet-disable.conf.expected
@@ -0,0 +1,2 @@
+hmp device_del tablet
+hmp device_del keyboard
diff --git a/src/test/hotplug/aarch64/x86-guest-net-add.conf b/src/test/hotplug/aarch64/x86-guest-net-add.conf
new file mode 100644
index 00000000..21a3bb5a
--- /dev/null
+++ b/src/test/hotplug/aarch64/x86-guest-net-add.conf
@@ -0,0 +1,18 @@
+# TEST: hotplug a network device into an emulated x86_64 VM on an aarch64 host does not use vhost
+# HOST_ARCH: aarch64
+arch: x86_64
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0,firewall=1
diff --git a/src/test/hotplug/aarch64/x86-guest-net-add.conf.expected b/src/test/hotplug/aarch64/x86-guest-net-add.conf.expected
new file mode 100644
index 00000000..7f2b08a8
--- /dev/null
+++ b/src/test/hotplug/aarch64/x86-guest-net-add.conf.expected
@@ -0,0 +1,5 @@
+sdn add_next_free_cidr ["vmbr0","hotplug","BA:DC:0F:FE:E0:01","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","BA:DC:0F:FE:E0:01","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net1","ifname":"tap8006i1","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap"}
+hmp device_add driver=virtio-net-pci,mac=BA:DC:0F:FE:E0:01,netdev=net1,bus=pci.0,addr=0x13,id=net1,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500
+qmp set_link {"name":"net1","up":true}
diff --git a/src/test/hotplug/agent-fstrim.conf b/src/test/hotplug/agent-fstrim.conf
new file mode 100644
index 00000000..1cdd489e
--- /dev/null
+++ b/src/test/hotplug/agent-fstrim.conf
@@ -0,0 +1,17 @@
+# TEST: the fstrim_cloned_disks agent option can be changed on a running VM
+agent: 1
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+agent: 1,fstrim_cloned_disks=1
diff --git a/src/test/hotplug/balloon.conf b/src/test/hotplug/balloon.conf
new file mode 100644
index 00000000..67b5a1a9
--- /dev/null
+++ b/src/test/hotplug/balloon.conf
@@ -0,0 +1,18 @@
+# TEST: changing the balloon target with shares=0 is applied to the running VM
+balloon: 1024
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+shares: 0
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+balloon: 512
diff --git a/src/test/hotplug/balloon.conf.expected b/src/test/hotplug/balloon.conf.expected
new file mode 100644
index 00000000..a4651b2d
--- /dev/null
+++ b/src/test/hotplug/balloon.conf.expected
@@ -0,0 +1 @@
+qmp balloon {"value":536870912}
diff --git a/src/test/hotplug/cdrom-eject.conf b/src/test/hotplug/cdrom-eject.conf
new file mode 100644
index 00000000..c9333952
--- /dev/null
+++ b/src/test/hotplug/cdrom-eject.conf
@@ -0,0 +1,17 @@
+# TEST: removing the ISO of a CD-ROM drive ejects the medium and removes the block nodes
+bootdisk: scsi0
+cores: 2
+ide2: local:iso/debian-13.iso,media=cdrom
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+ide2: none,media=cdrom
diff --git a/src/test/hotplug/cdrom-eject.conf.expected b/src/test/hotplug/cdrom-eject.conf.expected
new file mode 100644
index 00000000..1cf43436
--- /dev/null
+++ b/src/test/hotplug/cdrom-eject.conf.expected
@@ -0,0 +1,4 @@
+qmp blockdev-open-tray {"force":true,"id":"ide2"}
+qmp blockdev-remove-medium {"id":"ide2"}
+qmp blockdev-del {"node-name":"drive-ide2"}
+qmp object-del {"id":"throttle-drive-ide2"}
diff --git a/src/test/hotplug/cpu-add-too-many.conf b/src/test/hotplug/cpu-add-too-many.conf
new file mode 100644
index 00000000..81708f98
--- /dev/null
+++ b/src/test/hotplug/cpu-add-too-many.conf
@@ -0,0 +1,20 @@
+# TEST: hotplugging more vCPUs than the configured maximum fails
+# EXPECTED_ERROR: vcpus: hotplug problem - you can't add more vcpus than maxcpus
+# STAYS_PENDING: 1
+bootdisk: scsi0
+cores: 4
+hotplug: network,disk,usb,cpu
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vcpus: 2
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+vcpus: 8
diff --git a/src/test/hotplug/cpu-add.conf b/src/test/hotplug/cpu-add.conf
new file mode 100644
index 00000000..a99d2739
--- /dev/null
+++ b/src/test/hotplug/cpu-add.conf
@@ -0,0 +1,18 @@
+# TEST: hotplug vCPUs
+bootdisk: scsi0
+cores: 4
+hotplug: network,disk,usb,cpu
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vcpus: 2
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+vcpus: 4
diff --git a/src/test/hotplug/cpu-add.conf.expected b/src/test/hotplug/cpu-add.conf.expected
new file mode 100644
index 00000000..b9beb8cd
--- /dev/null
+++ b/src/test/hotplug/cpu-add.conf.expected
@@ -0,0 +1,2 @@
+hmp device_add driver=kvm64-x86_64-cpu,id=cpu3,socket-id=0,core-id=2,thread-id=0
+hmp device_add driver=kvm64-x86_64-cpu,id=cpu4,socket-id=0,core-id=3,thread-id=0
diff --git a/src/test/hotplug/cpu-remove.conf b/src/test/hotplug/cpu-remove.conf
new file mode 100644
index 00000000..884220da
--- /dev/null
+++ b/src/test/hotplug/cpu-remove.conf
@@ -0,0 +1,18 @@
+# TEST: hot-unplug vCPUs starting with the highest one
+bootdisk: scsi0
+cores: 4
+hotplug: network,disk,usb,cpu
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vcpus: 4
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+vcpus: 2
diff --git a/src/test/hotplug/cpu-remove.conf.expected b/src/test/hotplug/cpu-remove.conf.expected
new file mode 100644
index 00000000..db6e6e4c
--- /dev/null
+++ b/src/test/hotplug/cpu-remove.conf.expected
@@ -0,0 +1,2 @@
+hmp device_del cpu4
+hmp device_del cpu3
diff --git a/src/test/hotplug/cpulimit.conf b/src/test/hotplug/cpulimit.conf
new file mode 100644
index 00000000..066e1eb2
--- /dev/null
+++ b/src/test/hotplug/cpulimit.conf
@@ -0,0 +1,16 @@
+# TEST: changing the cpulimit is applied via cgroup
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+cpulimit: 2
diff --git a/src/test/hotplug/cpulimit.conf.expected b/src/test/hotplug/cpulimit.conf.expected
new file mode 100644
index 00000000..9b2d9a2e
--- /dev/null
+++ b/src/test/hotplug/cpulimit.conf.expected
@@ -0,0 +1 @@
+cgroup change_cpu_quota [200,null]
diff --git a/src/test/hotplug/disk-add-default-machine.conf b/src/test/hotplug/disk-add-default-machine.conf
new file mode 100644
index 00000000..db5cb7b4
--- /dev/null
+++ b/src/test/hotplug/disk-add-default-machine.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug a disk into a VM without explicit machine type uses the default machine of the running QEMU
+# QEMU_VERSION: 10.1.0
+bootdisk: scsi0
+cores: 2
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
diff --git a/src/test/hotplug/disk-add-default-machine.conf.expected b/src/test/hotplug/disk-add-default-machine.conf.expected
new file mode 100644
index 00000000..ac79a701
--- /dev/null
+++ b/src/test/hotplug/disk-add-default-machine.conf.expected
@@ -0,0 +1,6 @@
+storage activate_volumes ["local:8006/vm-8006-disk-1.qcow2"]
+qmp object-add {"id":"iothread-virtio1","qom-type":"iothread"}
+qmp object-del {"id":"throttle-drive-virtio1"}
+qmp object-add {"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}
+qmp blockdev-add {"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-1.qcow2","node-name":"ef4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"ff4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}
+hmp device_add driver=virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,write-cache=on
diff --git a/src/test/hotplug/disk-add-legacy-drive.conf b/src/test/hotplug/disk-add-legacy-drive.conf
new file mode 100644
index 00000000..e889bb71
--- /dev/null
+++ b/src/test/hotplug/disk-add-legacy-drive.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug a disk with machine version < 10.0 uses the legacy -drive backend
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-9.2
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+virtio1: local:8006/vm-8006-disk-1.qcow2,size=32G
diff --git a/src/test/hotplug/disk-add-legacy-drive.conf.expected b/src/test/hotplug/disk-add-legacy-drive.conf.expected
new file mode 100644
index 00000000..2b4ac61c
--- /dev/null
+++ b/src/test/hotplug/disk-add-legacy-drive.conf.expected
@@ -0,0 +1,3 @@
+storage activate_volumes ["local:8006/vm-8006-disk-1.qcow2"]
+hmp drive_add auto "file=/var/lib/vz/images/8006/vm-8006-disk-1.qcow2,if=none,id=drive-virtio1,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on"
+hmp device_add driver=virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb
diff --git a/src/test/hotplug/disk-add-scsi-single.conf b/src/test/hotplug/disk-add-scsi-single.conf
new file mode 100644
index 00000000..23b3f275
--- /dev/null
+++ b/src/test/hotplug/disk-add-scsi-single.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug a SCSI disk with virtio-scsi-single adds a dedicated controller with iothread
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,iothread=1,size=32G
+scsihw: virtio-scsi-single
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+scsi1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
diff --git a/src/test/hotplug/disk-add-scsi-single.conf.expected b/src/test/hotplug/disk-add-scsi-single.conf.expected
new file mode 100644
index 00000000..eb38c7a2
--- /dev/null
+++ b/src/test/hotplug/disk-add-scsi-single.conf.expected
@@ -0,0 +1,7 @@
+storage activate_volumes ["local:8006/vm-8006-disk-1.qcow2"]
+qmp object-add {"id":"iothread-virtioscsi1","qom-type":"iothread"}
+hmp device_add driver=virtio-scsi-pci,id=virtioscsi1,bus=pci.3,addr=0x2,iothread=iothread-virtioscsi1
+qmp object-del {"id":"throttle-drive-scsi1"}
+qmp object-add {"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}
+qmp blockdev-add {"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-1.qcow2","node-name":"e70a10e5fb0473d3fc55686f720db61","read-only":false},"node-name":"f70a10e5fb0473d3fc55686f720db61","read-only":false},"node-name":"drive-scsi1","read-only":false,"throttle-group":"throttle-drive-scsi1"}
+hmp device_add driver=scsi-hd,bus=virtioscsi1.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,device_id=drive-scsi1,write-cache=on
diff --git a/src/test/hotplug/disk-add-virtio.conf b/src/test/hotplug/disk-add-virtio.conf
new file mode 100644
index 00000000..ca750fde
--- /dev/null
+++ b/src/test/hotplug/disk-add-virtio.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug a new VirtIO block disk with iothread
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
diff --git a/src/test/hotplug/disk-add-virtio.conf.expected b/src/test/hotplug/disk-add-virtio.conf.expected
new file mode 100644
index 00000000..ac79a701
--- /dev/null
+++ b/src/test/hotplug/disk-add-virtio.conf.expected
@@ -0,0 +1,6 @@
+storage activate_volumes ["local:8006/vm-8006-disk-1.qcow2"]
+qmp object-add {"id":"iothread-virtio1","qom-type":"iothread"}
+qmp object-del {"id":"throttle-drive-virtio1"}
+qmp object-add {"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}
+qmp blockdev-add {"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-1.qcow2","node-name":"ef4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"ff4c217a7f08cf59741edc1790023f5","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}
+hmp device_add driver=virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,write-cache=on
diff --git a/src/test/hotplug/disk-remove-bootdisk.conf b/src/test/hotplug/disk-remove-bootdisk.conf
new file mode 100644
index 00000000..395bf019
--- /dev/null
+++ b/src/test/hotplug/disk-remove-bootdisk.conf
@@ -0,0 +1,18 @@
+# TEST: the boot disk cannot be hot-unplugged
+# EXPECTED_ERROR: scsi0: hotplug problem - can't unplug bootdisk 'scsi0'
+# STAYS_PENDING: 1
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+delete: scsi0
diff --git a/src/test/hotplug/disk-remove-busy.conf b/src/test/hotplug/disk-remove-busy.conf
new file mode 100644
index 00000000..ad988d10
--- /dev/null
+++ b/src/test/hotplug/disk-remove-busy.conf
@@ -0,0 +1,20 @@
+# TEST: a disk that is not released by the guest stays in the config
+# FAIL_DEVICE_DEL: virtio1
+# EXPECTED_ERROR: virtio1: hotplug problem - error on hot-unplugging device 'virtio1' - still busy in guest?
+# STAYS_PENDING: 1
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+delete: virtio1
diff --git a/src/test/hotplug/disk-remove-busy.conf.expected b/src/test/hotplug/disk-remove-busy.conf.expected
new file mode 100644
index 00000000..2bea74a8
--- /dev/null
+++ b/src/test/hotplug/disk-remove-busy.conf.expected
@@ -0,0 +1 @@
+hmp device_del virtio1
diff --git a/src/test/hotplug/disk-remove-scsi-single.conf b/src/test/hotplug/disk-remove-scsi-single.conf
new file mode 100644
index 00000000..7074eb79
--- /dev/null
+++ b/src/test/hotplug/disk-remove-scsi-single.conf
@@ -0,0 +1,17 @@
+# TEST: hot-unplug a SCSI disk with virtio-scsi-single also removes its controller and iothread
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,iothread=1,size=32G
+scsi1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
+scsihw: virtio-scsi-single
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+delete: scsi1
diff --git a/src/test/hotplug/disk-remove-scsi-single.conf.expected b/src/test/hotplug/disk-remove-scsi-single.conf.expected
new file mode 100644
index 00000000..0436eff1
--- /dev/null
+++ b/src/test/hotplug/disk-remove-scsi-single.conf.expected
@@ -0,0 +1,5 @@
+hmp device_del scsi1
+qmp blockdev-del {"node-name":"drive-scsi1"}
+qmp object-del {"id":"throttle-drive-scsi1"}
+hmp device_del virtioscsi1
+qmp object-del {"id":"iothread-virtioscsi1"}
diff --git a/src/test/hotplug/disk-remove-virtio.conf b/src/test/hotplug/disk-remove-virtio.conf
new file mode 100644
index 00000000..f6f334a8
--- /dev/null
+++ b/src/test/hotplug/disk-remove-virtio.conf
@@ -0,0 +1,17 @@
+# TEST: hot-unplug a VirtIO block disk with iothread and keep the volume as unused
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+delete: virtio1
diff --git a/src/test/hotplug/disk-remove-virtio.conf.expected b/src/test/hotplug/disk-remove-virtio.conf.expected
new file mode 100644
index 00000000..ba098006
--- /dev/null
+++ b/src/test/hotplug/disk-remove-virtio.conf.expected
@@ -0,0 +1,4 @@
+hmp device_del virtio1
+qmp blockdev-del {"node-name":"drive-virtio1"}
+qmp object-del {"id":"throttle-drive-virtio1"}
+qmp object-del {"id":"iothread-virtio1"}
diff --git a/src/test/hotplug/disk-skip-ide.conf b/src/test/hotplug/disk-skip-ide.conf
new file mode 100644
index 00000000..33672710
--- /dev/null
+++ b/src/test/hotplug/disk-skip-ide.conf
@@ -0,0 +1,17 @@
+# TEST: IDE disks cannot be hotplugged and stay pending
+# STAYS_PENDING: 1
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+ide0: local:8006/vm-8006-disk-1.qcow2,size=32G
diff --git a/src/test/hotplug/disk-throttle.conf b/src/test/hotplug/disk-throttle.conf
new file mode 100644
index 00000000..f1baf6df
--- /dev/null
+++ b/src/test/hotplug/disk-throttle.conf
@@ -0,0 +1,16 @@
+# TEST: changing the bandwidth limit of a disk is applied to the throttle group
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+scsi0: local:8006/vm-8006-disk-0.qcow2,mbps_rd=50,size=32G
diff --git a/src/test/hotplug/disk-throttle.conf.expected b/src/test/hotplug/disk-throttle.conf.expected
new file mode 100644
index 00000000..44fa2071
--- /dev/null
+++ b/src/test/hotplug/disk-throttle.conf.expected
@@ -0,0 +1 @@
+qmp qom-set {"path":"throttle-drive-scsi0","property":"limits","value":{"bps-read":52428800,"bps-read-max":0,"bps-read-max-length":1,"bps-total":0,"bps-total-max":0,"bps-total-max-length":1,"bps-write":0,"bps-write-max":0,"bps-write-max-length":1,"iops-read":0,"iops-read-max":0,"iops-read-max-length":1,"iops-total":0,"iops-total-max":0,"iops-total-max-length":1,"iops-write":0,"iops-write-max":0,"iops-write-max-length":1}}
diff --git a/src/test/hotplug/fast-plug.conf b/src/test/hotplug/fast-plug.conf
new file mode 100644
index 00000000..4746ade9
--- /dev/null
+++ b/src/test/hotplug/fast-plug.conf
@@ -0,0 +1,17 @@
+# TEST: options without impact on the running VM are applied without any action
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+name: renamed
+onboot: 1
diff --git a/src/test/hotplug/memory-add.conf b/src/test/hotplug/memory-add.conf
new file mode 100644
index 00000000..ac26ed68
--- /dev/null
+++ b/src/test/hotplug/memory-add.conf
@@ -0,0 +1,18 @@
+# TEST: hotplug memory adds DIMMs on top of the existing ones
+bootdisk: scsi0
+cores: 2
+hotplug: network,disk,usb,memory
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+numa: 1
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+memory: 3072
diff --git a/src/test/hotplug/memory-add.conf.expected b/src/test/hotplug/memory-add.conf.expected
new file mode 100644
index 00000000..88265ea3
--- /dev/null
+++ b/src/test/hotplug/memory-add.conf.expected
@@ -0,0 +1,4 @@
+qmp object-add {"id":"mem-dimm2","qom-type":"memory-backend-ram","size":536870912}
+qmp device_add {"driver":"pc-dimm","id":"dimm2","memdev":"mem-dimm2","node":0}
+qmp object-add {"id":"mem-dimm3","qom-type":"memory-backend-ram","size":536870912}
+qmp device_add {"driver":"pc-dimm","id":"dimm3","memdev":"mem-dimm3","node":0}
diff --git a/src/test/hotplug/memory-remove.conf b/src/test/hotplug/memory-remove.conf
new file mode 100644
index 00000000..1ac656c6
--- /dev/null
+++ b/src/test/hotplug/memory-remove.conf
@@ -0,0 +1,18 @@
+# TEST: hot-unplug memory removes DIMMs starting with the highest one
+bootdisk: scsi0
+cores: 2
+hotplug: network,disk,usb,memory
+machine: pc-i440fx-10.1
+memory: 3072
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+numa: 1
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+memory: 2048
diff --git a/src/test/hotplug/memory-remove.conf.expected b/src/test/hotplug/memory-remove.conf.expected
new file mode 100644
index 00000000..caf3bdb9
--- /dev/null
+++ b/src/test/hotplug/memory-remove.conf.expected
@@ -0,0 +1,4 @@
+hmp device_del dimm3
+qmp object-del {"id":"mem-dimm3"}
+hmp device_del dimm2
+qmp object-del {"id":"mem-dimm2"}
diff --git a/src/test/hotplug/net-add-fail.conf b/src/test/hotplug/net-add-fail.conf
new file mode 100644
index 00000000..9f743b52
--- /dev/null
+++ b/src/test/hotplug/net-add-fail.conf
@@ -0,0 +1,19 @@
+# TEST: a network device that does not show up after hotplug is cleaned up again
+# FAIL_DEVICE_ADD: net1
+# EXPECTED_ERROR: net1: hotplug problem - error on hotplug device 'net1'
+# STAYS_PENDING: 1
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0,firewall=1
diff --git a/src/test/hotplug/net-add-fail.conf.expected b/src/test/hotplug/net-add-fail.conf.expected
new file mode 100644
index 00000000..fbffcb47
--- /dev/null
+++ b/src/test/hotplug/net-add-fail.conf.expected
@@ -0,0 +1,5 @@
+sdn add_next_free_cidr ["vmbr0","hotplug","BA:DC:0F:FE:E0:01","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","BA:DC:0F:FE:E0:01","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net1","ifname":"tap8006i1","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap","vhost":true}
+hmp device_add driver=virtio-net-pci,mac=BA:DC:0F:FE:E0:01,netdev=net1,bus=pci.0,addr=0x13,id=net1,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500
+qmp netdev_del {"id":"net1"}
diff --git a/src/test/hotplug/net-add-pci-bridge.conf b/src/test/hotplug/net-add-pci-bridge.conf
new file mode 100644
index 00000000..3d440d28
--- /dev/null
+++ b/src/test/hotplug/net-add-pci-bridge.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug a network device on the second PCI bridge
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net6: virtio=BA:DC:0F:FE:E0:06,bridge=vmbr0
diff --git a/src/test/hotplug/net-add-pci-bridge.conf.expected b/src/test/hotplug/net-add-pci-bridge.conf.expected
new file mode 100644
index 00000000..40aa47c5
--- /dev/null
+++ b/src/test/hotplug/net-add-pci-bridge.conf.expected
@@ -0,0 +1,5 @@
+sdn add_next_free_cidr ["vmbr0","hotplug","BA:DC:0F:FE:E0:06","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","BA:DC:0F:FE:E0:06","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net6","ifname":"tap8006i6","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap","vhost":true}
+hmp device_add driver=virtio-net-pci,mac=BA:DC:0F:FE:E0:06,netdev=net6,bus=pci.1,addr=0x1,id=net6,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500
+qmp set_link {"name":"net6","up":true}
diff --git a/src/test/hotplug/net-add.conf b/src/test/hotplug/net-add.conf
new file mode 100644
index 00000000..b4bb3568
--- /dev/null
+++ b/src/test/hotplug/net-add.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug a new network device
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0,firewall=1
diff --git a/src/test/hotplug/net-add.conf.expected b/src/test/hotplug/net-add.conf.expected
new file mode 100644
index 00000000..562bfb12
--- /dev/null
+++ b/src/test/hotplug/net-add.conf.expected
@@ -0,0 +1,5 @@
+sdn add_next_free_cidr ["vmbr0","hotplug","BA:DC:0F:FE:E0:01","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","BA:DC:0F:FE:E0:01","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net1","ifname":"tap8006i1","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap","vhost":true}
+hmp device_add driver=virtio-net-pci,mac=BA:DC:0F:FE:E0:01,netdev=net1,bus=pci.0,addr=0x13,id=net1,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500
+qmp set_link {"name":"net1","up":true}
diff --git a/src/test/hotplug/net-change-bridge.conf b/src/test/hotplug/net-change-bridge.conf
new file mode 100644
index 00000000..562d6dce
--- /dev/null
+++ b/src/test/hotplug/net-change-bridge.conf
@@ -0,0 +1,16 @@
+# TEST: changing bridge and VLAN tag re-plugs the tap device without replacing the device
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr1,tag=100
diff --git a/src/test/hotplug/net-change-bridge.conf.expected b/src/test/hotplug/net-change-bridge.conf.expected
new file mode 100644
index 00000000..a745b2e5
--- /dev/null
+++ b/src/test/hotplug/net-change-bridge.conf.expected
@@ -0,0 +1,6 @@
+net tap_unplug ["tap8006i0"]
+qmp set_link {"name":"net0","up":false}
+sdn del_ips_from_mac ["vmbr0","A2:C0:43:77:08:A0","hotplug"]
+sdn add_next_free_cidr ["vmbr1","hotplug","A2:C0:43:77:08:A0","8006",null,1]
+net tap_plug ["tap8006i0","vmbr1","100",null,null,null]
+qmp set_link {"name":"net0","up":true}
diff --git a/src/test/hotplug/net-change-model.conf b/src/test/hotplug/net-change-model.conf
new file mode 100644
index 00000000..3dccc1ff
--- /dev/null
+++ b/src/test/hotplug/net-change-model.conf
@@ -0,0 +1,16 @@
+# TEST: changing the model replaces the network device
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net0: e1000=A2:C0:43:77:08:A0,bridge=vmbr0
diff --git a/src/test/hotplug/net-change-model.conf.expected b/src/test/hotplug/net-change-model.conf.expected
new file mode 100644
index 00000000..b61756cd
--- /dev/null
+++ b/src/test/hotplug/net-change-model.conf.expected
@@ -0,0 +1,8 @@
+hmp device_del net0
+qmp netdev_del {"id":"net0"}
+sdn del_ips_from_mac ["vmbr0","A2:C0:43:77:08:A0","hotplug"]
+sdn add_next_free_cidr ["vmbr0","hotplug","A2:C0:43:77:08:A0","8006",null,1]
+sdn add_dhcp_mapping ["vmbr0","A2:C0:43:77:08:A0","8006","hotplug"]
+qmp netdev_add {"downscript":"/usr/libexec/qemu-server/pve-bridgedown","id":"net0","ifname":"tap8006i0","script":"/usr/libexec/qemu-server/pve-bridge-hotplug","type":"tap"}
+hmp device_add driver=e1000,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0
+qmp set_link {"name":"net0","up":true}
diff --git a/src/test/hotplug/net-change-rate.conf b/src/test/hotplug/net-change-rate.conf
new file mode 100644
index 00000000..09d91d04
--- /dev/null
+++ b/src/test/hotplug/net-change-rate.conf
@@ -0,0 +1,16 @@
+# TEST: changing only the rate limit is applied to the tap device
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0,rate=10
diff --git a/src/test/hotplug/net-change-rate.conf.expected b/src/test/hotplug/net-change-rate.conf.expected
new file mode 100644
index 00000000..c4e24dae
--- /dev/null
+++ b/src/test/hotplug/net-change-rate.conf.expected
@@ -0,0 +1 @@
+net tap_rate_limit ["tap8006i0","10"]
diff --git a/src/test/hotplug/net-hotplug-disabled.conf b/src/test/hotplug/net-hotplug-disabled.conf
new file mode 100644
index 00000000..73a0809e
--- /dev/null
+++ b/src/test/hotplug/net-hotplug-disabled.conf
@@ -0,0 +1,18 @@
+# TEST: a new network device stays pending if network hotplug is disabled
+# STAYS_PENDING: 1
+bootdisk: scsi0
+cores: 2
+hotplug: disk
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0
diff --git a/src/test/hotplug/net-remove.conf b/src/test/hotplug/net-remove.conf
new file mode 100644
index 00000000..95da8dfd
--- /dev/null
+++ b/src/test/hotplug/net-remove.conf
@@ -0,0 +1,17 @@
+# TEST: hot-unplug a network device
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+delete: net1
diff --git a/src/test/hotplug/net-remove.conf.expected b/src/test/hotplug/net-remove.conf.expected
new file mode 100644
index 00000000..6c33294e
--- /dev/null
+++ b/src/test/hotplug/net-remove.conf.expected
@@ -0,0 +1,3 @@
+hmp device_del net1
+qmp netdev_del {"id":"net1"}
+sdn del_ips_from_mac ["vmbr0","BA:DC:0F:FE:E0:01","hotplug"]
diff --git a/src/test/hotplug/tablet-disable.conf b/src/test/hotplug/tablet-disable.conf
new file mode 100644
index 00000000..ef2821a2
--- /dev/null
+++ b/src/test/hotplug/tablet-disable.conf
@@ -0,0 +1,16 @@
+# TEST: disabling the tablet device hot-unplugs it
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+tablet: 0
diff --git a/src/test/hotplug/tablet-disable.conf.expected b/src/test/hotplug/tablet-disable.conf.expected
new file mode 100644
index 00000000..9d551e77
--- /dev/null
+++ b/src/test/hotplug/tablet-disable.conf.expected
@@ -0,0 +1 @@
+hmp device_del tablet
diff --git a/src/test/hotplug/tablet-enable.conf b/src/test/hotplug/tablet-enable.conf
new file mode 100644
index 00000000..8a7dbf95
--- /dev/null
+++ b/src/test/hotplug/tablet-enable.conf
@@ -0,0 +1,17 @@
+# TEST: enabling the tablet device hotplugs it
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+tablet: 0
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+tablet: 1
diff --git a/src/test/hotplug/tablet-enable.conf.expected b/src/test/hotplug/tablet-enable.conf.expected
new file mode 100644
index 00000000..800f9296
--- /dev/null
+++ b/src/test/hotplug/tablet-enable.conf.expected
@@ -0,0 +1 @@
+hmp device_add driver=usb-tablet,id=tablet,bus=uhci.0,port=1
diff --git a/src/test/hotplug/usb-add-spice.conf b/src/test/hotplug/usb-add-spice.conf
new file mode 100644
index 00000000..ead41bbd
--- /dev/null
+++ b/src/test/hotplug/usb-add-spice.conf
@@ -0,0 +1,17 @@
+# TEST: hotplug a SPICE USB redirection device
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+usb0: host=1234:5678
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+usb1: spice
diff --git a/src/test/hotplug/usb-add-spice.conf.expected b/src/test/hotplug/usb-add-spice.conf.expected
new file mode 100644
index 00000000..87ebf75e
--- /dev/null
+++ b/src/test/hotplug/usb-add-spice.conf.expected
@@ -0,0 +1,2 @@
+qmp chardev-add {"backend":{"data":{"type":"usbredir"},"type":"spicevmc"},"id":"usbredirchardev1"}
+hmp device_add driver=usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci.0,port=2
diff --git a/src/test/hotplug/usb-add.conf b/src/test/hotplug/usb-add.conf
new file mode 100644
index 00000000..b3514037
--- /dev/null
+++ b/src/test/hotplug/usb-add.conf
@@ -0,0 +1,16 @@
+# TEST: hotplug the first USB device also adds the xhci controller
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+usb0: host=1234:5678
diff --git a/src/test/hotplug/usb-add.conf.expected b/src/test/hotplug/usb-add.conf.expected
new file mode 100644
index 00000000..0ef6024e
--- /dev/null
+++ b/src/test/hotplug/usb-add.conf.expected
@@ -0,0 +1,2 @@
+hmp device_add driver=qemu-xhci,p2=15,p3=15,id=xhci,bus=pci.1,addr=0x1b
+hmp device_add driver=usb-host,bus=xhci.0,port=1,vendorid=0x1234,productid=0x5678,id=usb0
diff --git a/src/test/hotplug/usb-remove-last.conf b/src/test/hotplug/usb-remove-last.conf
new file mode 100644
index 00000000..e10e93fd
--- /dev/null
+++ b/src/test/hotplug/usb-remove-last.conf
@@ -0,0 +1,17 @@
+# TEST: hot-unplug the last USB device also removes the xhci controller
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+ostype: l26
+scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+usb0: host=1234:5678
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
+
+[PENDING]
+delete: usb0
diff --git a/src/test/hotplug/usb-remove-last.conf.expected b/src/test/hotplug/usb-remove-last.conf.expected
new file mode 100644
index 00000000..5e9b36f1
--- /dev/null
+++ b/src/test/hotplug/usb-remove-last.conf.expected
@@ -0,0 +1,2 @@
+hmp device_del usb0
+hmp device_del xhci
-- 
2.47.3





  parent reply	other threads:[~2026-09-14  8:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  8:54 [PATCH qemu-server v2 0/6] add hotplug tests and fix uncovered bugs Dominik Csapak
2026-09-14  8:54 ` [PATCH qemu-server v2 1/6] tests: hotplug: add initial hotplug test harness Dominik Csapak
2026-09-14  8:54 ` Dominik Csapak [this message]
2026-09-14  8:54 ` [PATCH qemu-server v2 3/6] tests: hotplug: add test case for adding scsi14 on qemu 11.1 Dominik Csapak
2026-09-14  8:54 ` [PATCH qemu-server v2 4/6] tests: hotplug: add cases for known defects Dominik Csapak
2026-09-14  8:54 ` [PATCH qemu-server v2 5/6] hotplug: fix vm_deviceplug call for 'tablet' and 'keyboard' on aarch64 Dominik Csapak
2026-09-14  8:54 ` [PATCH qemu-server v2 6/6] hotplug: remove iothread if adding drive device failed Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260914085725.1299009-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal