public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-ve-rs v3 3/3] ve-config: add helper function to iterate over all nodes in all fabrics
Date: Tue, 26 Aug 2025 11:49:44 +0200	[thread overview]
Message-ID: <20250826095000.180173-4-g.goller@proxmox.com> (raw)
In-Reply-To: <20250826095000.180173-1-g.goller@proxmox.com>

Add helper function to iterate over all nodes in all fabrics. This is
especially useful e.g. when retrieving the stats as we need to find all
the fabrics on the current node (and their node config).

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 proxmox-ve-config/src/sdn/fabric/mod.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/proxmox-ve-config/src/sdn/fabric/mod.rs b/proxmox-ve-config/src/sdn/fabric/mod.rs
index 58a06f9423cb..677a30976297 100644
--- a/proxmox-ve-config/src/sdn/fabric/mod.rs
+++ b/proxmox-ve-config/src/sdn/fabric/mod.rs
@@ -618,6 +618,11 @@ impl FabricConfig {
             .ok_or_else(|| FabricConfigError::FabricDoesNotExist(id.to_string()))
     }
 
+    /// Get an iterator over all the nodes in all fabrics.
+    pub fn all_nodes(&self) -> impl Iterator<Item = (&NodeId, &Node)> + '_ {
+        self.values().flat_map(|entry| entry.nodes())
+    }
+
     /// Returns an iterator over mutable references to all [`FabricEntry`] in the config
     pub fn get_fabrics_mut(&mut self) -> impl Iterator<Item = &mut FabricEntry> {
         self.fabrics.values_mut()
-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-08-26  9:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  9:49 [pve-devel] [PATCH manager/network/proxmox{-ve-rs, -perl-rs} v3 00/13] Add fabric status view Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH proxmox-ve-rs v3 1/3] frr: make room for deserialization structs Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH proxmox-ve-rs v3 2/3] frr: add deserialization types for openfabric and ospf Gabriel Goller
2025-08-26  9:49 ` Gabriel Goller [this message]
2025-08-26  9:49 ` [pve-devel] [PATCH proxmox-perl-rs v3 1/4] pve: fabrics: update proxmox-frr import path Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH proxmox-perl-rs v3 2/4] fabrics: add function to get status of fabric Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH proxmox-perl-rs v3 3/4] fabrics: add function to get all routes distributed by the fabrics Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH proxmox-perl-rs v3 4/4] fabrics: add function to get all neighbors of the fabric Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH pve-network v3 1/3] fabrics: add fabrics status to SDN::status function Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH pve-network v3 2/3] fabrics: add api endpoint to return fabrics routes Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH pve-network v3 3/3] fabrics: add api endpoint to return fabric neighbors Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH pve-manager v3 1/3] pvestatd: add fabrics status to pvestatd Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH pve-manager v3 2/3] fabrics: add resource view for fabrics Gabriel Goller
2025-08-26  9:49 ` [pve-devel] [PATCH pve-manager v3 3/3] permissions: differentiate between zone and fabric paths Gabriel Goller
2025-09-04 11:42 ` [pve-devel] [PATCH manager/network/proxmox{-ve-rs, -perl-rs} v3 00/13] Add fabric status view Gabriel Goller

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=20250826095000.180173-4-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pve-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal