/// Create (or ensure that they have already been created) the subvolumes
/// required for a specific run of a native service.
Create (or ensure that they have already been created) the subvolumes
required for a specific run of a native service.
Create ( or ensure that they have already been created ) the subvolumes required for a specific run of a native service .
pub(crate) fn create(svc: &ServiceInstance) -> Result<Self> {
        let paths = svc.paths();
        // ensure that the persistent subvolumes exist, creating them if not
        Self::ensure_subvol_exists(paths.state())?;
        Self::ensure_subvol_exists(paths.cache())?;
        Self::ensure_subvol_exists(paths.logs())?;
        // root and runtime are ephemeral for each run of the native service, so
        // create them fresh
        let root_src = Subvolume::get(paths.root_source()).map_err(Error::Get)?;
        let mut root = root_src
            .snapshot(paths.root(), SnapshotFlags::RECURSIVE)
            .map_err(Error::RootSetup)?;
        root.set_readonly(false).map_err(Error::RootSetup)?;
        let runtime = Subvolume::create(paths.runtime()).map_err(Error::Create)?;
        Ok(Self { root, runtime })
    }
pub ( crate ) fn create ( svc : & ServiceInstance ) -> Result < Self > { let paths = svc . paths ( ) ; // ensure that the persistent subvolumes exist, creating them if not Self :: ensure_subvol_exists ( paths . state ( ) ) ? ; Self :: ensure_subvol_exists ( paths . cache ( ) ) ? ; Self :: ensure_subvol_exists ( paths . logs ( ) ) ? ; // root and runtime are ephemeral for each run of the native service, so // create them fresh let root_src = Subvolume :: get ( paths . root_source ( ) ) . map_err ( Error :: Get ) ? ; let mut root = root_src . snapshot ( paths . root ( ) , SnapshotFlags :: RECURSIVE ) . map_err ( Error :: RootSetup ) ? ; root . set_readonly ( false ) . map_err ( Error :: RootSetup ) ? ; let runtime = Subvolume :: create ( paths . runtime ( ) ) . map_err ( Error :: Create ) ? ; Ok ( Self { root , runtime } ) }
Create (or ensure that they have already been created) the subvolumes
required for a specific run of a native service.
Create ( or ensure that they have already been created ) the subvolumes required for a specific run of a native service .
svc
&ServiceInstance