From 8c6b0569ea98fb6db6a673d1cffdf019e50a0d62 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 11 Mar 2025 14:20:45 +0100 Subject: [PATCH] migration blockers: allow mapped devices for *offline* migration Do not mark mapped devices as local resources for the offline migration case, there it's only relevant that they have a mapping configured on the target node, which is a different check. Signed-off-by: Dominik Csapak Tested-by: Christoph Heiss Signed-off-by: Thomas Lamprecht --- PVE/API2/Qemu.pm | 2 +- PVE/QemuServer.pm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 156b1c7b..e7b684d7 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -4665,7 +4665,7 @@ __PACKAGE__->register_method({ type => 'string', description => "A local resource", }, - description => "List local resources e.g. pci, usb" + description => "List local resources (e.g. pci, usb) that block migration." }, 'mapped-resources' => { type => 'array', diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index ffd5d56b..155432d3 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2517,6 +2517,10 @@ sub check_local_resources { if ($entry->{mapping}) { $add_missing_mapping->('pci', $k, $entry->{mapping}); push @$mapped_res, $k; + + # don't add mapped devices as blocker for offline migration but still iterate over + # all mappings above to collect on which nodes they are available. + next if !$state; } } # sockets are safe: they will recreated be on the target side post-migrate