[pve-devel] [PATCH v2 container] lxc start: warn in case of conflicting lxc.idmap entries

Friedrich Weber f.weber at proxmox.com
Fri May 12 11:58:24 CEST 2023


Thanks for the review!

On 12/05/2023 11:19, Wolfgang Bumiller wrote:
>>     So to report *all* conflicts, we'd need an algorithm that keeps track
>>     of all currently active intervals while iterating. I'm open for
> 
> ^ Only the end really.

I think you're right, we only need to track the endpoints of all
currently active intervals.

>>     implementing this, but in my opinion, the algorithm in this patch is
>>     good enough to be helpful, and since it's nicer to keep things simple,
>>     I'd keep that one. What do you think?
> 
> Yeah, given that we don't know the user's actual intention anyway, this
> really doesn't matter and the current implementation is fine.

Sounds good!

>> +sub validate_id_maps {
>> +    my ($id_map) = @_;
>> +
>> +    # $mappings->{$type}{$side} = [ { line => $line, start => $start, count => $count }, ... ]
> 
> ^ we always use arrows there: {$type}->{$side}
> 
> Basically, we always strictly separate with arrows. Old code might have
> some mixed prefix-derefs, but there shouldn't be any code using
> consecutive `{x}{y}` style dereferencing.

Makes sense. I'll send a v3 to rewrite all {x}{y} to {x}->{y}.






More information about the pve-devel mailing list