Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
LoopMountDetails Class Reference

Class that represents a single loop mount within a container. More...

#include <LoopMountDetails.h>

Collaboration diagram for LoopMountDetails:
Collaboration graph
[legend]

Public Member Functions

 LoopMountDetails (LoopMountDetails &)=delete
 
 LoopMountDetails (LoopMountDetails &&)=delete
 
 LoopMountDetails (const std::string &rootfsPath, const LoopMountProperties &mount, const uid_t &userId, const gid_t &groupId, const std::shared_ptr< DobbyRdkPluginUtils > &utils)
 
bool doLoopMount (const std::string &loopDevice)
 Performs the loop mount, this should be called prior to the container being runned. More...
 
bool onPreCreate ()
 Opens the data.img file and mounts it to temp location inside container. More...
 
bool setPermissions ()
 Sets permissions for container to access directories. More...
 
bool remountTempDirectory ()
 Mounts temp directory into desired one, then cleans old files. More...
 
bool cleanupTempDirectory ()
 Cleans up temp mount and directory. More...
 
bool removeNonPersistentImage ()
 Checks if image should be non persistent and if so remove it. More...
 

Private Member Functions

std::unique_ptr< RefCountFilegetRefCountFile ()
 Open the reference count file for the data.img file. More...
 

Private Attributes

std::string mMountPointInsideContainer
 
std::string mTempMountPointOutsideContainer
 
LoopMountProperties mMount
 
uid_t mUserId
 
gid_t mGroupId
 
const std::shared_ptr< DobbyRdkPluginUtilsmUtils
 

Friends

class Storage
 

Detailed Description

Class that represents a single loop mount within a container.

This class is only intended to be used internally by Storage plugin do not use from external code.

See also
Storage

Member Function Documentation

◆ cleanupTempDirectory()

bool LoopMountDetails::cleanupTempDirectory ( )

Cleans up temp mount and directory.

Returns
true on success, false on failure.

◆ doLoopMount()

bool LoopMountDetails::doLoopMount ( const std::string &  loopDevice)

Performs the loop mount, this should be called prior to the container being runned.

Parameters
[in]loopDeviceThe loop device to mount.
Returns
true on success, false on failure.

◆ getRefCountFile()

std::unique_ptr< RefCountFile > LoopMountDetails::getRefCountFile ( )
private

Open the reference count file for the data.img file.

Returns
unique_ptr to reference count file, nullptr on failure.

◆ onPreCreate()

bool LoopMountDetails::onPreCreate ( )

Opens the data.img file and mounts it to temp location inside container.

Returns
true on success, false on failure.

◆ remountTempDirectory()

bool LoopMountDetails::remountTempDirectory ( )

Mounts temp directory into desired one, then cleans old files.

Returns
true on success, false on failure.

◆ removeNonPersistentImage()

bool LoopMountDetails::removeNonPersistentImage ( )

Checks if image should be non persistent and if so remove it.

Returns
true on success, false on failure.

◆ setPermissions()

bool LoopMountDetails::setPermissions ( )

Sets permissions for container to access directories.

Returns
true on success, false on failure.

The documentation for this class was generated from the following files: