From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 2/6] tests: hotplug: add some test cases
Date: Thu, 10 Sep 2026 13:00:29 +0200 [thread overview]
Message-ID: <20260910110832.2822954-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260910110832.2822954-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 | 6 ++++
.../aarch64/disk-add-default-machine.conf | 20 +++++++++++++
.../disk-add-default-machine.conf.expected | 28 ++++++++++++++++++
src/test/hotplug/aarch64/disk-add-virtio.conf | 20 +++++++++++++
.../aarch64/disk-add-virtio.conf.expected | 29 +++++++++++++++++++
.../hotplug/aarch64/net-add-pci-bridge.conf | 20 +++++++++++++
.../aarch64/net-add-pci-bridge.conf.expected | 28 ++++++++++++++++++
src/test/hotplug/aarch64/net-add.conf | 20 +++++++++++++
.../hotplug/aarch64/net-add.conf.expected | 28 ++++++++++++++++++
src/test/hotplug/aarch64/tablet-disable.conf | 20 +++++++++++++
.../aarch64/tablet-disable.conf.expected | 25 ++++++++++++++++
.../hotplug/aarch64/x86-guest-net-add.conf | 18 ++++++++++++
.../aarch64/x86-guest-net-add.conf.expected | 26 +++++++++++++++++
src/test/hotplug/agent-fstrim.conf | 17 +++++++++++
src/test/hotplug/agent-fstrim.conf.expected | 20 +++++++++++++
src/test/hotplug/balloon.conf | 18 ++++++++++++
src/test/hotplug/balloon.conf.expected | 22 ++++++++++++++
src/test/hotplug/cdrom-eject.conf | 17 +++++++++++
src/test/hotplug/cdrom-eject.conf.expected | 24 +++++++++++++++
src/test/hotplug/cpu-add-too-many.conf | 18 ++++++++++++
.../hotplug/cpu-add-too-many.conf.expected | 25 ++++++++++++++++
src/test/hotplug/cpu-add.conf | 18 ++++++++++++
src/test/hotplug/cpu-add.conf.expected | 23 +++++++++++++++
src/test/hotplug/cpu-remove.conf | 18 ++++++++++++
src/test/hotplug/cpu-remove.conf.expected | 23 +++++++++++++++
src/test/hotplug/cpulimit.conf | 16 ++++++++++
src/test/hotplug/cpulimit.conf.expected | 21 ++++++++++++++
.../hotplug/disk-add-default-machine.conf | 16 ++++++++++
.../disk-add-default-machine.conf.expected | 25 ++++++++++++++++
src/test/hotplug/disk-add-legacy-drive.conf | 16 ++++++++++
.../disk-add-legacy-drive.conf.expected | 23 +++++++++++++++
src/test/hotplug/disk-add-scsi-single.conf | 16 ++++++++++
.../disk-add-scsi-single.conf.expected | 27 +++++++++++++++++
src/test/hotplug/disk-add-virtio.conf | 16 ++++++++++
.../hotplug/disk-add-virtio.conf.expected | 26 +++++++++++++++++
src/test/hotplug/disk-remove-bootdisk.conf | 16 ++++++++++
.../disk-remove-bootdisk.conf.expected | 23 +++++++++++++++
src/test/hotplug/disk-remove-busy.conf | 18 ++++++++++++
.../hotplug/disk-remove-busy.conf.expected | 25 ++++++++++++++++
src/test/hotplug/disk-remove-scsi-single.conf | 17 +++++++++++
.../disk-remove-scsi-single.conf.expected | 25 ++++++++++++++++
src/test/hotplug/disk-remove-virtio.conf | 17 +++++++++++
.../hotplug/disk-remove-virtio.conf.expected | 24 +++++++++++++++
src/test/hotplug/disk-skip-ide.conf | 16 ++++++++++
src/test/hotplug/disk-skip-ide.conf.expected | 22 ++++++++++++++
src/test/hotplug/disk-throttle.conf | 16 ++++++++++
src/test/hotplug/disk-throttle.conf.expected | 20 +++++++++++++
src/test/hotplug/fast-plug.conf | 17 +++++++++++
src/test/hotplug/fast-plug.conf.expected | 20 +++++++++++++
src/test/hotplug/memory-add.conf | 18 ++++++++++++
src/test/hotplug/memory-add.conf.expected | 25 ++++++++++++++++
src/test/hotplug/memory-remove.conf | 18 ++++++++++++
src/test/hotplug/memory-remove.conf.expected | 25 ++++++++++++++++
src/test/hotplug/net-add-fail.conf | 17 +++++++++++
src/test/hotplug/net-add-fail.conf.expected | 28 ++++++++++++++++++
src/test/hotplug/net-add-pci-bridge.conf | 16 ++++++++++
.../hotplug/net-add-pci-bridge.conf.expected | 25 ++++++++++++++++
src/test/hotplug/net-add.conf | 16 ++++++++++
src/test/hotplug/net-add.conf.expected | 25 ++++++++++++++++
src/test/hotplug/net-change-bridge.conf | 16 ++++++++++
.../hotplug/net-change-bridge.conf.expected | 25 ++++++++++++++++
src/test/hotplug/net-change-model.conf | 16 ++++++++++
.../hotplug/net-change-model.conf.expected | 27 +++++++++++++++++
src/test/hotplug/net-change-rate.conf | 16 ++++++++++
.../hotplug/net-change-rate.conf.expected | 20 +++++++++++++
src/test/hotplug/net-hotplug-disabled.conf | 17 +++++++++++
.../net-hotplug-disabled.conf.expected | 23 +++++++++++++++
src/test/hotplug/net-remove.conf | 17 +++++++++++
src/test/hotplug/net-remove.conf.expected | 22 ++++++++++++++
src/test/hotplug/tablet-disable.conf | 16 ++++++++++
src/test/hotplug/tablet-disable.conf.expected | 21 ++++++++++++++
src/test/hotplug/tablet-enable.conf | 17 +++++++++++
src/test/hotplug/tablet-enable.conf.expected | 21 ++++++++++++++
src/test/hotplug/usb-add-spice.conf | 17 +++++++++++
src/test/hotplug/usb-add-spice.conf.expected | 23 +++++++++++++++
src/test/hotplug/usb-add.conf | 16 ++++++++++
src/test/hotplug/usb-add.conf.expected | 22 ++++++++++++++
src/test/hotplug/usb-remove-last.conf | 17 +++++++++++
.../hotplug/usb-remove-last.conf.expected | 21 ++++++++++++++
79 files changed, 1612 insertions(+)
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/agent-fstrim.conf.expected
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-too-many.conf.expected
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-bootdisk.conf.expected
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-skip-ide.conf.expected
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/fast-plug.conf.expected
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-hotplug-disabled.conf.expected
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 b539a6b7..35f118e6 100644
--- a/src/test/Makefile
+++ b/src/test/Makefile
@@ -12,6 +12,12 @@ test_cfg_to_cmd: run_config2command_tests.pl CommandLineMocks.pm cfg2cmd/*.conf
test_cfg_to_cmd_aarch64: run_config2command_tests.pl CommandLineMocks.pm cfg2cmd/aarch64/*.conf
perl -I../ ./run_config2command_tests.pl cfg2cmd/aarch64
+test_hotplug: run_hotplug_tests.pl CommandLineMocks.pm hotplug/*.conf
+ perl -I../ ./run_hotplug_tests.pl
+
+test_hotplug_aarch64: run_hotplug_tests.pl CommandLineMocks.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..b25f9a70
--- /dev/null
+++ b/src/test/hotplug/aarch64/disk-add-default-machine.conf.expected
@@ -0,0 +1,28 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..f5bc17fa
--- /dev/null
+++ b/src/test/hotplug/aarch64/disk-add-virtio.conf.expected
@@ -0,0 +1,29 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..cc3fef58
--- /dev/null
+++ b/src/test/hotplug/aarch64/net-add-pci-bridge.conf.expected
@@ -0,0 +1,28 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+net6: virtio=BA:DC:0F:FE:E0:06,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
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..6a158151
--- /dev/null
+++ b/src/test/hotplug/aarch64/net-add.conf.expected
@@ -0,0 +1,28 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0,firewall=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
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..5c3343a0
--- /dev/null
+++ b/src/test/hotplug/aarch64/tablet-disable.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+hmp device_del tablet
+hmp device_del keyboard
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+tablet: 0
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..371a021f
--- /dev/null
+++ b/src/test/hotplug/aarch64/x86-guest-net-add.conf.expected
@@ -0,0 +1,26 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+net1: virtio=BA:DC:0F:FE:E0:01,bridge=vmbr0,firewall=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
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/agent-fstrim.conf.expected b/src/test/hotplug/agent-fstrim.conf.expected
new file mode 100644
index 00000000..bd524a22
--- /dev/null
+++ b/src/test/hotplug/agent-fstrim.conf.expected
@@ -0,0 +1,20 @@
+# recorded actions
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+agent: 1,fstrim_cloned_disks=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
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..ff29f4d3
--- /dev/null
+++ b/src/test/hotplug/balloon.conf.expected
@@ -0,0 +1,22 @@
+# recorded actions
+qmp balloon {"value":536870912}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+balloon: 512
+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
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..52e53550
--- /dev/null
+++ b/src/test/hotplug/cdrom-eject.conf.expected
@@ -0,0 +1,24 @@
+# recorded actions
+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"}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+ide2: none,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
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..aedc6656
--- /dev/null
+++ b/src/test/hotplug/cpu-add-too-many.conf
@@ -0,0 +1,18 @@
+# TEST: hotplugging more vCPUs than the configured maximum fails
+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-too-many.conf.expected b/src/test/hotplug/cpu-add-too-many.conf.expected
new file mode 100644
index 00000000..c1fa1f96
--- /dev/null
+++ b/src/test/hotplug/cpu-add-too-many.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+
+# hotplug errors
+vcpus: hotplug problem - you can't add more vcpus than maxcpus
+
+# differences to a freshly started VM
+
+# resulting config
+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..4ea0a98c
--- /dev/null
+++ b/src/test/hotplug/cpu-add.conf.expected
@@ -0,0 +1,23 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..fd548448
--- /dev/null
+++ b/src/test/hotplug/cpu-remove.conf.expected
@@ -0,0 +1,23 @@
+# recorded actions
+hmp device_del cpu4
+hmp device_del cpu3
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..2dc5b68e
--- /dev/null
+++ b/src/test/hotplug/cpulimit.conf.expected
@@ -0,0 +1,21 @@
+# recorded actions
+cgroup change_cpu_quota [200,null]
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+cpulimit: 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
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..1edb018f
--- /dev/null
+++ b/src/test/hotplug/disk-add-default-machine.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+virtio1: local:8006/vm-8006-disk-1.qcow2,iothread=1,size=32G
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..9a949342
--- /dev/null
+++ b/src/test/hotplug/disk-add-legacy-drive.conf.expected
@@ -0,0 +1,23 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+virtio1: local:8006/vm-8006-disk-1.qcow2,size=32G
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..e6d2a7b8
--- /dev/null
+++ b/src/test/hotplug/disk-add-scsi-single.conf.expected
@@ -0,0 +1,27 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..3b5999fb
--- /dev/null
+++ b/src/test/hotplug/disk-add-virtio.conf.expected
@@ -0,0 +1,26 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
diff --git a/src/test/hotplug/disk-remove-bootdisk.conf b/src/test/hotplug/disk-remove-bootdisk.conf
new file mode 100644
index 00000000..b44c9a94
--- /dev/null
+++ b/src/test/hotplug/disk-remove-bootdisk.conf
@@ -0,0 +1,16 @@
+# TEST: the boot disk cannot be hot-unplugged
+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-bootdisk.conf.expected b/src/test/hotplug/disk-remove-bootdisk.conf.expected
new file mode 100644
index 00000000..0d2a30d0
--- /dev/null
+++ b/src/test/hotplug/disk-remove-bootdisk.conf.expected
@@ -0,0 +1,23 @@
+# recorded actions
+
+# hotplug errors
+scsi0: hotplug problem - can't unplug bootdisk 'scsi0'
+
+# differences to a freshly started VM
+
+# resulting config
+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..9eddc8ba
--- /dev/null
+++ b/src/test/hotplug/disk-remove-busy.conf
@@ -0,0 +1,18 @@
+# TEST: a disk that is not released by the guest stays in the config
+# FAIL_DEVICE_DEL: virtio1
+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..3fc32469
--- /dev/null
+++ b/src/test/hotplug/disk-remove-busy.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+hmp device_del virtio1
+
+# hotplug errors
+virtio1: hotplug problem - error on hot-unplugging device 'virtio1' - still busy in guest?
+
+# differences to a freshly started VM
+
+# resulting config
+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-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..c9c39d05
--- /dev/null
+++ b/src/test/hotplug/disk-remove-scsi-single.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+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"}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+unused0: local:8006/vm-8006-disk-1.qcow2
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..c0f37833
--- /dev/null
+++ b/src/test/hotplug/disk-remove-virtio.conf.expected
@@ -0,0 +1,24 @@
+# recorded actions
+hmp device_del virtio1
+qmp blockdev-del {"node-name":"drive-virtio1"}
+qmp object-del {"id":"throttle-drive-virtio1"}
+qmp object-del {"id":"iothread-virtio1"}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+unused0: local:8006/vm-8006-disk-1.qcow2
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
diff --git a/src/test/hotplug/disk-skip-ide.conf b/src/test/hotplug/disk-skip-ide.conf
new file mode 100644
index 00000000..11f2db6a
--- /dev/null
+++ b/src/test/hotplug/disk-skip-ide.conf
@@ -0,0 +1,16 @@
+# TEST: IDE disks cannot be hotplugged and stay pending
+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-skip-ide.conf.expected b/src/test/hotplug/disk-skip-ide.conf.expected
new file mode 100644
index 00000000..bf63ca34
--- /dev/null
+++ b/src/test/hotplug/disk-skip-ide.conf.expected
@@ -0,0 +1,22 @@
+# recorded actions
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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..d0f3be00
--- /dev/null
+++ b/src/test/hotplug/disk-throttle.conf.expected
@@ -0,0 +1,20 @@
+# recorded actions
+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}}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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,mbps_rd=50,size=32G
+scsihw: virtio-scsi-pci
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
+sockets: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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/fast-plug.conf.expected b/src/test/hotplug/fast-plug.conf.expected
new file mode 100644
index 00000000..3abf55ae
--- /dev/null
+++ b/src/test/hotplug/fast-plug.conf.expected
@@ -0,0 +1,20 @@
+# recorded actions
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: renamed
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+onboot: 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
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..45e80f02
--- /dev/null
+++ b/src/test/hotplug/memory-add.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..be3784c2
--- /dev/null
+++ b/src/test/hotplug/memory-remove.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+hmp device_del dimm3
+qmp object-del {"id":"mem-dimm3"}
+hmp device_del dimm2
+qmp object-del {"id":"mem-dimm2"}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
diff --git a/src/test/hotplug/net-add-fail.conf b/src/test/hotplug/net-add-fail.conf
new file mode 100644
index 00000000..49ddcdc7
--- /dev/null
+++ b/src/test/hotplug/net-add-fail.conf
@@ -0,0 +1,17 @@
+# TEST: a network device that does not show up after hotplug is cleaned up again
+# FAIL_DEVICE_ADD: net1
+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..53133dc8
--- /dev/null
+++ b/src/test/hotplug/net-add-fail.conf.expected
@@ -0,0 +1,28 @@
+# recorded actions
+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"}
+
+# hotplug errors
+net1: hotplug problem - error on hotplug device 'net1'
+
+# differences to a freshly started VM
+
+# resulting config
+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-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..d38c03b8
--- /dev/null
+++ b/src/test/hotplug/net-add-pci-bridge.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0
+net6: virtio=BA:DC:0F:FE:E0:06,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
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..386e4e23
--- /dev/null
+++ b/src/test/hotplug/net-add.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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,firewall=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
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..f1b3acf1
--- /dev/null
+++ b/src/test/hotplug/net-change-bridge.conf.expected
@@ -0,0 +1,25 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr1,tag=100
+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
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..fc7b70bd
--- /dev/null
+++ b/src/test/hotplug/net-change-model.conf.expected
@@ -0,0 +1,27 @@
+# recorded actions
+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}
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: e1000=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
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..321b00d3
--- /dev/null
+++ b/src/test/hotplug/net-change-rate.conf.expected
@@ -0,0 +1,20 @@
+# recorded actions
+net tap_rate_limit ["tap8006i0","10"]
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+bootdisk: scsi0
+cores: 2
+machine: pc-i440fx-10.1
+memory: 2048
+name: hotplug
+net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0,rate=10
+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
diff --git a/src/test/hotplug/net-hotplug-disabled.conf b/src/test/hotplug/net-hotplug-disabled.conf
new file mode 100644
index 00000000..63b902b9
--- /dev/null
+++ b/src/test/hotplug/net-hotplug-disabled.conf
@@ -0,0 +1,17 @@
+# TEST: a new network device stays pending if network hotplug is disabled
+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-hotplug-disabled.conf.expected b/src/test/hotplug/net-hotplug-disabled.conf.expected
new file mode 100644
index 00000000..2dcf7663
--- /dev/null
+++ b/src/test/hotplug/net-hotplug-disabled.conf.expected
@@ -0,0 +1,23 @@
+# recorded actions
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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..272cc599
--- /dev/null
+++ b/src/test/hotplug/net-remove.conf.expected
@@ -0,0 +1,22 @@
+# recorded actions
+hmp device_del net1
+qmp netdev_del {"id":"net1"}
+sdn del_ips_from_mac ["vmbr0","BA:DC:0F:FE:E0:01","hotplug"]
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..50f7ac74
--- /dev/null
+++ b/src/test/hotplug/tablet-disable.conf.expected
@@ -0,0 +1,21 @@
+# recorded actions
+hmp device_del tablet
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..351ba809
--- /dev/null
+++ b/src/test/hotplug/tablet-enable.conf.expected
@@ -0,0 +1,21 @@
+# recorded actions
+hmp device_add driver=usb-tablet,id=tablet,bus=uhci.0,port=1
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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: 1
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..95741e24
--- /dev/null
+++ b/src/test/hotplug/usb-add-spice.conf.expected
@@ -0,0 +1,23 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
+usb1: spice
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
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..1c0d1df3
--- /dev/null
+++ b/src/test/hotplug/usb-add.conf.expected
@@ -0,0 +1,22 @@
+# recorded actions
+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
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
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..6092052a
--- /dev/null
+++ b/src/test/hotplug/usb-remove-last.conf.expected
@@ -0,0 +1,21 @@
+# recorded actions
+hmp device_del usb0
+hmp device_del xhci
+
+# hotplug errors
+
+# differences to a freshly started VM
+
+# resulting config
+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
--
2.47.3
next prev parent reply other threads:[~2026-09-10 11:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 11:00 [PATCH qemu-server 0/6] add hotplug tests and fix uncovered bugs Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 1/6] tests: hotplug: add initial hotplug test harness Dominik Csapak
2026-09-10 14:24 ` Fiona Ebner
2026-09-10 11:00 ` Dominik Csapak [this message]
2026-09-10 14:24 ` [PATCH qemu-server 2/6] tests: hotplug: add some test cases Fiona Ebner
2026-09-10 11:00 ` [PATCH qemu-server 3/6] tests: hotplug: add cases for known defects Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 4/6] tests: hotplug: add test case for adding scsi14 on qemu 11.1 Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 5/6] hotplug: fix vm_deviceplug call for 'tablet' and 'keyboard' on aarch64 Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 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=20260910110832.2822954-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox