From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 9F6691FF09B for ; Mon, 14 Sep 2026 10:57:50 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B8C6F215EB; Mon, 14 Sep 2026 10:57:32 +0200 (CEST) From: Dominik Csapak 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 Message-ID: <20260914085725.1299009-6-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260914085725.1299009-1-d.csapak@proxmox.com> References: <20260914085725.1299009-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.475 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: J4HUGE4ELYZH26UZDHY2F2VFLFSNRX4T X-Message-ID-Hash: J4HUGE4ELYZH26UZDHY2F2VFLFSNRX4T X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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