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, 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 };
00098
00099 enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, EVMS, NFSC,
00100 COTYPE_LAST_ENTRY };
00101
00102
00106 typedef void (*CallbackProgressBar)( const string& id, unsigned cur, unsigned max );
00107
00112 typedef void (*CallbackShowInstallInfo)( const string& id );
00113
00118 typedef void (*CallbackInfoPopup)( const string& text );
00119
00126 typedef bool (*CallbackYesNoPopup)( const string& text );
00127
00128
00132 struct FsCapabilities
00133 {
00134 FsCapabilities () {}
00135 bool isExtendable;
00136 bool isExtendableWhileMounted;
00137 bool isReduceable;
00138 bool isReduceableWhileMounted;
00139 bool supportsUuid;
00140 bool supportsLabel;
00141 bool labelWhileMounted;
00142 unsigned int labelLength;
00143 unsigned long long minimalFsSizeK;
00144 };
00145
00149 struct ContainerInfo
00150 {
00151 ContainerInfo() {};
00152 CType type;
00153 unsigned volcnt;
00154 string device;
00155 string name;
00156 UsedByType usedBy;
00157 string usedByName;
00158 bool readonly;
00159 };
00160
00164 struct DiskInfo
00165 {
00166 DiskInfo() {};
00167 unsigned long long sizeK;
00168 unsigned long long cylSizeB;
00169 unsigned long cyl;
00170 unsigned long heads;
00171 unsigned long sectors;
00172 string disklabel;
00173 string udevPath;
00174 string udevId;
00175 unsigned maxLogical;
00176 unsigned maxPrimary;
00177 bool initDisk;
00178 bool iscsi;
00179 };
00180
00184 struct LvmVgInfo
00185 {
00186 LvmVgInfo() {};
00187 unsigned long long sizeK;
00188 unsigned long long peSize;
00189 unsigned long peCount;
00190 unsigned long peFree;
00191 string uuid;
00192 bool lvm2;
00193 bool create;
00194 string devices;
00195 string devices_add;
00196 string devices_rem;
00197 };
00198
00202 struct EvmsCoInfo
00203 {
00204 EvmsCoInfo() {};
00205 unsigned long long sizeK;
00206 unsigned long long peSize;
00207 unsigned long peCount;
00208 unsigned long peFree;
00209 string uuid;
00210 bool lvm2;
00211 bool create;
00212 bool realContainer;
00213 string devices;
00214 string devices_add;
00215 string devices_rem;
00216 };
00217
00221 struct VolumeInfo
00222 {
00223 VolumeInfo() {};
00224 unsigned long long sizeK;
00225 unsigned long major;
00226 unsigned long minor;
00227 string name;
00228 string device;
00229 string mount;
00230 MountByType mount_by;
00231 UsedByType usedBy;
00232 string usedByName;
00233 string fstab_options;
00234 string uuid;
00235 string label;
00236 string mkfs_options;
00237 string loop;
00238 string dtxt;
00239 EncryptType encryption;
00240 string crypt_pwd;
00241 FsType fs;
00242 bool format;
00243 bool create;
00244 bool is_mounted;
00245 bool resize;
00246 bool ignore_fs;
00247 unsigned long long OrigSizeK;
00248 };
00249
00253 struct PartitionInfo
00254 {
00255 PartitionInfo() {};
00256 VolumeInfo v;
00257 unsigned nr;
00258 unsigned long cylStart;
00259 unsigned long cylSize;
00260 PartitionType partitionType;
00261 unsigned id;
00262 bool boot;
00263 string udevPath;
00264 string udevId;
00265 };
00266
00270 struct LvmLvInfo
00271 {
00272 LvmLvInfo() {};
00273 VolumeInfo v;
00274 unsigned stripe;
00275 unsigned stripe_size;
00276 string uuid;
00277 string status;
00278 string allocation;
00279 string dm_table;
00280 string dm_target;
00281 };
00282
00286 struct EvmsInfo
00287 {
00288 EvmsInfo() {};
00289 VolumeInfo v;
00290 unsigned stripe;
00291 unsigned stripe_size;
00292 bool compatible;
00293 string dm_table;
00294 string dm_target;
00295 };
00296
00301 struct MdInfo
00302 {
00303 MdInfo() {};
00304 VolumeInfo v;
00305 unsigned nr;
00306 unsigned type;
00307 unsigned parity;
00308 string uuid;
00309 unsigned long chunk;
00310 string devices;
00311 };
00312
00316 struct NfsInfo
00317 {
00318 NfsInfo() {};
00319 VolumeInfo v;
00320 };
00321
00325 struct LoopInfo
00326 {
00327 LoopInfo() {};
00328 VolumeInfo v;
00329 bool reuseFile;
00330 unsigned nr;
00331 string file;
00332 };
00333
00337 struct DmInfo
00338 {
00339 DmInfo() {};
00340 VolumeInfo v;
00341 unsigned nr;
00342 string table;
00343 string target;
00344 };
00345
00349 struct ContVolInfo
00350 {
00351 ContVolInfo() {numeric=false; nr=0; type=CUNKNOWN;};
00352 CType type;
00353 string cname;
00354 string vname;
00355 bool numeric;
00356 unsigned nr;
00357 };
00358
00362 enum ErrorCodes
00363 {
00364 DISK_PARTITION_OVERLAPS_EXISTING = -1000,
00365 DISK_PARTITION_EXCEEDS_DISK = -1001,
00366 DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
00367 DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
00368 DISK_PARTITION_NO_FREE_NUMBER = -1004,
00369 DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
00370 DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
00371 DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
00372 DISK_PARTITION_NOT_FOUND = -1008,
00373 DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
00374 DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
00375 DISK_SET_TYPE_INVALID_VOLUME = -1011,
00376 DISK_SET_TYPE_PARTED_FAILED = -1012,
00377 DISK_SET_LABEL_PARTED_FAILED = -1013,
00378 DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
00379 DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
00380 DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
00381 DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
00382 DISK_PARTITION_ZERO_SIZE = -1018,
00383 DISK_CHANGE_READONLY = -1019,
00384 DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
00385 DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
00386 DISK_RESIZE_NO_SPACE = -1022,
00387 DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
00388 DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
00389 DISK_COMMIT_NOTHING_TODO = -1025,
00390 DISK_CREATE_PARTITION_NO_SPACE = -1026,
00391 DISK_REMOVE_USED_BY = -1027,
00392 DISK_INIT_NOT_POSSIBLE = -1028,
00393
00394 STORAGE_DISK_NOT_FOUND = -2000,
00395 STORAGE_VOLUME_NOT_FOUND = -2001,
00396 STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
00397 STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
00398 STORAGE_CHANGE_READONLY = -2004,
00399 STORAGE_DISK_USED_BY = -2005,
00400 STORAGE_LVM_VG_EXISTS = -2006,
00401 STORAGE_LVM_VG_NOT_FOUND = -2007,
00402 STORAGE_LVM_INVALID_DEVICE = -2008,
00403 STORAGE_CONTAINER_NOT_FOUND = -2009,
00404 STORAGE_VG_INVALID_NAME = -2010,
00405 STORAGE_REMOVE_USED_VOLUME = -2011,
00406 STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
00407 STORAGE_NOT_YET_IMPLEMENTED = -2013,
00408 STORAGE_MD_INVALID_NAME = -2014,
00409 STORAGE_MD_NOT_FOUND = -2015,
00410 STORAGE_MEMORY_EXHAUSTED = -2016,
00411 STORAGE_LOOP_NOT_FOUND = -2017,
00412 STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
00413 STORAGE_EVMS_INVALID_NAME = -2019,
00414 STORAGE_EVMS_CO_EXISTS = -2020,
00415 STORAGE_EVMS_CO_NOT_FOUND = -2021,
00416 STORAGE_EVMS_INVALID_DEVICE = -2022,
00417 STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
00418 STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
00419 STORAGE_INVALID_FSTAB_VALUE = -2025,
00420 STORAGE_NO_FSTAB_PTR = -2026,
00421 STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
00422
00423 VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
00424 VOLUME_FSTAB_EMPTY_MOUNT = -3001,
00425 VOLUME_UMOUNT_FAILED = -3002,
00426 VOLUME_MOUNT_FAILED = -3003,
00427 VOLUME_FORMAT_DD_FAILED = -3004,
00428 VOLUME_FORMAT_UNKNOWN_FS = -3005,
00429 VOLUME_FORMAT_FS_UNDETECTED = -3006,
00430 VOLUME_FORMAT_FS_TOO_SMALL = -3007,
00431 VOLUME_FORMAT_FAILED = -3008,
00432 VOLUME_TUNE2FS_FAILED = -3009,
00433 VOLUME_MKLABEL_FS_UNABLE = -3010,
00434 VOLUME_MKLABEL_FAILED = -3011,
00435 VOLUME_LOSETUP_NO_LOOP = -3012,
00436 VOLUME_LOSETUP_FAILED = -3013,
00437 VOLUME_CRYPT_NO_PWD = -3014,
00438 VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
00439 VOLUME_CRYPT_NOT_DETECTED = -3016,
00440 VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
00441 VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
00442 VOLUME_MOUNT_POINT_INVALID = -3019,
00443 VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
00444 VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
00445 VOLUME_LABEL_NOT_SUPPORTED = -3022,
00446 VOLUME_LABEL_TOO_LONG = -3023,
00447 VOLUME_LABEL_WHILE_MOUNTED = -3024,
00448 VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
00449 VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
00450 VOLUME_RESIZE_FAILED = -3027,
00451 VOLUME_ALREADY_IN_USE = -3028,
00452 VOLUME_LOUNSETUP_FAILED = -3029,
00453 VOLUME_DEVICE_NOT_PRESENT = -3030,
00454 VOLUME_DEVICE_NOT_BLOCK = -3031,
00455 VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
00456 VOLUME_CRYPTFORMAT_FAILED = -3033,
00457 VOLUME_CRYPTSETUP_FAILED = -3034,
00458 VOLUME_CRYPTUNSETUP_FAILED = -3035,
00459 VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
00460 VOLUME_FORMAT_NFS_IMPOSSIBLE = -3037,
00461 VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
00462
00463 LVM_CREATE_PV_FAILED = -4000,
00464 LVM_PV_ALREADY_CONTAINED = -4001,
00465 LVM_PV_DEVICE_UNKNOWN = -4002,
00466 LVM_PV_DEVICE_USED = -4003,
00467 LVM_VG_HAS_NONE_PV = -4004,
00468 LVM_LV_INVALID_NAME = -4005,
00469 LVM_LV_DUPLICATE_NAME = -4006,
00470 LVM_LV_NO_SPACE = -4007,
00471 LVM_LV_UNKNOWN_NAME = -4008,
00472 LVM_LV_NOT_IN_LIST = -4009,
00473 LVM_VG_CREATE_FAILED = -4010,
00474 LVM_VG_EXTEND_FAILED = -4011,
00475 LVM_VG_REDUCE_FAILED = -4012,
00476 LVM_VG_REMOVE_FAILED = -4013,
00477 LVM_LV_CREATE_FAILED = -4014,
00478 LVM_LV_REMOVE_FAILED = -4015,
00479 LVM_LV_RESIZE_FAILED = -4016,
00480 LVM_PV_STILL_ADDED = -4017,
00481 LVM_PV_REMOVE_NOT_FOUND = -4018,
00482 LVM_CREATE_LV_INVALID_VOLUME = -4019,
00483 LVM_REMOVE_LV_INVALID_VOLUME = -4020,
00484 LVM_RESIZE_LV_INVALID_VOLUME = -4021,
00485 LVM_CHANGE_READONLY = -4022,
00486 LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
00487 LVM_COMMIT_NOTHING_TODO = -4024,
00488 LVM_LV_REMOVE_USED_BY = -4025,
00489 LVM_LV_ALREADY_ON_DISK = -4026,
00490 LVM_LV_NO_STRIPE_SIZE = -4027,
00491
00492 FSTAB_ENTRY_NOT_FOUND = -5000,
00493 FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
00494 FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
00495 FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
00496 FSTAB_ADD_ENTRY_FOUND = -5004,
00497
00498 MD_CHANGE_READONLY = -6000,
00499 MD_DUPLICATE_NUMBER = -6001,
00500 MD_TOO_FEW_DEVICES = -6002,
00501 MD_DEVICE_UNKNOWN = -6003,
00502 MD_DEVICE_USED = -6004,
00503 MD_CREATE_INVALID_VOLUME = -6005,
00504 MD_REMOVE_FAILED = -6006,
00505 MD_NOT_IN_LIST = -6007,
00506 MD_CREATE_FAILED = -6008,
00507 MD_UNKNOWN_NUMBER = -6009,
00508 MD_REMOVE_USED_BY = -6010,
00509 MD_NUMBER_TOO_LARGE = -6011,
00510 MD_REMOVE_INVALID_VOLUME = -6012,
00511 MD_REMOVE_CREATE_NOT_FOUND = -6013,
00512 MD_NO_RESIZE_ON_DISK = -6014,
00513 MD_ADD_DUPLICATE = -6015,
00514 MD_REMOVE_NONEXISTENT = -6016,
00515 MD_NO_CHANGE_ON_DISK = -6017,
00516 MD_NO_CREATE_UNKNOWN = -6018,
00517
00518 LOOP_CHANGE_READONLY = -7000,
00519 LOOP_DUPLICATE_FILE = -7001,
00520 LOOP_UNKNOWN_FILE = -7002,
00521 LOOP_REMOVE_USED_BY = -7003,
00522 LOOP_FILE_CREATE_FAILED = -7004,
00523 LOOP_CREATE_INVALID_VOLUME = -7005,
00524 LOOP_REMOVE_FILE_FAILED = -7006,
00525 LOOP_REMOVE_INVALID_VOLUME = -7007,
00526 LOOP_NOT_IN_LIST = -7008,
00527 LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
00528 LOOP_MODIFY_EXISTING = -7010,
00529
00530 EVMS_HELPER_UNKNOWN_CMD = -8000,
00531 EVMS_UNSUPPORTED_CONTAINER_TYPE = -8001,
00532 EVMS_MALLOC_FAILED = -8002,
00533 EVMS_INVALID_PHYSICAL_VOLUME = -8003,
00534 EVMS_PHYSICAL_VOLUME_IN_USE = -8004,
00535 EVMS_PLUGIN_NOT_FOUND = -8005,
00536 EVMS_CREATE_CONTAINER_FAILED = -8006,
00537 EVMS_RESIZE_VOLUME_NOT_FOUND = -8007,
00538 EVMS_RESIZE_CONTAINER_NOT_FOUND = -8008,
00539 EVMS_RESIZE_EXPAND_FAILED = -8009,
00540 EVMS_RESIZE_SHRINK_FAILED = -8010,
00541 EVMS_COMMIT_FAILED = -8011,
00542 EVMS_CREATE_VOLUME_FREESPACE_NOT_FOUND = -8012,
00543 EVMS_CREATE_VOLUME_FAILED = -8013,
00544 EVMS_CREATE_COMPAT_VOLUME_FAILED = -8014,
00545 EVMS_SEGMENT_NOT_FOUND = -8015,
00546 EVMS_REMOVE_VOLUME_NOT_FOUND = -8016,
00547 EVMS_REMOVE_REGION_FAILED = -8017,
00548 EVMS_CONTAINER_NOT_FOUND = -8018,
00549 EVMS_CONTAINER_EXPAND_FAILED = -8019,
00550 EVMS_CONTAINER_SHRINK_INVALID_SEGMENT = -8020,
00551 EVMS_CONTAINER_SHRINK_FAILED = -8021,
00552 EVMS_CONTAINER_REMOVE_FAILED = -8022,
00553 EVMS_PV_ALREADY_CONTAINED = -8023,
00554 EVMS_PV_DEVICE_UNKNOWN = -8024,
00555 EVMS_PV_DEVICE_USED = -8025,
00556 EVMS_CO_HAS_NONE_PV = -8026,
00557 EVMS_LV_INVALID_NAME = -8027,
00558 EVMS_LV_DUPLICATE_NAME = -8028,
00559 EVMS_LV_NO_SPACE = -8029,
00560 EVMS_LV_UNKNOWN_NAME = -8030,
00561 EVMS_LV_NOT_IN_LIST = -8031,
00562 EVMS_PV_STILL_ADDED = -8032,
00563 EVMS_PV_REMOVE_NOT_FOUND = -8033,
00564 EVMS_CREATE_LV_INVALID_VOLUME = -8034,
00565 EVMS_REMOVE_LV_INVALID_VOLUME = -8035,
00566 EVMS_RESIZE_LV_INVALID_VOLUME = -8036,
00567 EVMS_CHANGE_READONLY = -8037,
00568 EVMS_CHECK_RESIZE_INVALID_VOLUME = -8038,
00569 EVMS_COMMIT_NOTHING_TODO = -8039,
00570 EVMS_LV_REMOVE_USED_BY = -8040,
00571 EVMS_COMMUNICATION_FAILED = -8041,
00572 EVMS_LV_ALREADY_ON_DISK = -8042,
00573 EVMS_LV_NO_STRIPE_SIZE = -8043,
00574 EVMS_ACTIVATE_FAILED = -8044,
00575 EVMS_CONTAINER_NOT_CREATED = -8045,
00576
00577 PEC_PE_SIZE_INVALID = -9000,
00578 PEC_PV_NOT_FOUND = -9001,
00579 PEC_REMOVE_PV_IN_USE = -9002,
00580 PEC_REMOVE_PV_SIZE_NEEDED = -9003,
00581 PEC_LV_NO_SPACE_STRIPED = -9004,
00582 PEC_LV_NO_SPACE_SINGLE = -9005,
00583 PEC_LV_PE_DEV_NOT_FOUND = -9006,
00584
00585 DM_CHANGE_READONLY = -10000,
00586 DM_UNKNOWN_TABLE = -10001,
00587 DM_REMOVE_USED_BY = -10002,
00588 DM_REMOVE_CREATE_NOT_FOUND = -10003,
00589 DM_REMOVE_INVALID_VOLUME = -10004,
00590 DM_REMOVE_FAILED = -10005,
00591 DM_NOT_IN_LIST = -10006,
00592
00593 DASD_NOT_POSSIBLE = -11000,
00594 DASD_FDASD_FAILED = -11001,
00595 DASD_DASDFMT_FAILED = -11002,
00596
00597 NFS_VOLUME_NOT_FOUND = -14001,
00598 NFS_CHANGE_READONLY = -14002,
00599 NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
00600 NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
00601 NFS_REMOVE_INVALID_VOLUME = -14005,
00602
00603 CONTAINER_INTERNAL_ERROR = -99000,
00604 CONTAINER_INVALID_VIRTUAL_CALL = -99001,
00605
00606 };
00607
00608
00612 class StorageInterface
00613 {
00614 public:
00615
00616 StorageInterface () {}
00617 virtual ~StorageInterface () {}
00618
00622 virtual void getContainers( deque<ContainerInfo>& infos) = 0;
00623
00631 virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
00632
00641 virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
00642 DiskInfo& info ) = 0;
00643
00651 virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
00652
00661 virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
00662 LvmVgInfo& info) = 0;
00663
00671 virtual int getEvmsCoInfo( const string& name, EvmsCoInfo& info) = 0;
00672
00681 virtual int getContEvmsCoInfo( const string& name, ContainerInfo& cinfo,
00682 EvmsCoInfo& info) = 0;
00683
00689 virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
00690
00698 virtual int getVolume( const string& device, VolumeInfo& info) = 0;
00699
00707 virtual int getPartitionInfo( const string& disk,
00708 deque<PartitionInfo>& plist ) = 0;
00709
00717 virtual int getLvmLvInfo( const string& name,
00718 deque<LvmLvInfo>& plist ) = 0;
00719
00727 virtual int getEvmsInfo( const string& name,
00728 deque<EvmsInfo>& plist ) = 0;
00729
00736 virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
00737
00744 virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
00745
00752 virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
00753
00760 virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
00761
00765 virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
00766
00774 virtual void printInfo( std::ostream& str ) = 0;
00775
00788 virtual int createPartition( const string& disk, PartitionType type,
00789 unsigned long start,
00790 unsigned long sizeCyl,
00791 string& device ) = 0;
00792
00801 virtual int resizePartition( const string& device,
00802 unsigned long sizeCyl ) = 0;
00803
00812 virtual int resizePartitionNoFs( const string& device,
00813 unsigned long sizeCyl ) = 0;
00814
00825 virtual int updatePartitionArea( const string& device,
00826 unsigned long start,
00827 unsigned long sizeCyl ) = 0;
00828
00829
00839 virtual int nextFreePartition( const string& disk, PartitionType type,
00840 unsigned &nr, string& device ) = 0;
00841
00854 virtual int createPartitionKb( const string& disk, PartitionType type,
00855 unsigned long long start,
00856 unsigned long long size,
00857 string& device ) = 0;
00858
00869 virtual int createPartitionAny( const string& disk,
00870 unsigned long long size,
00871 string& device ) = 0;
00872
00883 virtual int createPartitionMax( const string& disk, PartitionType type,
00884 string& device ) = 0;
00885
00893 virtual unsigned long long cylinderToKb( const string& disk,
00894 unsigned long size ) = 0;
00895
00903 virtual unsigned long kbToCylinder( const string& disk,
00904 unsigned long long size ) = 0;
00905
00912 virtual int removePartition (const string& partition) = 0;
00913
00921 virtual int changePartitionId (const string& partition, unsigned id) = 0;
00922
00929 virtual int forgetChangePartitionId (const string& partition ) = 0;
00930
00939 virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
00940
00951 virtual int initializeDisk( const string& disk, bool value ) = 0;
00952
00959 virtual string defaultDiskLabel() const = 0;
00960
00970 virtual string defaultDiskLabelSize( unsigned long long size_k ) const = 0;
00971
00977 virtual unsigned long long maxSizeLabelK( const string& label ) const = 0;
00978
00987 virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
00988
00996 virtual int changeLabelVolume( const string& device, const string& label ) = 0;
00997
01005 virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
01006
01015 virtual int changeMountPoint( const string& device, const string& mount ) = 0;
01016
01024 virtual int getMountPoint( const string& device, string& mount ) = 0;
01025
01033 virtual int changeMountBy( const string& device, MountByType mby ) = 0;
01034
01042 #ifndef SWIG
01043 virtual int getMountBy( const string& device, MountByType& mby ) = 0;
01044 #else
01045 virtual int getMountBy( const string& device, MountByType& REFERENCE ) = 0;
01046 #endif
01047
01057 virtual int changeFstabOptions( const string& device, const string& options ) = 0;
01058
01067 virtual int getFstabOptions( const string& device, string& options ) = 0;
01068
01077 virtual int addFstabOptions( const string& device, const string& options ) = 0;
01078
01088 virtual int removeFstabOptions( const string& device, const string& options ) = 0;
01089
01097 virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
01098
01105 virtual int forgetCryptPassword( const string& device ) = 0;
01106
01114 virtual int getCryptPassword( const string& device, string& pwd ) = 0;
01115
01123 virtual int setCrypt( const string& device, bool val ) = 0;
01124
01133 virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
01134
01142 #ifndef SWIG
01143 virtual int getCrypt( const string& device, bool& val ) = 0;
01144 #else
01145 virtual int getCrypt( const string& device, bool& REFERENCE ) = 0;
01146 #endif
01147
01157 virtual int setIgnoreFstab( const string& device, bool val ) = 0;
01158
01166 #ifndef SWIG
01167 virtual int getIgnoreFstab( const string& device, bool& val ) = 0;
01168 #else
01169 virtual int getIgnoreFstab( const string& device, bool& REFERENCE ) = 0;
01170 #endif
01171
01180 virtual int changeDescText( const string& device, const string& txt ) = 0;
01181
01193 virtual int addFstabEntry( const string& device, const string& mount,
01194 const string& vfs, const string& options,
01195 unsigned freq, unsigned passno ) = 0;
01196
01197
01205 virtual int resizeVolume( const string& device, unsigned long long newSizeMb ) = 0;
01206
01214 virtual int resizeVolumeNoFs( const string& device, unsigned long long newSizeMb ) = 0;
01215
01222 virtual int forgetResizeVolume( const string& device ) = 0;
01223
01238 virtual void setRecursiveRemoval( bool val ) = 0;
01239
01245 virtual bool getRecursiveRemoval() const = 0;
01246
01260 virtual void setZeroNewPartitions( bool val ) = 0;
01261
01267 virtual bool getZeroNewPartitions() const = 0;
01268
01272 virtual void setDefaultMountBy( MountByType val ) = 0;
01273
01277 virtual MountByType getDefaultMountBy() const = 0;
01278
01288 virtual void setRootPrefix( const string& root ) = 0;
01289
01295 virtual void setDetectMountedVolumes( bool val ) = 0;
01296
01302 virtual bool getDetectMountedVolumes() const = 0;
01303
01311 virtual int removeVolume( const string& device ) = 0;
01312
01323 virtual int createLvmVg( const string& name,
01324 unsigned long long peSizeK, bool lvm1,
01325 const deque<string>& devs ) = 0;
01326
01334 virtual int removeLvmVg( const string& name ) = 0;
01335
01343 virtual int extendLvmVg( const string& name,
01344 const deque<string>& devs ) = 0;
01345
01353 virtual int shrinkLvmVg( const string& name,
01354 const deque<string>& devs ) = 0;
01355
01367 virtual int createLvmLv( const string& vg, const string& name,
01368 unsigned long long sizeM, unsigned stripe,
01369 string& device ) = 0;
01370
01377 virtual int removeLvmLvByDevice( const string& device ) = 0;
01378
01386 virtual int removeLvmLv( const string& vg, const string& name ) = 0;
01387
01397 virtual int changeLvStripeCount( const string& vg, const string& name,
01398 unsigned long stripes ) = 0;
01399
01409 virtual int changeLvStripeSize( const string& vg, const string& name,
01410 unsigned long long stripeSize ) = 0;
01411
01422 virtual int createEvmsContainer( const string& name,
01423 unsigned long long peSizeK, bool lvm1,
01424 const deque<string>& devs ) = 0;
01425
01440 virtual int modifyEvmsContainer( const string& old_name,
01441 const string& new_name,
01442 unsigned long long peSizeK,
01443 bool lvm1 ) = 0;
01444
01452 virtual int removeEvmsContainer( const string& name ) = 0;
01453
01461 virtual int extendEvmsContainer( const string& name,
01462 const deque<string>& devs ) = 0;
01463
01471 virtual int shrinkEvmsContainer( const string& name,
01472 const deque<string>& devs ) = 0;
01473
01485 virtual int createEvmsVolume( const string& coname, const string& name,
01486 unsigned long long sizeM, unsigned stripe,
01487 string& device ) = 0;
01488
01495 virtual int removeEvmsVolumeByDevice( const string& device ) = 0;
01496
01504 virtual int removeEvmsVolume( const string& coname, const string& name ) = 0;
01505
01515 virtual int changeEvmsStripeCount( const string& coname,
01516 const string& name,
01517 unsigned long stripe ) = 0;
01518
01528 virtual int changeEvmsStripeSize( const string& coname,
01529 const string& name,
01530 unsigned long long stripeSize ) = 0;
01531
01541 virtual int evmsActivate( bool force ) = 0;
01542
01551 virtual int createMd( const string& name, MdType rtype,
01552 const deque<string>& devs ) = 0;
01553
01562 virtual int createMdAny( MdType rtype, const deque<string>& devs,
01563 string& device ) = 0;
01564
01573 virtual int removeMd( const string& name, bool destroySb ) = 0;
01574
01583 virtual int extendMd( const string& name, const string& dev ) = 0;
01584
01593 virtual int shrinkMd( const string& name, const string& dev ) = 0;
01594
01603 virtual int changeMdType( const string& name, MdType rtype ) = 0;
01604
01613 virtual int changeMdChunk( const string& name, unsigned long chunk ) = 0;
01614
01623 virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
01624
01631 virtual int checkMd( const string& name ) = 0;
01632
01642 virtual int addNfsDevice( const string& nfsDev, const string& opts,
01643 unsigned long long sizeK,
01644 const string& mp ) = 0;
01645
01654 virtual int checkNfsDevice( const string& nfsDev, const string& opts,
01655 unsigned long long& sizeK ) = 0;
01656
01673 virtual int createFileLoop( const string& lname, bool reuseExisting,
01674 unsigned long long sizeK,
01675 const string& mp, const string& pwd,
01676 string& device ) = 0;
01677
01695 virtual int modifyFileLoop( const string& device, const string& lname,
01696 bool reuseExisting,
01697 unsigned long long sizeK ) = 0;
01698
01707 virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
01708
01717 virtual deque<string> getCommitActions( bool mark_destructive ) = 0;
01718
01724 virtual const string& getLastAction() const = 0;
01725
01732 virtual const string& getExtendedErrorMessage() const = 0;
01733
01734
01735 #ifndef SWIG
01736
01742 virtual void setCallbackProgressBar( CallbackProgressBar pfnc ) = 0;
01743
01749 virtual CallbackProgressBar getCallbackProgressBar() const = 0;
01750
01751
01757 virtual void setCallbackShowInstallInfo( CallbackShowInstallInfo pfnc ) = 0;
01758
01764 virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
01765
01766
01773 virtual void setCallbackInfoPopup( CallbackInfoPopup pfnc ) = 0;
01774
01781 virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
01782
01783
01790 virtual void setCallbackYesNoPopup( CallbackYesNoPopup pfnc ) = 0;
01791
01798 virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
01799
01800 #endif
01801
01807 virtual void setCacheChanges (bool cache) = 0;
01808
01812 virtual bool isCacheChanges () const = 0;
01813
01818 virtual int commit() = 0;
01819
01826 virtual int createBackupState( const string& name ) = 0;
01827
01834 virtual int restoreBackupState( const string& name ) = 0;
01835
01842 virtual bool checkBackupState( const string& name ) = 0;
01843
01852 virtual bool equalBackupStates( const string& lhs,
01853 const string& rhs,
01854 bool verbose_log ) const = 0;
01855
01863 virtual int removeBackupState( const string& name ) = 0;
01864
01872 virtual bool checkDeviceMounted( const string& device, string& mp ) = 0;
01873
01882 virtual bool umountDevice( const string& device ) = 0;
01883
01893 virtual bool mountDevice( const string& device, const string& mp ) = 0;
01894
01901 virtual bool checkDmMapsTo( const string& device ) = 0;
01902
01908 virtual void removeDmTableTo( const string& device ) = 0;
01909
01921 virtual bool getFreeInfo( const string& device,
01922 unsigned long long& resize_free,
01923 unsigned long long& df_free,
01924 unsigned long long& used,
01925 bool& win, bool& efi, bool use_cache ) = 0;
01926
01934 virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
01935
01942 virtual void activateHld( bool val ) = 0;
01943
01953 virtual void rescanEverything() = 0;
01954
01959 virtual void dumpObjectList() = 0;
01960
01970 virtual int getContVolInfo( const string& dev, ContVolInfo& info) = 0;
01971
01972 };
01973
01974
01978 void initDefaultLogger ();
01979
01980
01984 StorageInterface* createDefaultStorageInterface ();
01985
01986
01990 StorageInterface* createStorageInterface (bool readonly, bool testmode,
01991 bool autodetect);
01992
01993
01997 void destroyStorageInterface (StorageInterface*);
01998
01999 }
02000
02001
02002 #endif