From: "Christoph Heiss" <c.heiss@proxmox.com>
To: "Lukas Wagner" <l.wagner@proxmox.com>
Cc: Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>
Subject: Re: [pdm-devel] [PATCH proxmox v2 05/14] installer-types: add common types used by the installer
Date: Tue, 09 Dec 2025 13:17:59 +0100 [thread overview]
Message-ID: <DETOHFO1TQSM.1HSO9D5KWF778@proxmox.com> (raw)
In-Reply-To: <DETL0SLUFSP2.3O6BHACW9S9HV@proxmox.com>
Thanks for the review!
On Tue Dec 9, 2025 at 10:35 AM CET, Lukas Wagner wrote:
> Some notes inline.
>
> On Fri Dec 5, 2025 at 12:25 PM CET, Christoph Heiss wrote:
[..]
>> diff --git a/proxmox-installer-types/src/lib.rs b/proxmox-installer-types/src/lib.rs
>> new file mode 100644
>> index 00000000..07927cb0
>> --- /dev/null
>> +++ b/proxmox-installer-types/src/lib.rs
>> @@ -0,0 +1,143 @@
[..]
>> +#[derive(Copy, Clone, Eq, Deserialize, PartialEq, Serialize)]
>> +#[serde(rename_all = "lowercase")]
>> +/// Whether the system boots using legacy BIOS or (U)EFI.
>> +pub enum BootType {
>> + /// System boots using legacy BIOS.
>> + Bios,
>> + /// System boots using (U)EFI.
>> + Efi,
>> +}
>
> We already have some very similar definitions in proxmox-node-status -
> not sure how easy it would be to consolidate the two types, since the
> serialized form might not be exactly the same. Maybe the installer could
> just use custom de/serializers and reuse the types from
> proxmox-node-status?
>
Seems sensible.
Looking at it, we actually have at least two instances of this type
already:
- proxmox_node_status::types::BootMode and
- proxmox_sys::boot_mode::BootMode
The latter one would be compatible, but otherwise custom de-/serializers
are of course always an option. I will deduplicate at least this one,
not to introduce yet another one.
(There's another instance of this enum in pbs-api-types, but it's an API
type definition with an "Unknown" variant, which doesn't really fit
here.)
>> +#[allow(clippy::upper_case_acronyms)]
>> +#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Serialize)]
>> +#[serde(rename_all = "lowercase")]
>> +/// The name of the product.
>> +pub enum ProxmoxProduct {
>> + /// Proxmox Virtual Environment
>> + PVE,
>> + /// Proxmox Backup Server
>> + PBS,
>> + /// Proxmox Mail Gateway
>> + PMG,
>> + /// Proxmox Datacenter Manager
>> + PDM,
>> +}
>
> I think we generally prefer regular UpperPascalCase, even for acronyms,
> as per the official Rust naming guide [1].
> So these should rather be Pve, Pbs, etc.
>
> [1] https://rust-lang.github.io/api-guidelines/naming.html
There were just moved from pve-installer, but might as well use the
chance and change it. Will rename them for v2.
>
>> +
>> +serde_plain::derive_fromstr_from_deserialize!(ProxmoxProduct);
>> +
>> +impl Display for ProxmoxProduct {
>> + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
>> + match self {
>> + Self::PVE => write!(f, "Proxmox Virtualization Environment"),
>
> Virtual Environment, not Virtualization Environment :)
Good catch, thanks!
>
>> + Self::PBS => write!(f, "Proxmox Backup Server"),
>> + Self::PMG => write!(f, "Proxmox Mail Gateway"),
>> + Self::PDM => write!(f, "Proxmox Datacenter Manager"),
>> + }
>> + }
>> +}
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-12-09 12:17 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-05 11:25 [pdm-devel] [PATCH proxmox/datacenter-manager v2 00/14] initial auto-installer integration Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 01/14] api-macro: allow $ in identifier name Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 02/14] network-types: move `Fqdn` type from proxmox-installer-common Christoph Heiss
2025-12-09 9:13 ` Lukas Wagner
2025-12-09 12:26 ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 03/14] network-types: implement api type for Fqdn Christoph Heiss
2025-12-09 9:13 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 04/14] network-types: add api wrapper type for std::net::IpAddr Christoph Heiss
2025-12-09 9:16 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 05/14] installer-types: add common types used by the installer Christoph Heiss
2025-12-09 9:35 ` Lukas Wagner
2025-12-09 12:17 ` Christoph Heiss [this message]
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 06/14] installer-types: add types used by the auto-installer Christoph Heiss
2025-12-09 9:44 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 07/14] installer-types: implement api type for all externally-used types Christoph Heiss
2025-12-09 9:52 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 08/14] api-types: add api types for auto-installer integration Christoph Heiss
2025-12-09 10:03 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 09/14] config: add auto-installer configuration module Christoph Heiss
2025-12-09 10:22 ` Lukas Wagner
2025-12-09 12:10 ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 10/14] acl: wire up new /system/auto-installation acl path Christoph Heiss
2025-12-09 10:23 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 11/14] server: api: add auto-installer integration module Christoph Heiss
2025-12-09 11:01 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 12/14] ui: auto-installer: add installations overview panel Christoph Heiss
2025-12-09 12:35 ` Lukas Wagner
2025-12-16 13:55 ` Christoph Heiss
2025-12-17 9:09 ` Lukas Wagner
2025-12-17 9:42 ` Thomas Lamprecht
2025-12-17 14:00 ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 13/14] ui: auto-installer: add prepared answer configuration panel Christoph Heiss
2025-12-09 13:01 ` Lukas Wagner
2025-12-16 14:28 ` Christoph Heiss
2025-12-16 14:57 ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 14/14] docs: add documentation for auto-installer integration Christoph Heiss
2025-12-09 13:12 ` Lukas Wagner
2025-12-05 11:53 ` [pdm-devel] [PATCH proxmox/datacenter-manager v2 00/14] initial " Thomas Lamprecht
2025-12-05 15:50 ` Christoph Heiss
2025-12-05 15:57 ` Thomas Lamprecht
2025-12-09 13:38 ` Lukas Wagner
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=DETOHFO1TQSM.1HSO9D5KWF778@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=l.wagner@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.