[pve-devel] [PATCH guest-common 1/2] mapping: pci: add 'live-migration-capable' flag to mappings

Fiona Ebner f.ebner at proxmox.com
Wed Apr 10 12:09:32 CEST 2024


Am 02.04.24 um 11:30 schrieb Dominik Csapak:
>>> diff --git a/src/PVE/Mapping/PCI.pm b/src/PVE/Mapping/PCI.pm
>>> index 19ace98..0866175 100644
>>> --- a/src/PVE/Mapping/PCI.pm
>>> +++ b/src/PVE/Mapping/PCI.pm
>>> @@ -100,8 +100,16 @@ my $defaultData = {
>>>           maxLength => 4096,
>>>       },
>>>       mdev => {
>>> +        description => "Marks the device(s) as being capable of
>>> providing mediated devices.",
>>>           type => 'boolean',
>>>           optional => 1,
>>> +        default => 0,
>>> +    },
>>
>> Above should be its own patch. Most likely, I'm missing it, but where
>> exactly does the 'mdev' property from the mapping have an effect? Just
>> in the UI? At least telling from 'qm showcmd', the 'mdev' property for a
>> 'hostpciN' VM config entry will not be ignored even if the mapping has
>> 'mdev=0'. And it's also possible to run 'qm set 112 --hostpci0
>> mapping=bar,mdev=foo' without any warning if the mapping has 'mdev=0'.
>>
> 
> yeah sorry, i added that but overlooked it when adding the hunks...
> 
> AFAIR i intended to use the mdev property to safeguard the mapping
> like we do with the iommu groups, so when it changes, warn the user that
> the mapping changed (using it with mdevs wouldn't work anyway if that
> was set but the device wouldn't provide one)
> 
> aside from that, yes it currently only has effects on the gui,
> do we maybe want to make that stricter? (would be a breaking change imho)
> 

Maybe it's enough to mention in the description that the mdev property
from the hostpciN config will win? If we want to go one step further, we
could add warnings when mdev from the mapping and whether mdev in the
hostpciN is set do not agree. But the latter probably only makes sense
if we do want to enforce it at some point.

>>> +    'live-migration-capable' => {
>>> +        description => "Marks the device(s) as being able to be
>>> live-migrated (Experimental).",
>>
>> The bit about QEMU and the driver needing to support it should be
>> mentioned here.
>>
>>> +        type => 'boolean',
>>> +        optional => 1,
>>> +        default => 0,
>>>       },
>>>       map => {
>>>           type => 'array',
>>> @@ -123,6 +131,7 @@ sub options {
>>>       return {
>>>       description => { optional => 1 },
>>>       mdev => { optional => 1 },
>>> +    'live-migration-capable' => { optional => 1 },
>>>       map => {},
>>>       };
>>>   }
> 
> 




More information about the pve-devel mailing list