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, HFSPLUS, NFS, 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, UB_DMRAID };
00098 
00099     enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, EVMS, DMRAID, NFSC,
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         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 DmPartCoInfo
00221         {
00222         DmPartCoInfo() {};
00223         DiskInfo d;
00224         string devices;
00225         };
00226 
00227     struct DmraidCoInfo
00228         {
00229         DmraidCoInfo() {};
00230         DmPartCoInfo p;
00231         };
00232 
00236     struct VolumeInfo
00237         {
00238         VolumeInfo() {};
00239         unsigned long long sizeK;
00240         unsigned long major;
00241         unsigned long minor;
00242         string name;
00243         string device;
00244         string mount;
00245         MountByType mount_by;
00246         UsedByType usedBy;
00247         string usedByName;
00248         string fstab_options;
00249         string uuid;
00250         string label;
00251         string mkfs_options;
00252         string loop;
00253         string dtxt;
00254         EncryptType encryption;
00255         string crypt_pwd;
00256         FsType fs;
00257         bool format;
00258         bool create;
00259         bool is_mounted;
00260         bool resize;
00261         bool ignore_fs;
00262         unsigned long long OrigSizeK;
00263         };
00264 
00265     struct PartitionAddInfo
00266         {
00267         PartitionAddInfo() {};
00268         unsigned nr;
00269         unsigned long cylStart;
00270         unsigned long cylSize;
00271         PartitionType partitionType;
00272         unsigned id;
00273         bool boot;
00274         string udevPath;
00275         string udevId;
00276         };
00277 
00281     struct PartitionInfo
00282         {
00283         PartitionInfo() {};
00284         PartitionInfo& operator=( const PartitionAddInfo& rhs );
00285         VolumeInfo v;
00286         unsigned nr;
00287         unsigned long cylStart;
00288         unsigned long cylSize;
00289         PartitionType partitionType;
00290         unsigned id;
00291         bool boot;
00292         string udevPath;
00293         string udevId;
00294         };
00295 
00299     struct LvmLvInfo
00300         {
00301         LvmLvInfo() {};
00302         VolumeInfo v;
00303         unsigned stripe;
00304         unsigned stripe_size;
00305         string uuid;
00306         string status;
00307         string allocation;
00308         string dm_table;
00309         string dm_target;
00310         };
00311 
00315     struct EvmsInfo
00316         {
00317         EvmsInfo() {};
00318         VolumeInfo v;
00319         unsigned stripe;
00320         unsigned stripe_size;
00321         bool compatible;
00322         string dm_table;
00323         string dm_target;
00324         };
00325 
00330     struct MdInfo
00331         {
00332         MdInfo() {};
00333         VolumeInfo v;
00334         unsigned nr;
00335         unsigned type;
00336         unsigned parity;
00337         string uuid;
00338         unsigned long chunk;
00339         string devices;
00340         };
00341 
00345     struct NfsInfo
00346         {
00347         NfsInfo() {};
00348         VolumeInfo v;
00349         };
00350 
00354     struct LoopInfo
00355         {
00356         LoopInfo() {};
00357         VolumeInfo v;
00358         bool reuseFile;
00359         unsigned nr;
00360         string file;
00361         };
00362 
00366     struct DmInfo
00367         {
00368         DmInfo() {};
00369         VolumeInfo v;
00370         unsigned nr;
00371         string table;
00372         string target;
00373         };
00374 
00378     struct DmPartInfo
00379         {
00380         DmPartInfo() {};
00381         VolumeInfo v;
00382         PartitionAddInfo p;
00383         bool part;
00384         string table;
00385         string target;
00386         };
00387 
00391     struct DmraidInfo
00392         {
00393         DmraidInfo() {};
00394         DmPartInfo p;
00395         };
00396 
00400     struct ContVolInfo
00401         {
00402         ContVolInfo() {numeric=false; nr=0; type=CUNKNOWN;};
00403         CType type;
00404         string cname;
00405         string vname;
00406         bool numeric;
00407         unsigned nr;
00408         };
00409 
00413     enum ErrorCodes
00414     {
00415         DISK_PARTITION_OVERLAPS_EXISTING = -1000,
00416         DISK_PARTITION_EXCEEDS_DISK = -1001,
00417         DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
00418         DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
00419         DISK_PARTITION_NO_FREE_NUMBER = -1004,
00420         DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
00421         DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
00422         DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
00423         DISK_PARTITION_NOT_FOUND = -1008,
00424         DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
00425         DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
00426         DISK_SET_TYPE_INVALID_VOLUME = -1011,
00427         DISK_SET_TYPE_PARTED_FAILED = -1012,
00428         DISK_SET_LABEL_PARTED_FAILED = -1013,
00429         DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
00430         DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
00431         DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
00432         DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
00433         DISK_PARTITION_ZERO_SIZE = -1018,
00434         DISK_CHANGE_READONLY = -1019,
00435         DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
00436         DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
00437         DISK_RESIZE_NO_SPACE = -1022,
00438         DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
00439         DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
00440         DISK_COMMIT_NOTHING_TODO = -1025,
00441         DISK_CREATE_PARTITION_NO_SPACE = -1026,
00442         DISK_REMOVE_USED_BY = -1027,
00443         DISK_INIT_NOT_POSSIBLE = -1028,
00444 
00445         STORAGE_DISK_NOT_FOUND = -2000,
00446         STORAGE_VOLUME_NOT_FOUND = -2001,
00447         STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
00448         STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
00449         STORAGE_CHANGE_READONLY = -2004,
00450         STORAGE_DISK_USED_BY = -2005,
00451         STORAGE_LVM_VG_EXISTS = -2006,
00452         STORAGE_LVM_VG_NOT_FOUND = -2007,
00453         STORAGE_LVM_INVALID_DEVICE = -2008,
00454         STORAGE_CONTAINER_NOT_FOUND = -2009,
00455         STORAGE_VG_INVALID_NAME = -2010,
00456         STORAGE_REMOVE_USED_VOLUME = -2011,
00457         STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
00458         STORAGE_NOT_YET_IMPLEMENTED = -2013,
00459         STORAGE_MD_INVALID_NAME = -2014,
00460         STORAGE_MD_NOT_FOUND = -2015,
00461         STORAGE_MEMORY_EXHAUSTED = -2016,
00462         STORAGE_LOOP_NOT_FOUND = -2017,
00463         STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
00464         STORAGE_EVMS_INVALID_NAME = -2019,
00465         STORAGE_EVMS_CO_EXISTS = -2020,
00466         STORAGE_EVMS_CO_NOT_FOUND = -2021,
00467         STORAGE_EVMS_INVALID_DEVICE = -2022,
00468         STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
00469         STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
00470         STORAGE_INVALID_FSTAB_VALUE = -2025,
00471         STORAGE_NO_FSTAB_PTR = -2026,
00472         STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
00473         STORAGE_DMRAID_CO_NOT_FOUND = -2028,
00474         STORAGE_RESIZE_INVALID_CONTAINER = -2029,
00475 
00476         VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
00477         VOLUME_FSTAB_EMPTY_MOUNT = -3001,
00478         VOLUME_UMOUNT_FAILED = -3002,
00479         VOLUME_MOUNT_FAILED = -3003,
00480         VOLUME_FORMAT_DD_FAILED = -3004,
00481         VOLUME_FORMAT_UNKNOWN_FS = -3005,
00482         VOLUME_FORMAT_FS_UNDETECTED = -3006,
00483         VOLUME_FORMAT_FS_TOO_SMALL = -3007,
00484         VOLUME_FORMAT_FAILED = -3008,
00485         VOLUME_TUNE2FS_FAILED = -3009,
00486         VOLUME_MKLABEL_FS_UNABLE = -3010,
00487         VOLUME_MKLABEL_FAILED = -3011,
00488         VOLUME_LOSETUP_NO_LOOP = -3012,
00489         VOLUME_LOSETUP_FAILED = -3013,
00490         VOLUME_CRYPT_NO_PWD = -3014,
00491         VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
00492         VOLUME_CRYPT_NOT_DETECTED = -3016,
00493         VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
00494         VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
00495         VOLUME_MOUNT_POINT_INVALID = -3019,
00496         VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
00497         VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
00498         VOLUME_LABEL_NOT_SUPPORTED = -3022,
00499         VOLUME_LABEL_TOO_LONG = -3023,
00500         VOLUME_LABEL_WHILE_MOUNTED = -3024,
00501         VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
00502         VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
00503         VOLUME_RESIZE_FAILED = -3027,
00504         VOLUME_ALREADY_IN_USE = -3028,
00505         VOLUME_LOUNSETUP_FAILED = -3029,
00506         VOLUME_DEVICE_NOT_PRESENT = -3030,
00507         VOLUME_DEVICE_NOT_BLOCK = -3031,
00508         VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
00509         VOLUME_CRYPTFORMAT_FAILED = -3033,
00510         VOLUME_CRYPTSETUP_FAILED = -3034,
00511         VOLUME_CRYPTUNSETUP_FAILED = -3035,
00512         VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
00513         VOLUME_FORMAT_NFS_IMPOSSIBLE = -3037,
00514         VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
00515         VOLUME_REMOUNT_FAILED = -3039,
00516 
00517         LVM_CREATE_PV_FAILED = -4000,
00518         LVM_PV_ALREADY_CONTAINED = -4001,
00519         LVM_PV_DEVICE_UNKNOWN = -4002,
00520         LVM_PV_DEVICE_USED = -4003,
00521         LVM_VG_HAS_NONE_PV = -4004,
00522         LVM_LV_INVALID_NAME = -4005,
00523         LVM_LV_DUPLICATE_NAME = -4006,
00524         LVM_LV_NO_SPACE = -4007,
00525         LVM_LV_UNKNOWN_NAME = -4008,
00526         LVM_LV_NOT_IN_LIST = -4009,
00527         LVM_VG_CREATE_FAILED = -4010,
00528         LVM_VG_EXTEND_FAILED = -4011,
00529         LVM_VG_REDUCE_FAILED = -4012,
00530         LVM_VG_REMOVE_FAILED = -4013,
00531         LVM_LV_CREATE_FAILED = -4014,
00532         LVM_LV_REMOVE_FAILED = -4015,
00533         LVM_LV_RESIZE_FAILED = -4016,
00534         LVM_PV_STILL_ADDED = -4017,
00535         LVM_PV_REMOVE_NOT_FOUND = -4018,
00536         LVM_CREATE_LV_INVALID_VOLUME = -4019,
00537         LVM_REMOVE_LV_INVALID_VOLUME = -4020,
00538         LVM_RESIZE_LV_INVALID_VOLUME = -4021,
00539         LVM_CHANGE_READONLY = -4022,
00540         LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
00541         LVM_COMMIT_NOTHING_TODO = -4024,
00542         LVM_LV_REMOVE_USED_BY = -4025,
00543         LVM_LV_ALREADY_ON_DISK = -4026,
00544         LVM_LV_NO_STRIPE_SIZE = -4027,
00545 
00546         FSTAB_ENTRY_NOT_FOUND = -5000,
00547         FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
00548         FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
00549         FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
00550         FSTAB_ADD_ENTRY_FOUND = -5004,
00551 
00552         MD_CHANGE_READONLY = -6000,
00553         MD_DUPLICATE_NUMBER = -6001,
00554         MD_TOO_FEW_DEVICES = -6002,
00555         MD_DEVICE_UNKNOWN = -6003,
00556         MD_DEVICE_USED = -6004,
00557         MD_CREATE_INVALID_VOLUME = -6005,
00558         MD_REMOVE_FAILED = -6006,
00559         MD_NOT_IN_LIST = -6007,
00560         MD_CREATE_FAILED = -6008,
00561         MD_UNKNOWN_NUMBER = -6009,
00562         MD_REMOVE_USED_BY = -6010,
00563         MD_NUMBER_TOO_LARGE = -6011,
00564         MD_REMOVE_INVALID_VOLUME = -6012,
00565         MD_REMOVE_CREATE_NOT_FOUND = -6013,
00566         MD_NO_RESIZE_ON_DISK = -6014,
00567         MD_ADD_DUPLICATE = -6015,
00568         MD_REMOVE_NONEXISTENT = -6016,
00569         MD_NO_CHANGE_ON_DISK = -6017,
00570         MD_NO_CREATE_UNKNOWN = -6018,
00571 
00572         LOOP_CHANGE_READONLY = -7000,
00573         LOOP_DUPLICATE_FILE = -7001,
00574         LOOP_UNKNOWN_FILE = -7002,
00575         LOOP_REMOVE_USED_BY = -7003,
00576         LOOP_FILE_CREATE_FAILED = -7004,
00577         LOOP_CREATE_INVALID_VOLUME = -7005,
00578         LOOP_REMOVE_FILE_FAILED = -7006,
00579         LOOP_REMOVE_INVALID_VOLUME = -7007,
00580         LOOP_NOT_IN_LIST = -7008,
00581         LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
00582         LOOP_MODIFY_EXISTING = -7010,
00583 
00584         EVMS_HELPER_UNKNOWN_CMD = -8000,
00585         EVMS_UNSUPPORTED_CONTAINER_TYPE = -8001,
00586         EVMS_MALLOC_FAILED = -8002,
00587         EVMS_INVALID_PHYSICAL_VOLUME = -8003,
00588         EVMS_PHYSICAL_VOLUME_IN_USE = -8004,
00589         EVMS_PLUGIN_NOT_FOUND = -8005,
00590         EVMS_CREATE_CONTAINER_FAILED = -8006,
00591         EVMS_RESIZE_VOLUME_NOT_FOUND = -8007,
00592         EVMS_RESIZE_CONTAINER_NOT_FOUND = -8008,
00593         EVMS_RESIZE_EXPAND_FAILED = -8009,
00594         EVMS_RESIZE_SHRINK_FAILED = -8010,
00595         EVMS_COMMIT_FAILED = -8011,
00596         EVMS_CREATE_VOLUME_FREESPACE_NOT_FOUND = -8012,
00597         EVMS_CREATE_VOLUME_FAILED = -8013,
00598         EVMS_CREATE_COMPAT_VOLUME_FAILED = -8014,
00599         EVMS_SEGMENT_NOT_FOUND = -8015,
00600         EVMS_REMOVE_VOLUME_NOT_FOUND = -8016,
00601         EVMS_REMOVE_REGION_FAILED = -8017,
00602         EVMS_CONTAINER_NOT_FOUND = -8018,
00603         EVMS_CONTAINER_EXPAND_FAILED = -8019,
00604         EVMS_CONTAINER_SHRINK_INVALID_SEGMENT = -8020,
00605         EVMS_CONTAINER_SHRINK_FAILED = -8021,
00606         EVMS_CONTAINER_REMOVE_FAILED = -8022,
00607         EVMS_PV_ALREADY_CONTAINED = -8023,
00608         EVMS_PV_DEVICE_UNKNOWN = -8024,
00609         EVMS_PV_DEVICE_USED = -8025,
00610         EVMS_CO_HAS_NONE_PV = -8026,
00611         EVMS_LV_INVALID_NAME = -8027,
00612         EVMS_LV_DUPLICATE_NAME = -8028,
00613         EVMS_LV_NO_SPACE = -8029,
00614         EVMS_LV_UNKNOWN_NAME = -8030,
00615         EVMS_LV_NOT_IN_LIST = -8031,
00616         EVMS_PV_STILL_ADDED = -8032,
00617         EVMS_PV_REMOVE_NOT_FOUND = -8033,
00618         EVMS_CREATE_LV_INVALID_VOLUME = -8034,
00619         EVMS_REMOVE_LV_INVALID_VOLUME = -8035,
00620         EVMS_RESIZE_LV_INVALID_VOLUME = -8036,
00621         EVMS_CHANGE_READONLY = -8037,
00622         EVMS_CHECK_RESIZE_INVALID_VOLUME = -8038,
00623         EVMS_COMMIT_NOTHING_TODO = -8039,
00624         EVMS_LV_REMOVE_USED_BY = -8040,
00625         EVMS_COMMUNICATION_FAILED = -8041,
00626         EVMS_LV_ALREADY_ON_DISK = -8042,
00627         EVMS_LV_NO_STRIPE_SIZE = -8043,
00628         EVMS_ACTIVATE_FAILED = -8044,
00629         EVMS_CONTAINER_NOT_CREATED = -8045,
00630 
00631         PEC_PE_SIZE_INVALID = -9000,
00632         PEC_PV_NOT_FOUND = -9001,
00633         PEC_REMOVE_PV_IN_USE = -9002,
00634         PEC_REMOVE_PV_SIZE_NEEDED = -9003,
00635         PEC_LV_NO_SPACE_STRIPED = -9004,
00636         PEC_LV_NO_SPACE_SINGLE = -9005,
00637         PEC_LV_PE_DEV_NOT_FOUND = -9006,
00638 
00639         DM_CHANGE_READONLY = -10000,
00640         DM_UNKNOWN_TABLE = -10001,
00641         DM_REMOVE_USED_BY = -10002,
00642         DM_REMOVE_CREATE_NOT_FOUND = -10003,
00643         DM_REMOVE_INVALID_VOLUME = -10004,
00644         DM_REMOVE_FAILED = -10005,
00645         DM_NOT_IN_LIST = -10006,
00646 
00647         DASD_NOT_POSSIBLE = -11000,
00648         DASD_FDASD_FAILED = -11001,
00649         DASD_DASDFMT_FAILED = -11002,
00650 
00651         DMPART_CHANGE_READONLY = -12001,
00652         DMPART_INTERNAL_ERR = -12002,
00653         DMPART_INVALID_VOLUME = -12003,
00654         DMPART_PARTITION_NOT_FOUND = -12004,
00655         DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
00656         DMPART_COMMIT_NOTHING_TODO = -12006,
00657         DMPART_NO_REMOVE = -12007,
00658 
00659         DMRAID_REMOVE_FAILED = -13001,
00660 
00661         NFS_VOLUME_NOT_FOUND = -14001,
00662         NFS_CHANGE_READONLY = -14002,
00663         NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
00664         NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
00665         NFS_REMOVE_INVALID_VOLUME = -14005,
00666 
00667         CONTAINER_INTERNAL_ERROR = -99000,
00668         CONTAINER_INVALID_VIRTUAL_CALL = -99001,
00669 
00670     };
00671 
00672 
00676     class StorageInterface
00677     {
00678     public:
00679 
00680         StorageInterface () {}
00681         virtual ~StorageInterface () {}
00682 
00686         virtual void getContainers( deque<ContainerInfo>& infos) = 0;
00687 
00695         virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
00696 
00705         virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
00706                                      DiskInfo& info ) = 0;
00707 
00715         virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
00716 
00725         virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
00726                                       LvmVgInfo& info) = 0;
00727 
00735         virtual int getEvmsCoInfo( const string& name, EvmsCoInfo& info) = 0;
00736 
00745         virtual int getContEvmsCoInfo( const string& name, ContainerInfo& cinfo,
00746                                        EvmsCoInfo& info) = 0;
00747 
00755         virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
00756 
00765         virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
00766                                          DmraidCoInfo& info) = 0;
00767 
00773         virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
00774 
00782         virtual int getVolume( const string& device, VolumeInfo& info) = 0;
00783 
00791         virtual int getPartitionInfo( const string& disk,
00792                                       deque<PartitionInfo>& plist ) = 0;
00793 
00801         virtual int getLvmLvInfo( const string& name,
00802                                   deque<LvmLvInfo>& plist ) = 0;
00803 
00811         virtual int getEvmsInfo( const string& name,
00812                                  deque<EvmsInfo>& plist ) = 0;
00813 
00820         virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
00821 
00828         virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
00829 
00836         virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
00837 
00844         virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
00845 
00853         virtual int getDmraidInfo( const string& name, 
00854                                    deque<DmraidInfo>& plist ) = 0;
00855 
00859         virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
00860 
00865         virtual string getAllUsedFs() const = 0;
00866 
00874         virtual void printInfo( std::ostream& str ) = 0;
00875 
00884         virtual void printInfoCo( std::ostream& str, const string& name ) = 0;
00885 
00898         virtual int createPartition( const string& disk, PartitionType type,
00899                                      unsigned long start,
00900                                      unsigned long sizeCyl,
00901                                      string& device ) = 0;
00902 
00911         virtual int resizePartition( const string& device,
00912                                      unsigned long sizeCyl ) = 0;
00913 
00922         virtual int resizePartitionNoFs( const string& device,
00923                                          unsigned long sizeCyl ) = 0;
00924 
00935         virtual int updatePartitionArea( const string& device,
00936                                          unsigned long start,
00937                                          unsigned long sizeCyl ) = 0;
00938 
00939 
00949         virtual int nextFreePartition( const string& disk, PartitionType type,
00950                                        unsigned &nr, string& device ) = 0;
00951 
00964         virtual int createPartitionKb( const string& disk, PartitionType type,
00965                                        unsigned long long start,
00966                                        unsigned long long size,
00967                                        string& device ) = 0;
00968 
00979         virtual int createPartitionAny( const string& disk,
00980                                         unsigned long long size,
00981                                         string& device ) = 0;
00982 
00993         virtual int createPartitionMax( const string& disk, PartitionType type,
00994                                         string& device ) = 0;
00995 
01003         virtual unsigned long long cylinderToKb( const string& disk,
01004                                                  unsigned long size ) = 0;
01005 
01013         virtual unsigned long kbToCylinder( const string& disk,
01014                                             unsigned long long size ) = 0;
01015 
01022         virtual int removePartition (const string& partition) = 0;
01023 
01031         virtual int changePartitionId (const string& partition, unsigned id) = 0;
01032 
01039         virtual int forgetChangePartitionId (const string& partition ) = 0;
01040 
01049         virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
01050 
01061         virtual int initializeDisk( const string& disk, bool value ) = 0;
01062 
01069         virtual string defaultDiskLabel() const = 0;
01070 
01076         virtual unsigned long long maxSizeLabelK( const string& label ) const = 0;
01077 
01086         virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
01087 
01095         virtual int changeLabelVolume( const string& device, const string& label ) = 0;
01096 
01104         virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
01105 
01114         virtual int changeMountPoint( const string& device, const string& mount ) = 0;
01115 
01123         virtual int getMountPoint( const string& device, string& mount ) = 0;
01124 
01132         virtual int changeMountBy( const string& device, MountByType mby ) = 0;
01133 
01141 #ifndef SWIG
01142         virtual int getMountBy( const string& device, MountByType& mby ) = 0;
01143 #else
01144         virtual int getMountBy( const string& device, MountByType& REFERENCE ) = 0;
01145 #endif
01146 
01156         virtual int changeFstabOptions( const string& device, const string& options ) = 0;
01157 
01166         virtual int getFstabOptions( const string& device, string& options ) = 0;
01167 
01176         virtual int addFstabOptions( const string& device, const string& options ) = 0;
01177 
01187         virtual int removeFstabOptions( const string& device, const string& options ) = 0;
01188 
01196         virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
01197 
01204         virtual int forgetCryptPassword( const string& device ) = 0;
01205 
01213         virtual int getCryptPassword( const string& device, string& pwd ) = 0;
01214 
01222         virtual int setCrypt( const string& device, bool val ) = 0;
01223 
01232         virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
01233 
01241 #ifndef SWIG
01242         virtual int getCrypt( const string& device, bool& val ) = 0;
01243 #else
01244         virtual int getCrypt( const string& device, bool& REFERENCE ) = 0;
01245 #endif
01246 
01256         virtual int setIgnoreFstab( const string& device, bool val ) = 0;
01257 
01265 #ifndef SWIG
01266         virtual int getIgnoreFstab( const string& device, bool& val ) = 0;
01267 #else
01268         virtual int getIgnoreFstab( const string& device, bool& REFERENCE ) = 0;
01269 #endif
01270 
01279         virtual int changeDescText( const string& device, const string& txt ) = 0;
01280 
01292         virtual int addFstabEntry( const string& device, const string& mount,
01293                                    const string& vfs, const string& options,
01294                                    unsigned freq, unsigned passno ) = 0;
01295 
01296 
01304         virtual int resizeVolume( const string& device, unsigned long long newSizeMb ) = 0;
01305 
01313         virtual int resizeVolumeNoFs( const string& device, unsigned long long newSizeMb ) = 0;
01314 
01321         virtual int forgetResizeVolume( const string& device ) = 0;
01322 
01337         virtual void setRecursiveRemoval( bool val ) = 0;
01338 
01344         virtual bool getRecursiveRemoval() const = 0;
01345 
01359         virtual void setZeroNewPartitions( bool val ) = 0;
01360 
01366         virtual bool getZeroNewPartitions() const = 0;
01367 
01371         virtual void setDefaultMountBy( MountByType val ) = 0;
01372 
01376         virtual MountByType getDefaultMountBy() const = 0;
01377 
01387         virtual void setRootPrefix( const string& root ) = 0;
01388 
01394         virtual void setDetectMountedVolumes( bool val ) = 0;
01395 
01401         virtual bool getDetectMountedVolumes() const = 0;
01402 
01410         virtual int removeVolume( const string& device ) = 0;
01411 
01422         virtual int createLvmVg( const string& name,
01423                                  unsigned long long peSizeK, bool lvm1,
01424                                  const deque<string>& devs ) = 0;
01425 
01433         virtual int removeLvmVg( const string& name ) = 0;
01434 
01442         virtual int extendLvmVg( const string& name,
01443                                  const deque<string>& devs ) = 0;
01444 
01452         virtual int shrinkLvmVg( const string& name,
01453                                  const deque<string>& devs ) = 0;
01454 
01466         virtual int createLvmLv( const string& vg, const string& name,
01467                                  unsigned long long sizeM, unsigned stripe,
01468                                  string& device ) = 0;
01469 
01476         virtual int removeLvmLvByDevice( const string& device ) = 0;
01477 
01485         virtual int removeLvmLv( const string& vg, const string& name ) = 0;
01486 
01496         virtual int changeLvStripeCount( const string& vg, const string& name,
01497                                          unsigned long stripes ) = 0;
01498 
01508         virtual int changeLvStripeSize( const string& vg, const string& name,
01509                                         unsigned long long stripeSize ) = 0;
01510 
01521         virtual int createEvmsContainer( const string& name,
01522                                          unsigned long long peSizeK, bool lvm1,
01523                                          const deque<string>& devs ) = 0;
01524 
01539         virtual int modifyEvmsContainer( const string& old_name,
01540                                          const string& new_name,
01541                                          unsigned long long peSizeK,
01542                                          bool lvm1 ) = 0;
01543 
01551         virtual int removeEvmsContainer( const string& name ) = 0;
01552 
01560         virtual int extendEvmsContainer( const string& name,
01561                                          const deque<string>& devs ) = 0;
01562 
01570         virtual int shrinkEvmsContainer( const string& name,
01571                                          const deque<string>& devs ) = 0;
01572 
01584         virtual int createEvmsVolume( const string& coname, const string& name,
01585                                       unsigned long long sizeM, unsigned stripe,
01586                                       string& device ) = 0;
01587 
01594         virtual int removeEvmsVolumeByDevice( const string& device ) = 0;
01595 
01603         virtual int removeEvmsVolume( const string& coname, const string& name ) = 0;
01604 
01614         virtual int changeEvmsStripeCount( const string& coname,
01615                                            const string& name,
01616                                            unsigned long stripe ) = 0;
01617 
01627         virtual int changeEvmsStripeSize( const string& coname,
01628                                           const string& name,
01629                                           unsigned long long stripeSize ) = 0;
01630 
01640         virtual int evmsActivate( bool force ) = 0;
01641 
01650         virtual int createMd( const string& name, MdType rtype,
01651                               const deque<string>& devs ) = 0;
01652 
01661         virtual int createMdAny( MdType rtype, const deque<string>& devs,
01662                                  string& device ) = 0;
01663 
01672         virtual int removeMd( const string& name, bool destroySb ) = 0;
01673 
01682         virtual int extendMd( const string& name, const string& dev ) = 0;
01683 
01692         virtual int shrinkMd( const string& name, const string& dev ) = 0;
01693 
01702         virtual int changeMdType( const string& name, MdType rtype ) = 0;
01703 
01712         virtual int changeMdChunk( const string& name, unsigned long chunk ) = 0;
01713 
01722         virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
01723 
01730         virtual int checkMd( const string& name ) = 0;
01731 
01741         virtual int addNfsDevice( const string& nfsDev, const string& opts,
01742                                   unsigned long long sizeK,
01743                                   const string& mp ) = 0;
01744 
01753         virtual int checkNfsDevice( const string& nfsDev, const string& opts,
01754                                     unsigned long long& sizeK ) = 0;
01755 
01772         virtual int createFileLoop( const string& lname, bool reuseExisting,
01773                                     unsigned long long sizeK,
01774                                     const string& mp, const string& pwd,
01775                                     string& device ) = 0;
01776 
01794         virtual int modifyFileLoop( const string& device, const string& lname,
01795                                     bool reuseExisting,
01796                                     unsigned long long sizeK ) = 0;
01797 
01806         virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
01807 
01814         virtual int removeDmraid( const string& name ) = 0;
01815 
01824         virtual deque<string> getCommitActions( bool mark_destructive ) = 0;
01825 
01831         virtual const string& getLastAction() const = 0;
01832 
01839         virtual const string& getExtendedErrorMessage() const = 0;
01840 
01841 // temporarily disable callback function for swig
01842 #ifndef SWIG
01843 
01849         virtual void setCallbackProgressBar( CallbackProgressBar pfnc ) = 0;
01850 
01856         virtual CallbackProgressBar getCallbackProgressBar() const = 0;
01857 
01858 
01864         virtual void setCallbackShowInstallInfo( CallbackShowInstallInfo pfnc ) = 0;
01865 
01871         virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
01872 
01873 
01880         virtual void setCallbackInfoPopup( CallbackInfoPopup pfnc ) = 0;
01881 
01888         virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
01889 
01890 
01897         virtual void setCallbackYesNoPopup( CallbackYesNoPopup pfnc ) = 0;
01898 
01905         virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
01906 
01907 #endif
01908 
01914         virtual void setCacheChanges (bool cache) = 0;
01915 
01919         virtual bool isCacheChanges () const = 0;
01920 
01925         virtual int commit() = 0;
01926 
01933         virtual int createBackupState( const string& name ) = 0;
01934 
01941         virtual int restoreBackupState( const string& name ) = 0;
01942 
01949         virtual bool checkBackupState( const string& name ) = 0;
01950 
01959         virtual bool equalBackupStates( const string& lhs,
01960                                         const string& rhs,
01961                                         bool verbose_log ) const = 0;
01962 
01970         virtual int removeBackupState( const string& name ) = 0;
01971 
01979         virtual bool checkDeviceMounted( const string& device, string& mp ) = 0;
01980 
01989         virtual bool umountDevice( const string& device ) = 0;
01990 
02000         virtual bool mountDevice( const string& device, const string& mp ) = 0;
02001 
02011         virtual bool mountDeviceRo( const string& device, const string& mp ) = 0;
02012 
02019         virtual bool checkDmMapsTo( const string& device ) = 0;
02020 
02026         virtual void removeDmTableTo( const string& device ) = 0;
02027 
02039         virtual bool getFreeInfo( const string& device,
02040                                   unsigned long long& resize_free,
02041                                   unsigned long long& df_free,
02042                                   unsigned long long& used,
02043                                   bool& win, bool& efi, bool use_cache ) = 0;
02044 
02052         virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
02053 
02061         virtual void setNoEvms( bool val ) = 0;
02062 
02068         virtual bool getNoEvms() = 0;
02069 
02076         virtual void activateHld( bool val ) = 0;
02077 
02087         virtual void rescanEverything() = 0;
02088 
02093         virtual void dumpObjectList() = 0;
02094 
02104         virtual int getContVolInfo( const string& dev, ContVolInfo& info) = 0;
02105 
02106     };
02107 
02108 
02112     void initDefaultLogger ();
02113 
02114 
02118     StorageInterface* createDefaultStorageInterface ();
02119 
02120 
02124     StorageInterface* createStorageInterface (bool readonly, bool testmode,
02125                                               bool autodetect);
02126 
02127 
02131     void destroyStorageInterface (StorageInterface*);
02132 
02133 }
02134 
02135 
02136 #endif

Generated on Tue Sep 25 21:19:22 2007 for yast2-storage by  doxygen 1.5.3