libstorage
Public Member Functions
storage::StorageInterface Class Reference

Abstract class defining the interface for libstorage. More...

#include <StorageInterface.h>

List of all members.

Public Member Functions

virtual void getContainers (deque< ContainerInfo > &infos)=0
virtual int getDiskInfo (const string &disk, DiskInfo &info)=0
virtual int getContDiskInfo (const string &disk, ContainerInfo &cinfo, DiskInfo &info)=0
virtual int getLvmVgInfo (const string &name, LvmVgInfo &info)=0
virtual int getContLvmVgInfo (const string &name, ContainerInfo &cinfo, LvmVgInfo &info)=0
virtual int getDmraidCoInfo (const string &name, DmraidCoInfo &info)=0
virtual int getContDmraidCoInfo (const string &name, ContainerInfo &cinfo, DmraidCoInfo &info)=0
virtual int getDmmultipathCoInfo (const string &name, DmmultipathCoInfo &info)=0
virtual int getContDmmultipathCoInfo (const string &name, ContainerInfo &cinfo, DmmultipathCoInfo &info)=0
virtual int getMdPartCoInfo (const string &name, MdPartCoInfo &info)=0
virtual int getContMdPartCoInfo (const string &name, ContainerInfo &cinfo, MdPartCoInfo &info)=0
virtual void setMultipathAutostart (MultipathAutostart multipath_autostart)=0
virtual MultipathAutostart getMultipathAutostart () const =0
virtual void getVolumes (deque< VolumeInfo > &infos)=0
virtual int getVolume (const string &device, VolumeInfo &info)=0
virtual int getPartitionInfo (const string &disk, deque< PartitionInfo > &plist)=0
virtual int getLvmLvInfo (const string &name, deque< LvmLvInfo > &plist)=0
virtual int getMdInfo (deque< MdInfo > &plist)=0
virtual int getMdPartInfo (const string &device, deque< MdPartInfo > &plist)=0
virtual int getNfsInfo (deque< NfsInfo > &plist)=0
virtual int getLoopInfo (deque< LoopInfo > &plist)=0
virtual int getDmInfo (deque< DmInfo > &plist)=0
virtual int getBtrfsInfo (deque< BtrfsInfo > &plist)=0
virtual int getTmpfsInfo (deque< TmpfsInfo > &plist)=0
virtual int getDmraidInfo (const string &name, deque< DmraidInfo > &plist)=0
virtual int getDmmultipathInfo (const string &name, deque< DmmultipathInfo > &plist)=0
virtual bool getFsCapabilities (FsType fstype, FsCapabilities &fscapabilities) const =0
virtual bool getDlabelCapabilities (const string &dlabel, DlabelCapabilities &dlabelcapabilities) const =0
virtual list< string > getAllUsedFs () const =0
virtual int createPartition (const string &disk, PartitionType type, const RegionInfo &cylRegion, string &SWIG_OUTPUT(device))=0
virtual int resizePartition (const string &device, unsigned long sizeCyl)=0
virtual int resizePartitionNoFs (const string &device, unsigned long sizeCyl)=0
virtual int updatePartitionArea (const string &device, const RegionInfo &cylRegion)=0
virtual int freeCylindersAroundPartition (const string &device, unsigned long &SWIG_OUTPUT(freeCylsBefore), unsigned long &SWIG_OUTPUT(freeCylsAfter))=0
virtual int nextFreePartition (const string &disk, PartitionType type, unsigned &SWIG_OUTPUT(nr), string &SWIG_OUTPUT(device))=0
virtual int createPartitionKb (const string &disk, PartitionType type, const RegionInfo &kRegion, string &SWIG_OUTPUT(device))=0
virtual int createPartitionAny (const string &disk, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual int createPartitionMax (const string &disk, PartitionType type, string &SWIG_OUTPUT(device))=0
virtual unsigned long long cylinderToKb (const string &disk, unsigned long sizeCyl)=0
virtual unsigned long kbToCylinder (const string &disk, unsigned long long sizeK)=0
virtual int removePartition (const string &partition)=0
virtual int changePartitionId (const string &partition, unsigned id)=0
virtual int forgetChangePartitionId (const string &partition)=0
virtual string getPartitionPrefix (const string &disk)=0
virtual string getPartitionName (const string &disk, int partition_no)=0
virtual int getUnusedPartitionSlots (const string &disk, list< PartitionSlotInfo > &slots)=0
virtual int destroyPartitionTable (const string &disk, const string &label)=0
virtual int initializeDisk (const string &disk, bool value)=0
virtual string defaultDiskLabel (const string &device)=0
virtual int changeFormatVolume (const string &device, bool format, FsType fs)=0
virtual int changeLabelVolume (const string &device, const string &label)=0
virtual int changeMkfsOptVolume (const string &device, const string &opts)=0
virtual int changeTunefsOptVolume (const string &device, const string &opts)=0
virtual int changeMountPoint (const string &device, const string &mount)=0
virtual int getMountPoint (const string &device, string &SWIG_OUTPUT(mount))=0
virtual int changeMountBy (const string &device, MountByType mby)=0
virtual int getMountBy (const string &device, MountByType &SWIG_OUTPUT(mby))=0
virtual int changeFstabOptions (const string &device, const string &options)=0
virtual int getFstabOptions (const string &device, string &SWIG_OUTPUT(options))=0
virtual int addFstabOptions (const string &device, const string &options)=0
virtual int removeFstabOptions (const string &device, const string &options)=0
virtual int setCryptPassword (const string &device, const string &pwd)=0
virtual int forgetCryptPassword (const string &device)=0
virtual int getCryptPassword (const string &device, string &SWIG_OUTPUT(pwd))=0
virtual int verifyCryptPassword (const string &device, const string &pwd, bool erase)=0
virtual bool needCryptPassword (const string &device)=0
virtual int setCrypt (const string &device, bool val)=0
virtual int setCryptType (const string &device, bool val, EncryptType typ)=0
virtual int getCrypt (const string &device, bool &SWIG_OUTPUT(val))=0
virtual int setIgnoreFstab (const string &device, bool val)=0
virtual int getIgnoreFstab (const string &device, bool &SWIG_OUTPUT(val))=0
virtual int changeDescText (const string &device, const string &txt)=0
virtual int addFstabEntry (const string &device, const string &mount, const string &vfs, const string &options, unsigned freq, unsigned passno)=0
virtual int resizeVolume (const string &device, unsigned long long newSizeK)=0
virtual int resizeVolumeNoFs (const string &device, unsigned long long newSizeK)=0
virtual int forgetResizeVolume (const string &device)=0
virtual void setRecursiveRemoval (bool val)=0
virtual bool getRecursiveRemoval () const =0
virtual int getRecursiveUsing (const list< string > &devices, bool itself, list< string > &using_devices)=0
virtual int getRecursiveUsedBy (const list< string > &devices, bool itself, list< string > &usedby_devices)=0
virtual void setZeroNewPartitions (bool val)=0
virtual bool getZeroNewPartitions () const =0
virtual void setPartitionAlignment (PartAlign val)=0
virtual PartAlign getPartitionAlignment () const =0
virtual void setDefaultMountBy (MountByType val)=0
virtual MountByType getDefaultMountBy () const =0
virtual void setDefaultFs (FsType val)=0
virtual FsType getDefaultFs () const =0
virtual void setDefaultSubvolName (const string &val)=0
virtual string getDefaultSubvolName () const =0
virtual bool getEfiBoot ()=0
virtual void setRootPrefix (const string &root)=0
virtual string getRootPrefix () const =0
virtual void setDetectMountedVolumes (bool val)=0
virtual bool getDetectMountedVolumes () const =0
virtual int removeVolume (const string &device)=0
virtual int createLvmVg (const string &name, unsigned long long peSizeK, bool lvm1, const deque< string > &devs)=0
virtual int removeLvmVg (const string &name)=0
virtual int extendLvmVg (const string &name, const deque< string > &devs)=0
virtual int shrinkLvmVg (const string &name, const deque< string > &devs)=0
virtual int createLvmLv (const string &vg, const string &name, unsigned long long sizeK, unsigned stripes, string &SWIG_OUTPUT(device))=0
virtual int removeLvmLvByDevice (const string &device)=0
virtual int removeLvmLv (const string &vg, const string &name)=0
virtual int changeLvStripeCount (const string &vg, const string &name, unsigned long stripes)=0
virtual int changeLvStripeSize (const string &vg, const string &name, unsigned long long stripeSizeK)=0
virtual int createLvmLvSnapshot (const string &vg, const string &origin, const string &name, unsigned long long cowSizeK, string &SWIG_OUTPUT(device))=0
virtual int removeLvmLvSnapshot (const string &vg, const string &name)=0
virtual int getLvmLvSnapshotStateInfo (const string &vg, const string &name, LvmLvSnapshotStateInfo &info)=0
virtual int createLvmLvPool (const string &vg, const string &name, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual int createLvmLvThin (const string &vg, const string &name, const string &pool, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual int changeLvChunkSize (const string &vg, const string &name, unsigned long long chunkSizeK)=0
virtual int nextFreeMd (unsigned &SWIG_OUTPUT(nr), string &SWIG_OUTPUT(device))=0
virtual int createMd (const string &name, MdType md_type, const list< string > &devices, const list< string > &spares)=0
virtual int createMdAny (MdType md_type, const list< string > &devices, const list< string > &spares, string &SWIG_OUTPUT(device))=0
virtual int removeMd (const string &name, bool destroySb)=0
virtual int extendMd (const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int updateMd (const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int shrinkMd (const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int changeMdType (const string &name, MdType md_type)=0
virtual int changeMdChunk (const string &name, unsigned long chunkSizeK)=0
virtual int changeMdParity (const string &name, MdParity ptype)=0
virtual int checkMd (const string &name)=0
virtual int getMdStateInfo (const string &name, MdStateInfo &info)=0
virtual int getMdPartCoStateInfo (const string &name, MdPartCoStateInfo &info)=0
virtual int computeMdSize (MdType md_type, const list< string > &devices, const list< string > &spares, unsigned long long &SWIG_OUTPUT(sizeK))=0
virtual list< int > getMdAllowedParity (MdType md_type, unsigned devnr)=0
virtual int removeMdPartCo (const string &name, bool destroySb)=0
virtual int addNfsDevice (const string &nfsDev, const string &opts, unsigned long long sizeK, const string &mp, bool nfs4)=0
virtual int checkNfsDevice (const string &nfsDev, const string &opts, bool nfs4, unsigned long long &SWIG_OUTPUT(sizeK))=0
virtual int createFileLoop (const string &lname, bool reuseExisting, unsigned long long sizeK, const string &mp, const string &pwd, string &SWIG_OUTPUT(device))=0
virtual int modifyFileLoop (const string &device, const string &lname, bool reuseExisting, unsigned long long sizeK)=0
virtual int removeFileLoop (const string &lname, bool removeFile)=0
virtual int removeDmraid (const string &name)=0
virtual bool existSubvolume (const string &device, const string &name)=0
virtual int createSubvolume (const string &device, const string &name)=0
virtual int removeSubvolume (const string &device, const string &name)=0
virtual int extendBtrfsVolume (const string &name, const deque< string > &devs)=0
virtual int shrinkBtrfsVolume (const string &name, const deque< string > &devs)=0
virtual int addTmpfsMount (const string &mp, const string &opts)=0
virtual int removeTmpfsMount (const string &mp)=0
virtual void getCommitInfos (list< CommitInfo > &infos) const =0
virtual const string & getLastAction () const =0
virtual const string & getExtendedErrorMessage () const =0
virtual void setCallbackProgressBar (CallbackProgressBar pfnc)=0
virtual CallbackProgressBar getCallbackProgressBar () const =0
virtual void setCallbackShowInstallInfo (CallbackShowInstallInfo pfnc)=0
virtual CallbackShowInstallInfo getCallbackShowInstallInfo () const =0
virtual void setCallbackInfoPopup (CallbackInfoPopup pfnc)=0
virtual CallbackInfoPopup getCallbackInfoPopup () const =0
virtual void setCallbackYesNoPopup (CallbackYesNoPopup pfnc)=0
virtual CallbackYesNoPopup getCallbackYesNoPopup () const =0
virtual void setCallbackCommitErrorPopup (CallbackCommitErrorPopup pfnc)=0
virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup () const =0
virtual void setCallbackPasswordPopup (CallbackPasswordPopup pfnc)=0
virtual CallbackPasswordPopup getCallbackPasswordPopup () const =0
virtual void setCacheChanges (bool cache)=0
virtual bool isCacheChanges () const =0
virtual int commit ()=0
virtual string getErrorString (int error) const =0
virtual int createBackupState (const string &name)=0
virtual int restoreBackupState (const string &name)=0
virtual bool checkBackupState (const string &name) const =0
virtual bool equalBackupStates (const string &lhs, const string &rhs, bool verbose_log) const =0
virtual int removeBackupState (const string &name)=0
virtual bool checkDeviceMounted (const string &device, list< string > &mps)=0
virtual bool umountDevice (const string &device)=0
virtual bool umountDeviceUns (const string &device, bool unsetup)=0
virtual bool mountDevice (const string &device, const string &mp)=0
virtual int activateEncryption (const string &device, bool on)=0
virtual bool mountDeviceOpts (const string &device, const string &mp, const string &opts)=0
virtual bool mountDeviceRo (const string &device, const string &mp, const string &opts)=0
virtual bool checkDmMapsTo (const string &device)=0
virtual void removeDmTableTo (const string &device)=0
virtual int renameCryptDm (const string &device, const string &new_name)=0
virtual bool getFreeInfo (const string &device, bool get_resize, ResizeInfo &resize_info, bool get_content, ContentInfo &content_info, bool use_cache)=0
virtual bool readFstab (const string &dir, deque< VolumeInfo > &infos)=0
virtual void activateHld (bool val)=0
virtual void activateMultipath (bool val)=0
virtual void rescanEverything ()=0
virtual bool rescanCryptedObjects ()=0
virtual void dumpObjectList ()=0
virtual void dumpCommitInfos () const =0
virtual int getContVolInfo (const string &dev, ContVolInfo &info)=0
virtual int setUserdata (const string &device, const map< string, string > &userdata)=0
virtual int getUserdata (const string &device, map< string, string > &userdata)=0

Detailed Description

Abstract class defining the interface for libstorage.


Member Function Documentation

virtual int storage::StorageInterface::activateEncryption ( const string &  device,
bool  on 
) [pure virtual]

Mount the given device and do what is necessary to access volume (e.g. do losetup if loop is set up)

The function mounts at once, /etc/fstab is unaffected

Parameters:
devicedevice name
onif true activate access to encrypted data, otherwise deactivate it
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::activateHld ( bool  val) [pure virtual]

Activate or deactivate higher level devices as MD, LVM, DM

Multipath is not activate by this function. Only use in instsys mode.

Parameters:
valflag if devices should be activated or deactivated
Returns:
bool if values could be successfully determined
virtual void storage::StorageInterface::activateMultipath ( bool  val) [pure virtual]

Activate or deactivate multipath

Only use in instsys mode.

Parameters:
valflag if multipath should be activated or deactivated
Returns:
bool if values could be successfully determined
virtual int storage::StorageInterface::addFstabEntry ( const string &  device,
const string &  mount,
const string &  vfs,
const string &  options,
unsigned  freq,
unsigned  passno 
) [pure virtual]

Adds the specified entry to /etc/fstab

This function does not cache the changes but writes them immediately.

Parameters:
devicename of volume, e.g. /dev/hda1
mountmount point, e.g. /home
vfsvirtual filesystem type, e.g. reiserfs or ext3
optionsfstab options e.g. noauto,user,sync
freqvalue for fifth fstab field
passnovalue for sixth fstab field
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::addFstabOptions ( const string &  device,
const string &  options 
) [pure virtual]

Add to the fstab options of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
optionsfstab options to add to already exiting options of the volume (e.g. noauto,user,sync). Multiple options are separated by ",".
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::addNfsDevice ( const string &  nfsDev,
const string &  opts,
unsigned long long  sizeK,
const string &  mp,
bool  nfs4 
) [pure virtual]

Add knowledge about existence of nfs device.

Parameters:
nfsDevname of nfs device
sizeKsize of the nfs device
optsmount options for nfs mount
mpmount point of the nfs device
nfs4use NFS4 for device
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::addTmpfsMount ( const string &  mp,
const string &  opts 
) [pure virtual]

Add new tmpfs filesystem

Parameters:
mpmount point for the tmpfs
optsmount options for tmpfs mount
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeDescText ( const string &  device,
const string &  txt 
) [pure virtual]

Sets the value of description text. This text will be returned together with the text returned by getCommitInfos().

Parameters:
devicename of volume, e.g. /dev/hda1
txtdescription text for this partition
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeFormatVolume ( const string &  device,
bool  format,
FsType  fs 
) [pure virtual]

Sets or unsets the format flag for the given volume.

Parameters:
devicename of volume, e.g. /dev/hda1
formatflag if format is set on or off
fstype of filesystem to create if format is true
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeFstabOptions ( const string &  device,
const string &  options 
) [pure virtual]

Changes the fstab options of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
optionsnew fstab options of the volume (e.g. noauto,user,sync). Multiple options are separated by ",". It is valid to set an empty fstab option.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeLabelVolume ( const string &  device,
const string &  label 
) [pure virtual]

Sets the value of the filesystem label.

Parameters:
devicename of volume, e.g. /dev/hda1
labelvalue of the label
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeLvChunkSize ( const string &  vg,
const string &  name,
unsigned long long  chunkSizeK 
) [pure virtual]

Change chunk size of a LVM pool or snapshot. This can only be before the volume is created on disk.

Parameters:
vgname of volume group
nameof thin pool or snapshot
chunkSizeKnew chunk size
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeLvStripeCount ( const string &  vg,
const string &  name,
unsigned long  stripes 
) [pure virtual]

Change stripe count of a LVM logical volume. This can only be before the volume is created on disk.

Parameters:
vgname of volume group
nameof logical volume
stripesnew stripe count of logical volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeLvStripeSize ( const string &  vg,
const string &  name,
unsigned long long  stripeSizeK 
) [pure virtual]

Change stripe size of a LVM logical volume. This can only be before the volume is created on disk.

Parameters:
vgname of volume group
nameof logical volume
stripeSizeKnew stripe size of logical volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeMdChunk ( const string &  name,
unsigned long  chunkSizeK 
) [pure virtual]

Change chunk size of a raid device. This can only be done before the raid is created on disk.

Parameters:
namename of software raid device (e.g. /dev/md0)
chunkSizeKnew chunk size of the software raid
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeMdParity ( const string &  name,
MdParity  ptype 
) [pure virtual]

Change parity of a raid device with raid type raid5, raid6 or raid10. This can only be done before the raid is created on disk.

Parameters:
namename of software raid device (e.g. /dev/md0)
ptypenew parity of the software raid
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeMdType ( const string &  name,
MdType  md_type 
) [pure virtual]

Change raid type of a raid device. This can only be done before the raid is created on disk.

Parameters:
namename of software raid device (e.g. /dev/md0)
md_typenew raid personality of the software raid
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeMkfsOptVolume ( const string &  device,
const string &  opts 
) [pure virtual]

Sets the value of mkfs options.

Parameters:
devicename of volume, e.g. /dev/hda1
optsoptions for mkfs command
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeMountBy ( const string &  device,
MountByType  mby 
) [pure virtual]

Changes mount by value in fstab of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
mbynew mount by value of the volume.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeMountPoint ( const string &  device,
const string &  mount 
) [pure virtual]

Changes the mount point of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
mountnew mount point of the volume (e.g. /home). it is valid to set an empty mount point
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changePartitionId ( const string &  partition,
unsigned  id 
) [pure virtual]

Change partition id of a partition

Parameters:
partitionname of partition, e.g. /dev/hda1
idnew partition id (e.g. 0x82 swap, 0x8e for lvm, ...)
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::changeTunefsOptVolume ( const string &  device,
const string &  opts 
) [pure virtual]

Sets the value of tunefs options.

Parameters:
devicename of volume, e.g. /dev/hda1
optsoptions for tunefs command
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::checkBackupState ( const string &  name) const [pure virtual]

Checks if a backup with a certain name already exists

Parameters:
namename of the backup to check
Returns:
true if the backup exists
virtual bool storage::StorageInterface::checkDeviceMounted ( const string &  device,
list< string > &  mps 
) [pure virtual]

Determine if the given device is known and mounted somewhere

Parameters:
devicedevice name to check (checks also all alias names)
mpsset to current mount points if mounted
Returns:
bool that is true if device is mounted
virtual bool storage::StorageInterface::checkDmMapsTo ( const string &  device) [pure virtual]

Check if there are dm maps to a given device

Parameters:
devicedevice name for which dm maps should be checked
Returns:
bool true if there are map to device
virtual int storage::StorageInterface::checkMd ( const string &  name) [pure virtual]

Check if a raid device is valid

Parameters:
namename of software raid device (e.g. /dev/md0)
Returns:
true if all is ok, a false to indicate an error
virtual int storage::StorageInterface::checkNfsDevice ( const string &  nfsDev,
const string &  opts,
bool  nfs4,
unsigned long long &  SWIG_OUTPUTsizeK 
) [pure virtual]

Check accessibility and size of nfs device.

Parameters:
nfsDevname of nfs device
optsmount options for nfs mount
nfs4use NFS4 for device
sizeKsize of the nfs device
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::commit ( ) [pure virtual]

Commit the current state to the system. Only useful in caching mode.

virtual int storage::StorageInterface::computeMdSize ( MdType  md_type,
const list< string > &  devices,
const list< string > &  spares,
unsigned long long &  SWIG_OUTPUTsizeK 
) [pure virtual]

Compute the size of a raid device.

The size compute may not be accurate. It must not be used for further computations. Do not used in new code.

Parameters:
md_typeraid type of the software raid
deviceslist with physical devices for the software raid
spareslist with spare physical devices for the software raid
sizeKwill contain the computed size in kilobytes
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createBackupState ( const string &  name) [pure virtual]

Create backup of current state of all containers

Parameters:
namename under which the backup should be created
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createFileLoop ( const string &  lname,
bool  reuseExisting,
unsigned long long  sizeK,
const string &  mp,
const string &  pwd,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a file based loop device. Encryption is automatically activated on the loop device.

Parameters:
lnamename of file the loop device is based on
reuseExistingif true an already existing file will be reused. if false the file will be created new. if false the format flag for the device is set by default.
sizeKsize of the created file, this parameter is ignored if reuseExisting is true and a file already exists.
mpmount point of the file based loop device
pwdcrypt password for the loop device, encryption type is determined automatically by the system
devicethe name of the created loop device
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createLvmLv ( const string &  vg,
const string &  name,
unsigned long long  sizeK,
unsigned  stripes,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a LVM logical volume

Parameters:
vgname of volume group
nameof logical volume
sizeKsize of logical volume in kilobytes
stripesstripe count of logical volume (use 1 unless you know exactly what you are doing)
deviceis set to the device name of the new LV
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createLvmLvPool ( const string &  vg,
const string &  name,
unsigned long long  sizeK,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a LVM thin pool

Parameters:
vgname of volume group
nameof thin pool
sizeKsize of thin pool in kilobytes
deviceis set to the device name of the new pool
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createLvmLvSnapshot ( const string &  vg,
const string &  origin,
const string &  name,
unsigned long long  cowSizeK,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a LVM logical volume snapshot

Parameters:
vgname of volume group
originname of logical volume origin
nameof logical volume snapshot
cowSizeKsize of snapshot in kilobytes
deviceis set to the device name of the new snapshot
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createLvmLvThin ( const string &  vg,
const string &  name,
const string &  pool,
unsigned long long  sizeK,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a LVM logical volume that is thin provisioned

Parameters:
vgname of volume group
nameof logical volume
poolname of the pool this logical volume allocates from
sizeKvirtual size of logical volume in kilobytes
deviceis set to the device name of the logical volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createLvmVg ( const string &  name,
unsigned long long  peSizeK,
bool  lvm1,
const deque< string > &  devs 
) [pure virtual]

Create a LVM volume group

Parameters:
namename of volume group, must not contain blanks, colons and shell special characters (e.g. system)
peSizeKphysical extent size in kilobytes
lvm1flag if lvm1 compatible format should be used
devslist with physical devices to add to that volume group
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createMd ( const string &  name,
MdType  md_type,
const list< string > &  devices,
const list< string > &  spares 
) [pure virtual]

Create a Software raid device by name

Parameters:
namename of software raid device to create (e.g. /dev/md0)
md_typeraid personality of the new software raid
deviceslist with physical devices for the new software raid
spareslist with spare physical devices for the new software raid
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createMdAny ( MdType  md_type,
const list< string > &  devices,
const list< string > &  spares,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a Software raid device. Name determined by library.

Parameters:
md_typeraid personality of the new software raid
deviceslist with physical devices for the new software raid
spareslist with spare physical devices for the new software raid
devicedevice name of created software raid device
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createPartition ( const string &  disk,
PartitionType  type,
const RegionInfo cylRegion,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a new partition. Units given in disk cylinders.

Parameters:
diskdevice name of disk, e.g. /dev/hda
typetype of partition to create, e.g. primary or extended
cylRegionregion in cylinder of partition (cylinders are numbered starting with 0)
deviceis set to the device name of the new partition The name is returned instead of the number since creating the name from the number is not straight-forward.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createPartitionAny ( const string &  disk,
unsigned long long  sizeK,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a new partition of any type anywhere on the disk. Units given in Kilobytes.

Parameters:
diskdevice name of disk, e.g. /dev/hda
sizeKsize of partition in kilobytes
deviceis set to the device name of the new partition The name is returned instead of the number since creating the name from the number is not straight-forward.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createPartitionKb ( const string &  disk,
PartitionType  type,
const RegionInfo kRegion,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a new partition. Units given in Kilobytes.

Parameters:
diskdevice name of disk, e.g. /dev/hda
typetype of partition to create, e.g. primary or extended
kRegionregion in kilobyte of partition
deviceis set to the device name of the new partition The name is returned instead of the number since creating the name from the number is not straight-forward.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createPartitionMax ( const string &  disk,
PartitionType  type,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Create a new partition of given type as large as possible.

Parameters:
diskdevice name of disk, e.g. /dev/hda
typetype of partition to create, e.g. primary or extended
deviceis set to the device name of the new partition The name is returned instead of the number since creating the name from the number is not straight-forward.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::createSubvolume ( const string &  device,
const string &  name 
) [pure virtual]

Create a BTRFS subvolume

Parameters:
deviceof the main BTRFS volume
nameof subvolume
Returns:
zero if all is ok, a negative number to indicate an error
virtual unsigned long long storage::StorageInterface::cylinderToKb ( const string &  disk,
unsigned long  sizeCyl 
) [pure virtual]

Compute number of kilobytes of a given number of disk cylinders

Parameters:
diskdevice name of disk, e.g. /dev/hda
sizeCylnumber of disk cylinders
Returns:
number of kilobytes of given cylinders
virtual string storage::StorageInterface::defaultDiskLabel ( const string &  device) [pure virtual]

Query the default disk label of the architecture of the machine (e.g. msdos for ix86, gpt for ia64, ...) for a disk

Parameters:
devicedevice of disk
Returns:
default disk label of the disk
virtual int storage::StorageInterface::destroyPartitionTable ( const string &  disk,
const string &  label 
) [pure virtual]

Destroys the partition table of a disk. An empty disk label of the given type without any partition is created.

Parameters:
diskdevice name of disk, e.g. /dev/hda
labeldisk label to create on disk, e.g. msdos, gpt, ...
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::dumpCommitInfos ( ) const [pure virtual]

Dump list of commit actions to log file.

virtual void storage::StorageInterface::dumpObjectList ( ) [pure virtual]

Dump list of all objects to log file.

virtual bool storage::StorageInterface::equalBackupStates ( const string &  lhs,
const string &  rhs,
bool  verbose_log 
) const [pure virtual]

Compare two backup states

Parameters:
lhsname of backup to compare, empty string means active state
rhsname of backup to compare, empty string means active state
verbose_logflag if differences should be logged in detail
Returns:
true if states are equal
virtual bool storage::StorageInterface::existSubvolume ( const string &  device,
const string &  name 
) [pure virtual]

Check for existence of a BTRFS subvolume

Parameters:
deviceof the main BTRFS volume
nameof subvolume
Returns:
true if subvolume exists, false otherwise
virtual int storage::StorageInterface::extendBtrfsVolume ( const string &  name,
const deque< string > &  devs 
) [pure virtual]

Extend a BTRFS volume with additional devices

Parameters:
namename of BTRFS volume (this can contain a device name or be specified as "UUID=<uuid>")
devslist with devices to add to that BTRFS volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::extendLvmVg ( const string &  name,
const deque< string > &  devs 
) [pure virtual]

Extend a LVM volume group with additional physical devices

Parameters:
namename of volume group
devslist with physical devices to add to that volume group
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::extendMd ( const string &  name,
const list< string > &  devices,
const list< string > &  spares 
) [pure virtual]

Add a partition to a raid device. This can only be done before the raid is created on disk.

Parameters:
namename of software raid device (e.g. /dev/md0)
deviceslist with physical devices to add to the raid
spareslist with spare physical devices to add to the raid
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::forgetChangePartitionId ( const string &  partition) [pure virtual]

Forget previously issued change of partition id

Parameters:
partitionname of partition, e.g. /dev/hda1
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::forgetCryptPassword ( const string &  device) [pure virtual]

Makes library forget a crypt password of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::forgetResizeVolume ( const string &  device) [pure virtual]

Forget about possible resize of an volume.

Parameters:
devicedevice name of volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::freeCylindersAroundPartition ( const string &  device,
unsigned long &  SWIG_OUTPUTfreeCylsBefore,
unsigned long &  SWIG_OUTPUTfreeCylsAfter 
) [pure virtual]

Return the number of free cylinders before and after a partition.

Parameters:
devicedevice name of partition, e.g. /dev/sda1
freeCylsBeforeis set to the number of free cylinders before the partition
freeCylsAfteris set to the number of free cylinders after the partition
Returns:
zero if all is ok, a negative number to indicate an error
virtual list<string> storage::StorageInterface::getAllUsedFs ( ) const [pure virtual]

Get list of filesystem types present on any block devices.

virtual int storage::StorageInterface::getBtrfsInfo ( deque< BtrfsInfo > &  plist) [pure virtual]

Query infos for btrfs devices in system

Parameters:
plistlist of records that get filled with btrfs specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual CallbackCommitErrorPopup storage::StorageInterface::getCallbackCommitErrorPopup ( ) const [pure virtual]

Query the callback function called for errors during commit.

Returns:
pointer to function currently called for progress bar events
virtual CallbackInfoPopup storage::StorageInterface::getCallbackInfoPopup ( ) const [pure virtual]

Query the callback function called to display info popup to the user

Returns:
pointer to function currently called for progress bar events
virtual CallbackPasswordPopup storage::StorageInterface::getCallbackPasswordPopup ( ) const [pure virtual]

Query the callback function called to query a password from the user.

Returns:
pointer to function currently called for password queries.
virtual CallbackProgressBar storage::StorageInterface::getCallbackProgressBar ( ) const [pure virtual]

Query the callback function called on progress bar events

Returns:
pointer to function currently called for progress bar events
virtual CallbackShowInstallInfo storage::StorageInterface::getCallbackShowInstallInfo ( ) const [pure virtual]

Query the callback function called to display install info

Returns:
pointer to function currently called for progress bar events
virtual CallbackYesNoPopup storage::StorageInterface::getCallbackYesNoPopup ( ) const [pure virtual]

Query the callback function called to get a Yes/No decision by the user.

Returns:
pointer to function currently called for progress bar events
virtual void storage::StorageInterface::getCommitInfos ( list< CommitInfo > &  infos) const [pure virtual]

Gets info about actions to be executed after next call to commit().

Parameters:
infoslist of records that gets filled with infos
virtual void storage::StorageInterface::getContainers ( deque< ContainerInfo > &  infos) [pure virtual]

Query all containers found in system

virtual int storage::StorageInterface::getContDiskInfo ( const string &  disk,
ContainerInfo cinfo,
DiskInfo info 
) [pure virtual]

Query disk info for a disk device

Parameters:
diskdevice name of disk, e.g. /dev/hda
cinforecord that gets filled with container general data
inforecord that gets filled with disk special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getContDmmultipathCoInfo ( const string &  name,
ContainerInfo cinfo,
DmmultipathCoInfo info 
) [pure virtual]

Query container info for a DMMULTIPATH container

Parameters:
namename of container, e.g. 3600508b400105f590000900000300000
cinforecord that gets filled with container general data
inforecord that gets filled with DMMULTIPATH Container special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getContDmraidCoInfo ( const string &  name,
ContainerInfo cinfo,
DmraidCoInfo info 
) [pure virtual]

Query container info for a DMRAID container

Parameters:
namename of container, e.g. pdc_ccaihgii
cinforecord that gets filled with container general data
inforecord that gets filled with DMRAID Container special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getContLvmVgInfo ( const string &  name,
ContainerInfo cinfo,
LvmVgInfo info 
) [pure virtual]

Query info for a LVM volume group

Parameters:
namename of volume group, e.g. system
cinforecord that gets filled with container general data
inforecord that gets filled with LVM VG special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getContMdPartCoInfo ( const string &  name,
ContainerInfo cinfo,
MdPartCoInfo info 
) [pure virtual]

Query container info for a MDPART container

Parameters:
namename of container, e.g. md126
cinforecord that gets filled with container general data
inforecord that gets filled with MDPART Container special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getContVolInfo ( const string &  dev,
ContVolInfo info 
) [pure virtual]

Split volume device name up into container name and a volume name. For Containers where this is appropriate (e.g. disks, MD, loop) also a volume number is provided.

Parameters:
devdevice name of volume, e.g. /dev/hda1
inforecord that get filled with split data
Returns:
zero if all is ok, negative number to indicate an error
virtual int storage::StorageInterface::getCrypt ( const string &  device,
bool &  SWIG_OUTPUTval 
) [pure virtual]

Get encryption state of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
valwill be set if encryption is activated
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getCryptPassword ( const string &  device,
string &  SWIG_OUTPUTpwd 
) [pure virtual]

Get crypt password of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
pwdcrypt password for this volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual FsType storage::StorageInterface::getDefaultFs ( ) const [pure virtual]

Get default filesystem.

Returns:
default filesystem.
virtual MountByType storage::StorageInterface::getDefaultMountBy ( ) const [pure virtual]

Get default value for mount by.

Returns:
default value for mount by
virtual string storage::StorageInterface::getDefaultSubvolName ( ) const [pure virtual]

Get default filesystem.

Returns:
default filesystem.
virtual bool storage::StorageInterface::getDetectMountedVolumes ( ) const [pure virtual]

Get value of the flag for detection of mounted volumes.

Returns:
value of the flag for detection of mounted volumes
virtual int storage::StorageInterface::getDiskInfo ( const string &  disk,
DiskInfo info 
) [pure virtual]

Query disk info for a disk device

Parameters:
diskdevice name of disk, e.g. /dev/hda
inforecord that get filled with disk special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::getDlabelCapabilities ( const string &  dlabel,
DlabelCapabilities dlabelcapabilities 
) const [pure virtual]

Query capabilities of a disk label.

virtual int storage::StorageInterface::getDmInfo ( deque< DmInfo > &  plist) [pure virtual]

Query infos for dm devices in system

Parameters:
plistlist of records that get filled with dm specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getDmmultipathCoInfo ( const string &  name,
DmmultipathCoInfo info 
) [pure virtual]

Query container info for a DMMULTIPATH container

Parameters:
namename of container, e.g. 3600508b400105f590000900000300000
inforecord that gets filled with DMMULTIPATH Container special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getDmmultipathInfo ( const string &  name,
deque< DmmultipathInfo > &  plist 
) [pure virtual]

Query infos for dmmultipath devices in system

Parameters:
plistlist of records that get filled with dmmultipath specific info
namename of dmmultipath, e.g. 3600508b400105f590000900000300000
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getDmraidCoInfo ( const string &  name,
DmraidCoInfo info 
) [pure virtual]

Query container info for a DMRAID container

Parameters:
namename of container, e.g. pdc_ccaihgii
inforecord that gets filled with DMRAID Container special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getDmraidInfo ( const string &  name,
deque< DmraidInfo > &  plist 
) [pure virtual]

Query infos for dmraid devices in system

Parameters:
plistlist of records that get filled with dmraid specific info
namename of dmraid, e.g. pdc_igeeeadj
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::getEfiBoot ( ) [pure virtual]

Get value for EFI boot.

Returns:
value for efi boot
virtual string storage::StorageInterface::getErrorString ( int  error) const [pure virtual]

Get a textual message for an error code. Can be empty.

virtual const string& storage::StorageInterface::getExtendedErrorMessage ( ) const [pure virtual]

Gets a possible existing extended error message describing failure of to last call commit()

Returns:
string error text provided by external program
virtual bool storage::StorageInterface::getFreeInfo ( const string &  device,
bool  get_resize,
ResizeInfo resize_info,
bool  get_content,
ContentInfo content_info,
bool  use_cache 
) [pure virtual]

Detect potentially available free space on a partition

Parameters:
devicedevice to check
get_resizeflag to indicate that resize_info should be queried
resize_infostruct that gets filled with resize info
get_contentflag to indicate that content_info should be queried
content_infostruct that gets filled with content info
use_cachefunction should return cached data if available
Returns:
bool if values could be successfully determined
virtual bool storage::StorageInterface::getFsCapabilities ( FsType  fstype,
FsCapabilities fscapabilities 
) const [pure virtual]

Query capabilities of a filesystem type.

virtual int storage::StorageInterface::getFstabOptions ( const string &  device,
string &  SWIG_OUTPUToptions 
) [pure virtual]

Get the fstab options of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
optionswill be set to the fstab options of the volume (e.g. noauto,user,sync). Multiple options are separated by ",".
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getIgnoreFstab ( const string &  device,
bool &  SWIG_OUTPUTval 
) [pure virtual]

Get fstab handling state of a volume.

Parameters:
devicename of volume, e.g. /dev/hda1
valwill be set if fstab should be ignored for this volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual const string& storage::StorageInterface::getLastAction ( ) const [pure virtual]

Gets action performed last during previous call to commit()

Returns:
string presentable to the user
virtual int storage::StorageInterface::getLoopInfo ( deque< LoopInfo > &  plist) [pure virtual]

Query infos for file based loop devices in system

Parameters:
plistlist of records that get filled with loop specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getLvmLvInfo ( const string &  name,
deque< LvmLvInfo > &  plist 
) [pure virtual]

Query infos for LVM LVs of a LVM VG

Parameters:
namename of volume group, e.g. system
plistlist of records that get filled with LV specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getLvmLvSnapshotStateInfo ( const string &  vg,
const string &  name,
LvmLvSnapshotStateInfo info 
) [pure virtual]

Get state of a LVM logical volume snapshot

Precondition:
This can only be done after the snapshot has been created on disk.
Parameters:
vgname of volume group
namename of logical volume snapshot
inforecord that gets filled with snapshot special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getLvmVgInfo ( const string &  name,
LvmVgInfo info 
) [pure virtual]

Query info for a LVM volume group

Parameters:
namename of volume group, e.g. system
inforecord that gets filled with LVM VG special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual list<int> storage::StorageInterface::getMdAllowedParity ( MdType  md_type,
unsigned  devnr 
) [pure virtual]

Determine allowed parity types for raid type.

Parameters:
md_typeraid type of the software raid
devnrnumber of physical devices for the software raid
Returns:
list of allowed parity typed for this raid
virtual int storage::StorageInterface::getMdInfo ( deque< MdInfo > &  plist) [pure virtual]

Query infos for software raid devices in system

Parameters:
plistlist of records that get filled with MD specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getMdPartCoInfo ( const string &  name,
MdPartCoInfo info 
) [pure virtual]

Query container info for a MDPART container

Parameters:
namename of container, e.g. md126
inforecord that gets filled with MDPART Container special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getMdPartCoStateInfo ( const string &  name,
MdPartCoStateInfo info 
) [pure virtual]

Get state of a MD software raid device.

Precondition:
This can only be done after the raid has been created on disk.
Parameters:
namename of software raid device (e.g. /dev/md125)
inforecord that gets filled with raid special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getMdPartInfo ( const string &  device,
deque< MdPartInfo > &  plist 
) [pure virtual]

Query infos for partitions on raid device in system

Parameters:
devicedevice name of the parent MdPartCo, e.g. /dev/md125
plistlist of records that get filled with MdPart specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getMdStateInfo ( const string &  name,
MdStateInfo info 
) [pure virtual]

Get state of a raid device.

Precondition:
This can only be done after the raid has been created on disk.
Parameters:
namename of software raid device (e.g. /dev/md0)
inforecord that gets filled with raid special data
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getMountBy ( const string &  device,
MountByType &  SWIG_OUTPUTmby 
) [pure virtual]

Get mount by value in fstab of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
mbywill be set to the mount by value of the volume.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getMountPoint ( const string &  device,
string &  SWIG_OUTPUTmount 
) [pure virtual]

Get the mount point of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
mountwill be set to the mount point of the volume (e.g. /home).
Returns:
zero if all is ok, a negative number to indicate an error
virtual MultipathAutostart storage::StorageInterface::getMultipathAutostart ( ) const [pure virtual]

Query whether multipath should be started automatically if detected.

Returns:
value for automatically start of multipath.
virtual int storage::StorageInterface::getNfsInfo ( deque< NfsInfo > &  plist) [pure virtual]

Query infos for nfs devices in system

Parameters:
plistlist of records that get filled with nfs info
Returns:
zero if all is ok, a negative number to indicate an error
virtual PartAlign storage::StorageInterface::getPartitionAlignment ( ) const [pure virtual]

Get value for the alignment of newly created partitions

Returns:
value for the alignment
virtual int storage::StorageInterface::getPartitionInfo ( const string &  disk,
deque< PartitionInfo > &  plist 
) [pure virtual]

Query infos for partitions of a disk

Parameters:
diskdevice name of disk, e.g. /dev/hda
plistlist of records that get filled with partition specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual string storage::StorageInterface::getPartitionName ( const string &  disk,
int  partition_no 
) [pure virtual]

Construct the device name for a partiton from the disk name and partiton number.

Parameters:
diskname of disk, e.g. /dev/sda
partition_nonumber of partition, e.g. 1
Returns:
device name of partition, e.g. /dev/sda1
virtual string storage::StorageInterface::getPartitionPrefix ( const string &  disk) [pure virtual]

Return the prefix that is inserted between the disk name and the partition number.

Parameters:
diskname of disk, e.g. /dev/sda
Returns:
prefix for partitions, e.g. "", "p" or "-part"
virtual bool storage::StorageInterface::getRecursiveRemoval ( ) const [pure virtual]

Get value of the flag for recursive removal

Returns:
value of the flag for recursive removal
virtual int storage::StorageInterface::getRecursiveUsedBy ( const list< string > &  devices,
bool  itself,
list< string > &  usedby_devices 
) [pure virtual]

Recursively get all devices used by devices. Containers of volumes are also considered as used by the devices.

Parameters:
deviceslist of name of devices, e.g. /dev/sda1
itselfwhether the device itself is included in the result
usedby_devicesname of devices used by devices, e.g. /dev/sda
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getRecursiveUsing ( const list< string > &  devices,
bool  itself,
list< string > &  using_devices 
) [pure virtual]

Recursively get all devices using devices. Volumes of containers are also considered as using the devices.

Parameters:
devicesname of device, e.g. /dev/sda
itselfwhether the device itself is included in the result
using_devicesname of devices using device, e.g. /dev/sda1 /dev/sda2
Returns:
zero if all is ok, a negative number to indicate an error
virtual string storage::StorageInterface::getRootPrefix ( ) const [pure virtual]

Get value for root prefix.

Returns:
value for root prefix
virtual int storage::StorageInterface::getTmpfsInfo ( deque< TmpfsInfo > &  plist) [pure virtual]

Query infos for tmpfs devices in system

Parameters:
plistlist of records that get filled with tmpfs specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getUnusedPartitionSlots ( const string &  disk,
list< PartitionSlotInfo > &  slots 
) [pure virtual]

Query unused slots on a disk suitable for creating partitions. The returned information gets invalid as soon as one partition is created. If more partitions should be created the slots must be queried again.

Parameters:
diskname of disk, e.g. /dev/hda1
slotslist of records that get filled with partition slot specific info
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::getUserdata ( const string &  device,
map< string, string > &  userdata 
) [pure virtual]

Get the userdata of a device.

Parameters:
devicedevice name of volume, e.g. /dev/sda1
userdatagets filled with the userdata of the device
Returns:
zero if all is ok, negative number to indicate an error
virtual int storage::StorageInterface::getVolume ( const string &  device,
VolumeInfo info 
) [pure virtual]

Query a volume by device name found in system

Parameters:
devicedevice name , e.g. /dev/hda1
inforecord that gets filled with data
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::getVolumes ( deque< VolumeInfo > &  infos) [pure virtual]

Query all volumes found in system

Parameters:
infoslist of records that get filled with volume info
virtual bool storage::StorageInterface::getZeroNewPartitions ( ) const [pure virtual]

Get value of the flag for zeroing newly created partitions

Returns:
value of the flag for zeroing newly created partitions
virtual int storage::StorageInterface::initializeDisk ( const string &  disk,
bool  value 
) [pure virtual]

Do what is needed for low level initialisation of a disk. This function does nothing on normal disks but is needed e.g. on S/390 DASD devices where it executes dasdfmt. If should be considered as destroying all data on the disk.

Parameters:
diskdevice name of disk, e.g. /dev/hda
valuetoggle if disk should be initialized or not
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::isCacheChanges ( ) const [pure virtual]

Query the caching mode.

virtual unsigned long storage::StorageInterface::kbToCylinder ( const string &  disk,
unsigned long long  sizeK 
) [pure virtual]

Compute number of disk cylinders needed for given space

Parameters:
diskdevice name of disk, e.g. /dev/hda
sizeKnumber of kilobytes
Returns:
number of disk cylinders needed
virtual int storage::StorageInterface::modifyFileLoop ( const string &  device,
const string &  lname,
bool  reuseExisting,
unsigned long long  sizeK 
) [pure virtual]

Modify size and pathname of a file based loop device. This function can only be used between the creation of a device and the next call to commit(). Containers that are already created cannot have these properties changed. The size has only a meaning if reuseExisting is true, otherwise it is ignored.

Parameters:
devicedevice name of the loop device
lnamename of file the loop device is based on
reuseExistingif true an already existing file will be reused. if false the file will be created new. if false the format flag for the device is set by default.
sizeKsize of the created file, this parameter is ignored if reuseExisting is false
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::mountDevice ( const string &  device,
const string &  mp 
) [pure virtual]

Mount the given device and do what is necessary to access volume (e.g. do losetup if loop is set up)

The function mounts at once, /etc/fstab is unaffected

Parameters:
devicedevice name to mount
mpmount point to mount to
Returns:
bool if mount succeeded
virtual bool storage::StorageInterface::mountDeviceOpts ( const string &  device,
const string &  mp,
const string &  opts 
) [pure virtual]

Mount the given device with given options and do what is necessary to access volume (e.g. do losetup if loop is set up)

The function mounts at once, /etc/fstab is unaffected

Parameters:
devicedevice name to mount
mpmount point to mount to
optsoptions to use for mount
Returns:
bool if mount succeeded
virtual bool storage::StorageInterface::mountDeviceRo ( const string &  device,
const string &  mp,
const string &  opts 
) [pure virtual]

Mount the given device readonly and do what is necessary to access volume (e.g. do losetup if loop is set up)

The function mounts at once, /etc/fstab is unaffected

Parameters:
devicedevice name to mount
mpmount point to mount to
optsoptions to use for mount
Returns:
bool if mount succeeded
virtual bool storage::StorageInterface::needCryptPassword ( const string &  device) [pure virtual]

Check if crypt password is required

Parameters:
devicename of volume, e.g. /dev/hda1
Returns:
true if password is required, false otherwise
virtual int storage::StorageInterface::nextFreeMd ( unsigned &  SWIG_OUTPUTnr,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Determine the device name of the next created software raid device

Parameters:
nris set to the number of the next created software raid device
deviceis set to the device name of the next created software raid device
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::nextFreePartition ( const string &  disk,
PartitionType  type,
unsigned &  SWIG_OUTPUTnr,
string &  SWIG_OUTPUTdevice 
) [pure virtual]

Determine the device name of the next created partition

Parameters:
diskdevice name of disk, e.g. /dev/hda
typetype of partition to create, e.g. primary or extended
nris set to the number of the next created partition
deviceis set to the device name of the next created partition
Returns:
zero if all is ok, a negative number to indicate an error

Deprecated. Do not use. Use getUnusedPartitionSlots() to get number and device name of partition since number and device name depend on region, e.g. for DASD partition table.

virtual bool storage::StorageInterface::readFstab ( const string &  dir,
deque< VolumeInfo > &  infos 
) [pure virtual]

Read fstab and cryptotab, if existent, from a specified directory and return the volumes found in fstab and cryptotab

Parameters:
dirdirectory where fstab and cryptotab are read from
infoslist of records that get filled with volume info
virtual int storage::StorageInterface::removeBackupState ( const string &  name) [pure virtual]

Remove existing backup state

Parameters:
namename of backup to remove, empty string means to remove all existing backup states
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeDmraid ( const string &  name) [pure virtual]

Remove a Software raid device.

Parameters:
namename of dmraid device to remove (e.g. pdc_dabaheedj)
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::removeDmTableTo ( const string &  device) [pure virtual]

Remove all possibly existing dm maps to a given device

Parameters:
devicedevice name for which dm maps should be removed
virtual int storage::StorageInterface::removeFileLoop ( const string &  lname,
bool  removeFile 
) [pure virtual]

Remove a file based loop device from the system.

Parameters:
lnamename of file the loop device is based on
removeFileif true the file is removed together with the based loop device. If false the file is not touched.
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeFstabOptions ( const string &  device,
const string &  options 
) [pure virtual]

Remove from the fstab options of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
optionsfstab options to remove from already existing options of the volume (e.g. noauto). Multiple options are separated by ",". It is possible to specify wildcards, so "uid=.*" matches every option starting with the string "uid=".
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeLvmLv ( const string &  vg,
const string &  name 
) [pure virtual]

Remove a LVM logical volume

Parameters:
vgname of volume group
nameof logical volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeLvmLvByDevice ( const string &  device) [pure virtual]

Remove a LVM logical volume

Parameters:
devicename of logical volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeLvmLvSnapshot ( const string &  vg,
const string &  name 
) [pure virtual]

Remove a LVM logical volume snapshot

Parameters:
vgname of volume group
namename of logical volume snapshot
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeLvmVg ( const string &  name) [pure virtual]

Remove a LVM volume group. If the volume group contains logical volumes, these are automatically also removed.

Parameters:
namename of volume group
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeMd ( const string &  name,
bool  destroySb 
) [pure virtual]

Remove a Software raid device.

Parameters:
namename of software raid device to remove (e.g. /dev/md0)
destroySbflag if the MD superblocks on the physical devices should be destroyed after md device is deleted
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeMdPartCo ( const string &  name,
bool  destroySb 
) [pure virtual]

Remove a Partitionable Software raid device.

Only RAID with persistent superblock can be removed. IMSM and DDF RAIDs cannot be removed.

Parameters:
namename of software raid device to remove (e.g. /dev/md0)
destroySbflag if the MD superblocks on the physical devices should be destroyed after md device is deleted
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removePartition ( const string &  partition) [pure virtual]

Remove a partition

Parameters:
partitionname of partition, e.g. /dev/hda1
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeSubvolume ( const string &  device,
const string &  name 
) [pure virtual]

Remove a BTRFS subvolume

Parameters:
deviceof the main BTRFS volume
nameof subvolume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeTmpfsMount ( const string &  mp) [pure virtual]

Remove tmpfs filesystem

Parameters:
mpmount point for the tmpfs
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::removeVolume ( const string &  device) [pure virtual]

Removes a volume from the system. This function can be used for removing all types of volumes (partitions, LVM LVs, MD devices ...)

Parameters:
devicename of volume, e.g. /dev/hda1
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::renameCryptDm ( const string &  device,
const string &  new_name 
) [pure virtual]

If device has an encrypted dm map, rename it en device

Parameters:
devicedevice name for which dm map should be renamed
new_namenew dm name used for the device
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::rescanCryptedObjects ( ) [pure virtual]

Rescan after unlocked encrypted volume. Rescan for objects that might be newly found after at least one encrypted volume has been unlocked. Currently the only supported containers on an decrypted volume is a LVM Volume Group.

Returns:
true if at least on encrypted container has been found
virtual void storage::StorageInterface::rescanEverything ( ) [pure virtual]

Rescan all disks. All currently detected objects are forgotten and a new scan for all type of objects (disks, LVM, MD) is initiated. This function makes sense to be called after something outside of libstorage changed disk layout or created storage objects. Any changes already cached are lost.

virtual int storage::StorageInterface::resizePartition ( const string &  device,
unsigned long  sizeCyl 
) [pure virtual]

Resize an existing disk partition. Units given in disk cylinders. Filesystem data is resized accordingly.

Parameters:
devicedevice name of partition
sizeCylnew size of partition in disk cylinders
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::resizePartitionNoFs ( const string &  device,
unsigned long  sizeCyl 
) [pure virtual]

Resize an existing disk partition. Units given in disk cylinders. Filesystem data is ignored.

Parameters:
devicedevice name of partition
sizeCylnew size of partition in disk cylinders
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::resizeVolume ( const string &  device,
unsigned long long  newSizeK 
) [pure virtual]

Resizes a volume while keeping the data on the filesystem

Parameters:
devicename of volume, e.g. /dev/hda1
newSizeKnew size desired volume in kilobytes
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::resizeVolumeNoFs ( const string &  device,
unsigned long long  newSizeK 
) [pure virtual]

Resizes a volume while ignoring the data on the filesystem

Parameters:
devicename of volume, e.g. /dev/hda1
newSizeKnew size desired volume in kilobytes
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::restoreBackupState ( const string &  name) [pure virtual]

Restore state to a previously created backup

Parameters:
namename of the backup to restore
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::setCacheChanges ( bool  cache) [pure virtual]

With the function setCacheChanges you can turn the caching mode on and off. Turning of caching mode will cause all changes done so far to be committed upto the next modifying function.

virtual void storage::StorageInterface::setCallbackCommitErrorPopup ( CallbackCommitErrorPopup  pfnc) [pure virtual]

Sets the callback function called for errors during commit.

Parameters:
pfncpointer to function
virtual void storage::StorageInterface::setCallbackInfoPopup ( CallbackInfoPopup  pfnc) [pure virtual]

Sets the callback function called to display a info popup to the user

Parameters:
pfncpointer to function
virtual void storage::StorageInterface::setCallbackPasswordPopup ( CallbackPasswordPopup  pfnc) [pure virtual]

Sets the callback function called to query a password by the user.

Parameters:
pfncpointer to function.
virtual void storage::StorageInterface::setCallbackProgressBar ( CallbackProgressBar  pfnc) [pure virtual]

Sets the callback function called on progress bar events

Parameters:
pfncpointer to function
virtual void storage::StorageInterface::setCallbackShowInstallInfo ( CallbackShowInstallInfo  pfnc) [pure virtual]

Sets the callback function called to display install info

Parameters:
pfncpointer to function
virtual void storage::StorageInterface::setCallbackYesNoPopup ( CallbackYesNoPopup  pfnc) [pure virtual]

Sets the callback function called to get a Yes/No decision by the user.

Parameters:
pfncpointer to function
virtual int storage::StorageInterface::setCrypt ( const string &  device,
bool  val 
) [pure virtual]

Set encryption state of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
valflag if encryption should be activated
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::setCryptPassword ( const string &  device,
const string &  pwd 
) [pure virtual]

Set crypt password of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
pwdcrypt password for this volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::setCryptType ( const string &  device,
bool  val,
EncryptType  typ 
) [pure virtual]

Set encryption state of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
valflag if encryption should be activated
typtype of encryption to set up
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::setDefaultFs ( FsType  val) [pure virtual]

Set default filesystem.

Parameters:
valnew default filesystem.
virtual void storage::StorageInterface::setDefaultMountBy ( MountByType  val) [pure virtual]

Set default value for mount by.

Parameters:
valnew default mount by value.
virtual void storage::StorageInterface::setDefaultSubvolName ( const string &  val) [pure virtual]

Set default subvolume name.

Parameters:
valnew default subvolume name.
virtual void storage::StorageInterface::setDetectMountedVolumes ( bool  val) [pure virtual]

Determine of libstorage should detect mounted volumes.

Parameters:
valflag if mounted volumes should be detected
virtual int storage::StorageInterface::setIgnoreFstab ( const string &  device,
bool  val 
) [pure virtual]

Set fstab handling state of a volume. This way one can make libstorage ignore fstab handling for a volume. Use this with care.

Parameters:
devicename of volume, e.g. /dev/hda1
valflag if fstab should be ignored for this volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual void storage::StorageInterface::setMultipathAutostart ( MultipathAutostart  multipath_autostart) [pure virtual]

Set whether multipath should be started automatically if detected.

Parameters:
multipath_autostartvalue for automatically start of multipath.
virtual void storage::StorageInterface::setPartitionAlignment ( PartAlign  val) [pure virtual]

Set alignment of newly created partitions. PartAlign has value ALIGN_OPTIMAL or ALIGN_CYLINDER. ALIGN_CYLINDER aligns partiton start to cylinder boundaries like it was traditionally for a long time. ALIGN_OPTIMAL aligns according to values provided by kernel. Default alignment is to multiples of 2048 sectors which is compatible to partition layout of Windows Vista and Windows 7.

Parameters:
valvalue of new alignment type
virtual void storage::StorageInterface::setRecursiveRemoval ( bool  val) [pure virtual]

Set handling of deletion of entities that belong to other volumes. Normally it is not possible to remove a volume that is part of another entity (e.g. you cannot remove a partition that is part of an LVM Volume group or a Software raid). This setting makes the removal recursive, this means all entities where the removed volume is a part of are also removed. Use this setting with extreme care, it may cause the removal of LVM Volume group spanning multiple disks just because one partition of the LVM Volume group got deleted. Default value of this flag is false.

Parameters:
valflag if removal is done recursive
virtual void storage::StorageInterface::setRootPrefix ( const string &  root) [pure virtual]

Set value for root prefix.

This value is appended to all mount points of volumes, when changes are commited. Config files fstab, crypttab and mdadm.conf are also created relative to this prefix. This variable must be set before first call to commit.

Parameters:
rootnew value for root prefix
virtual int storage::StorageInterface::setUserdata ( const string &  device,
const map< string, string > &  userdata 
) [pure virtual]

Set new userdata of a device. The userdata is only stored by libstorage but not processed.

Parameters:
devicedevice name of volume, e.g. /dev/sda1
userdatanew userdata for the device
Returns:
zero if all is ok, negative number to indicate an error
virtual void storage::StorageInterface::setZeroNewPartitions ( bool  val) [pure virtual]

Set handling of newly created partitions. With this flag once can make the library overwrite start and end of newly created partitions with zeroes. This prevents that obsolete structures (e.g. LVM VGs or MD superblocks) still exists on newly created partitions since the area on disk previously contained a LVM PV or a device of a software raid. volumes. Use this setting with extreme care, it make libstorage behave fundamentally different from all other partitioning tools. Default value of this flag is false.

Parameters:
valflag if newly created partitions should be zeroed
virtual int storage::StorageInterface::shrinkBtrfsVolume ( const string &  name,
const deque< string > &  devs 
) [pure virtual]

Shrink a BTRFS volume by some devices

Parameters:
namename of BTRFS volume (this can contain a device name or be specified as "UUID=<uuid>")
devslist with devices to remove from that BTRFS volume
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::shrinkLvmVg ( const string &  name,
const deque< string > &  devs 
) [pure virtual]

Shrink a LVM volume group

Parameters:
namename of volume group
devslist with physical devices to remove from that volume group
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::shrinkMd ( const string &  name,
const list< string > &  devices,
const list< string > &  spares 
) [pure virtual]

Remove a partition from a raid device. This can only be done before the raid is created on disk.

Parameters:
namename of software raid device (e.g. /dev/md0)
deviceslist of physical devices to remove from the raid
spareslist of spare physical devices to remove from the raid
Returns:
zero if all is ok, a negative number to indicate an error
virtual bool storage::StorageInterface::umountDevice ( const string &  device) [pure virtual]

Umount the given device and do what is necessary to remove underlying volume (e.g. do losetup -d if loop is set up or dmsetup remove if dmcrypt is used)

The function umounts at once, /etc/fstab is unaffected

Parameters:
devicedevice name to umount
Returns:
bool if umount succeeded
virtual bool storage::StorageInterface::umountDeviceUns ( const string &  device,
bool  unsetup 
) [pure virtual]

Umount the given device and dependent of parameter unsetup do what is necessary to remove underlying volume (e.g. do losetup -d if loop is set up or dmsetup remove if dmcrypt is used

The function umounts at once, /etc/fstab is unaffected

Parameters:
devicedevice name to umount
unsetupflag if losetup/dmcrypt should be removed
Returns:
bool if umount succeeded
virtual int storage::StorageInterface::updateMd ( const string &  name,
const list< string > &  devices,
const list< string > &  spares 
) [pure virtual]

Update all partitions of a raid device. This can only be done before the raid is created on disk.

Parameters:
namename of software raid device (e.g. /dev/md0)
deviceslist with physical devices to create the raid with
spareslist with spare physical devices to create the raid with
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::updatePartitionArea ( const string &  device,
const RegionInfo cylRegion 
) [pure virtual]

Update area used by a new partition. Units given in disk cylinders. This function can only be used with a partition created but not yet committed.

Parameters:
devicedevice name of partition, e.g. /dev/hda1
cylRegionregion in cylinder of partition (cylinders are numbered starting with 0)
Returns:
zero if all is ok, a negative number to indicate an error
virtual int storage::StorageInterface::verifyCryptPassword ( const string &  device,
const string &  pwd,
bool  erase 
) [pure virtual]

Verify password of a volume

Parameters:
devicename of volume, e.g. /dev/hda1
pwdcrypt password for this volume
eraseif true remove password even after successful verification
Returns:
zero if password is ok, a negative number to indicate an error

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