24 #ifndef STORAGE_INTERFACE_H
25 #define STORAGE_INTERFACE_H
41 #include "storage/StorageVersion.h"
42 #include "storage/StorageSwig.h"
144 enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS,
145 SWAP, HFSPLUS, NFS, NFS4, TMPFS, ISO9660, UDF, FSNONE };
147 enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
149 enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
151 enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
152 ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
154 enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
156 enum MdParity { PAR_DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC,
157 RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC, PAR_FIRST, PAR_LAST,
158 LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6, RIGHT_ASYMMETRIC_6,
159 RIGHT_SYMMETRIC_6, PAR_FIRST_6,
160 PAR_NEAR_2, PAR_OFFSET_2, PAR_FAR_2,
161 PAR_NEAR_3, PAR_OFFSET_3, PAR_FAR_3 };
163 enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO,
164 CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE };
166 enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS };
168 enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC };
170 enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE };
172 enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF };
174 enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER };
176 enum DasdFormat { DASDF_NONE, DASDF_LDL, DASDF_CDL };
178 enum DasdType { DASDTYPE_NONE, DASDTYPE_ECKD, DASDTYPE_FBA };
184 typedef void (*CallbackProgressBar)(
const string& id,
unsigned cur,
unsigned max);
190 typedef void (*CallbackShowInstallInfo)(
const string& id);
196 typedef void (*CallbackInfoPopup)(
const string& text);
204 typedef bool (*CallbackYesNoPopup)(
const string& text);
211 typedef bool (*CallbackCommitErrorPopup)(
int error,
const string& last_action,
212 const string& extended_message);
219 typedef bool (*CallbackPasswordPopup)(
const string& device,
int attempts,
string& password);
232 virtual void post_root_filesystem_create()
const {}
233 virtual void post_root_mount()
const {}
234 virtual void post_root_fstab_add()
const {}
246 bool isExtendableWhileMounted;
248 bool isReduceableWhileMounted;
251 bool labelWhileMounted;
252 unsigned int labelLength;
254 unsigned long long minimalFsSizeK;
264 bool extendedPossible;
266 unsigned long long maxSectors;
273 UsedByInfo(UsedByType type,
const string& device) : type(type), device(device) {}
281 ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(
false) {}
282 unsigned long long df_freeK;
283 unsigned long long resize_freeK;
284 unsigned long long usedK;
291 ContentInfo() : windows(
false), efi(
false), homes(0) {}
308 list<UsedByInfo> usedBy;
310 map<string, string> userdata;
330 unsigned long long sizeK;
331 unsigned long long cylSize;
334 unsigned long sectors;
335 unsigned int sectorSize;
337 string orig_disklabel;
339 bool extendedPossible;
343 bool has_fake_partition;
344 storage::DasdFormat dasd_format;
345 storage::DasdType dasd_type;
354 unsigned long long sizeK;
355 unsigned long long peSizeK;
356 unsigned long peCount;
357 unsigned long peFree;
361 list<string> devices;
362 list<string> devices_add;
363 list<string> devices_rem;
373 list<string> devices;
397 unsigned long long sizeK;
402 MountByType mount_by;
404 string fstab_options;
408 string tunefs_options;
411 EncryptType encryption;
420 unsigned long long origSizeK;
429 RegionInfo(
unsigned long long start,
unsigned long long len) : start(start), len(len) {}
430 unsigned long long start;
431 unsigned long long len;
439 PartitionType partitionType;
454 PartitionType partitionType;
467 unsigned stripeSizeK;
499 unsigned long chunkSizeK;
500 list<string> devices;
527 unsigned long chunkSizeK;
528 list<string> devices;
577 : path(), nocow(
false), created(
false), deleted(
false) {}
578 SubvolumeInfo(
const string& path,
bool nocow,
bool created,
bool deleted)
579 : path(path), nocow(nocow), created(created), deleted(deleted) {}
596 list<string> devices;
597 list<string> devices_add;
598 list<string> devices_rem;
599 vector<SubvolumeInfo> subvolumes;
679 bool primaryPossible;
681 bool extendedPossible;
683 bool logicalPossible;
702 STORAGE_NO_ERROR = 0,
704 DISK_PARTITION_OVERLAPS_EXISTING = -1000,
705 DISK_PARTITION_EXCEEDS_DISK = -1001,
706 DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
707 DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
708 DISK_PARTITION_NO_FREE_NUMBER = -1004,
709 DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
710 DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
711 DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
712 DISK_PARTITION_NOT_FOUND = -1008,
713 DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
714 DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
715 DISK_SET_TYPE_INVALID_VOLUME = -1011,
716 DISK_SET_TYPE_PARTED_FAILED = -1012,
717 DISK_SET_LABEL_PARTED_FAILED = -1013,
718 DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
719 DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
720 DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
721 DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
722 DISK_PARTITION_ZERO_SIZE = -1018,
723 DISK_CHANGE_READONLY = -1019,
724 DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
725 DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
726 DISK_RESIZE_NO_SPACE = -1022,
727 DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
728 DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
729 DISK_COMMIT_NOTHING_TODO = -1025,
730 DISK_CREATE_PARTITION_NO_SPACE = -1026,
731 DISK_REMOVE_USED_BY = -1027,
732 DISK_INIT_NOT_POSSIBLE = -1028,
733 DISK_INVALID_PARTITION_ID = -1029,
735 STORAGE_DISK_NOT_FOUND = -2000,
736 STORAGE_VOLUME_NOT_FOUND = -2001,
737 STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
738 STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
739 STORAGE_CHANGE_READONLY = -2004,
740 STORAGE_DISK_USED_BY = -2005,
741 STORAGE_LVM_VG_EXISTS = -2006,
742 STORAGE_LVM_VG_NOT_FOUND = -2007,
743 STORAGE_LVM_INVALID_DEVICE = -2008,
744 STORAGE_CONTAINER_NOT_FOUND = -2009,
745 STORAGE_VG_INVALID_NAME = -2010,
746 STORAGE_REMOVE_USED_VOLUME = -2011,
747 STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
748 STORAGE_NOT_YET_IMPLEMENTED = -2013,
749 STORAGE_MD_INVALID_NAME = -2014,
750 STORAGE_MD_NOT_FOUND = -2015,
751 STORAGE_MEMORY_EXHAUSTED = -2016,
752 STORAGE_LOOP_NOT_FOUND = -2017,
753 STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
754 STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
755 STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
756 STORAGE_INVALID_FSTAB_VALUE = -2025,
757 STORAGE_NO_FSTAB_PTR = -2026,
758 STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
759 STORAGE_DMRAID_CO_NOT_FOUND = -2028,
760 STORAGE_RESIZE_INVALID_CONTAINER = -2029,
761 STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030,
762 STORAGE_ZERO_DEVICE_FAILED = -2031,
763 STORAGE_INVALID_BACKUP_STATE_NAME = -2032,
764 STORAGE_MDPART_CO_NOT_FOUND = -2033,
765 STORAGE_DEVICE_NOT_FOUND = -2034,
766 STORAGE_BTRFS_CO_NOT_FOUND = -2035,
767 STORAGE_TMPFS_CO_NOT_FOUND = -2036,
768 STORAGE_VOLUME_NOT_ENCRYPTED = -2037,
769 STORAGE_DM_RENAME_FAILED = -2038,
771 VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
772 VOLUME_FSTAB_EMPTY_MOUNT = -3001,
773 VOLUME_UMOUNT_FAILED = -3002,
774 VOLUME_MOUNT_FAILED = -3003,
775 VOLUME_FORMAT_UNKNOWN_FS = -3005,
776 VOLUME_FORMAT_FS_UNDETECTED = -3006,
777 VOLUME_FORMAT_FS_TOO_SMALL = -3007,
778 VOLUME_FORMAT_FAILED = -3008,
779 VOLUME_TUNE2FS_FAILED = -3009,
780 VOLUME_MKLABEL_FS_UNABLE = -3010,
781 VOLUME_MKLABEL_FAILED = -3011,
782 VOLUME_LOSETUP_NO_LOOP = -3012,
783 VOLUME_LOSETUP_FAILED = -3013,
784 VOLUME_CRYPT_NO_PWD = -3014,
785 VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
786 VOLUME_CRYPT_NOT_DETECTED = -3016,
787 VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
788 VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
789 VOLUME_MOUNT_POINT_INVALID = -3019,
790 VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
791 VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
792 VOLUME_LABEL_NOT_SUPPORTED = -3022,
793 VOLUME_LABEL_TOO_LONG = -3023,
794 VOLUME_LABEL_WHILE_MOUNTED = -3024,
795 VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
796 VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
797 VOLUME_RESIZE_FAILED = -3027,
798 VOLUME_ALREADY_IN_USE = -3028,
799 VOLUME_LOUNSETUP_FAILED = -3029,
800 VOLUME_DEVICE_NOT_PRESENT = -3030,
801 VOLUME_DEVICE_NOT_BLOCK = -3031,
802 VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
803 VOLUME_CRYPTFORMAT_FAILED = -3033,
804 VOLUME_CRYPTSETUP_FAILED = -3034,
805 VOLUME_CRYPTUNSETUP_FAILED = -3035,
806 VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
807 VOLUME_FORMAT_IMPOSSIBLE = -3037,
808 VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
809 VOLUME_REMOUNT_FAILED = -3039,
810 VOLUME_TUNEREISERFS_FAILED = -3040,
811 VOLUME_UMOUNT_NOT_MOUNTED = -3041,
812 VOLUME_BTRFS_ADD_FAILED = -3042,
813 VOLUME_CANNOT_TMP_MOUNT = -3043,
814 VOLUME_CANNOT_TMP_UMOUNT = -3044,
815 VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045,
816 VOLUME_BTRFS_SUBVOL_SETDEFAULT = -3046,
818 LVM_CREATE_PV_FAILED = -4000,
819 LVM_PV_ALREADY_CONTAINED = -4001,
820 LVM_PV_DEVICE_UNKNOWN = -4002,
821 LVM_PV_DEVICE_USED = -4003,
822 LVM_VG_HAS_NONE_PV = -4004,
823 LVM_LV_INVALID_NAME = -4005,
824 LVM_LV_DUPLICATE_NAME = -4006,
825 LVM_LV_NO_SPACE = -4007,
826 LVM_LV_UNKNOWN_NAME = -4008,
827 LVM_LV_NOT_IN_LIST = -4009,
828 LVM_VG_CREATE_FAILED = -4010,
829 LVM_VG_EXTEND_FAILED = -4011,
830 LVM_VG_REDUCE_FAILED = -4012,
831 LVM_VG_REMOVE_FAILED = -4013,
832 LVM_LV_CREATE_FAILED = -4014,
833 LVM_LV_REMOVE_FAILED = -4015,
834 LVM_LV_RESIZE_FAILED = -4016,
835 LVM_PV_STILL_ADDED = -4017,
836 LVM_PV_REMOVE_NOT_FOUND = -4018,
837 LVM_CREATE_LV_INVALID_VOLUME = -4019,
838 LVM_REMOVE_LV_INVALID_VOLUME = -4020,
839 LVM_RESIZE_LV_INVALID_VOLUME = -4021,
840 LVM_CHANGE_READONLY = -4022,
841 LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
842 LVM_COMMIT_NOTHING_TODO = -4024,
843 LVM_LV_REMOVE_USED_BY = -4025,
844 LVM_LV_ALREADY_ON_DISK = -4026,
845 LVM_LV_NO_STRIPE_SIZE = -4027,
846 LVM_LV_UNKNOWN_ORIGIN = -4028,
847 LVM_LV_NOT_ON_DISK = -4029,
848 LVM_LV_NOT_SNAPSHOT = -4030,
849 LVM_LV_HAS_SNAPSHOTS = -4031,
850 LVM_LV_IS_SNAPSHOT = -4032,
851 LVM_LIST_EMPTY = -4033,
852 LVM_LV_NO_POOL_OR_SNAP = -4034,
853 LVM_LV_NO_POOL = -4035,
854 LVM_LV_UNKNOWN_POOL = -4036,
855 LVM_LV_INVALID_CHUNK_SIZE = -4037,
856 LVM_LV_POOL_NO_FORMAT = -4038,
857 LVM_LV_POOL_NO_MOUNT = -4039,
859 FSTAB_ENTRY_NOT_FOUND = -5000,
860 FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
861 FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
862 FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
863 FSTAB_ADD_ENTRY_FOUND = -5004,
865 MD_CHANGE_READONLY = -6000,
866 MD_DUPLICATE_NUMBER = -6001,
867 MD_TOO_FEW_DEVICES = -6002,
868 MD_DEVICE_UNKNOWN = -6003,
869 MD_DEVICE_USED = -6004,
870 MD_CREATE_INVALID_VOLUME = -6005,
871 MD_REMOVE_FAILED = -6006,
872 MD_NOT_IN_LIST = -6007,
873 MD_CREATE_FAILED = -6008,
874 MD_UNKNOWN_NUMBER = -6009,
875 MD_REMOVE_USED_BY = -6010,
876 MD_NUMBER_TOO_LARGE = -6011,
877 MD_REMOVE_INVALID_VOLUME = -6012,
878 MD_REMOVE_CREATE_NOT_FOUND = -6013,
879 MD_NO_RESIZE_ON_DISK = -6014,
880 MD_ADD_DUPLICATE = -6015,
881 MD_REMOVE_NONEXISTENT = -6016,
882 MD_NO_CHANGE_ON_DISK = -6017,
883 MD_NO_CREATE_UNKNOWN = -6018,
884 MD_STATE_NOT_ON_DISK = -6019,
885 MD_PARTITION_NOT_FOUND = -6020,
886 MD_INVALID_PARITY = -6021,
887 MD_TOO_MANY_SPARES = -6022,
888 MD_GET_STATE_FAILED = -6023,
889 MD_DUPLICATE_NAME = -6024,
891 MDPART_CHANGE_READONLY = -6100,
892 MDPART_INTERNAL_ERR = -6101,
893 MDPART_INVALID_VOLUME = -6102,
894 MDPART_PARTITION_NOT_FOUND = -6103,
895 MDPART_REMOVE_PARTITION_LIST_ERASE = -6104,
896 MDPART_COMMIT_NOTHING_TODO = -6105,
897 MDPART_NO_REMOVE = -6106,
898 MDPART_DEVICE_NOT_FOUND = -6107,
900 LOOP_CHANGE_READONLY = -7000,
901 LOOP_DUPLICATE_FILE = -7001,
902 LOOP_UNKNOWN_FILE = -7002,
903 LOOP_REMOVE_USED_BY = -7003,
904 LOOP_FILE_CREATE_FAILED = -7004,
905 LOOP_CREATE_INVALID_VOLUME = -7005,
906 LOOP_REMOVE_FILE_FAILED = -7006,
907 LOOP_REMOVE_INVALID_VOLUME = -7007,
908 LOOP_NOT_IN_LIST = -7008,
909 LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
910 LOOP_MODIFY_EXISTING = -7010,
912 PEC_PE_SIZE_INVALID = -9000,
913 PEC_PV_NOT_FOUND = -9001,
914 PEC_REMOVE_PV_IN_USE = -9002,
915 PEC_REMOVE_PV_SIZE_NEEDED = -9003,
916 PEC_LV_NO_SPACE_STRIPED = -9004,
917 PEC_LV_NO_SPACE_SINGLE = -9005,
918 PEC_LV_PE_DEV_NOT_FOUND = -9006,
920 DM_CHANGE_READONLY = -10000,
921 DM_UNKNOWN_TABLE = -10001,
922 DM_REMOVE_USED_BY = -10002,
923 DM_REMOVE_CREATE_NOT_FOUND = -10003,
924 DM_REMOVE_INVALID_VOLUME = -10004,
925 DM_REMOVE_FAILED = -10005,
926 DM_NOT_IN_LIST = -10006,
928 DASD_NOT_POSSIBLE = -11000,
929 DASD_DASDFMT_FAILED = -11002,
931 DMPART_CHANGE_READONLY = -12001,
932 DMPART_INTERNAL_ERR = -12002,
933 DMPART_INVALID_VOLUME = -12003,
934 DMPART_PARTITION_NOT_FOUND = -12004,
935 DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
936 DMPART_COMMIT_NOTHING_TODO = -12006,
937 DMPART_NO_REMOVE = -12007,
939 DMRAID_REMOVE_FAILED = -13001,
941 NFS_VOLUME_NOT_FOUND = -14001,
942 NFS_CHANGE_READONLY = -14002,
943 NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
944 NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
945 NFS_REMOVE_INVALID_VOLUME = -14005,
947 BTRFS_COMMIT_INVALID_VOLUME = -15001,
948 BTRFS_CANNOT_TMP_MOUNT = -15002,
949 BTRFS_CANNOT_TMP_UMOUNT = -15003,
950 BTRFS_DELETE_SUBVOL_FAIL = -15004,
951 BTRFS_CREATE_SUBVOL_FAIL = -15005,
952 BTRFS_VOLUME_NOT_FOUND = -15006,
953 BTRFS_SUBVOL_EXISTS = -15007,
954 BTRFS_SUBVOL_NON_EXISTS = -15008,
955 BTRFS_REMOVE_NOT_FOUND = -15009,
956 BTRFS_REMOVE_NO_BTRFS = -15010,
957 BTRFS_REMOVE_INVALID_VOLUME = -15011,
958 BTRFS_CHANGE_READONLY = -15012,
959 BTRFS_DEV_ALREADY_CONTAINED = -15013,
960 BTRFS_DEVICE_UNKNOWN = -15014,
961 BTRFS_DEVICE_USED = -15015,
962 BTRFS_HAS_NONE_DEV = -15016,
963 BTRFS_DEV_NOT_FOUND = -15017,
964 BTRFS_EXTEND_FAIL = -15018,
965 BTRFS_REDUCE_FAIL = -15019,
966 BTRFS_LIST_EMPTY = -15020,
967 BTRFS_RESIZE_INVALID_VOLUME = -15021,
968 BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022,
970 TMPFS_REMOVE_INVALID_VOLUME = -16001,
971 TMPFS_REMOVE_NO_TMPFS = -16002,
972 TMPFS_REMOVE_NOT_FOUND = -16003,
974 CHATTR_FAILED = -17001,
975 QUOTA_RESTART_FAILED = -17002,
977 CONTAINER_INTERNAL_ERROR = -99000,
978 CONTAINER_INVALID_VIRTUAL_CALL = -99001,
996 virtual void getContainers( deque<ContainerInfo>& infos) = 0;
1118 virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
1137 deque<PartitionInfo>& plist ) = 0;
1147 deque<LvmLvInfo>& plist ) = 0;
1155 virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
1165 deque<MdPartInfo>& plist ) = 0;
1173 virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
1181 virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
1189 virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
1197 virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0;
1205 virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0;
1215 deque<DmraidInfo>& plist ) = 0;
1225 deque<DmmultipathInfo>& plist ) = 0;
1256 string& SWIG_OUTPUT(device)) = 0;
1267 unsigned long sizeCyl ) = 0;
1278 unsigned long sizeCyl ) = 0;
1300 unsigned long& SWIG_OUTPUT(freeCylsBefore),
1301 unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0;
1317 unsigned & SWIG_OUTPUT(nr),
1318 string& SWIG_OUTPUT(device) ) = 0;
1333 string& SWIG_OUTPUT(device)) = 0;
1346 unsigned long long sizeK,
1347 string& SWIG_OUTPUT(device) ) = 0;
1360 string& SWIG_OUTPUT(device) ) = 0;
1369 virtual unsigned long long cylinderToKb(
const string& disk,
1370 unsigned long sizeCyl) = 0;
1379 virtual unsigned long kbToCylinder(
const string& disk,
1380 unsigned long long sizeK) = 0;
1458 virtual int initializeDisk(
const string& disk,
bool value ) = 0;
1515 virtual int changeMountPoint(
const string& device,
const string& mount ) = 0;
1525 string& SWIG_OUTPUT(mount) ) = 0;
1534 virtual int changeMountBy(
const string& device, MountByType mby ) = 0;
1543 virtual int getMountBy(
const string& device,
1544 MountByType& SWIG_OUTPUT(mby) ) = 0;
1566 string& SWIG_OUTPUT(options) ) = 0;
1577 virtual int addFstabOptions(
const string& device,
const string& options ) = 0;
1597 virtual int setCryptPassword(
const string& device,
const string& pwd ) = 0;
1615 string& SWIG_OUTPUT(pwd) ) = 0;
1626 const string& pwd,
bool erase ) = 0;
1643 virtual int setCrypt(
const string& device,
bool val ) = 0;
1653 virtual int setCryptType(
const string& device,
bool val, EncryptType typ ) = 0;
1662 virtual int getCrypt(
const string& device,
bool& SWIG_OUTPUT(val) ) = 0;
1673 virtual int setIgnoreFstab(
const string& device,
bool val ) = 0;
1682 virtual int getIgnoreFstab(
const string& device,
bool& SWIG_OUTPUT(val) ) = 0;
1693 virtual int changeDescText(
const string& device,
const string& txt ) = 0;
1709 virtual int addFstabEntry(
const string& device,
const string& mount,
1710 const string& vfs,
const string& options,
1711 unsigned freq,
unsigned passno ) = 0;
1721 virtual int resizeVolume(
const string& device,
unsigned long long newSizeK) = 0;
1730 virtual int resizeVolumeNoFs(
const string& device,
unsigned long long newSizeK) = 0;
1773 list<string>& using_devices) = 0;
1785 list<string>& usedby_devices) = 0;
1931 unsigned long long peSizeK,
bool lvm1,
1932 const deque<string>& devs ) = 0;
1941 virtual int removeLvmVg(
const string& name ) = 0;
1951 const deque<string>& devs ) = 0;
1961 const deque<string>& devs ) = 0;
1974 virtual int createLvmLv(
const string& vg,
const string& name,
1975 unsigned long long sizeK,
unsigned stripes,
1976 string& SWIG_OUTPUT(device) ) = 0;
1993 virtual int removeLvmLv(
const string& vg,
const string& name ) = 0;
2005 unsigned long stripes ) = 0;
2017 unsigned long long stripeSizeK) = 0;
2030 const string& name,
unsigned long long cowSizeK,
2031 string& SWIG_OUTPUT(device) ) = 0;
2065 unsigned long long sizeK,
2066 string& SWIG_OUTPUT(device) ) = 0;
2080 unsigned long long sizeK,
2081 string& SWIG_OUTPUT(device) ) = 0;
2093 unsigned long long chunkSizeK) = 0;
2102 virtual int nextFreeMd(
unsigned& SWIG_OUTPUT(nr),
2103 string& SWIG_OUTPUT(device)) = 0;
2114 virtual int createMd(
const string& name, MdType md_type,
const list<string>& devices,
2115 const list<string>& spares) = 0;
2126 virtual int createMdAny(MdType md_type,
const list<string>& devices,
2127 const list<string>& spares,
2128 string& SWIG_OUTPUT(device) ) = 0;
2138 virtual int removeMd(
const string& name,
bool destroySb ) = 0;
2149 virtual int extendMd(
const string& name,
const list<string>& devices,
2150 const list<string>& spares) = 0;
2161 virtual int updateMd(
const string& name,
const list<string>& devices,
2162 const list<string>& spares) = 0;
2173 virtual int shrinkMd(
const string& name,
const list<string>& devices,
2174 const list<string>& spares) = 0;
2184 virtual int changeMdType(
const string& name, MdType md_type) = 0;
2194 virtual int changeMdChunk(
const string& name,
unsigned long chunkSizeK) = 0;
2204 virtual int changeMdParity(
const string& name, MdParity ptype ) = 0;
2212 virtual int checkMd(
const string& name ) = 0;
2249 virtual int computeMdSize(MdType md_type,
const list<string>& devices,
2250 const list<string>& spares,
unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2271 virtual int removeMdPartCo(
const string& name,
bool destroySb ) = 0;
2283 virtual int addNfsDevice(
const string& nfsDev,
const string& opts,
2284 unsigned long long sizeK,
const string& mp,
2296 virtual int checkNfsDevice(
const string& nfsDev,
const string& opts,
2297 bool nfs4,
unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2315 virtual int createFileLoop(
const string& lname,
bool reuseExisting,
2316 unsigned long long sizeK,
2317 const string& mp,
const string& pwd,
2318 string& SWIG_OUTPUT(device) ) = 0;
2337 virtual int modifyFileLoop(
const string& device,
const string& lname,
2339 unsigned long long sizeK ) = 0;
2349 virtual int removeFileLoop(
const string& lname,
bool removeFile ) = 0;
2366 virtual bool existSubvolume(
const string& device,
const string& name ) = 0;
2376 virtual int createSubvolume(
const string& device,
const string& name,
bool nocow) = 0;
2385 virtual int removeSubvolume(
const string& device,
const string& name ) = 0;
2396 const deque<string>& devs ) = 0;
2407 const deque<string>& devs ) = 0;
2416 virtual int addTmpfsMount(
const string& mp,
const string& opts ) = 0;
2568 virtual int commit() = 0;
2608 bool verbose_log)
const = 0;
2652 virtual bool umountDeviceUns(
const string& device,
bool unsetup ) = 0;
2664 virtual bool mountDevice(
const string& device,
const string& mp ) = 0;
2690 const string& opts ) = 0;
2703 virtual bool mountDeviceRo(
const string& device,
const string& mp,
2704 const string& opts ) = 0;
2730 const string& new_name ) = 0;
2744 bool get_content,
ContentInfo& content_info,
bool use_cache) = 0;
2753 virtual bool readFstab(
const string& dir, deque<VolumeInfo>& infos) = 0;
2825 virtual int setUserdata(
const string& device,
const map<string, string>& userdata) = 0;
2834 virtual int getUserdata(
const string& device, map<string, string>& userdata) = 0;
2842 void initDefaultLogger(
const string& logdir );
2848 typedef void (*CallbackLogDo)(
int level,
const string& component,
const char* file,
2849 int line,
const char*
function,
const string& content );
2855 typedef bool (*CallbackLogQuery)(
int level,
const string& component );
2860 void setLogDoCallback( CallbackLogDo pfc );
2865 CallbackLogDo getLogDoCallback();
2870 void setLogQueryCallback( CallbackLogQuery pfc );
2875 CallbackLogQuery getLogQueryCallback();
2882 Environment(
bool readonly,
const string& logdir =
"/var/log/YaST2")
2883 : readonly(readonly), testmode(
false), autodetect(
true),
2884 instsys(
false), logdir(logdir), testdir(
"tmp")
2886 storage::initDefaultLogger( logdir );
virtual void activateMultipath(bool val)=0
virtual int nextFreeMd(unsigned &SWIG_OUTPUT(nr), string &SWIG_OUTPUT(device))=0
virtual int addFstabEntry(const string &device, const string &mount, const string &vfs, const string &options, unsigned freq, unsigned passno)=0
virtual int createMd(const string &name, MdType md_type, const list< string > &devices, const list< string > &spares)=0
virtual int extendMd(const string &name, const list< string > &devices, const list< string > &spares)=0
Definition: StorageInterface.h:649
virtual int resizePartition(const string &device, unsigned long sizeCyl)=0
Definition: StorageInterface.h:672
virtual int createMdAny(MdType md_type, const list< string > &devices, const list< string > &spares, string &SWIG_OUTPUT(device))=0
virtual bool checkDeviceMounted(const string &device, list< string > &mps)=0
virtual int addTmpfsMount(const string &mp, const string &opts)=0
virtual int removeLvmVg(const string &name)=0
virtual void getVolumes(deque< VolumeInfo > &infos)=0
virtual int getNfsInfo(deque< NfsInfo > &plist)=0
virtual int removeMdPartCo(const string &name, bool destroySb)=0
Definition: StorageInterface.h:242
virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc)=0
virtual int getLoopInfo(deque< LoopInfo > &plist)=0
virtual int removeBackupState(const string &name)=0
virtual int forgetResizeVolume(const string &device)=0
virtual bool checkBackupState(const string &name) const =0
virtual int getLvmLvInfo(const string &name, deque< LvmLvInfo > &plist)=0
virtual int createPartition(const string &disk, PartitionType type, const RegionInfo &cylRegion, string &SWIG_OUTPUT(device))=0
virtual int setCryptPassword(const string &device, const string &pwd)=0
virtual int changeMountBy(const string &device, MountByType mby)=0
virtual PartAlign getPartitionAlignment() const =0
Definition: StorageInterface.h:289
virtual int createBackupState(const string &name)=0
virtual int checkMd(const string &name)=0
virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc)=0
Definition: StorageInterface.h:552
virtual int getDmInfo(deque< DmInfo > &plist)=0
virtual const string & getLastAction() const =0
virtual bool readFstab(const string &dir, deque< VolumeInfo > &infos)=0
virtual int changeFormatVolume(const string &device, bool format, FsType fs)=0
virtual int getDmmultipathInfo(const string &name, deque< DmmultipathInfo > &plist)=0
virtual bool mountDeviceOpts(const string &device, const string &mp, const string &opts)=0
Definition: StorageInterface.h:518
virtual int getContMdPartCoInfo(const string &name, ContainerInfo &cinfo, MdPartCoInfo &info)=0
Definition: StorageInterface.h:640
virtual void activateHld(bool val)=0
virtual int addNfsDevice(const string &nfsDev, const string &opts, unsigned long long sizeK, const string &mp, bool nfs4)=0
virtual int changeMountPoint(const string &device, const string &mount)=0
Definition: StorageInterface.h:508
virtual int shrinkMd(const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int getMdStateInfo(const string &name, MdStateInfo &info)=0
Definition: StorageInterface.h:2880
Definition: StorageInterface.h:627
Definition: StorageInterface.h:592
virtual void setZeroNewPartitions(bool val)=0
virtual int resizeVolumeNoFs(const string &device, unsigned long long newSizeK)=0
virtual MountByType getDefaultMountBy() const =0
virtual int changeDescText(const string &device, const string &txt)=0
virtual CallbackProgressBar getCallbackProgressBar() const =0
virtual int changePartitionId(const string &partition, unsigned id)=0
virtual int updatePartitionArea(const string &device, const RegionInfo &cylRegion)=0
virtual void getContainers(deque< ContainerInfo > &infos)=0
virtual int createPartitionMax(const string &disk, PartitionType type, string &SWIG_OUTPUT(device))=0
virtual int getUnusedPartitionSlots(const string &disk, list< PartitionSlotInfo > &slots)=0
Definition: StorageInterface.h:434
virtual int getContDmraidCoInfo(const string &name, ContainerInfo &cinfo, DmraidCoInfo &info)=0
virtual int createFileLoop(const string &lname, bool reuseExisting, unsigned long long sizeK, const string &mp, const string &pwd, string &SWIG_OUTPUT(device))=0
virtual int getUserdata(const string &device, map< string, string > &userdata)=0
Definition: StorageInterface.h:279
Definition: StorageInterface.h:426
virtual int shrinkLvmVg(const string &name, const deque< string > &devs)=0
virtual int setIgnoreFstab(const string &device, bool val)=0
Definition: StorageInterface.h:351
virtual unsigned long kbToCylinder(const string &disk, unsigned long long sizeK)=0
Definition: StorageInterface.h:490
virtual bool umountDevice(const string &device)=0
virtual int createPartitionKb(const string &disk, PartitionType type, const RegionInfo &kRegion, string &SWIG_OUTPUT(device))=0
virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc)=0
virtual int changeLabelVolume(const string &device, const string &label)=0
virtual int getMdPartInfo(const string &device, deque< MdPartInfo > &plist)=0
virtual int createLvmLvPool(const string &vg, const string &name, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual int removeMd(const string &name, bool destroySb)=0
virtual int changeLvChunkSize(const string &vg, const string &name, unsigned long long chunkSizeK)=0
Definition: StorageInterface.h:383
Definition: StorageInterface.h:369
virtual int getLvmLvSnapshotStateInfo(const string &vg, const string &name, LvmLvSnapshotStateInfo &info)=0
virtual int changeMdParity(const string &name, MdParity ptype)=0
virtual bool getDetectMountedVolumes() const =0
Definition: StorageInterface.h:298
virtual int nextFreePartition(const string &disk, PartitionType type, unsigned &SWIG_OUTPUT(nr), string &SWIG_OUTPUT(device))=0
virtual void dumpCommitInfos() const =0
Definition: StorageInterface.h:689
virtual int forgetChangePartitionId(const string &partition)=0
virtual bool getDlabelCapabilities(const string &dlabel, DlabelCapabilities &dlabelcapabilities) const =0
virtual int addFstabOptions(const string &device, const string &options)=0
virtual int setUserdata(const string &device, const map< string, string > &userdata)=0
virtual int getContLvmVgInfo(const string &name, ContainerInfo &cinfo, LvmVgInfo &info)=0
virtual int getContDiskInfo(const string &disk, ContainerInfo &cinfo, DiskInfo &info)=0
virtual int resizePartitionNoFs(const string &device, unsigned long sizeCyl)=0
virtual int setCrypt(const string &device, bool val)=0
Abstract class defining the interface for libstorage.
Definition: StorageInterface.h:986
virtual bool getFreeInfo(const string &device, bool get_resize, ResizeInfo &resize_info, bool get_content, ContentInfo &content_info, bool use_cache)=0
Definition: StorageInterface.h:658
virtual int changeLvStripeSize(const string &vg, const string &name, unsigned long long stripeSizeK)=0
virtual int getDmraidCoInfo(const string &name, DmraidCoInfo &info)=0
virtual int getTmpfsInfo(deque< TmpfsInfo > &plist)=0
virtual int getVolume(const string &device, VolumeInfo &info)=0
Definition: StorageInterface.h:226
virtual CallbackInfoPopup getCallbackInfoPopup() const =0
virtual int shrinkBtrfsVolume(const string &name, const deque< string > &devs)=0
virtual int getMountPoint(const string &device, string &SWIG_OUTPUT(mount))=0
virtual int initializeDisk(const string &disk, bool value)=0
virtual int getContVolInfo(const string &dev, ContVolInfo &info)=0
Definition: StorageInterface.h:532
virtual void setRootPrefix(const string &root)=0
virtual int changeMdType(const string &name, MdType md_type)=0
virtual string getRootPrefix() const =0
virtual int createLvmLvThin(const string &vg, const string &name, const string &pool, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual void setDefaultSubvolName(const string &val)=0
virtual int getContDmmultipathCoInfo(const string &name, ContainerInfo &cinfo, DmmultipathCoInfo &info)=0
virtual int extendBtrfsVolume(const string &name, const deque< string > &devs)=0
virtual int resizeVolume(const string &device, unsigned long long newSizeK)=0
Definition: StorageInterface.h:541
Definition: StorageInterface.h:377
virtual void dumpObjectList()=0
virtual CallbackPasswordPopup getCallbackPasswordPopup() const =0
virtual void setCallbackProgressBar(CallbackProgressBar pfnc)=0
virtual bool rescanCryptedObjects()=0
Definition: StorageInterface.h:447
virtual int getMdInfo(deque< MdInfo > &plist)=0
virtual list< int > getMdAllowedParity(MdType md_type, unsigned devnr)=0
virtual string getPartitionName(const string &disk, int partition_no)=0
virtual int extendLvmVg(const string &name, const deque< string > &devs)=0
virtual int removePartition(const string &partition)=0
Definition: StorageInterface.h:561
virtual bool getZeroNewPartitions() const =0
virtual int activateEncryption(const string &device, bool on)=0
Definition: StorageInterface.h:480
virtual int removeLvmLvByDevice(const string &device)=0
virtual void removeDmTableTo(const string &device)=0
virtual int getCrypt(const string &device, bool &SWIG_OUTPUT(val))=0
virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc)=0
virtual int changeMdChunk(const string &name, unsigned long chunkSizeK)=0
virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const =0
virtual int setCryptType(const string &device, bool val, EncryptType typ)=0
virtual FsType getDefaultFs() const =0
virtual int createLvmVg(const string &name, unsigned long long peSizeK, bool lvm1, const deque< string > &devs)=0
virtual string getPartitionPrefix(const string &disk)=0
virtual int getMdPartCoInfo(const string &name, MdPartCoInfo &info)=0
virtual bool equalBackupStates(const string &lhs, const string &rhs, bool verbose_log) const =0
Definition: StorageInterface.h:317
virtual int getDiskInfo(const string &disk, DiskInfo &info)=0
virtual string defaultDiskLabel(const string &device)=0
virtual int createLvmLv(const string &vg, const string &name, unsigned long long sizeK, unsigned stripes, string &SWIG_OUTPUT(device))=0
virtual int createPartitionAny(const string &disk, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual void rescanEverything()=0
virtual const string & getExtendedErrorMessage() const =0
virtual string getErrorString(int error) const =0
virtual bool getRecursiveRemoval() const =0
virtual int changeMkfsOptVolume(const string &device, const string &opts)=0
virtual void setPartitionAlignment(PartAlign val)=0
Definition: StorageInterface.h:615
virtual unsigned long long cylinderToKb(const string &disk, unsigned long sizeCyl)=0
Definition: StorageInterface.h:606
virtual string getDefaultSubvolName() const =0
virtual int getLvmVgInfo(const string &name, LvmVgInfo &info)=0
virtual bool checkDmMapsTo(const string &device)=0
virtual int removeVolume(const string &device)=0
virtual void setDefaultMountBy(MountByType val)=0
virtual int destroyPartitionTable(const string &disk, const string &label)=0
virtual bool needCryptPassword(const string &device)=0
virtual int getMdPartCoStateInfo(const string &name, MdPartCoStateInfo &info)=0
virtual bool getEfiBoot()=0
virtual bool getFsCapabilities(FsType fstype, FsCapabilities &fscapabilities) const =0
virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const =0
virtual int getDmraidInfo(const string &name, deque< DmraidInfo > &plist)=0
virtual void setDefaultFs(FsType val)=0
virtual int getPartitionInfo(const string &disk, deque< PartitionInfo > &plist)=0
virtual int computeMdSize(MdType md_type, const list< string > &devices, const list< string > &spares, unsigned long long &SWIG_OUTPUT(sizeK))=0
virtual int createSubvolume(const string &device, const string &name, bool nocow)=0
virtual void setCommitCallbacks(const CommitCallbacks *commit_callbacks)=0
Definition: StorageInterface.h:462
virtual int removeSubvolume(const string &device, const string &name)=0
virtual int forgetCryptPassword(const string &device)=0
virtual MultipathAutostart getMultipathAutostart() const =0
virtual int updateMd(const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int removeLvmLv(const string &vg, const string &name)=0
virtual int renameCryptDm(const string &device, const string &new_name)=0
virtual int getMountBy(const string &device, MountByType &SWIG_OUTPUT(mby))=0
virtual int modifyFileLoop(const string &device, const string &lname, bool reuseExisting, unsigned long long sizeK)=0
virtual int getBtrfsInfo(deque< BtrfsInfo > &plist)=0
virtual int removeFileLoop(const string &lname, bool removeFile)=0
virtual bool existSubvolume(const string &device, const string &name)=0
virtual int verifyCryptPassword(const string &device, const string &pwd, bool erase)=0
virtual int changeLvStripeCount(const string &vg, const string &name, unsigned long stripes)=0
Definition: StorageInterface.h:394
virtual int getDmmultipathCoInfo(const string &name, DmmultipathCoInfo &info)=0
virtual int changeTunefsOptVolume(const string &device, const string &opts)=0
virtual int getRecursiveUsing(const list< string > &devices, bool itself, list< string > &using_devices)=0
virtual bool isCacheChanges() const =0
virtual void setDetectMountedVolumes(bool val)=0
virtual int freeCylindersAroundPartition(const string &device, unsigned long &SWIG_OUTPUT(freeCylsBefore), unsigned long &SWIG_OUTPUT(freeCylsAfter))=0
virtual int checkNfsDevice(const string &nfsDev, const string &opts, bool nfs4, unsigned long long &SWIG_OUTPUT(sizeK))=0
virtual int removeDmraid(const string &name)=0
virtual int getFstabOptions(const string &device, string &SWIG_OUTPUT(options))=0
Definition: StorageInterface.h:260
virtual int removeTmpfsMount(const string &mp)=0
virtual int getIgnoreFstab(const string &device, bool &SWIG_OUTPUT(val))=0
virtual int restoreBackupState(const string &name)=0
Definition: StorageInterface.h:327
virtual void getCommitInfos(list< CommitInfo > &infos) const =0
Definition: StorageInterface.h:270
virtual int getCryptPassword(const string &device, string &SWIG_OUTPUT(pwd))=0
virtual bool mountDevice(const string &device, const string &mp)=0
virtual void setMultipathAutostart(MultipathAutostart multipath_autostart)=0
virtual void setCacheChanges(bool cache)=0
virtual bool mountDeviceRo(const string &device, const string &mp, const string &opts)=0
virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc)=0
Definition: StorageInterface.h:574
virtual int removeFstabOptions(const string &device, const string &options)=0
virtual int removeLvmLvSnapshot(const string &vg, const string &name)=0
virtual void setRecursiveRemoval(bool val)=0
virtual int createLvmLvSnapshot(const string &vg, const string &origin, const string &name, unsigned long long cowSizeK, string &SWIG_OUTPUT(device))=0
virtual CallbackYesNoPopup getCallbackYesNoPopup() const =0
virtual bool umountDeviceUns(const string &device, bool unsetup)=0
virtual list< string > getAllUsedFs() const =0
virtual int getRecursiveUsedBy(const list< string > &devices, bool itself, list< string > &usedby_devices)=0
virtual int changeFstabOptions(const string &device, const string &options)=0