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 <d.csapak@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2025-03-11 14:20:45 +01:00 committed by Thomas Lamprecht
parent 4a9d773711
commit 8c6b0569ea
2 changed files with 5 additions and 1 deletions

View File

@ -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',

View File

@ -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