Re: [PATCH perl-rs v3 13/40] pve-rs: resource-scheduling: use generic usage implementation

Dominik Rusovac
2026-03-31T07:40:41Z

lgtm, consider this

On Mon Mar 30, 2026 at 4:30 PM CEST, Daniel Kral wrote:
> The proxmox_resource_scheduling crate provides a generic usage
> implementation, which is backwards compatible with the pve_static
> bindings. This reduces the static resource scheduling bindings to a
> slightly thinner wrapper.
>
> This also exposes the new `add_resource(...)` binding, which allows
> callers to add services with additional state other than the usage
> stats. It is exposed as `add_service(...)` to be consistent with the
> naming of the rest of the existing methods.
>
> Where it is sensible for the bindings, the documentation is extended
> with a link to the documentation of the underlying methods.
>
> Signed-off-by: Daniel Kral <d.kral@proxmox.com>
> ---
> changes v2 -> v3:
> - require callers to handle the `current_node` not set invariant
> themselves, as this is pve-ha-manager-specific behavior and simplifies
> the logic a bit
> - s/FromInto/From/ for PveResource<T> impl
> - use kebab-case for (de)serialization of `PveResource<T>`
> - make node_stats closure variable mutable instead of shadowing it in
> the closure body again in StartedResourceAggregator::aggregate()
>

[snip]