StorageInterface.h

Go to the documentation of this file.
00001 #ifndef STORAGEINTERFACE_H
00002 #define STORAGEINTERFACE_H
00003 
00004 
00005 #include <string>
00006 #include <deque>
00007 #include <ostream>
00008 
00009 using std::string;
00010 using std::deque;
00011 
00012 
00081 namespace storage
00082 {
00083     enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, VFAT, XFS, JFS, HFS, NTFS, SWAP, FSNONE };
00084 
00085     enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
00086 
00087     enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
00088 
00089     enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
00090                        ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
00091 
00092     enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
00093 
00094     enum MdParity { PAR_NONE, LEFT_ASYMMETRIC, LEFT_SYMMETRIC,
00095                     RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC };
00096 
00097     enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_EVMS, UB_DM };
00098 
00099     enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, EVMS };
00100 
00101 
00105     typedef void (*CallbackProgressBar)( const string& id, unsigned cur, unsigned max );
00106 
00111     typedef void (*CallbackShowInstallInfo)( const string& id );
00112 
00117     typedef void (*CallbackInfoPopup)( const string& text );
00118 
00125     typedef bool (*CallbackYesNoPopup)( const string& text );
00126 
00127 
00131     struct FsCapabilities
00132     {
00133         FsCapabilities () {}
00134         bool isExtendable;
00135         bool isExtendableWhileMounted;
00136         bool isReduceable;
00137         bool isReduceableWhileMounted;
00138         bool supportsUuid;
00139         bool supportsLabel;
00140         bool labelWhileMounted;
00141         unsigned int labelLength;
00142         unsigned long long minimalFsSizeK;
00143     };
00144 
00148     struct ContainerInfo
00149         {
00150         ContainerInfo() {};
00151         CType type;
00152         unsigned volcnt;
00153         string device;
00154         string name;
00155         UsedByType usedBy;
00156         string usedByName;
00157         bool readonly;
00158         };
00159 
00163     struct DiskInfo
00164         {
00165         DiskInfo() {};
00166         unsigned long long sizeK;
00167         unsigned long long cylSizeB;
00168         unsigned long cyl;
00169         unsigned long heads;
00170         unsigned long sectors;
00171         string disklabel;
00172         string udevPath;
00173         string udevId;
00174         unsigned maxLogical;
00175         unsigned maxPrimary;
00176         bool initDisk;
00177         bool iscsi;
00178         };
00179 
00183     struct LvmVgInfo
00184         {
00185         LvmVgInfo() {};
00186         unsigned long long sizeK;
00187         unsigned long long peSize;
00188         unsigned long peCount;
00189         unsigned long peFree;
00190         string uuid;
00191         bool lvm2;
00192         bool create;
00193         string devices;
00194         string devices_add;
00195         string devices_rem;
00196         };
00197 
00201     struct EvmsCoInfo
00202         {
00203         EvmsCoInfo() {};
00204         unsigned long long sizeK;
00205         unsigned long long peSize;
00206         unsigned long peCount;
00207         unsigned long peFree;
00208         string uuid;
00209         bool lvm2;
00210         bool create;
00211         bool realContainer;
00212         string devices;
00213         string devices_add;
00214         string devices_rem;
00215         };
00216 
00220     struct VolumeInfo
00221         {
00222         VolumeInfo() {};
00223         unsigned long long sizeK;
00224         unsigned long major;
00225         unsigned long minor;
00226         string name;
00227         string device;
00228         string mount;
00229         MountByType mount_by;
00230         UsedByType usedBy;
00231         string usedByName;
00232         string fstab_options;
00233         string uuid;
00234         string label;
00235         string mkfs_options;
00236         string loop;
00237         string dtxt;
00238         EncryptType encryption;
00239         string crypt_pwd;
00240         FsType fs;
00241         bool format;
00242         bool create;
00243         bool is_mounted;
00244         bool resize;
00245         bool ignore_fs;
00246         unsigned long long OrigSizeK;
00247         };
00248 
00252     struct PartitionInfo
00253         {
00254         PartitionInfo() {};
00255         VolumeInfo v;
00256         unsigned nr;
00257         unsigned long cylStart;
00258         unsigned long cylSize;
00259         PartitionType partitionType;
00260         unsigned id;
00261         bool boot;
00262         string udevPath;
00263         string udevId;
00264         };
00265 
00269     struct LvmLvInfo
00270         {
00271         LvmLvInfo() {};
00272         VolumeInfo v;
00273         unsigned stripe;
00274         unsigned stripe_size;
00275         string uuid;
00276         string status;
00277         string allocation;
00278         string dm_table;
00279         string dm_target;
00280         };
00281 
00285     struct EvmsInfo
00286         {
00287         EvmsInfo() {};
00288         VolumeInfo v;
00289         unsigned stripe;
00290         unsigned stripe_size;
00291         bool compatible;
00292         string dm_table;
00293         string dm_target;
00294         };
00295 
00300     struct MdInfo
00301         {
00302         MdInfo() {};
00303         VolumeInfo v;
00304         unsigned nr;
00305         unsigned type;
00306         unsigned parity;
00307         string uuid;
00308         unsigned long chunk;
00309         string devices;
00310         };
00311 
00315     struct LoopInfo
00316         {
00317         LoopInfo() {};
00318         VolumeInfo v;
00319         bool reuseFile;
00320         unsigned nr;
00321         string file;
00322         };
00323 
00327     struct DmInfo
00328         {
00329         DmInfo() {};
00330         VolumeInfo v;
00331         unsigned nr;
00332         string table;
00333         string target;
00334         };
00335 
00339     struct ContVolInfo
00340         {
00341         ContVolInfo() {numeric=false; nr=0; type=CUNKNOWN;};
00342         CType type;
00343         string cname;
00344         string vname;
00345         bool numeric;
00346         unsigned nr;
00347         };
00348 
00352     enum ErrorCodes
00353     {
00354         DISK_PARTITION_OVERLAPS_EXISTING = -1000,
00355         DISK_PARTITION_EXCEEDS_DISK = -1001,
00356         DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
00357         DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
00358         DISK_PARTITION_NO_FREE_NUMBER = -1004,
00359         DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
00360         DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
00361         DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
00362         DISK_PARTITION_NOT_FOUND = -1008,
00363         DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
00364         DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
00365         DISK_SET_TYPE_INVALID_VOLUME = -1011,
00366         DISK_SET_TYPE_PARTED_FAILED = -1012,
00367         DISK_SET_LABEL_PARTED_FAILED = -1013,
00368         DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
00369         DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
00370         DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
00371         DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
00372         DISK_PARTITION_ZERO_SIZE = -1018,
00373         DISK_CHANGE_READONLY = -1019,
00374         DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
00375         DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
00376         DISK_RESIZE_NO_SPACE = -1022,
00377         DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
00378         DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
00379         DISK_COMMIT_NOTHING_TODO = -1025,
00380         DISK_CREATE_PARTITION_NO_SPACE = -1026,
00381         DISK_REMOVE_USED_BY = -1027,
00382         DISK_INIT_NOT_POSSIBLE = -1028,
00383 
00384         STORAGE_DISK_NOT_FOUND = -2000,
00385         STORAGE_VOLUME_NOT_FOUND = -2001,
00386         STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
00387         STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
00388         STORAGE_CHANGE_READONLY = -2004,
00389         STORAGE_DISK_USED_BY = -2005,
00390         STORAGE_LVM_VG_EXISTS = -2006,
00391         STORAGE_LVM_VG_NOT_FOUND = -2007,
00392         STORAGE_LVM_INVALID_DEVICE = -2008,
00393         STORAGE_CONTAINER_NOT_FOUND = -2009,
00394         STORAGE_VG_INVALID_NAME = -2010,
00395         STORAGE_REMOVE_USED_VOLUME = -2011,
00396         STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
00397         STORAGE_NOT_YET_IMPLEMENTED = -2013,
00398         STORAGE_MD_INVALID_NAME = -2014,
00399         STORAGE_MD_NOT_FOUND = -2015,
00400         STORAGE_MEMORY_EXHAUSTED = -2016,
00401         STORAGE_LOOP_NOT_FOUND = -2017,
00402         STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
00403         STORAGE_EVMS_INVALID_NAME = -2019,
00404         STORAGE_EVMS_CO_EXISTS = -2020,
00405         STORAGE_EVMS_CO_NOT_FOUND = -2021,
00406         STORAGE_EVMS_INVALID_DEVICE = -2022,
00407         STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
00408         STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
00409         STORAGE_INVALID_FSTAB_VALUE = -2025,
00410         STORAGE_NO_FSTAB_PTR = -2026,
00411         STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
00412 
00413         VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
00414         VOLUME_FSTAB_EMPTY_MOUNT = -3001,
00415         VOLUME_UMOUNT_FAILED = -3002,
00416         VOLUME_MOUNT_FAILED = -3003,
00417         VOLUME_FORMAT_DD_FAILED = -3004,
00418         VOLUME_FORMAT_UNKNOWN_FS = -3005,
00419         VOLUME_FORMAT_FS_UNDETECTED = -3006,
00420         VOLUME_FORMAT_FS_TOO_SMALL = -3007,
00421         VOLUME_FORMAT_FAILED = -3008,
00422         VOLUME_TUNE2FS_FAILED = -3009,
00423         VOLUME_MKLABEL_FS_UNABLE = -3010,
00424         VOLUME_MKLABEL_FAILED = -3011,
00425         VOLUME_LOSETUP_NO_LOOP = -3012,
00426         VOLUME_LOSETUP_FAILED = -3013,
00427         VOLUME_CRYPT_NO_PWD = -3014,
00428         VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
00429         VOLUME_CRYPT_NOT_DETECTED = -3016,
00430         VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
00431         VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
00432         VOLUME_MOUNT_POINT_INVALID = -3019,
00433         VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
00434         VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
00435         VOLUME_LABEL_NOT_SUPPORTED = -3022,
00436         VOLUME_LABEL_TOO_LONG = -3023,
00437         VOLUME_LABEL_WHILE_MOUNTED = -3024,
00438         VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
00439         VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
00440         VOLUME_RESIZE_FAILED = -3027,
00441         VOLUME_ALREADY_IN_USE = -3028,
00442         VOLUME_LOUNSETUP_FAILED = -3029,
00443         VOLUME_DEVICE_NOT_PRESENT = -3030,
00444         VOLUME_DEVICE_NOT_BLOCK = -3031,
00445         VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
00446         VOLUME_CRYPTFORMAT_FAILED = -3033,
00447         VOLUME_CRYPTSETUP_FAILED = -3034,
00448         VOLUME_CRYPTUNSETUP_FAILED = -3035,
00449 
00450         LVM_CREATE_PV_FAILED = -4000,
00451         LVM_PV_ALREADY_CONTAINED = -4001,
00452         LVM_PV_DEVICE_UNKNOWN = -4002,
00453         LVM_PV_DEVICE_USED = -4003,
00454         LVM_VG_HAS_NONE_PV = -4004,
00455         LVM_LV_INVALID_NAME = -4005,
00456         LVM_LV_DUPLICATE_NAME = -4006,
00457         LVM_LV_NO_SPACE = -4007,
00458         LVM_LV_UNKNOWN_NAME = -4008,
00459         LVM_LV_NOT_IN_LIST = -4009,
00460         LVM_VG_CREATE_FAILED = -4010,
00461         LVM_VG_EXTEND_FAILED = -4011,
00462         LVM_VG_REDUCE_FAILED = -4012,
00463         LVM_VG_REMOVE_FAILED = -4013,
00464         LVM_LV_CREATE_FAILED = -4014,
00465         LVM_LV_REMOVE_FAILED = -4015,
00466         LVM_LV_RESIZE_FAILED = -4016,
00467         LVM_PV_STILL_ADDED = -4017,
00468         LVM_PV_REMOVE_NOT_FOUND = -4018,
00469         LVM_CREATE_LV_INVALID_VOLUME = -4019,
00470         LVM_REMOVE_LV_INVALID_VOLUME = -4020,
00471         LVM_RESIZE_LV_INVALID_VOLUME = -4021,
00472         LVM_CHANGE_READONLY = -4022,
00473         LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
00474         LVM_COMMIT_NOTHING_TODO = -4024,
00475         LVM_LV_REMOVE_USED_BY = -4025,
00476         LVM_LV_ALREADY_ON_DISK = -4026,
00477         LVM_LV_NO_STRIPE_SIZE = -4027,
00478 
00479         FSTAB_ENTRY_NOT_FOUND = -5000,
00480         FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
00481         FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
00482         FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
00483         FSTAB_ADD_ENTRY_FOUND = -5004,
00484 
00485         MD_CHANGE_READONLY = -6000,
00486         MD_DUPLICATE_NUMBER = -6001,
00487         MD_TOO_FEW_DEVICES = -6002,
00488         MD_DEVICE_UNKNOWN = -6003,
00489         MD_DEVICE_USED = -6004,
00490         MD_CREATE_INVALID_VOLUME = -6005,
00491         MD_REMOVE_FAILED = -6006,
00492         MD_NOT_IN_LIST = -6007,
00493         MD_CREATE_FAILED = -6008,
00494         MD_UNKNOWN_NUMBER = -6009,
00495         MD_REMOVE_USED_BY = -6010,
00496         MD_NUMBER_TOO_LARGE = -6011,
00497         MD_REMOVE_INVALID_VOLUME = -6012,
00498         MD_REMOVE_CREATE_NOT_FOUND = -6013,
00499         MD_NO_RESIZE_ON_DISK = -6014,
00500         MD_ADD_DUPLICATE = -6015,
00501         MD_REMOVE_NONEXISTENT = -6016,
00502         MD_NO_CHANGE_ON_DISK = -6017,
00503         MD_NO_CREATE_UNKNOWN = -6018,
00504 
00505         LOOP_CHANGE_READONLY = -7000,
00506         LOOP_DUPLICATE_FILE = -7001,
00507         LOOP_UNKNOWN_FILE = -7002,
00508         LOOP_REMOVE_USED_BY = -7003,
00509         LOOP_FILE_CREATE_FAILED = -7004,
00510         LOOP_CREATE_INVALID_VOLUME = -7005,
00511         LOOP_REMOVE_FILE_FAILED = -7006,
00512         LOOP_REMOVE_INVALID_VOLUME = -7007,
00513         LOOP_NOT_IN_LIST = -7008,
00514         LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
00515         LOOP_MODIFY_EXISTING = -7010,
00516 
00517         EVMS_HELPER_UNKNOWN_CMD = -8000,
00518         EVMS_UNSUPPORTED_CONTAINER_TYPE = -8001,
00519         EVMS_MALLOC_FAILED = -8002,
00520         EVMS_INVALID_PHYSICAL_VOLUME = -8003,
00521         EVMS_PHYSICAL_VOLUME_IN_USE = -8004,
00522         EVMS_PLUGIN_NOT_FOUND = -8005,
00523         EVMS_CREATE_CONTAINER_FAILED = -8006,
00524         EVMS_RESIZE_VOLUME_NOT_FOUND = -8007,
00525         EVMS_RESIZE_CONTAINER_NOT_FOUND = -8008,
00526         EVMS_RESIZE_EXPAND_FAILED = -8009,
00527         EVMS_RESIZE_SHRINK_FAILED = -8010,
00528         EVMS_COMMIT_FAILED = -8011,
00529         EVMS_CREATE_VOLUME_FREESPACE_NOT_FOUND = -8012,
00530         EVMS_CREATE_VOLUME_FAILED = -8013,
00531         EVMS_CREATE_COMPAT_VOLUME_FAILED = -8014,
00532         EVMS_SEGMENT_NOT_FOUND = -8015,
00533         EVMS_REMOVE_VOLUME_NOT_FOUND = -8016,
00534         EVMS_REMOVE_REGION_FAILED = -8017,
00535         EVMS_CONTAINER_NOT_FOUND = -8018,
00536         EVMS_CONTAINER_EXPAND_FAILED = -8019,
00537         EVMS_CONTAINER_SHRINK_INVALID_SEGMENT = -8020,
00538         EVMS_CONTAINER_SHRINK_FAILED = -8021,
00539         EVMS_CONTAINER_REMOVE_FAILED = -8022,
00540         EVMS_PV_ALREADY_CONTAINED = -8023,
00541         EVMS_PV_DEVICE_UNKNOWN = -8024,
00542         EVMS_PV_DEVICE_USED = -8025,
00543         EVMS_CO_HAS_NONE_PV = -8026,
00544         EVMS_LV_INVALID_NAME = -8027,
00545         EVMS_LV_DUPLICATE_NAME = -8028,
00546         EVMS_LV_NO_SPACE = -8029,
00547         EVMS_LV_UNKNOWN_NAME = -8030,
00548         EVMS_LV_NOT_IN_LIST = -8031,
00549         EVMS_PV_STILL_ADDED = -8032,
00550         EVMS_PV_REMOVE_NOT_FOUND = -8033,
00551         EVMS_CREATE_LV_INVALID_VOLUME = -8034,
00552         EVMS_REMOVE_LV_INVALID_VOLUME = -8035,
00553         EVMS_RESIZE_LV_INVALID_VOLUME = -8036,
00554         EVMS_CHANGE_READONLY = -8037,
00555         EVMS_CHECK_RESIZE_INVALID_VOLUME = -8038,
00556         EVMS_COMMIT_NOTHING_TODO = -8039,
00557         EVMS_LV_REMOVE_USED_BY = -8040,
00558         EVMS_COMMUNICATION_FAILED = -8041,
00559         EVMS_LV_ALREADY_ON_DISK = -8042,
00560         EVMS_LV_NO_STRIPE_SIZE = -8043,
00561         EVMS_ACTIVATE_FAILED = -8044,
00562         EVMS_CONTAINER_NOT_CREATED = -8045,
00563 
00564         PEC_PE_SIZE_INVALID = -9000,
00565         PEC_PV_NOT_FOUND = -9001,
00566         PEC_REMOVE_PV_IN_USE = -9002,
00567         PEC_REMOVE_PV_SIZE_NEEDED = -9003,
00568         PEC_LV_NO_SPACE_STRIPED = -9004,
00569         PEC_LV_NO_SPACE_SINGLE = -9005,
00570         PEC_LV_PE_DEV_NOT_FOUND = -9006,
00571 
00572         DM_CHANGE_READONLY = -10000,
00573         DM_UNKNOWN_TABLE = -10001,
00574         DM_REMOVE_USED_BY = -10002,
00575         DM_REMOVE_CREATE_NOT_FOUND = -10003,
00576         DM_REMOVE_INVALID_VOLUME = -10004,
00577         DM_REMOVE_FAILED = -10005,
00578         DM_NOT_IN_LIST = -10006,
00579 
00580         DASD_NOT_POSSIBLE = -11000,
00581         DASD_FDASD_FAILED = -11001,
00582         DASD_DASDFMT_FAILED = -11002,
00583 
00584         CONTAINER_INTERNAL_ERROR = -99000,
00585         CONTAINER_INVALID_VIRTUAL_CALL = -99001,
00586 
00587     };
00588 
00589 
00593     class StorageInterface
00594     {
00595     public:
00596 
00597         StorageInterface () {}
00598         virtual ~StorageInterface () {}
00599 
00603         virtual void getContainers( deque<ContainerInfo>& infos) = 0;
00604 
00612         virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
00613 
00622         virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
00623                                      DiskInfo& info ) = 0;
00624 
00632         virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
00633 
00642         virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
00643                                       LvmVgInfo& info) = 0;
00644 
00652         virtual int getEvmsCoInfo( const string& name, EvmsCoInfo& info) = 0;
00653 
00662         virtual int getContEvmsCoInfo( const string& name, ContainerInfo& cinfo,
00663                                        EvmsCoInfo& info) = 0;
00664 
00670         virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
00671 
00679         virtual int getVolume( const string& device, VolumeInfo& info) = 0;
00680 
00688         virtual int getPartitionInfo( const string& disk,
00689                                       deque<PartitionInfo>& plist ) = 0;
00690 
00698         virtual int getLvmLvInfo( const string& name,
00699                                   deque<LvmLvInfo>& plist ) = 0;
00700 
00708         virtual int getEvmsInfo( const string& name,
00709                                  deque<EvmsInfo>& plist ) = 0;
00710 
00717         virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
00718 
00725         virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
00726 
00733         virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
00734 
00738         virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
00739 
00747         virtual void printInfo( std::ostream& str ) = 0;
00748 
00761         virtual int createPartition( const string& disk, PartitionType type,
00762                                      unsigned long start,
00763                                      unsigned long sizeCyl,
00764                                      string& device ) = 0;
00765 
00774         virtual int resizePartition( const string& device,
00775                                      unsigned long sizeCyl ) = 0;
00776 
00785         virtual int resizePartitionNoFs( const string& device,
00786                                          unsigned long sizeCyl ) = 0;
00787 
00798         virtual int updatePartitionArea( const string& device,
00799                                          unsigned long start,
00800                                          unsigned long sizeCyl ) = 0;
00801 
00802 
00812         virtual int nextFreePartition( const string& disk, PartitionType type,
00813                                        unsigned &nr, string& device ) = 0;
00814 
00827         virtual int createPartitionKb( const string& disk, PartitionType type,
00828                                        unsigned long long start,
00829                                        unsigned long long size,
00830                                        string& device ) = 0;
00831 
00842         virtual int createPartitionAny( const string& disk,
00843                                         unsigned long long size,
00844                                         string& device ) = 0;
00845 
00856         virtual int createPartitionMax( const string& disk, PartitionType type,
00857                                         string& device ) = 0;
00858 
00866         virtual unsigned long long cylinderToKb( const string& disk,
00867                                                  unsigned long size ) = 0;
00868 
00876         virtual unsigned long kbToCylinder( const string& disk,
00877                                             unsigned long long size ) = 0;
00878 
00885         virtual int removePartition (const string& partition) = 0;
00886 
00894         virtual int changePartitionId (const string& partition, unsigned id) = 0;
00895 
00902         virtual int forgetChangePartitionId (const string& partition ) = 0;
00903 
00912         virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
00913 
00924         virtual int initializeDisk( const string& disk, bool value ) = 0;
00925 
00932         virtual string defaultDiskLabel() const = 0;
00933 
00939         virtual unsigned long long maxSizeLabelK( const string& label ) const = 0;
00940 
00949         virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
00950 
00958         virtual int changeLabelVolume( const string& device, const string& label ) = 0;
00959 
00967         virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
00968 
00977         virtual int changeMountPoint( const string& device, const string& mount ) = 0;
00978 
00986         virtual int getMountPoint( const string& device, string& mount ) = 0;
00987 
00995         virtual int changeMountBy( const string& device, MountByType mby ) = 0;
00996 
01004 #ifndef SWIG
01005         virtual int getMountBy( const string& device, MountByType& mby ) = 0;
01006 #else
01007         virtual int getMountBy( const string& device, MountByType& REFERENCE ) = 0;
01008 #endif
01009 
01019         virtual int changeFstabOptions( const string& device, const string& options ) = 0;
01020 
01029         virtual int getFstabOptions( const string& device, string& options ) = 0;
01030 
01039         virtual int addFstabOptions( const string& device, const string& options ) = 0;
01040 
01050         virtual int removeFstabOptions( const string& device, const string& options ) = 0;
01051 
01059         virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
01060 
01067         virtual int forgetCryptPassword( const string& device ) = 0;
01068 
01076         virtual int getCryptPassword( const string& device, string& pwd ) = 0;
01077 
01085         virtual int setCrypt( const string& device, bool val ) = 0;
01086 
01095         virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
01096 
01104 #ifndef SWIG
01105         virtual int getCrypt( const string& device, bool& val ) = 0;
01106 #else
01107         virtual int getCrypt( const string& device, bool& REFERENCE ) = 0;
01108 #endif
01109 
01119         virtual int setIgnoreFstab( const string& device, bool val ) = 0;
01120 
01128 #ifndef SWIG
01129         virtual int getIgnoreFstab( const string& device, bool& val ) = 0;
01130 #else
01131         virtual int getIgnoreFstab( const string& device, bool& REFERENCE ) = 0;
01132 #endif
01133 
01142         virtual int changeDescText( const string& device, const string& txt ) = 0;
01143 
01155         virtual int addFstabEntry( const string& device, const string& mount,
01156                                    const string& vfs, const string& options,
01157                                    unsigned freq, unsigned passno ) = 0;
01158 
01159 
01167         virtual int resizeVolume( const string& device, unsigned long long newSizeMb ) = 0;
01168 
01176         virtual int resizeVolumeNoFs( const string& device, unsigned long long newSizeMb ) = 0;
01177 
01184         virtual int forgetResizeVolume( const string& device ) = 0;
01185 
01200         virtual void setRecursiveRemoval( bool val ) = 0;
01201 
01207         virtual bool getRecursiveRemoval() const = 0;
01208 
01222         virtual void setZeroNewPartitions( bool val ) = 0;
01223 
01229         virtual bool getZeroNewPartitions() const = 0;
01230 
01234         virtual void setDefaultMountBy( MountByType val ) = 0;
01235 
01239         virtual MountByType getDefaultMountBy() const = 0;
01240 
01250         virtual void setRootPrefix( const string& root ) = 0;
01251 
01257         virtual void setDetectMountedVolumes( bool val ) = 0;
01258 
01264         virtual bool getDetectMountedVolumes() const = 0;
01265 
01273         virtual int removeVolume( const string& device ) = 0;
01274 
01285         virtual int createLvmVg( const string& name,
01286                                  unsigned long long peSizeK, bool lvm1,
01287                                  const deque<string>& devs ) = 0;
01288 
01296         virtual int removeLvmVg( const string& name ) = 0;
01297 
01305         virtual int extendLvmVg( const string& name,
01306                                  const deque<string>& devs ) = 0;
01307 
01315         virtual int shrinkLvmVg( const string& name,
01316                                  const deque<string>& devs ) = 0;
01317 
01329         virtual int createLvmLv( const string& vg, const string& name,
01330                                  unsigned long long sizeM, unsigned stripe,
01331                                  string& device ) = 0;
01332 
01339         virtual int removeLvmLvByDevice( const string& device ) = 0;
01340 
01348         virtual int removeLvmLv( const string& vg, const string& name ) = 0;
01349 
01359         virtual int changeLvStripeCount( const string& vg, const string& name,
01360                                          unsigned long stripes ) = 0;
01361 
01371         virtual int changeLvStripeSize( const string& vg, const string& name,
01372                                         unsigned long long stripeSize ) = 0;
01373 
01384         virtual int createEvmsContainer( const string& name,
01385                                          unsigned long long peSizeK, bool lvm1,
01386                                          const deque<string>& devs ) = 0;
01387 
01402         virtual int modifyEvmsContainer( const string& old_name,
01403                                          const string& new_name,
01404                                          unsigned long long peSizeK,
01405                                          bool lvm1 ) = 0;
01406 
01414         virtual int removeEvmsContainer( const string& name ) = 0;
01415 
01423         virtual int extendEvmsContainer( const string& name,
01424                                          const deque<string>& devs ) = 0;
01425 
01433         virtual int shrinkEvmsContainer( const string& name,
01434                                          const deque<string>& devs ) = 0;
01435 
01447         virtual int createEvmsVolume( const string& coname, const string& name,
01448                                       unsigned long long sizeM, unsigned stripe,
01449                                       string& device ) = 0;
01450 
01457         virtual int removeEvmsVolumeByDevice( const string& device ) = 0;
01458 
01466         virtual int removeEvmsVolume( const string& coname, const string& name ) = 0;
01467 
01477         virtual int changeEvmsStripeCount( const string& coname,
01478                                            const string& name,
01479                                            unsigned long stripe ) = 0;
01480 
01490         virtual int changeEvmsStripeSize( const string& coname,
01491                                           const string& name,
01492                                           unsigned long long stripeSize ) = 0;
01493 
01503         virtual int evmsActivate( bool force ) = 0;
01504 
01513         virtual int createMd( const string& name, MdType rtype,
01514                               const deque<string>& devs ) = 0;
01515 
01524         virtual int createMdAny( MdType rtype, const deque<string>& devs,
01525                                  string& device ) = 0;
01526 
01535         virtual int removeMd( const string& name, bool destroySb ) = 0;
01536 
01545         virtual int extendMd( const string& name, const string& dev ) = 0;
01546 
01555         virtual int shrinkMd( const string& name, const string& dev ) = 0;
01556 
01565         virtual int changeMdType( const string& name, MdType rtype ) = 0;
01566 
01575         virtual int changeMdChunk( const string& name, unsigned long chunk ) = 0;
01576 
01585         virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
01586 
01593         virtual int checkMd( const string& name ) = 0;
01594 
01611         virtual int createFileLoop( const string& lname, bool reuseExisting,
01612                                     unsigned long long sizeK,
01613                                     const string& mp, const string& pwd,
01614                                     string& device ) = 0;
01615 
01633         virtual int modifyFileLoop( const string& device, const string& lname,
01634                                     bool reuseExisting,
01635                                     unsigned long long sizeK ) = 0;
01636 
01645         virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
01646 
01655         virtual deque<string> getCommitActions( bool mark_destructive ) = 0;
01656 
01662         virtual const string& getLastAction() const = 0;
01663 
01670         virtual const string& getExtendedErrorMessage() const = 0;
01671 
01672 // temporarily disable callback function for swig
01673 #ifndef SWIG
01674 
01680         virtual void setCallbackProgressBar( CallbackProgressBar pfnc ) = 0;
01681 
01687         virtual CallbackProgressBar getCallbackProgressBar() const = 0;
01688 
01689 
01695         virtual void setCallbackShowInstallInfo( CallbackShowInstallInfo pfnc ) = 0;
01696 
01702         virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
01703 
01704 
01711         virtual void setCallbackInfoPopup( CallbackInfoPopup pfnc ) = 0;
01712 
01719         virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
01720 
01721 
01728         virtual void setCallbackYesNoPopup( CallbackYesNoPopup pfnc ) = 0;
01729 
01736         virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
01737 
01738 #endif
01739 
01745         virtual void setCacheChanges (bool cache) = 0;
01746 
01750         virtual bool isCacheChanges () const = 0;
01751 
01756         virtual int commit() = 0;
01757 
01764         virtual int createBackupState( const string& name ) = 0;
01765 
01772         virtual int restoreBackupState( const string& name ) = 0;
01773 
01780         virtual bool checkBackupState( const string& name ) = 0;
01781 
01790         virtual bool equalBackupStates( const string& lhs,
01791                                         const string& rhs,
01792                                         bool verbose_log ) const = 0;
01793 
01801         virtual int removeBackupState( const string& name ) = 0;
01802 
01810         virtual bool checkDeviceMounted( const string& device, string& mp ) = 0;
01811 
01820         virtual bool umountDevice( const string& device ) = 0;
01821 
01831         virtual bool mountDevice( const string& device, const string& mp ) = 0;
01832 
01839         virtual bool checkDmMapsTo( const string& device ) = 0;
01840 
01846         virtual void removeDmTableTo( const string& device ) = 0;
01847 
01859         virtual bool getFreeInfo( const string& device,
01860                                   unsigned long long& resize_free,
01861                                   unsigned long long& df_free,
01862                                   unsigned long long& used,
01863                                   bool& win, bool use_cache ) = 0;
01864 
01872         virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
01873 
01880         virtual void activateHld( bool val ) = 0;
01881 
01891         virtual void rescanEverything() = 0;
01892 
01897         virtual void dumpObjectList() = 0;
01898 
01908         virtual int getContVolInfo( const string& dev, ContVolInfo& info) = 0;
01909 
01910     };
01911 
01912 
01916     void initDefaultLogger ();
01917 
01918 
01922     StorageInterface* createDefaultStorageInterface ();
01923 
01924 
01928     StorageInterface* createStorageInterface (bool readonly, bool testmode,
01929                                               bool autodetect);
01930 
01931 
01935     void destroyStorageInterface (StorageInterface*);
01936 
01937 }
01938 
01939 
01940 #endif

Generated on Fri May 18 12:20:05 2007 for yast2-storage by  doxygen 1.4.6