Am 10.03.25 um 14:58 schrieb Dominik Csapak: > On 3/10/25 14:21, Fiona Ebner wrote: >> Am 10.03.25 um 13:52 schrieb Dominik Csapak: >>> hmm i can try that, but i have a question on how to handle some >>> situations: >>> >>> there are the following possibilities (if I didn't forget one): >>> * non-mapped hostpci device -> local resource >>> * mapped hostpci device with no live migration capabilities -> local >>> resource + mapped >> >> I'd only add it to local resources if $state is set too, i.e. if it is a >> live migration. If it's mapped and if it's an offline migration, don't >> add it. >> >>> * mapped hostpci device with live migration capabilities -> mapped only >>> >>> did I understand you correctly? >>> >> >> I.e. local resources should only contain the config keys that are actual >> blockers for the migration at hand, which differs when it's online or >> offline. > > > ok makes sense, did a quick test here, and it seems the UI handles it > already gracefully, > (we ignore the local_resources for mapped devices alread) but wouldn't > that be a 'breaking' change, > since we did return the devices in the 'local_resources' list until now? > > I'm not saying that the change would be bad, but the current description > and results would not > indicate to an api user that it's only for blocking migrations, as the > current description is > "List local resources e.g. pci, usb"
It comes down to arguing what "local" means in this context. One could argue that a mapped device is a logical abstraction over equivalent devices on multiple nodes and thus not local in that sense. Looking at the API endpoint naively, I would intuitively expect local_resources and mapped-resources to be disjoint. Regarding breakage, you do have a point. If a consumer is relying only on local_resources and not looking at the mappings, or using the keys from local resources to try to iterate over the mappings, the precondition check would be wrong in the case of missing mappings. IMHO we can go for this, as it's only the precondition check, migration will just fail later for such API consumers. We can make the description more precise, i.e. mention these are the local resources that cannot be migrated, do not include mapped resources and they can be different for offline vs. online. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel