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_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, UB_DMRAID };
00098 
00099     enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, EVMS, DMRAID, 
00100                  COTYPE_LAST_ENTRY };
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         };
00178 
00182     struct LvmVgInfo
00183         {
00184         LvmVgInfo() {};
00185         unsigned long long sizeK;
00186         unsigned long long peSize;
00187         unsigned long peCount;
00188         unsigned long peFree;
00189         string uuid;
00190         bool lvm2;
00191         bool create;
00192         string devices;
00193         string devices_add;
00194         string devices_rem;
00195         };
00196 
00200     struct EvmsCoInfo
00201         {
00202         EvmsCoInfo() {};
00203         unsigned long long sizeK;
00204         unsigned long long peSize;
00205         unsigned long peCount;
00206         unsigned long peFree;
00207         string uuid;
00208         bool lvm2;
00209         bool create;
00210         bool realContainer;
00211         string devices;
00212         string devices_add;
00213         string devices_rem;
00214         };
00215 
00219     struct DmPartCoInfo
00220         {
00221         DmPartCoInfo() {};
00222         DiskInfo d;
00223         string devices;
00224         };
00225 
00226     struct DmraidCoInfo
00227         {
00228         DmraidCoInfo() {};
00229         DmPartCoInfo p;
00230         };
00231 
00235     struct VolumeInfo
00236         {
00237         VolumeInfo() {};
00238         unsigned long long sizeK;
00239         unsigned long major;
00240         unsigned long minor;
00241         string name;
00242         string device;
00243         string mount;
00244         MountByType mount_by;
00245         UsedByType usedBy;
00246         string usedByName;
00247         string fstab_options;
00248         string uuid;
00249         string label;
00250         string mkfs_options;
00251         string loop;
00252         string dtxt;
00253         EncryptType encryption;
00254         string crypt_pwd;
00255         FsType fs;
00256         bool format;
00257         bool create;
00258         bool is_mounted;
00259         bool resize;
00260         bool ignore_fs;
00261         unsigned long long OrigSizeK;
00262         };
00263 
00264     struct PartitionAddInfo
00265         {
00266         PartitionAddInfo() {};
00267         unsigned nr;
00268         unsigned long cylStart;
00269         unsigned long cylSize;
00270         PartitionType partitionType;
00271         unsigned id;
00272         bool boot;
00273         string udevPath;
00274         string udevId;
00275         };
00276 
00280     struct PartitionInfo
00281         {
00282         PartitionInfo() {};
00283         PartitionInfo& operator=( const PartitionAddInfo& rhs );
00284         VolumeInfo v;
00285         unsigned nr;
00286         unsigned long cylStart;
00287         unsigned long cylSize;
00288         PartitionType partitionType;
00289         unsigned id;
00290         bool boot;
00291         string udevPath;
00292         string udevId;
00293         };
00294 
00298     struct LvmLvInfo
00299         {
00300         LvmLvInfo() {};
00301         VolumeInfo v;
00302         unsigned stripe;
00303         unsigned stripe_size;
00304         string uuid;
00305         string status;
00306         string allocation;
00307         string dm_table;
00308         string dm_target;
00309         };
00310 
00314     struct EvmsInfo
00315         {
00316         EvmsInfo() {};
00317         VolumeInfo v;
00318         unsigned stripe;
00319         unsigned stripe_size;
00320         bool compatible;
00321         string dm_table;
00322         string dm_target;
00323         };
00324 
00329     struct MdInfo
00330         {
00331         MdInfo() {};
00332         VolumeInfo v;
00333         unsigned nr;
00334         unsigned type;
00335         unsigned parity;
00336         string uuid;
00337         unsigned long chunk;
00338         string devices;
00339         };
00340 
00344     struct LoopInfo
00345         {
00346         LoopInfo() {};
00347         VolumeInfo v;
00348         bool reuseFile;
00349         unsigned nr;
00350         string file;
00351         };
00352 
00356     struct DmInfo
00357         {
00358         DmInfo() {};
00359         VolumeInfo v;
00360         unsigned nr;
00361         string table;
00362         string target;
00363         };
00364 
00368     struct DmPartInfo
00369         {
00370         DmPartInfo() {};
00371         VolumeInfo v;
00372         PartitionAddInfo p;
00373         bool part;
00374         string table;
00375         string target;
00376         };
00377 
00381     struct DmraidInfo
00382         {
00383         DmraidInfo() {};
00384         DmPartInfo p;
00385         };
00386 
00390     enum ErrorCodes
00391     {
00392         DISK_PARTITION_OVERLAPS_EXISTING = -1000,
00393         DISK_PARTITION_EXCEEDS_DISK = -1001,
00394         DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
00395         DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
00396         DISK_PARTITION_NO_FREE_NUMBER = -1004,
00397         DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
00398         DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
00399         DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
00400         DISK_PARTITION_NOT_FOUND = -1008,
00401         DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
00402         DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
00403         DISK_SET_TYPE_INVALID_VOLUME = -1011,
00404         DISK_SET_TYPE_PARTED_FAILED = -1012,
00405         DISK_SET_LABEL_PARTED_FAILED = -1013,
00406         DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
00407         DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
00408         DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
00409         DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
00410         DISK_PARTITION_ZERO_SIZE = -1018,
00411         DISK_CHANGE_READONLY = -1019,
00412         DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
00413         DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
00414         DISK_RESIZE_NO_SPACE = -1022,
00415         DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
00416         DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
00417         DISK_COMMIT_NOTHING_TODO = -1025,
00418         DISK_CREATE_PARTITION_NO_SPACE = -1026,
00419         DISK_REMOVE_USED_BY = -1027,
00420         DISK_INIT_NOT_POSSIBLE = -1028,
00421 
00422         STORAGE_DISK_NOT_FOUND = -2000,
00423         STORAGE_VOLUME_NOT_FOUND = -2001,
00424         STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
00425         STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
00426         STORAGE_CHANGE_READONLY = -2004,
00427         STORAGE_DISK_USED_BY = -2005,
00428         STORAGE_LVM_VG_EXISTS = -2006,
00429         STORAGE_LVM_VG_NOT_FOUND = -2007,
00430         STORAGE_LVM_INVALID_DEVICE = -2008,
00431         STORAGE_CONTAINER_NOT_FOUND = -2009,
00432         STORAGE_VG_INVALID_NAME = -2010,
00433         STORAGE_REMOVE_USED_VOLUME = -2011,
00434         STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
00435         STORAGE_NOT_YET_IMPLEMENTED = -2013,
00436         STORAGE_MD_INVALID_NAME = -2014,
00437         STORAGE_MD_NOT_FOUND = -2015,
00438         STORAGE_MEMORY_EXHAUSTED = -2016,
00439         STORAGE_LOOP_NOT_FOUND = -2017,
00440         STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
00441         STORAGE_EVMS_INVALID_NAME = -2019,
00442         STORAGE_EVMS_CO_EXISTS = -2020,
00443         STORAGE_EVMS_CO_NOT_FOUND = -2021,
00444         STORAGE_EVMS_INVALID_DEVICE = -2022,
00445         STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
00446         STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
00447         STORAGE_INVALID_FSTAB_VALUE = -2025,
00448         STORAGE_NO_FSTAB_PTR = -2026,
00449         STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
00450         STORAGE_DMRAID_CO_NOT_FOUND = -2028,
00451         STORAGE_RESIZE_INVALID_CONTAINER = -2029,
00452 
00453         VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
00454         VOLUME_FSTAB_EMPTY_MOUNT = -3001,
00455         VOLUME_UMOUNT_FAILED = -3002,
00456         VOLUME_MOUNT_FAILED = -3003,
00457         VOLUME_FORMAT_DD_FAILED = -3004,
00458         VOLUME_FORMAT_UNKNOWN_FS = -3005,
00459         VOLUME_FORMAT_FS_UNDETECTED = -3006,
00460         VOLUME_FORMAT_FS_TOO_SMALL = -3007,
00461         VOLUME_FORMAT_FAILED = -3008,
00462         VOLUME_TUNE2FS_FAILED = -3009,
00463         VOLUME_MKLABEL_FS_UNABLE = -3010,
00464         VOLUME_MKLABEL_FAILED = -3011,
00465         VOLUME_LOSETUP_NO_LOOP = -3012,
00466         VOLUME_LOSETUP_FAILED = -3013,
00467         VOLUME_CRYPT_NO_PWD = -3014,
00468         VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
00469         VOLUME_CRYPT_NOT_DETECTED = -3016,
00470         VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
00471         VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
00472         VOLUME_MOUNT_POINT_INVALID = -3019,
00473         VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
00474         VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
00475         VOLUME_LABEL_NOT_SUPPORTED = -3022,
00476         VOLUME_LABEL_TOO_LONG = -3023,
00477         VOLUME_LABEL_WHILE_MOUNTED = -3024,
00478         VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
00479         VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
00480         VOLUME_RESIZE_FAILED = -3027,
00481         VOLUME_ALREADY_IN_USE = -3028,
00482         VOLUME_LOUNSETUP_FAILED = -3029,
00483         VOLUME_DEVICE_NOT_PRESENT = -3030,
00484         VOLUME_DEVICE_NOT_BLOCK = -3031,
00485         VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
00486 
00487         LVM_CREATE_PV_FAILED = -4000,
00488         LVM_PV_ALREADY_CONTAINED = -4001,
00489         LVM_PV_DEVICE_UNKNOWN = -4002,
00490         LVM_PV_DEVICE_USED = -4003,
00491         LVM_VG_HAS_NONE_PV = -4004,
00492         LVM_LV_INVALID_NAME = -4005,
00493         LVM_LV_DUPLICATE_NAME = -4006,
00494         LVM_LV_NO_SPACE = -4007,
00495         LVM_LV_UNKNOWN_NAME = -4008,
00496         LVM_LV_NOT_IN_LIST = -4009,
00497         LVM_VG_CREATE_FAILED = -4010,
00498         LVM_VG_EXTEND_FAILED = -4011,
00499         LVM_VG_REDUCE_FAILED = -4012,
00500         LVM_VG_REMOVE_FAILED = -4013,
00501         LVM_LV_CREATE_FAILED = -4014,
00502         LVM_LV_REMOVE_FAILED = -4015,
00503         LVM_LV_RESIZE_FAILED = -4016,
00504         LVM_PV_STILL_ADDED = -4017,
00505         LVM_PV_REMOVE_NOT_FOUND = -4018,
00506         LVM_CREATE_LV_INVALID_VOLUME = -4019,
00507         LVM_REMOVE_LV_INVALID_VOLUME = -4020,
00508         LVM_RESIZE_LV_INVALID_VOLUME = -4021,
00509         LVM_CHANGE_READONLY = -4022,
00510         LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
00511         LVM_COMMIT_NOTHING_TODO = -4024,
00512         LVM_LV_REMOVE_USED_BY = -4025,
00513         LVM_LV_ALREADY_ON_DISK = -4026,
00514         LVM_LV_NO_STRIPE_SIZE = -4027,
00515 
00516         FSTAB_ENTRY_NOT_FOUND = -5000,
00517         FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
00518         FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
00519         FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
00520         FSTAB_ADD_ENTRY_FOUND = -5004,
00521 
00522         MD_CHANGE_READONLY = -6000,
00523         MD_DUPLICATE_NUMBER = -6001,
00524         MD_TOO_FEW_DEVICES = -6002,
00525         MD_DEVICE_UNKNOWN = -6003,
00526         MD_DEVICE_USED = -6004,
00527         MD_CREATE_INVALID_VOLUME = -6005,
00528         MD_REMOVE_FAILED = -6006,
00529         MD_NOT_IN_LIST = -6007,
00530         MD_CREATE_FAILED = -6008,
00531         MD_UNKNOWN_NUMBER = -6009,
00532         MD_REMOVE_USED_BY = -6010,
00533         MD_NUMBER_TOO_LARGE = -6011,
00534         MD_REMOVE_INVALID_VOLUME = -6012,
00535         MD_REMOVE_CREATE_NOT_FOUND = -6013,
00536         MD_NO_RESIZE_ON_DISK = -6014,
00537         MD_ADD_DUPLICATE = -6015,
00538         MD_REMOVE_NONEXISTENT = -6016,
00539         MD_NO_CHANGE_ON_DISK = -6017,
00540         MD_NO_CREATE_UNKNOWN = -6018,
00541 
00542         LOOP_CHANGE_READONLY = -7000,
00543         LOOP_DUPLICATE_FILE = -7001,
00544         LOOP_UNKNOWN_FILE = -7002,
00545         LOOP_REMOVE_USED_BY = -7003,
00546         LOOP_FILE_CREATE_FAILED = -7004,
00547         LOOP_CREATE_INVALID_VOLUME = -7005,
00548         LOOP_REMOVE_FILE_FAILED = -7006,
00549         LOOP_REMOVE_INVALID_VOLUME = -7007,
00550         LOOP_NOT_IN_LIST = -7008,
00551         LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
00552         LOOP_MODIFY_EXISTING = -7010,
00553 
00554         EVMS_HELPER_UNKNOWN_CMD = -8000,
00555         EVMS_UNSUPPORTED_CONTAINER_TYPE = -8001,
00556         EVMS_MALLOC_FAILED = -8002,
00557         EVMS_INVALID_PHYSICAL_VOLUME = -8003,
00558         EVMS_PHYSICAL_VOLUME_IN_USE = -8004,
00559         EVMS_PLUGIN_NOT_FOUND = -8005,
00560         EVMS_CREATE_CONTAINER_FAILED = -8006,
00561         EVMS_RESIZE_VOLUME_NOT_FOUND = -8007,
00562         EVMS_RESIZE_CONTAINER_NOT_FOUND = -8008,
00563         EVMS_RESIZE_EXPAND_FAILED = -8009,
00564         EVMS_RESIZE_SHRINK_FAILED = -8010,
00565         EVMS_COMMIT_FAILED = -8011,
00566         EVMS_CREATE_VOLUME_FREESPACE_NOT_FOUND = -8012,
00567         EVMS_CREATE_VOLUME_FAILED = -8013,
00568         EVMS_CREATE_COMPAT_VOLUME_FAILED = -8014,
00569         EVMS_SEGMENT_NOT_FOUND = -8015,
00570         EVMS_REMOVE_VOLUME_NOT_FOUND = -8016,
00571         EVMS_REMOVE_REGION_FAILED = -8017,
00572         EVMS_CONTAINER_NOT_FOUND = -8018,
00573         EVMS_CONTAINER_EXPAND_FAILED = -8019,
00574         EVMS_CONTAINER_SHRINK_INVALID_SEGMENT = -8020,
00575         EVMS_CONTAINER_SHRINK_FAILED = -8021,
00576         EVMS_CONTAINER_REMOVE_FAILED = -8022,
00577         EVMS_PV_ALREADY_CONTAINED = -8023,
00578         EVMS_PV_DEVICE_UNKNOWN = -8024,
00579         EVMS_PV_DEVICE_USED = -8025,
00580         EVMS_CO_HAS_NONE_PV = -8026,
00581         EVMS_LV_INVALID_NAME = -8027,
00582         EVMS_LV_DUPLICATE_NAME = -8028,
00583         EVMS_LV_NO_SPACE = -8029,
00584         EVMS_LV_UNKNOWN_NAME = -8030,
00585         EVMS_LV_NOT_IN_LIST = -8031,
00586         EVMS_PV_STILL_ADDED = -8032,
00587         EVMS_PV_REMOVE_NOT_FOUND = -8033,
00588         EVMS_CREATE_LV_INVALID_VOLUME = -8034,
00589         EVMS_REMOVE_LV_INVALID_VOLUME = -8035,
00590         EVMS_RESIZE_LV_INVALID_VOLUME = -8036,
00591         EVMS_CHANGE_READONLY = -8037,
00592         EVMS_CHECK_RESIZE_INVALID_VOLUME = -8038,
00593         EVMS_COMMIT_NOTHING_TODO = -8039,
00594         EVMS_LV_REMOVE_USED_BY = -8040,
00595         EVMS_COMMUNICATION_FAILED = -8041,
00596         EVMS_LV_ALREADY_ON_DISK = -8042,
00597         EVMS_LV_NO_STRIPE_SIZE = -8043,
00598         EVMS_ACTIVATE_FAILED = -8044,
00599         EVMS_CONTAINER_NOT_CREATED = -8045,
00600 
00601         PEC_PE_SIZE_INVALID = -9000,
00602         PEC_PV_NOT_FOUND = -9001,
00603         PEC_REMOVE_PV_IN_USE = -9002,
00604         PEC_REMOVE_PV_SIZE_NEEDED = -9003,
00605         PEC_LV_NO_SPACE_STRIPED = -9004,
00606         PEC_LV_NO_SPACE_SINGLE = -9005,
00607         PEC_LV_PE_DEV_NOT_FOUND = -9006,
00608 
00609         DM_CHANGE_READONLY = -10000,
00610         DM_UNKNOWN_TABLE = -10001,
00611         DM_REMOVE_USED_BY = -10002,
00612         DM_REMOVE_CREATE_NOT_FOUND = -10003,
00613         DM_REMOVE_INVALID_VOLUME = -10004,
00614         DM_REMOVE_FAILED = -10005,
00615         DM_NOT_IN_LIST = -10006,
00616 
00617         DASD_NOT_POSSIBLE = -11000,
00618         DASD_FDASD_FAILED = -11001,
00619         DASD_DASDFMT_FAILED = -11002,
00620 
00621         DMPART_CHANGE_READONLY = -12001,
00622         DMPART_INTERNAL_ERR = -12002,
00623         DMPART_INVALID_VOLUME = -12003,
00624         DMPART_PARTITION_NOT_FOUND = -12004,
00625         DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
00626         DMPART_COMMIT_NOTHING_TODO = -12006,
00627         DMPART_NO_REMOVE = -12007,
00628 
00629         DMRAID_REMOVE_FAILED = -13001,
00630 
00631         CONTAINER_INTERNAL_ERROR = -99000,
00632         CONTAINER_INVALID_VIRTUAL_CALL = -99001,
00633 
00634     };
00635 
00636 
00640     class StorageInterface
00641     {
00642     public:
00643 
00644         StorageInterface () {}
00645         virtual ~StorageInterface () {}
00646 
00650         virtual void getContainers( deque<ContainerInfo>& infos) = 0;
00651 
00659         virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
00660 
00669         virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
00670                                      DiskInfo& info ) = 0;
00671 
00679         virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
00680 
00689         virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
00690                                       LvmVgInfo& info) = 0;
00691 
00699         virtual int getEvmsCoInfo( const string& name, EvmsCoInfo& info) = 0;
00700 
00709         virtual int getContEvmsCoInfo( const string& name, ContainerInfo& cinfo,
00710                                        EvmsCoInfo& info) = 0;
00711 
00719         virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
00720 
00729         virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
00730                                          DmraidCoInfo& info) = 0;
00731 
00737         virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
00738 
00746         virtual int getVolume( const string& device, VolumeInfo& info) = 0;
00747 
00755         virtual int getPartitionInfo( const string& disk,
00756                                       deque<PartitionInfo>& plist ) = 0;
00757 
00765         virtual int getLvmLvInfo( const string& name,
00766                                   deque<LvmLvInfo>& plist ) = 0;
00767 
00775         virtual int getEvmsInfo( const string& name,
00776                                  deque<EvmsInfo>& plist ) = 0;
00777 
00784         virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
00785 
00792         virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
00793 
00800         virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
00801 
00809         virtual int getDmraidInfo( const string& name, 
00810                                    deque<DmraidInfo>& plist ) = 0;
00811 
00815         virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
00816 
00824         virtual void printInfo( std::ostream& str ) = 0;
00825 
00834         virtual void printInfoCo( std::ostream& str, const string& name ) = 0;
00835 
00848         virtual int createPartition( const string& disk, PartitionType type,
00849                                      unsigned long start,
00850                                      unsigned long sizeCyl,
00851                                      string& device ) = 0;
00852 
00861         virtual int resizePartition( const string& device,
00862                                      unsigned long sizeCyl ) = 0;
00863 
00872         virtual int resizePartitionNoFs( const string& device,
00873                                          unsigned long sizeCyl ) = 0;
00874 
00885         virtual int updatePartitionArea( const string& device,
00886                                          unsigned long start,
00887                                          unsigned long sizeCyl ) = 0;
00888 
00889 
00899         virtual int nextFreePartition( const string& disk, PartitionType type,
00900                                        unsigned &nr, string& device ) = 0;
00901 
00914         virtual int createPartitionKb( const string& disk, PartitionType type,
00915                                        unsigned long long start,
00916                                        unsigned long long size,
00917                                        string& device ) = 0;
00918 
00929         virtual int createPartitionAny( const string& disk,
00930                                         unsigned long long size,
00931                                         string& device ) = 0;
00932 
00943         virtual int createPartitionMax( const string& disk, PartitionType type,
00944                                         string& device ) = 0;
00945 
00953         virtual unsigned long long cylinderToKb( const string& disk,
00954                                                  unsigned long size ) = 0;
00955 
00963         virtual unsigned long kbToCylinder( const string& disk,
00964                                             unsigned long long size ) = 0;
00965 
00972         virtual int removePartition (const string& partition) = 0;
00973 
00981         virtual int changePartitionId (const string& partition, unsigned id) = 0;
00982 
00989         virtual int forgetChangePartitionId (const string& partition ) = 0;
00990 
00999         virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
01000 
01011         virtual int initializeDisk( const string& disk, bool value ) = 0;
01012 
01019         virtual string defaultDiskLabel() const = 0;
01020 
01029         virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
01030 
01038         virtual int changeLabelVolume( const string& device, const string& label ) = 0;
01039 
01047         virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
01048 
01057         virtual int changeMountPoint( const string& device, const string& mount ) = 0;
01058 
01066         virtual int getMountPoint( const string& device, string& mount ) = 0;
01067 
01075         virtual int changeMountBy( const string& device, MountByType mby ) = 0;
01076 
01084 #ifndef SWIG
01085         virtual int getMountBy( const string& device, MountByType& mby ) = 0;
01086 #else
01087         virtual int getMountBy( const string& device, MountByType& REFERENCE ) = 0;
01088 #endif
01089 
01099         virtual int changeFstabOptions( const string& device, const string& options ) = 0;
01100 
01109         virtual int getFstabOptions( const string& device, string& options ) = 0;
01110 
01119         virtual int addFstabOptions( const string& device, const string& options ) = 0;
01120 
01130         virtual int removeFstabOptions( const string& device, const string& options ) = 0;
01131 
01139         virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
01140 
01147         virtual int forgetCryptPassword( const string& device ) = 0;
01148 
01156         virtual int getCryptPassword( const string& device, string& pwd ) = 0;
01157 
01165         virtual int setCrypt( const string& device, bool val ) = 0;
01166 
01174 #ifndef SWIG
01175         virtual int getCrypt( const string& device, bool& val ) = 0;
01176 #else
01177         virtual int getCrypt( const string& device, bool& REFERENCE ) = 0;
01178 #endif
01179 
01189         virtual int setIgnoreFstab( const string& device, bool val ) = 0;
01190 
01198 #ifndef SWIG
01199         virtual int getIgnoreFstab( const string& device, bool& val ) = 0;
01200 #else
01201         virtual int getIgnoreFstab( const string& device, bool& REFERENCE ) = 0;
01202 #endif
01203 
01212         virtual int changeDescText( const string& device, const string& txt ) = 0;
01213 
01225         virtual int addFstabEntry( const string& device, const string& mount,
01226                                    const string& vfs, const string& options,
01227                                    unsigned freq, unsigned passno ) = 0;
01228 
01229 
01237         virtual int resizeVolume( const string& device, unsigned long long newSizeMb ) = 0;
01238 
01246         virtual int resizeVolumeNoFs( const string& device, unsigned long long newSizeMb ) = 0;
01247 
01254         virtual int forgetResizeVolume( const string& device ) = 0;
01255 
01270         virtual void setRecursiveRemoval( bool val ) = 0;
01271 
01277         virtual bool getRecursiveRemoval() const = 0;
01278 
01292         virtual void setZeroNewPartitions( bool val ) = 0;
01293 
01299         virtual bool getZeroNewPartitions() const = 0;
01300 
01304         virtual void setDefaultMountBy( MountByType val ) = 0;
01305 
01309         virtual MountByType getDefaultMountBy() const = 0;
01310 
01320         virtual void setRootPrefix( const string& root ) = 0;
01321 
01327         virtual void setDetectMountedVolumes( bool val ) = 0;
01328 
01334         virtual bool getDetectMountedVolumes() const = 0;
01335 
01343         virtual int removeVolume( const string& device ) = 0;
01344 
01355         virtual int createLvmVg( const string& name,
01356                                  unsigned long long peSizeK, bool lvm1,
01357                                  const deque<string>& devs ) = 0;
01358 
01366         virtual int removeLvmVg( const string& name ) = 0;
01367 
01375         virtual int extendLvmVg( const string& name,
01376                                  const deque<string>& devs ) = 0;
01377 
01385         virtual int shrinkLvmVg( const string& name,
01386                                  const deque<string>& devs ) = 0;
01387 
01399         virtual int createLvmLv( const string& vg, const string& name,
01400                                  unsigned long long sizeM, unsigned stripe,
01401                                  string& device ) = 0;
01402 
01409         virtual int removeLvmLvByDevice( const string& device ) = 0;
01410 
01418         virtual int removeLvmLv( const string& vg, const string& name ) = 0;
01419 
01429         virtual int changeLvStripeSize( const string& vg, const string& name,
01430                                         unsigned long long stripeSize ) = 0;
01431 
01442         virtual int createEvmsContainer( const string& name,
01443                                          unsigned long long peSizeK, bool lvm1,
01444                                          const deque<string>& devs ) = 0;
01445 
01460         virtual int modifyEvmsContainer( const string& old_name,
01461                                          const string& new_name,
01462                                          unsigned long long peSizeK,
01463                                          bool lvm1 ) = 0;
01464 
01472         virtual int removeEvmsContainer( const string& name ) = 0;
01473 
01481         virtual int extendEvmsContainer( const string& name,
01482                                          const deque<string>& devs ) = 0;
01483 
01491         virtual int shrinkEvmsContainer( const string& name,
01492                                          const deque<string>& devs ) = 0;
01493 
01505         virtual int createEvmsVolume( const string& coname, const string& name,
01506                                       unsigned long long sizeM, unsigned stripe,
01507                                       string& device ) = 0;
01508 
01515         virtual int removeEvmsVolumeByDevice( const string& device ) = 0;
01516 
01524         virtual int removeEvmsVolume( const string& coname, const string& name ) = 0;
01525 
01535         virtual int changeEvmsStripeSize( const string& coname,
01536                                           const string& name,
01537                                           unsigned long long stripeSize ) = 0;
01538 
01547         virtual int evmsActivate() = 0;
01548 
01557         virtual int createMd( const string& name, MdType rtype,
01558                               const deque<string>& devs ) = 0;
01559 
01568         virtual int createMdAny( MdType rtype, const deque<string>& devs,
01569                                  string& device ) = 0;
01570 
01579         virtual int removeMd( const string& name, bool destroySb ) = 0;
01580 
01589         virtual int extendMd( const string& name, const string& dev ) = 0;
01590 
01599         virtual int shrinkMd( const string& name, const string& dev ) = 0;
01600 
01609         virtual int changeMdType( const string& name, MdType rtype ) = 0;
01610 
01619         virtual int changeMdChunk( const string& name, unsigned long chunk ) = 0;
01620 
01629         virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
01630 
01637         virtual int checkMd( const string& name ) = 0;
01638 
01655         virtual int createFileLoop( const string& lname, bool reuseExisting,
01656                                     unsigned long long sizeK,
01657                                     const string& mp, const string& pwd,
01658                                     string& device ) = 0;
01659 
01677         virtual int modifyFileLoop( const string& device, const string& lname,
01678                                     bool reuseExisting,
01679                                     unsigned long long sizeK ) = 0;
01680 
01689         virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
01690 
01697         virtual int removeDmraid( const string& name ) = 0;
01698 
01707         virtual deque<string> getCommitActions( bool mark_destructive ) = 0;
01708 
01714         virtual const string& getLastAction() const = 0;
01715 
01722         virtual const string& getExtendedErrorMessage() const = 0;
01723 
01724 // temporarily disable callback function for swig
01725 #ifndef SWIG
01726 
01732         virtual void setCallbackProgressBar( CallbackProgressBar pfnc ) = 0;
01733 
01739         virtual CallbackProgressBar getCallbackProgressBar() const = 0;
01740 
01741 
01747         virtual void setCallbackShowInstallInfo( CallbackShowInstallInfo pfnc ) = 0;
01748 
01754         virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
01755 
01756 
01763         virtual void setCallbackInfoPopup( CallbackInfoPopup pfnc ) = 0;
01764 
01771         virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
01772 
01773 
01780         virtual void setCallbackYesNoPopup( CallbackYesNoPopup pfnc ) = 0;
01781 
01788         virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
01789 
01790 #endif
01791 
01797         virtual void setCacheChanges (bool cache) = 0;
01798 
01802         virtual bool isCacheChanges () const = 0;
01803 
01808         virtual int commit() = 0;
01809 
01816         virtual int createBackupState( const string& name ) = 0;
01817 
01824         virtual int restoreBackupState( const string& name ) = 0;
01825 
01832         virtual bool checkBackupState( const string& name ) = 0;
01833 
01842         virtual bool equalBackupStates( const string& lhs,
01843                                         const string& rhs,
01844                                         bool verbose_log ) const = 0;
01845 
01853         virtual int removeBackupState( const string& name ) = 0;
01854 
01862         virtual bool checkDeviceMounted( const string& device, string& mp ) = 0;
01863 
01872         virtual bool umountDevice( const string& device ) = 0;
01873 
01883         virtual bool mountDevice( const string& device, const string& mp ) = 0;
01884 
01891         virtual bool checkDmMapsTo( const string& device ) = 0;
01892 
01900         virtual bool removeDmMapsTo( const string& device, bool also_evms ) = 0;
01901 
01913         virtual bool getFreeInfo( const string& device,
01914                                   unsigned long long& resize_free,
01915                                   unsigned long long& df_free,
01916                                   unsigned long long& used,
01917                                   bool& win, bool use_cache ) = 0;
01918 
01926         virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
01927 
01934         virtual void activateHld( bool val ) = 0;
01935 
01945         virtual void rescanEverything() = 0;
01946 
01951         virtual void dumpObjectList() = 0;
01952 
01953     };
01954 
01955 
01959     void initDefaultLogger ();
01960 
01961 
01965     StorageInterface* createDefaultStorageInterface ();
01966 
01967 
01971     StorageInterface* createStorageInterface (bool readonly, bool testmode,
01972                                               bool autodetect);
01973 
01974 
01978     void destroyStorageInterface (StorageInterface*);
01979 
01980 }
01981 
01982 
01983 #endif

Generated on Tue Nov 28 17:50:01 2006 for yast2-storage by  doxygen 1.5.0