From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B026B1FF17A for ; Tue, 9 Dec 2025 13:17:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0E8B927047; Tue, 9 Dec 2025 13:18:33 +0100 (CET) Mime-Version: 1.0 Date: Tue, 09 Dec 2025 13:17:59 +0100 Message-Id: From: "Christoph Heiss" To: "Lukas Wagner" X-Mailer: aerc 0.21.0 References: <20251205112528.373387-1-c.heiss@proxmox.com> <20251205112528.373387-6-c.heiss@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1765282674060 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lib.rs, rust-lang.github.io] Subject: Re: [pdm-devel] [PATCH proxmox v2 05/14] installer-types: add common types used by the installer X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Cc: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" 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