From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E6FDD1FF168 for ; Mon, 14 Oct 2024 15:43:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1F36D36276; Mon, 14 Oct 2024 15:43:37 +0200 (CEST) Date: Mon, 14 Oct 2024 15:43:01 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20240904141155.350454-1-h.laimer@proxmox.com> <20240904141155.350454-26-h.laimer@proxmox.com> In-Reply-To: <20240904141155.350454-26-h.laimer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1728912745.8tg2jjxrjy.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 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 Subject: Re: [pbs-devel] [PATCH proxmox-backup v12 25/26] node: disks: replace BASE_MOUNT_DIR with DATASTORE_MOUNT_DIR X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On September 4, 2024 4:11 pm, Hannes Laimer wrote: since they have the same value (this is important information!) > Signed-off-by: Hannes Laimer > --- > src/api2/node/disks/directory.rs | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/src/api2/node/disks/directory.rs b/src/api2/node/disks/directory.rs > index ed0bd03d..2525642d 100644 > --- a/src/api2/node/disks/directory.rs > +++ b/src/api2/node/disks/directory.rs > @@ -11,8 +11,8 @@ use proxmox_schema::api; > use proxmox_section_config::SectionConfigData; > > use pbs_api_types::{ > - DataStoreConfig, BLOCKDEVICE_NAME_SCHEMA, DATASTORE_SCHEMA, NODE_SCHEMA, PRIV_SYS_AUDIT, > - PRIV_SYS_MODIFY, UPID_SCHEMA, > + DataStoreConfig, BLOCKDEVICE_NAME_SCHEMA, DATASTORE_MOUNT_DIR, DATASTORE_SCHEMA, NODE_SCHEMA, > + PRIV_SYS_AUDIT, PRIV_SYS_MODIFY, UPID_SCHEMA, > }; > > use crate::tools::disks::{ > @@ -23,8 +23,6 @@ use crate::tools::systemd::{self, types::*}; > > use proxmox_rest_server::WorkerTask; > > -const BASE_MOUNT_DIR: &str = "/mnt/datastore/"; > - > #[api( > properties: { > "filesystem": { > @@ -91,7 +89,7 @@ pub fn list_datastore_mounts() -> Result, Error> { > > let name = data > .Where > - .strip_prefix(BASE_MOUNT_DIR) > + .strip_prefix(DATASTORE_MOUNT_DIR) > .unwrap_or(&data.Where) > .to_string(); > > @@ -230,7 +228,7 @@ pub fn create_datastore_disk( > return Ok(upid_str); > }; > > - let mount_point = format!("{}{}", BASE_MOUNT_DIR, &name); > + let mount_point = format!("{}/{}", DATASTORE_MOUNT_DIR, &name); > // check if the default path exists already. > // bail if it is not empty or another filesystem mounted on top > let default_path = std::path::PathBuf::from(&mount_point); > @@ -238,7 +236,7 @@ pub fn create_datastore_disk( > match std::fs::metadata(&default_path) { > Err(_) => {} // path does not exist > Ok(stat) => { > - let basedir_dev = std::fs::metadata(BASE_MOUNT_DIR)?.st_dev(); > + let basedir_dev = std::fs::metadata(DATASTORE_MOUNT_DIR)?.st_dev(); > if stat.st_dev() != basedir_dev { > bail!("path {default_path:?} already exists and is mountpoint"); > } > @@ -315,7 +313,7 @@ pub fn create_datastore_disk( > )] > /// Remove a Filesystem mounted under `/mnt/datastore/`. > pub fn delete_datastore_disk(name: String) -> Result<(), Error> { > - let path = format!("{}{}", BASE_MOUNT_DIR, name); > + let path = format!("{}/{}", DATASTORE_MOUNT_DIR, name); > // path of datastore cannot be changed > let (config, _) = pbs_config::datastore::config()?; > let datastores: Vec = config.convert_to_typed_array("datastore")?; > -- > 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