From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B1AC71FF0AF for ; Thu, 10 Sep 2026 13:09:11 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CC67B216C4; Thu, 10 Sep 2026 13:08:39 +0200 (CEST) From: Dominik Csapak 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 Message-ID: <20260910110832.2822954-6-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260910110832.2822954-1-d.csapak@proxmox.com> References: <20260910110832.2822954-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.481 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: MWO3SS5D2ZUILAXF4CEMQCJZE3AXTZND X-Message-ID-Hash: MWO3SS5D2ZUILAXF4CEMQCJZE3AXTZND 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 ++++++++++++------ .../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