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 v2 5/6] hotplug: fix vm_deviceplug call for 'tablet' and 'keyboard' on aarch64
Date: Mon, 14 Sep 2026 10:54:34 +0200	[thread overview]
Message-ID: <20260914085725.1299009-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260914085725.1299009-1-d.csapak@proxmox.com>

vm_deviceplug has a 'device' parameter between 'deviceid' and 'arch',
but this was overlooked at these two callsites. This means that the
calls would give the 'machine_type' as 'arch'. On x86 this is harmless,
but on aarch64 systems this produced wrong behavior.

Fix this by simply adding 'undef' as device, since it's not used in
those cases anyway.

Modify the relevant test that highlighted this problem.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/PVE/QemuServer.pm                          | 18 ++++++++++++------
 src/test/hotplug/aarch64/tablet-enable.conf    |  2 --
 .../aarch64/tablet-enable.conf.expected        |  3 ++-
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 759f7db2..13318198 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -4689,9 +4689,12 @@ sub vmconfig_hotplug_pending {
             } elsif ($opt eq 'tablet') {
                 die "skip\n" if !$hotplug_features->{usb};
                 if ($defaults->{tablet}) {
-                    vm_deviceplug($storecfg, $conf, $vmid, 'tablet', $arch, $machine_type);
-                    vm_deviceplug($storecfg, $conf, $vmid, 'keyboard', $arch, $machine_type)
-                        if $arch eq 'aarch64';
+                    vm_deviceplug(
+                        $storecfg, $conf, $vmid, 'tablet', undef, $arch, $machine_type,
+                    );
+                    vm_deviceplug(
+                        $storecfg, $conf, $vmid, 'keyboard', undef, $arch, $machine_type,
+                    ) if $arch eq 'aarch64';
                 } else {
                     vm_deviceunplug($vmid, $conf, 'tablet');
                     vm_deviceunplug($vmid, $conf, 'keyboard') if $arch eq 'aarch64';
@@ -4760,9 +4763,12 @@ sub vmconfig_hotplug_pending {
             } elsif ($opt eq 'tablet') {
                 die "skip\n" if !$hotplug_features->{usb};
                 if ($value == 1) {
-                    vm_deviceplug($storecfg, $conf, $vmid, 'tablet', $arch, $machine_type);
-                    vm_deviceplug($storecfg, $conf, $vmid, 'keyboard', $arch, $machine_type)
-                        if $arch eq 'aarch64';
+                    vm_deviceplug(
+                        $storecfg, $conf, $vmid, 'tablet', undef, $arch, $machine_type,
+                    );
+                    vm_deviceplug(
+                        $storecfg, $conf, $vmid, 'keyboard', undef, $arch, $machine_type,
+                    ) if $arch eq 'aarch64';
                 } elsif ($value == 0) {
                     vm_deviceunplug($vmid, $conf, 'tablet');
                     vm_deviceunplug($vmid, $conf, 'keyboard') if $arch eq 'aarch64';
diff --git a/src/test/hotplug/aarch64/tablet-enable.conf b/src/test/hotplug/aarch64/tablet-enable.conf
index 443cae77..bb523819 100644
--- a/src/test/hotplug/aarch64/tablet-enable.conf
+++ b/src/test/hotplug/aarch64/tablet-enable.conf
@@ -1,7 +1,5 @@
 # TEST: enabling the tablet device on aarch64 hotplugs tablet and keyboard
 # HOST_ARCH: aarch64
-# EXPECTED_ERROR: tablet: hotplug problem - Too few arguments for subroutine 'PVE::QemuServer::QMPHelpers::qemu_deviceadd' (got 1; expected 2)
-# STAYS_PENDING: 1
 arch: aarch64
 bios: ovmf
 bootdisk: scsi0
diff --git a/src/test/hotplug/aarch64/tablet-enable.conf.expected b/src/test/hotplug/aarch64/tablet-enable.conf.expected
index 800f9296..7200f76b 100644
--- a/src/test/hotplug/aarch64/tablet-enable.conf.expected
+++ b/src/test/hotplug/aarch64/tablet-enable.conf.expected
@@ -1 +1,2 @@
-hmp device_add driver=usb-tablet,id=tablet,bus=uhci.0,port=1
+hmp device_add driver=usb-tablet,id=tablet,bus=ehci.0,port=1
+hmp device_add driver=usb-kbd,id=keyboard,bus=ehci.0,port=2
-- 
2.47.3





  parent 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 [PATCH qemu-server v2 0/6] add hotplug tests and fix uncovered bugs Dominik Csapak
2026-09-14  8:54 ` [PATCH qemu-server v2 1/6] tests: hotplug: add initial hotplug test harness Dominik Csapak
2026-09-14  8:54 ` [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 ` Dominik Csapak [this message]
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-6-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