[pve-devel] [PATCH ha-manager 10/18] compile ha rules to a more compact representation

Michael Köppl m.koeppl at proxmox.com
Tue Sep 2 09:32:30 CEST 2025


On Fri Aug 29, 2025 at 3:42 PM CEST, Daniel Kral wrote:
>>> diff --git a/src/PVE/HA/Rules.pm b/src/PVE/HA/Rules.pm
>>> index a075feac..d7593532 100644
>>> --- a/src/PVE/HA/Rules.pm
>>> +++ b/src/PVE/HA/Rules.pm
>>> @@ -47,6 +47,12 @@ Each I<rule plugin> is required to implement the methods C<L<type()>>,
>>>  C<L<properties()>>, and C<L<options>> from the C<L<PVE::SectionConfig>> to
>>>  extend the properties of this I<base plugin> with plugin-specific properties.
>>>  
>>> +Each I<rule plugin> is required to implement the method
>>> +C<L<< plugin_compile()|/$class->plugin_compile(...) >>> to distill a compiled
>>> +representation of the more verbose C<$rules> from the config file, which is
>>> +returned by C<L<< compile()|/$class->compile(...) >>> to be more appropriate
>>> +and efficient for the scheduler and other users.
>>
>> Is this supposed to say "other uses" or do you actually mean "other
>> users"? Do you mean that this more efficient representation can (and
>> probably should) be used for other uses cases when e.g. iterating over
>> only resource affinity rules?
>
> With "users" I meant other call sites that use the compiled rules
> instead of the rules. As the helpers were converted to using the
> compiled rules now too, many call sites are 'required' to use the
> compiled rules anyway to be able to use these rule helpers (e.g.
> get_node_affinity, get_affinitive_resources, ...).
>
> If there's a better term I'm happy to change it.

I see, thanks for the explanation. I mean maybe something like "and
other calling functions", but it might also just have been me. It does
make sense the way you explained it and I assumed that's what you meant,
but wanted to be sure.

>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list