[pve-devel] [PATCH installer v4 09/12] auto-installer: udevinfo: introduce type alias for udev properties
Christoph Heiss
c.heiss at proxmox.com
Mon Nov 11 14:15:05 CET 2024
Makes handling & passing them around a bit more convenient. Will be used
in the upcoming proxmox-post-hook utility.
Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v3 -> v4:
* no changes
Changes v2 -> v3:
* new patch, split out from later patch
proxmox-auto-installer/src/udevinfo.rs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/proxmox-auto-installer/src/udevinfo.rs b/proxmox-auto-installer/src/udevinfo.rs
index a6b61b5..677f3f6 100644
--- a/proxmox-auto-installer/src/udevinfo.rs
+++ b/proxmox-auto-installer/src/udevinfo.rs
@@ -1,9 +1,11 @@
use serde::Deserialize;
use std::collections::BTreeMap;
+/// Uses a BTreeMap to have the keys sorted
+pub type UdevProperties = BTreeMap<String, String>;
+
#[derive(Clone, Deserialize, Debug)]
pub struct UdevInfo {
- // use BTreeMap to have keys sorted
- pub disks: BTreeMap<String, BTreeMap<String, String>>,
- pub nics: BTreeMap<String, BTreeMap<String, String>>,
+ pub disks: BTreeMap<String, UdevProperties>,
+ pub nics: BTreeMap<String, UdevProperties>,
}
--
2.47.0
More information about the pve-devel
mailing list