From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pbs-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 4F03D1FF15C for <inbox@lore.proxmox.com>; Wed, 4 Sep 2024 11:16:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 71058166C2; Wed, 4 Sep 2024 11:17:19 +0200 (CEST) Date: Wed, 04 Sep 2024 11:16:42 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= <f.gruenbichler@proxmox.com> To: Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com> References: <20240724161856.398271-1-f.schauer@proxmox.com> <20240724161856.398271-4-f.schauer@proxmox.com> In-Reply-To: <20240724161856.398271-4-f.schauer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1725441266.nmi9ke7bkz.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.055 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 vma-to-pbs 3/4] replace hard coded values with constants X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion <pbs-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/> List-Post: <mailto:pbs-devel@lists.proxmox.com> List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" <pbs-devel-bounces@lists.proxmox.com> On July 24, 2024 6:18 pm, Filip Schauer wrote: > Signed-off-by: Filip Schauer <f.schauer@proxmox.com> > --- > src/vma.rs | 2 +- > src/vma2pbs.rs | 5 +++-- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/src/vma.rs b/src/vma.rs > index 518de8a..63ee3b5 100644 > --- a/src/vma.rs > +++ b/src/vma.rs > @@ -22,7 +22,7 @@ const VMA_MAX_CONFIGS: usize = 256; > > /// Maximum number of block devices > /// See VMA Header in pve-qemu.git/vma_spec.txt > -const VMA_MAX_DEVICES: usize = 256; > +pub const VMA_MAX_DEVICES: usize = 256; > > /// VMA magic string > /// See VMA Header in pve-qemu.git/vma_spec.txt > diff --git a/src/vma2pbs.rs b/src/vma2pbs.rs > index 3e9689d..5c0d03f 100644 > --- a/src/vma2pbs.rs > +++ b/src/vma2pbs.rs > @@ -175,11 +175,12 @@ where > fn register_block_devices<T>( > vma_reader: &VmaReader<T>, > pbs: *mut ProxmoxBackupHandle, > -) -> Result<[Option<BlockDeviceInfo>; 256], Error> > +) -> Result<[Option<BlockDeviceInfo>; VMA_MAX_DEVICES], Error> > where > T: Read, > { > - let mut block_device_infos: [Option<BlockDeviceInfo>; 256] = [None; 256]; > + let mut block_device_infos: [Option<BlockDeviceInfo>; VMA_MAX_DEVICES] = > + [None; VMA_MAX_DEVICES]; > let mut pbs_err: *mut c_char = ptr::null_mut(); > > for device_id in 0..255 { this range here is also derived from the constant value, and should probably be actually derived from it? there's another `take(255)` call in the same file further below where I guess the same applies as well.. > -- > 2.39.2 > > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel > > > _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel