public inbox for pve-devel@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 0/6] add hotplug tests and fix uncovered bugs
Date: Thu, 10 Sep 2026 13:00:27 +0200	[thread overview]
Message-ID: <20260910110832.2822954-1-d.csapak@proxmox.com> (raw)

Recently it was uncovered that hotplugging scsiX >= 14 does not work
in all situations. Inspired by this, this attempts to add some hotplug
regression tests by simulating the qmp/hmp environment, recording the
calls and testing against some invariants.

This uncovered two additional bugs in the hotplug code:
* hotplugging a tablet device into an aarch64 vm fails
* failure to hotplug a disk with iothreds leaves the iothread behind

The series first adds the harness + refactor of shared code from the
cfg2cmd tests, then adds some tests that behave ok, then adds some
tests that show some defect and finally it fixes the two mentioned bugs.

If wanted i can fix the bugs and add the relevant regression test in one
step, but this way it is much more visible how they fail.

Dominik Csapak (6):
  tests: hotplug: add initial hotplug test harness
  tests: hotplug: add some test cases
  tests: hotplug: add cases for known defects
  tests: hotplug: add test case for adding scsi14 on qemu 11.1
  hotplug: fix vm_deviceplug call for 'tablet' and 'keyboard' on aarch64
  hotplug: remove iothread if adding drive device failed

 src/PVE/QemuServer.pm                         |  29 +-
 src/test/CommandLineMocks.pm                  | 556 +++++++++++++
 src/test/Makefile                             |  12 +-
 .../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 +
 src/test/hotplug/aarch64/tablet-enable.conf   |  21 +
 .../aarch64/tablet-enable.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-fail.conf           |  17 +
 src/test/hotplug/disk-add-fail.conf.expected  |  32 +
 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-scsi14-old.conf     |  15 +
 .../hotplug/disk-add-scsi14-old.conf.expected |  23 +
 .../hotplug/disk-add-scsi14-qemu11.1.conf     |  15 +
 .../disk-add-scsi14-qemu11.1.conf.expected    |  24 +
 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 +
 src/test/run_config2command_tests.pl          | 552 +------------
 src/test/run_hotplug_tests.pl                 | 780 ++++++++++++++++++
 91 files changed, 3160 insertions(+), 547 deletions(-)
 create mode 100644 src/test/CommandLineMocks.pm
 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/tablet-enable.conf
 create mode 100644 src/test/hotplug/aarch64/tablet-enable.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-fail.conf
 create mode 100644 src/test/hotplug/disk-add-fail.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-scsi14-old.conf
 create mode 100644 src/test/hotplug/disk-add-scsi14-old.conf.expected
 create mode 100644 src/test/hotplug/disk-add-scsi14-qemu11.1.conf
 create mode 100644 src/test/hotplug/disk-add-scsi14-qemu11.1.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
 create mode 100644 src/test/run_hotplug_tests.pl

-- 
2.47.3





             reply	other threads:[~2026-09-10 11:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 11:00 Dominik Csapak [this message]
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 ` [PATCH qemu-server 2/6] tests: hotplug: add some test cases Dominik Csapak
2026-09-10 14:24   ` 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-1-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal