From: Filip Schauer <f.schauer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH vma-to-pbs 3/4] replace hard coded values with constants
Date: Wed, 24 Jul 2024 18:18:55 +0200 [thread overview]
Message-ID: <20240724161856.398271-4-f.schauer@proxmox.com> (raw)
In-Reply-To: <20240724161856.398271-1-f.schauer@proxmox.com>
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 {
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-07-24 16:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 16:18 [pbs-devel] [PATCH vma-to-pbs 0/4] add support for bulk import of a dump directory Filip Schauer
2024-07-24 16:18 ` [pbs-devel] [PATCH vma-to-pbs 1/4] bump proxmox-sys Filip Schauer
2024-09-04 9:24 ` [pbs-devel] applied: " Fabian Grünbichler
2024-07-24 16:18 ` [pbs-devel] [PATCH vma-to-pbs 2/4] add support for bulk import of a dump directory Filip Schauer
2024-09-04 9:14 ` Fabian Grünbichler
2024-10-08 14:36 ` Filip Schauer
2024-10-14 7:27 ` Fabian Grünbichler
2024-10-14 10:05 ` Filip Schauer
2024-07-24 16:18 ` Filip Schauer [this message]
2024-09-04 9:16 ` [pbs-devel] [PATCH vma-to-pbs 3/4] replace hard coded values with constants Fabian Grünbichler
2024-07-24 16:18 ` [pbs-devel] [PATCH vma-to-pbs 4/4] improve readability of stdout Filip Schauer
2024-09-04 9:18 ` Fabian Grünbichler
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=20240724161856.398271-4-f.schauer@proxmox.com \
--to=f.schauer@proxmox.com \
--cc=pbs-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.