[pdm-devel] [PATCH proxmox 1/1] pbs-api-types: extend datastore config by backend config parser helper

Christian Ebner c.ebner at proxmox.com
Tue Nov 4 15:49:02 CET 2025


Adds a helper method to `DataStoreConfig` which will facilitate the
parsing of the `DatastoreBackendConfig`.
This is required several times, so although logically trivial making
this a common helper is justified.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-api-types/src/datastore.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index a214ac25..97f530ee 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -630,6 +630,11 @@ impl DataStoreConfig {
 
         Ok(())
     }
+
+    /// Parse the datastore backend config from the datastore config
+    pub fn parse_backend_config(&self) -> Result<DatastoreBackendConfig, Error> {
+        self.backend.as_deref().unwrap_or_default().parse()
+    }
 }
 
 #[api(
-- 
2.47.3





More information about the pdm-devel mailing list