From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7D0BD9E198 for ; Mon, 27 Nov 2023 09:56:11 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5E8022A0A for ; Mon, 27 Nov 2023 09:56:11 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 27 Nov 2023 09:56:10 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7346344A29 for ; Mon, 27 Nov 2023 09:56:10 +0100 (CET) Message-ID: <329f626f-e78d-413f-9220-deed3621f7a7@proxmox.com> Date: Mon, 27 Nov 2023 09:56:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Gabriel Goller To: Thomas Lamprecht , Proxmox Backup Server development discussion , Lukas Wagner Reply-To: Proxmox Backup Server development discussion References: <20231124120228.180173-1-g.goller@proxmox.com> <59e58a82-a881-4b95-8f8d-45669bbb12e1@proxmox.com> In-Reply-To: <59e58a82-a881-4b95-8f8d-45669bbb12e1@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.218 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pbs-devel] [PATCH v2 proxmox{-backup, } 0/3] Add boot_mode, improve kernel version X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2023 08:56:11 -0000 On 11/27/23 09:41, Gabriel Goller wrote: > Thanks for the review! > > On 11/24/23 15:45, Thomas Lamprecht wrote: >> Thanks for patch and review to both, but IMO this is still differing >> to much >> from Proxmox VE's endpoint without any real justification? >> >> There the "boot-info" object with the required key "mode" and the >> optional >> "secureboot" entry, that explicitly de-couples the general mode from >> some >> mode-specific detail. >> >> The fitting rust struct (at least in sys) would be >> >> pub enum BootModeInformation { >>      /// The BootMode is EFI/UEFI, the boolean specifies if secure >> boot is enabled >>      Efi(bool), >>      /// The BootMode is Legacy BIOS >>      Bios, >> } >> >> >> or if one wants to be overly specific then something like: >> >> pub enum SecureBoot { >>      Enabled, >>      Disabled, >> } >> >> >> pub enum BootModeInformation { >>      /// The BootMode is EFI/UEFI >>      Efi(SecureBoot), >>      /// The BootMode is Legacy BIOS >>      Bios, >> } >> >> (but could be overkill) >> >> It's not a hard must to keep this the same for pve-manager and pbs, >> but IMO >> one should have very good reason for changing the format for relaying >> the >> exact same information between two products, such inconsistencies >> make it >> harder to interact with our API for any users, or external devs, and >> also >> won't make it easier to reuse widgets for the (current or future) UIs.. > Ok, I will implement this in v2. > I think I'll choose the second one with the specific enum for > `SecureBoot`. Will > be more clear what is means (without looking at comments) + won't use > more memory > than the bool version. > On a second note, I don't like this. We don't support enum variants (fields) with the `api` macro, so I would have to create a struct containing `mode` and `secureboot`. That again implies that bios + secureboot is possible, which is not. But I get your argument about consistency between products, so if we'd go that way, I'd send another patch with the requested changes...