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 5/6] hotplug: fix vm_deviceplug call for 'tablet' and 'keyboard' on aarch64
Date: Thu, 10 Sep 2026 13:00:32 +0200	[thread overview]
Message-ID: <20260910110832.2822954-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260910110832.2822954-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 ++++++++++++------
 .../aarch64/tablet-enable.conf.expected        |  9 +++------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index cf46f635..34073ee8 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.expected b/src/test/hotplug/aarch64/tablet-enable.conf.expected
index 708c5432..3a195c2d 100644
--- a/src/test/hotplug/aarch64/tablet-enable.conf.expected
+++ b/src/test/hotplug/aarch64/tablet-enable.conf.expected
@@ -1,8 +1,8 @@
 # recorded actions
-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
 
 # hotplug errors
-tablet: hotplug problem - Too few arguments for subroutine 'PVE::QemuServer::QMPHelpers::qemu_deviceadd' (got 1; expected 2)
 
 # differences to a freshly started VM
 
@@ -21,8 +21,5 @@ 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
+vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
-- 
2.47.3





  parent 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 [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 ` [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 ` Dominik Csapak [this message]
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-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