From a3235a6bb92a9a6eab0de0c3a98df9993027da99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 23 Mar 2026 13:56:21 +0100 Subject: [PATCH] ext/block: fix reporting which device is attached The get_device_attachments() function is supposed to handle devices of a specific VM, but it reported them from all the VMs. If there were devices with the same port_id but in different backend VMs, it could result in wrong device being reported as attached. This especially affected events about attach/detach, which can confuse devices widget. Fix it be actually checking what is the backend VM of a given device. Fixes QubesOS/qubes-issues#10803 --- qubes/ext/block.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qubes/ext/block.py b/qubes/ext/block.py index 913fd7b1c..37f024708 100644 --- a/qubes/ext/block.py +++ b/qubes/ext/block.py @@ -360,7 +360,9 @@ def get_device_attachments(vm_): info = _try_get_block_device_info(vm.app, disk) if not info: continue - _backend_domain, port_id = info + backend_domain, port_id = info + if backend_domain != vm_: + continue result[port_id] = vm return result