From: Gabriel Goller <g.goller@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] Remove direct access to SectionConfigData<T> sections
Date: Mon, 14 Apr 2025 14:00:42 +0200 [thread overview]
Message-ID: <20250414120046.486853-1-g.goller@proxmox.com> (raw)
This patch series removes direct access to SectionConfigData<T>. Previously,
one could directly access and add sections by using DerefMut and the public
`sections` HashMap property. This created a significant risk of not updating
the `order` Vector, which maintains the section sequence to ensure consistent
read and write ordering.
To address this issue, this patch removes the DerefMut implementation and makes
both `sections` and `order` private. Read access remains available through the
Deref implementation for the `sections` HashMap, while write access is now
provided through newly introduced helper methods: `insert`, `remove`, and
`get_mut`.
This is a breaking change that affects multiple `SectionConfigData<T>` usages.
Since SectionConfigData<T> is primarily used in the proxmox-datacenter-manager,
all usages there have been updated accordingly.
A follow-up patch series is in preparation that will convert untyped
SectionConfigData to typed SectionConfigData<T>, which provides better
usability and eliminates the need for frequent serialization and
deserialization operations.
proxmox:
Gabriel Goller (3):
section-config: make write_section_config parameter more generic
section-config: remove DerefMut and make underlying HashMap private
section-config: add lookup and convert_to_typed_array helpers
proxmox-section-config/Cargo.toml | 3 +
proxmox-section-config/src/typed.rs | 189 ++++++++++++++++++++++++++--
2 files changed, 183 insertions(+), 9 deletions(-)
proxmox-datacenter-manager:
Gabriel Goller (1):
remotes: remove direct access on underlying sections HashMap
server/src/api/resources.rs | 2 +-
server/src/metric_collection/mod.rs | 8 ++++----
server/src/remote_tasks/mod.rs | 6 +++---
server/src/test_support/fake_remote.rs | 9 +++------
4 files changed, 11 insertions(+), 14 deletions(-)
Summary over all repositories:
6 files changed, 194 insertions(+), 23 deletions(-)
--
Generated by git-murpp 0.8.0
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next reply other threads:[~2025-04-14 12:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 12:00 Gabriel Goller [this message]
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox 1/3] section-config: make write_section_config parameter more generic Gabriel Goller
2025-04-15 6:44 ` Wolfgang Bumiller
2025-04-23 9:35 ` Gabriel Goller
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox 2/3] section-config: remove DerefMut and make underlying HashMap private Gabriel Goller
2025-04-15 8:29 ` Wolfgang Bumiller
2025-04-23 9:40 ` Gabriel Goller
2025-04-15 8:42 ` Wolfgang Bumiller
2025-04-23 9:44 ` Gabriel Goller
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox 3/3] section-config: add lookup and convert_to_typed_array helpers Gabriel Goller
2025-04-15 8:39 ` Wolfgang Bumiller
2025-04-23 10:00 ` Gabriel Goller
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] remotes: remove direct access on underlying sections HashMap Gabriel Goller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250414120046.486853-1-g.goller@proxmox.com \
--to=g.goller@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal