all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server v2 0/6]  add hotplug tests and fix uncovered bugs
Date: Mon, 14 Sep 2026 10:54:29 +0200	[thread overview]
Message-ID: <20260914085725.1299009-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.

changes from v1:
* harness: move shared test code to TestsCommon/, split out diff helper
  and use it in run_parse_config_tests.pl too
* harness: simplify expected output, only record actions
* harness: add EXPECTED_ERROR/STAYS_PENDING directives and fail tests
  on unexpected errors, differences or pending changes
* harness: die on unknown directives and unexpected config reloads
* harness: resolve machine aliases via windows_get_pinned_machine_version
* harness: model usb-redir chardev removal on unplug
* harness: refactor QMP mock error handling, renames, comment cleanups
* tests: move disk-add-fail into the iothread fix, add scsi-single-fail
* tests: drop obsolete EXPECTED_ERROR from aarch64/tablet-enable
* tests: reorder scsi14 patches, reword known defects commit message
* iothread fix: mention virtio-scsi-single in commit message

Dominik Csapak (6):
  tests: hotplug: add initial hotplug test harness
  tests: hotplug: add some test cases
  tests: hotplug: add test case for adding scsi14 on qemu 11.1
  tests: hotplug: add cases for known defects
  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/Makefile                             |  16 +-
 src/test/TestsCommon/CommandLineMocks.pm      | 537 +++++++++++
 src/test/TestsCommon/Utils.pm                 |  31 +
 .../aarch64/disk-add-default-machine.conf     |  20 +
 .../disk-add-default-machine.conf.expected    |   6 +
 src/test/hotplug/aarch64/disk-add-virtio.conf |  20 +
 .../aarch64/disk-add-virtio.conf.expected     |   6 +
 .../hotplug/aarch64/net-add-pci-bridge.conf   |  20 +
 .../aarch64/net-add-pci-bridge.conf.expected  |   5 +
 src/test/hotplug/aarch64/net-add.conf         |  20 +
 .../hotplug/aarch64/net-add.conf.expected     |   5 +
 src/test/hotplug/aarch64/tablet-disable.conf  |  20 +
 .../aarch64/tablet-disable.conf.expected      |   2 +
 src/test/hotplug/aarch64/tablet-enable.conf   |  21 +
 .../aarch64/tablet-enable.conf.expected       |   2 +
 .../hotplug/aarch64/x86-guest-net-add.conf    |  18 +
 .../aarch64/x86-guest-net-add.conf.expected   |   5 +
 src/test/hotplug/agent-fstrim.conf            |  17 +
 src/test/hotplug/balloon.conf                 |  18 +
 src/test/hotplug/balloon.conf.expected        |   1 +
 src/test/hotplug/cdrom-eject.conf             |  17 +
 src/test/hotplug/cdrom-eject.conf.expected    |   4 +
 src/test/hotplug/cpu-add-too-many.conf        |  20 +
 src/test/hotplug/cpu-add.conf                 |  18 +
 src/test/hotplug/cpu-add.conf.expected        |   2 +
 src/test/hotplug/cpu-remove.conf              |  18 +
 src/test/hotplug/cpu-remove.conf.expected     |   2 +
 src/test/hotplug/cpulimit.conf                |  16 +
 src/test/hotplug/cpulimit.conf.expected       |   1 +
 .../hotplug/disk-add-default-machine.conf     |  16 +
 .../disk-add-default-machine.conf.expected    |   6 +
 src/test/hotplug/disk-add-fail.conf           |  19 +
 src/test/hotplug/disk-add-fail.conf.expected  |   9 +
 src/test/hotplug/disk-add-legacy-drive.conf   |  16 +
 .../disk-add-legacy-drive.conf.expected       |   3 +
 .../hotplug/disk-add-scsi-single-fail.conf    |  19 +
 .../disk-add-scsi-single-fail.conf.expected   |   4 +
 src/test/hotplug/disk-add-scsi-single.conf    |  16 +
 .../disk-add-scsi-single.conf.expected        |   7 +
 src/test/hotplug/disk-add-scsi14-old.conf     |  17 +
 .../hotplug/disk-add-scsi14-old.conf.expected |   1 +
 .../hotplug/disk-add-scsi14-qemu11.1.conf     |  15 +
 .../disk-add-scsi14-qemu11.1.conf.expected    |   6 +
 src/test/hotplug/disk-add-virtio.conf         |  16 +
 .../hotplug/disk-add-virtio.conf.expected     |   6 +
 src/test/hotplug/disk-remove-bootdisk.conf    |  18 +
 src/test/hotplug/disk-remove-busy.conf        |  20 +
 .../hotplug/disk-remove-busy.conf.expected    |   1 +
 src/test/hotplug/disk-remove-scsi-single.conf |  17 +
 .../disk-remove-scsi-single.conf.expected     |   5 +
 src/test/hotplug/disk-remove-virtio.conf      |  17 +
 .../hotplug/disk-remove-virtio.conf.expected  |   4 +
 src/test/hotplug/disk-skip-ide.conf           |  17 +
 src/test/hotplug/disk-throttle.conf           |  16 +
 src/test/hotplug/disk-throttle.conf.expected  |   1 +
 src/test/hotplug/fast-plug.conf               |  17 +
 src/test/hotplug/memory-add.conf              |  18 +
 src/test/hotplug/memory-add.conf.expected     |   4 +
 src/test/hotplug/memory-remove.conf           |  18 +
 src/test/hotplug/memory-remove.conf.expected  |   4 +
 src/test/hotplug/net-add-fail.conf            |  19 +
 src/test/hotplug/net-add-fail.conf.expected   |   5 +
 src/test/hotplug/net-add-pci-bridge.conf      |  16 +
 .../hotplug/net-add-pci-bridge.conf.expected  |   5 +
 src/test/hotplug/net-add.conf                 |  16 +
 src/test/hotplug/net-add.conf.expected        |   5 +
 src/test/hotplug/net-change-bridge.conf       |  16 +
 .../hotplug/net-change-bridge.conf.expected   |   6 +
 src/test/hotplug/net-change-model.conf        |  16 +
 .../hotplug/net-change-model.conf.expected    |   8 +
 src/test/hotplug/net-change-rate.conf         |  16 +
 .../hotplug/net-change-rate.conf.expected     |   1 +
 src/test/hotplug/net-hotplug-disabled.conf    |  18 +
 src/test/hotplug/net-remove.conf              |  17 +
 src/test/hotplug/net-remove.conf.expected     |   3 +
 src/test/hotplug/tablet-disable.conf          |  16 +
 src/test/hotplug/tablet-disable.conf.expected |   1 +
 src/test/hotplug/tablet-enable.conf           |  17 +
 src/test/hotplug/tablet-enable.conf.expected  |   1 +
 src/test/hotplug/usb-add-spice.conf           |  17 +
 src/test/hotplug/usb-add-spice.conf.expected  |   2 +
 src/test/hotplug/usb-add.conf                 |  16 +
 src/test/hotplug/usb-add.conf.expected        |   2 +
 src/test/hotplug/usb-remove-last.conf         |  17 +
 .../hotplug/usb-remove-last.conf.expected     |   2 +
 src/test/run_config2command_tests.pl          | 553 +-----------
 src/test/run_hotplug_tests.pl                 | 833 ++++++++++++++++++
 src/test/run_parse_config_tests.pl            |  25 +-
 89 files changed, 2376 insertions(+), 563 deletions(-)
 create mode 100644 src/test/TestsCommon/CommandLineMocks.pm
 create mode 100644 src/test/TestsCommon/Utils.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/balloon.conf
 create mode 100644 src/test/hotplug/balloon.conf.expected
 create mode 100644 src/test/hotplug/cdrom-eject.conf
 create mode 100644 src/test/hotplug/cdrom-eject.conf.expected
 create mode 100644 src/test/hotplug/cpu-add-too-many.conf
 create mode 100644 src/test/hotplug/cpu-add.conf
 create mode 100644 src/test/hotplug/cpu-add.conf.expected
 create mode 100644 src/test/hotplug/cpu-remove.conf
 create mode 100644 src/test/hotplug/cpu-remove.conf.expected
 create mode 100644 src/test/hotplug/cpulimit.conf
 create mode 100644 src/test/hotplug/cpulimit.conf.expected
 create mode 100644 src/test/hotplug/disk-add-default-machine.conf
 create mode 100644 src/test/hotplug/disk-add-default-machine.conf.expected
 create mode 100644 src/test/hotplug/disk-add-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-fail.conf
 create mode 100644 src/test/hotplug/disk-add-scsi-single-fail.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-busy.conf
 create mode 100644 src/test/hotplug/disk-remove-busy.conf.expected
 create mode 100644 src/test/hotplug/disk-remove-scsi-single.conf
 create mode 100644 src/test/hotplug/disk-remove-scsi-single.conf.expected
 create mode 100644 src/test/hotplug/disk-remove-virtio.conf
 create mode 100644 src/test/hotplug/disk-remove-virtio.conf.expected
 create mode 100644 src/test/hotplug/disk-skip-ide.conf
 create mode 100644 src/test/hotplug/disk-throttle.conf
 create mode 100644 src/test/hotplug/disk-throttle.conf.expected
 create mode 100644 src/test/hotplug/fast-plug.conf
 create mode 100644 src/test/hotplug/memory-add.conf
 create mode 100644 src/test/hotplug/memory-add.conf.expected
 create mode 100644 src/test/hotplug/memory-remove.conf
 create mode 100644 src/test/hotplug/memory-remove.conf.expected
 create mode 100644 src/test/hotplug/net-add-fail.conf
 create mode 100644 src/test/hotplug/net-add-fail.conf.expected
 create mode 100644 src/test/hotplug/net-add-pci-bridge.conf
 create mode 100644 src/test/hotplug/net-add-pci-bridge.conf.expected
 create mode 100644 src/test/hotplug/net-add.conf
 create mode 100644 src/test/hotplug/net-add.conf.expected
 create mode 100644 src/test/hotplug/net-change-bridge.conf
 create mode 100644 src/test/hotplug/net-change-bridge.conf.expected
 create mode 100644 src/test/hotplug/net-change-model.conf
 create mode 100644 src/test/hotplug/net-change-model.conf.expected
 create mode 100644 src/test/hotplug/net-change-rate.conf
 create mode 100644 src/test/hotplug/net-change-rate.conf.expected
 create mode 100644 src/test/hotplug/net-hotplug-disabled.conf
 create mode 100644 src/test/hotplug/net-remove.conf
 create mode 100644 src/test/hotplug/net-remove.conf.expected
 create mode 100644 src/test/hotplug/tablet-disable.conf
 create mode 100644 src/test/hotplug/tablet-disable.conf.expected
 create mode 100644 src/test/hotplug/tablet-enable.conf
 create mode 100644 src/test/hotplug/tablet-enable.conf.expected
 create mode 100644 src/test/hotplug/usb-add-spice.conf
 create mode 100644 src/test/hotplug/usb-add-spice.conf.expected
 create mode 100644 src/test/hotplug/usb-add.conf
 create mode 100644 src/test/hotplug/usb-add.conf.expected
 create mode 100644 src/test/hotplug/usb-remove-last.conf
 create mode 100644 src/test/hotplug/usb-remove-last.conf.expected
 create mode 100644 src/test/run_hotplug_tests.pl

-- 
2.47.3





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

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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20260914085725.1299009-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal