diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs index 8032a190..316d9f97 100644 --- a/src/api2/config/datastore.rs +++ b/src/api2/config/datastore.rs @@ -54,11 +54,12 @@ pub(crate) fn do_create_datastore( _lock: std::fs::File, mut config: SectionConfigData, datastore: DataStoreConfig, + worker: Option<&dyn crate::task::TaskState>, ) -> Result<(), Error> { let path: PathBuf = datastore.path.clone().into(); let backup_user = crate::backup::backup_user()?; - let _store = ChunkStore::create(&datastore.name, path, backup_user.uid, backup_user.gid)?; + let _store = ChunkStore::create(&datastore.name, path, backup_user.uid, backup_user.gid, worker)?; config.set_data(&datastore.name, "datastore", &datastore)?; @@ -157,7 +158,7 @@ pub fn create_datastore( Some(datastore.name.to_string()), auth_id, false, - move |_worker| do_create_datastore(lock, config, datastore), + move |worker| do_create_datastore(lock, config, datastore, Some(&worker)), ) } diff --git a/src/api2/node/disks/directory.rs b/src/api2/node/disks/directory.rs index 829699ca..6f292177 100644 --- a/src/api2/node/disks/directory.rs +++ b/src/api2/node/disks/directory.rs @@ -190,7 +190,7 @@ pub fn create_datastore_disk( bail!("datastore '{}' already exists.", datastore.name); } - crate::api2::config::datastore::do_create_datastore(lock, config, datastore)?; + crate::api2::config::datastore::do_create_datastore(lock, config, datastore, Some(&worker))?; } Ok(()) diff --git a/src/api2/node/disks/zfs.rs b/src/api2/node/disks/zfs.rs index 75c53c83..89f72172 100644 --- a/src/api2/node/disks/zfs.rs +++ b/src/api2/node/disks/zfs.rs @@ -383,7 +383,7 @@ pub fn create_zpool( bail!("datastore '{}' already exists.", datastore.name); } - crate::api2::config::datastore::do_create_datastore(lock, config, datastore)?; + crate::api2::config::datastore::do_create_datastore(lock, config, datastore, Some(&worker))?; } Ok(()) diff --git a/src/backup/chunk_store.rs b/src/backup/chunk_store.rs index 31e8307c..e9cc3897 100644 --- a/src/backup/chunk_store.rs +++ b/src/backup/chunk_store.rs @@ -7,6 +7,7 @@ use std::os::unix::io::AsRawFd; use proxmox::tools::fs::{CreateOptions, create_path, create_dir}; +use crate::task_log; use crate::tools; use crate::api2::types::GarbageCollectionStatus; @@ -61,7 +62,7 @@ impl ChunkStore { chunk_dir } - pub fn create
(name: &str, path: P, uid: nix::unistd::Uid, gid: nix::unistd::Gid) -> Result (name: &str, path: P, uid: nix::unistd::Uid, gid: nix::unistd::Gid, worker: Option<&dyn TaskState>) -> Result