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 EFA2B1FF0AB for ; Wed, 07 Oct 2026 16:22:47 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 5C11621701; Wed, 07 Oct 2026 16:21:53 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v3 5/8] hotplug: fix hot unplugging tablet on aarch64 Date: Wed, 7 Oct 2026 16:17:57 +0200 Message-ID: <20261007142145.984970-6-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261007142145.984970-1-d.csapak@proxmox.com> References: <20261007142145.984970-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.381 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: SX4CPN77XNCLCMO3VECWH3R6FTG4X4QM X-Message-ID-Hash: SX4CPN77XNCLCMO3VECWH3R6FTG4X4QM 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: On aarch64 guests, a keyboard device is added in addition to a tablet device for `tablet: 1`. In contrast to the tablet device, this does not show up in the `query-mice` qmp call and neither in `query-pci`. It does show up in the `qom-list` call, but only usb(redirdev) devices are extracted there. This means that hot-unplugging a tablet device from an aarch64 vm leaves the keyboard device plugged in, resulting in a mismatch between such a running vm and a newly started one. This lets the live migration fail for such guests. To fix this, also extract `keyboard` devices out of `qom-list` and add a test case for this, which would have failed without the fix. Signed-off-by: Dominik Csapak --- src/PVE/QemuServer.pm | 2 +- src/test/hotplug/aarch64/tablet-disable.conf | 20 +++++++++++++++++++ .../aarch64/tablet-disable.conf.expected | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/test/hotplug/aarch64/tablet-disable.conf create mode 100644 src/test/hotplug/aarch64/tablet-disable.conf.expected diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 74772fdd..055f5d78 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -3864,7 +3864,7 @@ sub vm_devices_list { # qom-list path=/machine/peripheral my $resperipheral = mon_cmd($vmid, 'qom-list', path => '/machine/peripheral'); foreach my $per (@$resperipheral) { - if ($per->{name} =~ m/^usb(?:redirdev)?\d+$/) { + if ($per->{name} =~ m/^(?:usb(?:redirdev)?\d+|keyboard)$/) { $devices->{ $per->{name} } = 1; } } diff --git a/src/test/hotplug/aarch64/tablet-disable.conf b/src/test/hotplug/aarch64/tablet-disable.conf new file mode 100644 index 00000000..5dccd220 --- /dev/null +++ b/src/test/hotplug/aarch64/tablet-disable.conf @@ -0,0 +1,20 @@ +# TEST: disabling the tablet device on aarch64 also hot-unplugs the keyboard +# HOST_ARCH: aarch64 +arch: aarch64 +bios: ovmf +bootdisk: scsi0 +cores: 2 +efidisk0: local:8006/vm-8006-disk-2.qcow2,efitype=4m +machine: virt-10.1 +memory: 2048 +name: hotplug +net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0 +ostype: l26 +scsi0: local:8006/vm-8006-disk-0.qcow2,size=32G +scsihw: virtio-scsi-pci +smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465 +sockets: 1 +vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8 + +[PENDING] +tablet: 0 diff --git a/src/test/hotplug/aarch64/tablet-disable.conf.expected b/src/test/hotplug/aarch64/tablet-disable.conf.expected new file mode 100644 index 00000000..fc5a5751 --- /dev/null +++ b/src/test/hotplug/aarch64/tablet-disable.conf.expected @@ -0,0 +1,2 @@ +hmp device_del tablet +hmp device_del keyboard -- 2.47.3