libstorage
|
00001 /* 00002 * Copyright (c) [2004-2015] Novell, Inc. 00003 * Copyright (c) [2015] SUSE LLC 00004 * 00005 * All Rights Reserved. 00006 * 00007 * This program is free software; you can redistribute it and/or modify it 00008 * under the terms of version 2 of the GNU General Public License as published 00009 * by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT 00012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00014 * more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, contact Novell, Inc. 00018 * 00019 * To contact Novell about this file by physical or electronic mail, you may 00020 * find current contact information at www.novell.com. 00021 */ 00022 00023 00024 #ifndef STORAGE_INTERFACE_H 00025 #define STORAGE_INTERFACE_H 00026 00027 00028 #include <string> 00029 #include <vector> 00030 #include <deque> 00031 #include <list> 00032 #include <map> 00033 00034 using std::string; 00035 using std::vector; 00036 using std::deque; 00037 using std::list; 00038 using std::map; 00039 00040 00041 #include "storage/StorageVersion.h" 00042 #include "storage/StorageSwig.h" 00043 00044 00142 namespace storage 00143 { 00144 enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS, 00145 SWAP, HFSPLUS, NFS, NFS4, TMPFS, ISO9660, UDF, FSNONE }; 00146 00147 enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY }; 00148 00149 enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH }; 00150 00151 enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD, 00152 ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN }; 00153 00154 enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH }; 00155 00156 enum MdParity { PAR_DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC, 00157 RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC, PAR_FIRST, PAR_LAST, 00158 LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6, RIGHT_ASYMMETRIC_6, 00159 RIGHT_SYMMETRIC_6, PAR_FIRST_6, 00160 PAR_NEAR_2, PAR_OFFSET_2, PAR_FAR_2, 00161 PAR_NEAR_3, PAR_OFFSET_3, PAR_FAR_3 }; 00162 00163 enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO, 00164 CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE }; 00165 00166 enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS }; 00167 00168 enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC }; 00169 00170 enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE }; 00171 00172 enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF }; 00173 00174 enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER }; 00175 00176 enum DasdFormat { DASDF_NONE, DASDF_LDL, DASDF_CDL }; 00177 00178 enum DasdType { DASDTYPE_NONE, DASDTYPE_ECKD, DASDTYPE_FBA }; 00179 00184 typedef void (*CallbackProgressBar)(const string& id, unsigned cur, unsigned max); 00185 00190 typedef void (*CallbackShowInstallInfo)(const string& id); 00191 00196 typedef void (*CallbackInfoPopup)(const string& text); 00197 00204 typedef bool (*CallbackYesNoPopup)(const string& text); 00205 00211 typedef bool (*CallbackCommitErrorPopup)(int error, const string& last_action, 00212 const string& extended_message); 00213 00219 typedef bool (*CallbackPasswordPopup)(const string& device, int attempts, string& password); 00220 00221 00226 class CommitCallbacks 00227 { 00228 public: 00229 00230 virtual ~CommitCallbacks() {} 00231 00232 virtual void post_root_filesystem_create() const {} 00233 virtual void post_root_mount() const {} 00234 virtual void post_root_fstab_add() const {} 00235 00236 }; 00237 00238 00242 struct FsCapabilities 00243 { 00244 FsCapabilities() {} 00245 bool isExtendable; 00246 bool isExtendableWhileMounted; 00247 bool isReduceable; 00248 bool isReduceableWhileMounted; 00249 bool supportsUuid; 00250 bool supportsLabel; 00251 bool labelWhileMounted; 00252 unsigned int labelLength; 00253 bool canFormat; 00254 unsigned long long minimalFsSizeK; 00255 }; 00256 00260 struct DlabelCapabilities 00261 { 00262 DlabelCapabilities() {} 00263 unsigned maxPrimary; 00264 bool extendedPossible; 00265 unsigned maxLogical; 00266 unsigned long long maxSectors; 00267 }; 00268 00269 00270 struct UsedByInfo 00271 { 00272 UsedByInfo() : type(UB_NONE) {} // only for swig bindings 00273 UsedByInfo(UsedByType type, const string& device) : type(type), device(device) {} 00274 UsedByType type; 00275 string device; 00276 }; 00277 00278 00279 struct ResizeInfo 00280 { 00281 ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(false) {} 00282 unsigned long long df_freeK; 00283 unsigned long long resize_freeK; 00284 unsigned long long usedK; 00285 bool resize_ok; 00286 }; 00287 00288 00289 struct ContentInfo 00290 { 00291 ContentInfo() : windows(false), efi(false), homes(0) {} 00292 bool windows; 00293 bool efi; 00294 unsigned homes; 00295 }; 00296 00297 00298 struct DeviceInfo 00299 { 00300 DeviceInfo() {} 00301 00302 string device; 00303 string name; 00304 00305 string udevPath; 00306 list<string> udevId; 00307 00308 list<UsedByInfo> usedBy; 00309 00310 map<string, string> userdata; 00311 }; 00312 00313 00317 struct ContainerInfo : public DeviceInfo 00318 { 00319 ContainerInfo() {} 00320 CType type; 00321 bool readonly; 00322 }; 00323 00327 struct DiskInfo 00328 { 00329 DiskInfo() {} 00330 unsigned long long sizeK; 00331 unsigned long long cylSize; 00332 unsigned long cyl; 00333 unsigned long heads; 00334 unsigned long sectors; 00335 unsigned int sectorSize; 00336 string disklabel; 00337 string orig_disklabel; 00338 unsigned maxPrimary; 00339 bool extendedPossible; 00340 unsigned maxLogical; 00341 bool initDisk; 00342 Transport transport; 00343 bool has_fake_partition; 00344 storage::DasdFormat dasd_format; 00345 storage::DasdType dasd_type; 00346 }; 00347 00351 struct LvmVgInfo 00352 { 00353 LvmVgInfo() {} 00354 unsigned long long sizeK; 00355 unsigned long long peSizeK; 00356 unsigned long peCount; 00357 unsigned long peFree; 00358 string uuid; 00359 bool lvm2; 00360 bool create; 00361 list<string> devices; 00362 list<string> devices_add; 00363 list<string> devices_rem; 00364 }; 00365 00369 struct DmPartCoInfo 00370 { 00371 DmPartCoInfo() {} 00372 DiskInfo d; 00373 list<string> devices; 00374 unsigned long minor; 00375 }; 00376 00377 struct DmraidCoInfo 00378 { 00379 DmraidCoInfo() {} 00380 DmPartCoInfo p; 00381 }; 00382 00383 struct DmmultipathCoInfo 00384 { 00385 DmmultipathCoInfo() {} 00386 DmPartCoInfo p; 00387 string vendor; 00388 string model; 00389 }; 00390 00394 struct VolumeInfo : public DeviceInfo 00395 { 00396 VolumeInfo() {} 00397 unsigned long long sizeK; 00398 unsigned long major; 00399 unsigned long minor; 00400 string mount; 00401 string crypt_device; 00402 MountByType mount_by; 00403 bool ignore_fstab; 00404 string fstab_options; 00405 string uuid; 00406 string label; 00407 string mkfs_options; 00408 string tunefs_options; 00409 string loop; 00410 string dtxt; 00411 EncryptType encryption; 00412 string crypt_pwd; 00413 FsType fs; 00414 FsType detected_fs; 00415 bool format; 00416 bool create; 00417 bool is_mounted; 00418 bool resize; 00419 bool ignore_fs; 00420 unsigned long long origSizeK; 00421 }; 00422 00426 struct RegionInfo 00427 { 00428 RegionInfo() : start(0), len(0) {} 00429 RegionInfo(unsigned long long start, unsigned long long len) : start(start), len(len) {} 00430 unsigned long long start; 00431 unsigned long long len; 00432 }; 00433 00434 struct PartitionAddInfo 00435 { 00436 PartitionAddInfo() {} 00437 unsigned nr; 00438 RegionInfo cylRegion; 00439 PartitionType partitionType; 00440 unsigned id; 00441 bool boot; 00442 }; 00443 00447 struct PartitionInfo 00448 { 00449 PartitionInfo() {} 00450 PartitionInfo& operator=( const PartitionAddInfo& rhs ); 00451 VolumeInfo v; 00452 unsigned nr; 00453 RegionInfo cylRegion; 00454 PartitionType partitionType; 00455 unsigned id; 00456 bool boot; 00457 }; 00458 00462 struct LvmLvInfo 00463 { 00464 LvmLvInfo() {} 00465 VolumeInfo v; 00466 unsigned stripes; 00467 unsigned stripeSizeK; 00468 string uuid; 00469 string status; 00470 string dm_table; 00471 string dm_target; 00472 string origin; 00473 string used_pool; 00474 bool pool; 00475 }; 00476 00480 struct LvmLvSnapshotStateInfo 00481 { 00482 LvmLvSnapshotStateInfo() {} 00483 bool active; 00484 double allocated; 00485 }; 00486 00490 struct MdInfo 00491 { 00492 MdInfo() {} 00493 VolumeInfo v; 00494 unsigned nr; 00495 unsigned type; 00496 unsigned parity; 00497 string uuid; 00498 string sb_ver; 00499 unsigned long chunkSizeK; 00500 list<string> devices; 00501 list<string> spares; 00502 bool inactive; 00503 }; 00504 00508 struct MdStateInfo 00509 { 00510 MdStateInfo() {} 00511 MdArrayState state; 00512 }; 00513 00518 struct MdPartCoInfo 00519 { 00520 MdPartCoInfo() {} 00521 DiskInfo d; 00522 unsigned type; // RAID level 00523 unsigned nr; // MD device number 00524 unsigned parity; // Parity (not for all RAID level) 00525 string uuid; // MD Device UUID 00526 string sb_ver; // Metadata version 00527 unsigned long chunkSizeK; // Chunksize (strip size) 00528 list<string> devices; 00529 list<string> spares; 00530 }; 00531 00532 struct MdPartCoStateInfo 00533 { 00534 MdPartCoStateInfo() {} 00535 MdArrayState state; 00536 }; 00537 00541 struct MdPartInfo 00542 { 00543 MdPartInfo() {} 00544 VolumeInfo v; 00545 PartitionAddInfo p; 00546 bool part; 00547 }; 00548 00552 struct NfsInfo 00553 { 00554 NfsInfo() {} 00555 VolumeInfo v; 00556 }; 00557 00561 struct LoopInfo 00562 { 00563 LoopInfo() {} 00564 VolumeInfo v; 00565 bool reuseFile; 00566 unsigned nr; 00567 string file; 00568 }; 00569 00570 00574 struct SubvolumeInfo 00575 { 00576 SubvolumeInfo() 00577 : path(), nocow(false), created(false), deleted(false) {} 00578 SubvolumeInfo(const string& path, bool nocow, bool created, bool deleted) 00579 : path(path), nocow(nocow), created(created), deleted(deleted) {} 00580 00581 string path; 00582 bool nocow; 00583 00584 bool created; 00585 bool deleted; 00586 }; 00587 00588 00592 struct BtrfsInfo 00593 { 00594 BtrfsInfo() {} 00595 VolumeInfo v; 00596 list<string> devices; 00597 list<string> devices_add; 00598 list<string> devices_rem; 00599 vector<SubvolumeInfo> subvolumes; 00600 }; 00601 00602 00606 struct TmpfsInfo 00607 { 00608 TmpfsInfo() {} 00609 VolumeInfo v; 00610 }; 00611 00615 struct DmInfo 00616 { 00617 DmInfo() {} 00618 VolumeInfo v; 00619 unsigned nr; 00620 string table; 00621 string target; 00622 }; 00623 00627 struct DmPartInfo 00628 { 00629 DmPartInfo() {} 00630 VolumeInfo v; 00631 PartitionAddInfo p; 00632 bool part; 00633 string table; 00634 string target; 00635 }; 00636 00640 struct DmraidInfo 00641 { 00642 DmraidInfo() {} 00643 DmPartInfo p; 00644 }; 00645 00649 struct DmmultipathInfo 00650 { 00651 DmmultipathInfo() {} 00652 DmPartInfo p; 00653 }; 00654 00658 struct ContVolInfo 00659 { 00660 ContVolInfo() : ctype(CUNKNOWN), num(-1) {} 00661 CType ctype; 00662 string cname; 00663 string cdevice; 00664 string vname; 00665 string vdevice; 00666 int num; 00667 }; 00668 00672 struct PartitionSlotInfo 00673 { 00674 PartitionSlotInfo() {} 00675 RegionInfo cylRegion; 00676 unsigned nr; 00677 string device; 00678 bool primarySlot; 00679 bool primaryPossible; 00680 bool extendedSlot; 00681 bool extendedPossible; 00682 bool logicalSlot; 00683 bool logicalPossible; 00684 }; 00685 00689 struct CommitInfo 00690 { 00691 CommitInfo() {} 00692 bool destructive; 00693 string text; 00694 }; 00695 00696 00700 enum ErrorCodes 00701 { 00702 STORAGE_NO_ERROR = 0, 00703 00704 DISK_PARTITION_OVERLAPS_EXISTING = -1000, 00705 DISK_PARTITION_EXCEEDS_DISK = -1001, 00706 DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002, 00707 DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003, 00708 DISK_PARTITION_NO_FREE_NUMBER = -1004, 00709 DISK_CREATE_PARTITION_INVALID_VOLUME = -1005, 00710 DISK_CREATE_PARTITION_INVALID_TYPE = -1006, 00711 DISK_CREATE_PARTITION_PARTED_FAILED = -1007, 00712 DISK_PARTITION_NOT_FOUND = -1008, 00713 DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009, 00714 DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010, 00715 DISK_SET_TYPE_INVALID_VOLUME = -1011, 00716 DISK_SET_TYPE_PARTED_FAILED = -1012, 00717 DISK_SET_LABEL_PARTED_FAILED = -1013, 00718 DISK_REMOVE_PARTITION_PARTED_FAILED = -1014, 00719 DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015, 00720 DISK_REMOVE_PARTITION_LIST_ERASE = -1016, 00721 DISK_DESTROY_TABLE_INVALID_LABEL = -1017, 00722 DISK_PARTITION_ZERO_SIZE = -1018, 00723 DISK_CHANGE_READONLY = -1019, 00724 DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020, 00725 DISK_RESIZE_PARTITION_PARTED_FAILED = -1021, 00726 DISK_RESIZE_NO_SPACE = -1022, 00727 DISK_CHECK_RESIZE_INVALID_VOLUME = -1023, 00728 DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024, 00729 DISK_COMMIT_NOTHING_TODO = -1025, 00730 DISK_CREATE_PARTITION_NO_SPACE = -1026, 00731 DISK_REMOVE_USED_BY = -1027, 00732 DISK_INIT_NOT_POSSIBLE = -1028, 00733 DISK_INVALID_PARTITION_ID = -1029, 00734 00735 STORAGE_DISK_NOT_FOUND = -2000, 00736 STORAGE_VOLUME_NOT_FOUND = -2001, 00737 STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002, 00738 STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003, 00739 STORAGE_CHANGE_READONLY = -2004, 00740 STORAGE_DISK_USED_BY = -2005, 00741 STORAGE_LVM_VG_EXISTS = -2006, 00742 STORAGE_LVM_VG_NOT_FOUND = -2007, 00743 STORAGE_LVM_INVALID_DEVICE = -2008, 00744 STORAGE_CONTAINER_NOT_FOUND = -2009, 00745 STORAGE_VG_INVALID_NAME = -2010, 00746 STORAGE_REMOVE_USED_VOLUME = -2011, 00747 STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012, 00748 STORAGE_NOT_YET_IMPLEMENTED = -2013, 00749 STORAGE_MD_INVALID_NAME = -2014, 00750 STORAGE_MD_NOT_FOUND = -2015, 00751 STORAGE_MEMORY_EXHAUSTED = -2016, 00752 STORAGE_LOOP_NOT_FOUND = -2017, 00753 STORAGE_CREATED_LOOP_NOT_FOUND = -2018, 00754 STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023, 00755 STORAGE_BACKUP_STATE_NOT_FOUND = -2024, 00756 STORAGE_INVALID_FSTAB_VALUE = -2025, 00757 STORAGE_NO_FSTAB_PTR = -2026, 00758 STORAGE_DEVICE_NODE_NOT_FOUND = -2027, 00759 STORAGE_DMRAID_CO_NOT_FOUND = -2028, 00760 STORAGE_RESIZE_INVALID_CONTAINER = -2029, 00761 STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030, 00762 STORAGE_ZERO_DEVICE_FAILED = -2031, 00763 STORAGE_INVALID_BACKUP_STATE_NAME = -2032, 00764 STORAGE_MDPART_CO_NOT_FOUND = -2033, 00765 STORAGE_DEVICE_NOT_FOUND = -2034, 00766 STORAGE_BTRFS_CO_NOT_FOUND = -2035, 00767 STORAGE_TMPFS_CO_NOT_FOUND = -2036, 00768 STORAGE_VOLUME_NOT_ENCRYPTED = -2037, 00769 STORAGE_DM_RENAME_FAILED = -2038, 00770 00771 VOLUME_COMMIT_UNKNOWN_STAGE = -3000, 00772 VOLUME_FSTAB_EMPTY_MOUNT = -3001, 00773 VOLUME_UMOUNT_FAILED = -3002, 00774 VOLUME_MOUNT_FAILED = -3003, 00775 VOLUME_FORMAT_UNKNOWN_FS = -3005, 00776 VOLUME_FORMAT_FS_UNDETECTED = -3006, 00777 VOLUME_FORMAT_FS_TOO_SMALL = -3007, 00778 VOLUME_FORMAT_FAILED = -3008, 00779 VOLUME_TUNE2FS_FAILED = -3009, 00780 VOLUME_MKLABEL_FS_UNABLE = -3010, 00781 VOLUME_MKLABEL_FAILED = -3011, 00782 VOLUME_LOSETUP_NO_LOOP = -3012, 00783 VOLUME_LOSETUP_FAILED = -3013, 00784 VOLUME_CRYPT_NO_PWD = -3014, 00785 VOLUME_CRYPT_PWD_TOO_SHORT = -3015, 00786 VOLUME_CRYPT_NOT_DETECTED = -3016, 00787 VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017, 00788 VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018, 00789 VOLUME_MOUNT_POINT_INVALID = -3019, 00790 VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020, 00791 VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021, 00792 VOLUME_LABEL_NOT_SUPPORTED = -3022, 00793 VOLUME_LABEL_TOO_LONG = -3023, 00794 VOLUME_LABEL_WHILE_MOUNTED = -3024, 00795 VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025, 00796 VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026, 00797 VOLUME_RESIZE_FAILED = -3027, 00798 VOLUME_ALREADY_IN_USE = -3028, 00799 VOLUME_LOUNSETUP_FAILED = -3029, 00800 VOLUME_DEVICE_NOT_PRESENT = -3030, 00801 VOLUME_DEVICE_NOT_BLOCK = -3031, 00802 VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032, 00803 VOLUME_CRYPTFORMAT_FAILED = -3033, 00804 VOLUME_CRYPTSETUP_FAILED = -3034, 00805 VOLUME_CRYPTUNSETUP_FAILED = -3035, 00806 VOLUME_FORMAT_NOT_IMPLEMENTED = -3036, 00807 VOLUME_FORMAT_IMPOSSIBLE = -3037, 00808 VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038, 00809 VOLUME_REMOUNT_FAILED = -3039, 00810 VOLUME_TUNEREISERFS_FAILED = -3040, 00811 VOLUME_UMOUNT_NOT_MOUNTED = -3041, 00812 VOLUME_BTRFS_ADD_FAILED = -3042, 00813 VOLUME_CANNOT_TMP_MOUNT = -3043, 00814 VOLUME_CANNOT_TMP_UMOUNT = -3044, 00815 VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045, 00816 VOLUME_BTRFS_SUBVOL_SETDEFAULT = -3046, 00817 00818 LVM_CREATE_PV_FAILED = -4000, 00819 LVM_PV_ALREADY_CONTAINED = -4001, 00820 LVM_PV_DEVICE_UNKNOWN = -4002, 00821 LVM_PV_DEVICE_USED = -4003, 00822 LVM_VG_HAS_NONE_PV = -4004, 00823 LVM_LV_INVALID_NAME = -4005, 00824 LVM_LV_DUPLICATE_NAME = -4006, 00825 LVM_LV_NO_SPACE = -4007, 00826 LVM_LV_UNKNOWN_NAME = -4008, 00827 LVM_LV_NOT_IN_LIST = -4009, 00828 LVM_VG_CREATE_FAILED = -4010, 00829 LVM_VG_EXTEND_FAILED = -4011, 00830 LVM_VG_REDUCE_FAILED = -4012, 00831 LVM_VG_REMOVE_FAILED = -4013, 00832 LVM_LV_CREATE_FAILED = -4014, 00833 LVM_LV_REMOVE_FAILED = -4015, 00834 LVM_LV_RESIZE_FAILED = -4016, 00835 LVM_PV_STILL_ADDED = -4017, 00836 LVM_PV_REMOVE_NOT_FOUND = -4018, 00837 LVM_CREATE_LV_INVALID_VOLUME = -4019, 00838 LVM_REMOVE_LV_INVALID_VOLUME = -4020, 00839 LVM_RESIZE_LV_INVALID_VOLUME = -4021, 00840 LVM_CHANGE_READONLY = -4022, 00841 LVM_CHECK_RESIZE_INVALID_VOLUME = -4023, 00842 LVM_COMMIT_NOTHING_TODO = -4024, 00843 LVM_LV_REMOVE_USED_BY = -4025, 00844 LVM_LV_ALREADY_ON_DISK = -4026, 00845 LVM_LV_NO_STRIPE_SIZE = -4027, 00846 LVM_LV_UNKNOWN_ORIGIN = -4028, 00847 LVM_LV_NOT_ON_DISK = -4029, 00848 LVM_LV_NOT_SNAPSHOT = -4030, 00849 LVM_LV_HAS_SNAPSHOTS = -4031, 00850 LVM_LV_IS_SNAPSHOT = -4032, 00851 LVM_LIST_EMPTY = -4033, 00852 LVM_LV_NO_POOL_OR_SNAP = -4034, 00853 LVM_LV_NO_POOL = -4035, 00854 LVM_LV_UNKNOWN_POOL = -4036, 00855 LVM_LV_INVALID_CHUNK_SIZE = -4037, 00856 LVM_LV_POOL_NO_FORMAT = -4038, 00857 LVM_LV_POOL_NO_MOUNT = -4039, 00858 00859 FSTAB_ENTRY_NOT_FOUND = -5000, 00860 FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001, 00861 FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002, 00862 FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003, 00863 FSTAB_ADD_ENTRY_FOUND = -5004, 00864 00865 MD_CHANGE_READONLY = -6000, 00866 MD_DUPLICATE_NUMBER = -6001, 00867 MD_TOO_FEW_DEVICES = -6002, 00868 MD_DEVICE_UNKNOWN = -6003, 00869 MD_DEVICE_USED = -6004, 00870 MD_CREATE_INVALID_VOLUME = -6005, 00871 MD_REMOVE_FAILED = -6006, 00872 MD_NOT_IN_LIST = -6007, 00873 MD_CREATE_FAILED = -6008, 00874 MD_UNKNOWN_NUMBER = -6009, 00875 MD_REMOVE_USED_BY = -6010, 00876 MD_NUMBER_TOO_LARGE = -6011, 00877 MD_REMOVE_INVALID_VOLUME = -6012, 00878 MD_REMOVE_CREATE_NOT_FOUND = -6013, 00879 MD_NO_RESIZE_ON_DISK = -6014, 00880 MD_ADD_DUPLICATE = -6015, 00881 MD_REMOVE_NONEXISTENT = -6016, 00882 MD_NO_CHANGE_ON_DISK = -6017, 00883 MD_NO_CREATE_UNKNOWN = -6018, 00884 MD_STATE_NOT_ON_DISK = -6019, 00885 MD_PARTITION_NOT_FOUND = -6020, 00886 MD_INVALID_PARITY = -6021, 00887 MD_TOO_MANY_SPARES = -6022, 00888 MD_GET_STATE_FAILED = -6023, 00889 MD_DUPLICATE_NAME = -6024, 00890 00891 MDPART_CHANGE_READONLY = -6100, 00892 MDPART_INTERNAL_ERR = -6101, 00893 MDPART_INVALID_VOLUME = -6102, 00894 MDPART_PARTITION_NOT_FOUND = -6103, 00895 MDPART_REMOVE_PARTITION_LIST_ERASE = -6104, 00896 MDPART_COMMIT_NOTHING_TODO = -6105, 00897 MDPART_NO_REMOVE = -6106, 00898 MDPART_DEVICE_NOT_FOUND = -6107, 00899 00900 LOOP_CHANGE_READONLY = -7000, 00901 LOOP_DUPLICATE_FILE = -7001, 00902 LOOP_UNKNOWN_FILE = -7002, 00903 LOOP_REMOVE_USED_BY = -7003, 00904 LOOP_FILE_CREATE_FAILED = -7004, 00905 LOOP_CREATE_INVALID_VOLUME = -7005, 00906 LOOP_REMOVE_FILE_FAILED = -7006, 00907 LOOP_REMOVE_INVALID_VOLUME = -7007, 00908 LOOP_NOT_IN_LIST = -7008, 00909 LOOP_REMOVE_CREATE_NOT_FOUND = -7009, 00910 LOOP_MODIFY_EXISTING = -7010, 00911 00912 PEC_PE_SIZE_INVALID = -9000, 00913 PEC_PV_NOT_FOUND = -9001, 00914 PEC_REMOVE_PV_IN_USE = -9002, 00915 PEC_REMOVE_PV_SIZE_NEEDED = -9003, 00916 PEC_LV_NO_SPACE_STRIPED = -9004, 00917 PEC_LV_NO_SPACE_SINGLE = -9005, 00918 PEC_LV_PE_DEV_NOT_FOUND = -9006, 00919 00920 DM_CHANGE_READONLY = -10000, 00921 DM_UNKNOWN_TABLE = -10001, 00922 DM_REMOVE_USED_BY = -10002, 00923 DM_REMOVE_CREATE_NOT_FOUND = -10003, 00924 DM_REMOVE_INVALID_VOLUME = -10004, 00925 DM_REMOVE_FAILED = -10005, 00926 DM_NOT_IN_LIST = -10006, 00927 00928 DASD_NOT_POSSIBLE = -11000, 00929 DASD_DASDFMT_FAILED = -11002, 00930 00931 DMPART_CHANGE_READONLY = -12001, 00932 DMPART_INTERNAL_ERR = -12002, 00933 DMPART_INVALID_VOLUME = -12003, 00934 DMPART_PARTITION_NOT_FOUND = -12004, 00935 DMPART_REMOVE_PARTITION_LIST_ERASE = -12005, 00936 DMPART_COMMIT_NOTHING_TODO = -12006, 00937 DMPART_NO_REMOVE = -12007, 00938 00939 DMRAID_REMOVE_FAILED = -13001, 00940 00941 NFS_VOLUME_NOT_FOUND = -14001, 00942 NFS_CHANGE_READONLY = -14002, 00943 NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003, 00944 NFS_REMOVE_VOLUME_LIST_ERASE = -14004, 00945 NFS_REMOVE_INVALID_VOLUME = -14005, 00946 00947 BTRFS_COMMIT_INVALID_VOLUME = -15001, 00948 BTRFS_CANNOT_TMP_MOUNT = -15002, 00949 BTRFS_CANNOT_TMP_UMOUNT = -15003, 00950 BTRFS_DELETE_SUBVOL_FAIL = -15004, 00951 BTRFS_CREATE_SUBVOL_FAIL = -15005, 00952 BTRFS_VOLUME_NOT_FOUND = -15006, 00953 BTRFS_SUBVOL_EXISTS = -15007, 00954 BTRFS_SUBVOL_NON_EXISTS = -15008, 00955 BTRFS_REMOVE_NOT_FOUND = -15009, 00956 BTRFS_REMOVE_NO_BTRFS = -15010, 00957 BTRFS_REMOVE_INVALID_VOLUME = -15011, 00958 BTRFS_CHANGE_READONLY = -15012, 00959 BTRFS_DEV_ALREADY_CONTAINED = -15013, 00960 BTRFS_DEVICE_UNKNOWN = -15014, 00961 BTRFS_DEVICE_USED = -15015, 00962 BTRFS_HAS_NONE_DEV = -15016, 00963 BTRFS_DEV_NOT_FOUND = -15017, 00964 BTRFS_EXTEND_FAIL = -15018, 00965 BTRFS_REDUCE_FAIL = -15019, 00966 BTRFS_LIST_EMPTY = -15020, 00967 BTRFS_RESIZE_INVALID_VOLUME = -15021, 00968 BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022, 00969 00970 TMPFS_REMOVE_INVALID_VOLUME = -16001, 00971 TMPFS_REMOVE_NO_TMPFS = -16002, 00972 TMPFS_REMOVE_NOT_FOUND = -16003, 00973 00974 CHATTR_FAILED = -17001, 00975 QUOTA_RESTART_FAILED = -17002, 00976 00977 CONTAINER_INTERNAL_ERROR = -99000, 00978 CONTAINER_INVALID_VIRTUAL_CALL = -99001, 00979 00980 }; 00981 00982 00986 class StorageInterface 00987 { 00988 public: 00989 00990 StorageInterface () {} 00991 virtual ~StorageInterface () {} 00992 00996 virtual void getContainers( deque<ContainerInfo>& infos) = 0; 00997 01005 virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0; 01006 01015 virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo, 01016 DiskInfo& info ) = 0; 01017 01025 virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0; 01026 01035 virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo, 01036 LvmVgInfo& info) = 0; 01037 01045 virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0; 01046 01055 virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo, 01056 DmraidCoInfo& info) = 0; 01057 01065 virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0; 01066 01075 virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo, 01076 DmmultipathCoInfo& info) = 0; 01077 01085 virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0; 01086 01087 01096 virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo, 01097 MdPartCoInfo& info) = 0; 01098 01104 virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0; 01105 01111 virtual MultipathAutostart getMultipathAutostart() const = 0; 01112 01118 virtual void getVolumes( deque<VolumeInfo>& infos) = 0; 01119 01127 virtual int getVolume( const string& device, VolumeInfo& info) = 0; 01128 01136 virtual int getPartitionInfo( const string& disk, 01137 deque<PartitionInfo>& plist ) = 0; 01138 01146 virtual int getLvmLvInfo( const string& name, 01147 deque<LvmLvInfo>& plist ) = 0; 01148 01155 virtual int getMdInfo( deque<MdInfo>& plist ) = 0; 01156 01164 virtual int getMdPartInfo( const string& device, 01165 deque<MdPartInfo>& plist ) = 0; 01166 01173 virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0; 01174 01181 virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0; 01182 01189 virtual int getDmInfo( deque<DmInfo>& plist ) = 0; 01190 01197 virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0; 01198 01205 virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0; 01206 01214 virtual int getDmraidInfo( const string& name, 01215 deque<DmraidInfo>& plist ) = 0; 01216 01224 virtual int getDmmultipathInfo( const string& name, 01225 deque<DmmultipathInfo>& plist ) = 0; 01226 01230 virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0; 01231 01235 virtual bool getDlabelCapabilities(const string& dlabel, 01236 DlabelCapabilities& dlabelcapabilities) const = 0; 01237 01241 virtual list<string> getAllUsedFs() const = 0; 01242 01254 virtual int createPartition(const string& disk, PartitionType type, 01255 const RegionInfo& cylRegion, 01256 string& SWIG_OUTPUT(device)) = 0; 01257 01266 virtual int resizePartition( const string& device, 01267 unsigned long sizeCyl ) = 0; 01268 01277 virtual int resizePartitionNoFs( const string& device, 01278 unsigned long sizeCyl ) = 0; 01279 01289 virtual int updatePartitionArea(const string& device, const RegionInfo& cylRegion) = 0; 01290 01299 virtual int freeCylindersAroundPartition(const string& device, 01300 unsigned long& SWIG_OUTPUT(freeCylsBefore), 01301 unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0; 01302 01316 virtual int nextFreePartition( const string& disk, PartitionType type, 01317 unsigned & SWIG_OUTPUT(nr), 01318 string& SWIG_OUTPUT(device) ) = 0; 01319 01331 virtual int createPartitionKb(const string& disk, PartitionType type, 01332 const RegionInfo& kRegion, 01333 string& SWIG_OUTPUT(device)) = 0; 01334 01345 virtual int createPartitionAny( const string& disk, 01346 unsigned long long sizeK, 01347 string& SWIG_OUTPUT(device) ) = 0; 01348 01359 virtual int createPartitionMax( const string& disk, PartitionType type, 01360 string& SWIG_OUTPUT(device) ) = 0; 01361 01369 virtual unsigned long long cylinderToKb( const string& disk, 01370 unsigned long sizeCyl) = 0; 01371 01379 virtual unsigned long kbToCylinder( const string& disk, 01380 unsigned long long sizeK) = 0; 01381 01388 virtual int removePartition (const string& partition) = 0; 01389 01397 virtual int changePartitionId (const string& partition, unsigned id) = 0; 01398 01405 virtual int forgetChangePartitionId (const string& partition ) = 0; 01406 01414 virtual string getPartitionPrefix(const string& disk) = 0; 01415 01424 virtual string getPartitionName(const string& disk, int partition_no) = 0; 01425 01436 virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0; 01437 01446 virtual int destroyPartitionTable (const string& disk, const string& label) = 0; 01447 01458 virtual int initializeDisk( const string& disk, bool value ) = 0; 01459 01468 virtual string defaultDiskLabel(const string& device) = 0; 01469 01478 virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0; 01479 01487 virtual int changeLabelVolume( const string& device, const string& label ) = 0; 01488 01496 virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0; 01497 01505 virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0; 01506 01515 virtual int changeMountPoint( const string& device, const string& mount ) = 0; 01516 01524 virtual int getMountPoint( const string& device, 01525 string& SWIG_OUTPUT(mount) ) = 0; 01526 01534 virtual int changeMountBy( const string& device, MountByType mby ) = 0; 01535 01543 virtual int getMountBy( const string& device, 01544 MountByType& SWIG_OUTPUT(mby) ) = 0; 01545 01555 virtual int changeFstabOptions( const string& device, const string& options ) = 0; 01556 01565 virtual int getFstabOptions( const string& device, 01566 string& SWIG_OUTPUT(options) ) = 0; 01567 01568 01577 virtual int addFstabOptions( const string& device, const string& options ) = 0; 01578 01588 virtual int removeFstabOptions( const string& device, const string& options ) = 0; 01589 01597 virtual int setCryptPassword( const string& device, const string& pwd ) = 0; 01598 01605 virtual int forgetCryptPassword( const string& device ) = 0; 01606 01614 virtual int getCryptPassword( const string& device, 01615 string& SWIG_OUTPUT(pwd) ) = 0; 01616 01625 virtual int verifyCryptPassword( const string& device, 01626 const string& pwd, bool erase ) = 0; 01627 01634 virtual bool needCryptPassword( const string& device ) = 0; 01635 01643 virtual int setCrypt( const string& device, bool val ) = 0; 01644 01653 virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0; 01654 01662 virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0; 01663 01673 virtual int setIgnoreFstab( const string& device, bool val ) = 0; 01674 01682 virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0; 01683 01693 virtual int changeDescText( const string& device, const string& txt ) = 0; 01694 01709 virtual int addFstabEntry( const string& device, const string& mount, 01710 const string& vfs, const string& options, 01711 unsigned freq, unsigned passno ) = 0; 01712 01713 01721 virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0; 01722 01730 virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0; 01731 01738 virtual int forgetResizeVolume( const string& device ) = 0; 01739 01754 virtual void setRecursiveRemoval( bool val ) = 0; 01755 01761 virtual bool getRecursiveRemoval() const = 0; 01762 01772 virtual int getRecursiveUsing(const list<string>& devices, bool itself, 01773 list<string>& using_devices) = 0; 01774 01784 virtual int getRecursiveUsedBy(const list<string>& devices, bool itself, 01785 list<string>& usedby_devices) = 0; 01786 01800 virtual void setZeroNewPartitions( bool val ) = 0; 01801 01807 virtual bool getZeroNewPartitions() const = 0; 01808 01820 virtual void setPartitionAlignment( PartAlign val ) = 0; 01821 01827 virtual PartAlign getPartitionAlignment() const = 0; 01828 01834 virtual void setDefaultMountBy( MountByType val ) = 0; 01835 01841 virtual MountByType getDefaultMountBy() const = 0; 01842 01848 virtual void setDefaultFs(FsType val) = 0; 01849 01855 virtual FsType getDefaultFs() const = 0; 01856 01862 virtual void setDefaultSubvolName( const string& val) = 0; 01863 01869 virtual string getDefaultSubvolName() const = 0; 01870 01876 virtual bool getEfiBoot() = 0; 01877 01888 virtual void setRootPrefix( const string& root ) = 0; 01889 01895 virtual string getRootPrefix() const = 0; 01896 01902 virtual void setDetectMountedVolumes( bool val ) = 0; 01903 01909 virtual bool getDetectMountedVolumes() const = 0; 01910 01918 virtual int removeVolume( const string& device ) = 0; 01919 01930 virtual int createLvmVg( const string& name, 01931 unsigned long long peSizeK, bool lvm1, 01932 const deque<string>& devs ) = 0; 01933 01941 virtual int removeLvmVg( const string& name ) = 0; 01942 01950 virtual int extendLvmVg( const string& name, 01951 const deque<string>& devs ) = 0; 01952 01960 virtual int shrinkLvmVg( const string& name, 01961 const deque<string>& devs ) = 0; 01962 01974 virtual int createLvmLv( const string& vg, const string& name, 01975 unsigned long long sizeK, unsigned stripes, 01976 string& SWIG_OUTPUT(device) ) = 0; 01977 01984 virtual int removeLvmLvByDevice( const string& device ) = 0; 01985 01993 virtual int removeLvmLv( const string& vg, const string& name ) = 0; 01994 02004 virtual int changeLvStripeCount( const string& vg, const string& name, 02005 unsigned long stripes ) = 0; 02006 02016 virtual int changeLvStripeSize( const string& vg, const string& name, 02017 unsigned long long stripeSizeK) = 0; 02018 02029 virtual int createLvmLvSnapshot(const string& vg, const string& origin, 02030 const string& name, unsigned long long cowSizeK, 02031 string& SWIG_OUTPUT(device) ) = 0; 02032 02040 virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0; 02041 02052 virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name, 02053 LvmLvSnapshotStateInfo& info) = 0; 02054 02064 virtual int createLvmLvPool(const string& vg, const string& name, 02065 unsigned long long sizeK, 02066 string& SWIG_OUTPUT(device) ) = 0; 02067 02078 virtual int createLvmLvThin(const string& vg, const string& name, 02079 const string& pool, 02080 unsigned long long sizeK, 02081 string& SWIG_OUTPUT(device) ) = 0; 02082 02092 virtual int changeLvChunkSize( const string& vg, const string& name, 02093 unsigned long long chunkSizeK) = 0; 02094 02102 virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr), 02103 string& SWIG_OUTPUT(device)) = 0; 02104 02114 virtual int createMd(const string& name, MdType md_type, const list<string>& devices, 02115 const list<string>& spares) = 0; 02116 02126 virtual int createMdAny(MdType md_type, const list<string>& devices, 02127 const list<string>& spares, 02128 string& SWIG_OUTPUT(device) ) = 0; 02129 02138 virtual int removeMd( const string& name, bool destroySb ) = 0; 02139 02149 virtual int extendMd(const string& name, const list<string>& devices, 02150 const list<string>& spares) = 0; 02151 02161 virtual int updateMd(const string& name, const list<string>& devices, 02162 const list<string>& spares) = 0; 02163 02173 virtual int shrinkMd(const string& name, const list<string>& devices, 02174 const list<string>& spares) = 0; 02175 02184 virtual int changeMdType(const string& name, MdType md_type) = 0; 02185 02194 virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0; 02195 02204 virtual int changeMdParity( const string& name, MdParity ptype ) = 0; 02205 02212 virtual int checkMd( const string& name ) = 0; 02213 02223 virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0; 02224 02234 virtual int getMdPartCoStateInfo(const string& name, 02235 MdPartCoStateInfo& info) = 0; 02236 02249 virtual int computeMdSize(MdType md_type, const list<string>& devices, 02250 const list<string>& spares, unsigned long long& SWIG_OUTPUT(sizeK)) = 0; 02251 02259 virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0; 02260 02271 virtual int removeMdPartCo(const string& name, bool destroySb ) = 0; 02272 02283 virtual int addNfsDevice(const string& nfsDev, const string& opts, 02284 unsigned long long sizeK, const string& mp, 02285 bool nfs4) = 0; 02286 02296 virtual int checkNfsDevice(const string& nfsDev, const string& opts, 02297 bool nfs4, unsigned long long& SWIG_OUTPUT(sizeK)) = 0; 02298 02315 virtual int createFileLoop( const string& lname, bool reuseExisting, 02316 unsigned long long sizeK, 02317 const string& mp, const string& pwd, 02318 string& SWIG_OUTPUT(device) ) = 0; 02319 02337 virtual int modifyFileLoop( const string& device, const string& lname, 02338 bool reuseExisting, 02339 unsigned long long sizeK ) = 0; 02340 02349 virtual int removeFileLoop( const string& lname, bool removeFile ) = 0; 02350 02357 virtual int removeDmraid( const string& name ) = 0; 02358 02366 virtual bool existSubvolume( const string& device, const string& name ) = 0; 02367 02376 virtual int createSubvolume(const string& device, const string& name, bool nocow) = 0; 02377 02385 virtual int removeSubvolume( const string& device, const string& name ) = 0; 02386 02395 virtual int extendBtrfsVolume( const string& name, 02396 const deque<string>& devs ) = 0; 02397 02406 virtual int shrinkBtrfsVolume( const string& name, 02407 const deque<string>& devs ) = 0; 02408 02416 virtual int addTmpfsMount( const string& mp, const string& opts ) = 0; 02417 02424 virtual int removeTmpfsMount( const string& mp ) = 0; 02425 02431 virtual void getCommitInfos(list<CommitInfo>& infos) const = 0; 02432 02438 virtual const string& getLastAction() const = 0; 02439 02446 virtual const string& getExtendedErrorMessage() const = 0; 02447 02448 // temporarily disable callback function for swig 02449 #ifndef SWIG 02450 02456 virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0; 02457 02463 virtual CallbackProgressBar getCallbackProgressBar() const = 0; 02464 02465 02471 virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0; 02472 02478 virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0; 02479 02480 02487 virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0; 02488 02495 virtual CallbackInfoPopup getCallbackInfoPopup() const = 0; 02496 02497 02504 virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0; 02505 02512 virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0; 02513 02514 02520 virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0; 02521 02527 virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0; 02528 02529 02535 virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0; 02536 02543 virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0; 02544 02545 #endif 02546 02552 virtual void setCacheChanges (bool cache) = 0; 02553 02557 virtual bool isCacheChanges () const = 0; 02558 02562 virtual void setCommitCallbacks(const CommitCallbacks* commit_callbacks) = 0; 02563 02568 virtual int commit() = 0; 02569 02573 virtual string getErrorString(int error) const = 0; 02574 02581 virtual int createBackupState( const string& name ) = 0; 02582 02589 virtual int restoreBackupState( const string& name ) = 0; 02590 02597 virtual bool checkBackupState(const string& name) const = 0; 02598 02607 virtual bool equalBackupStates(const string& lhs, const string& rhs, 02608 bool verbose_log) const = 0; 02609 02617 virtual int removeBackupState( const string& name ) = 0; 02618 02626 virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0; 02627 02638 virtual bool umountDevice( const string& device ) = 0; 02639 02652 virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0; 02653 02664 virtual bool mountDevice( const string& device, const string& mp ) = 0; 02665 02676 virtual int activateEncryption( const string& device, bool on ) = 0; 02677 02689 virtual bool mountDeviceOpts( const string& device, const string& mp, 02690 const string& opts ) = 0; 02691 02703 virtual bool mountDeviceRo( const string& device, const string& mp, 02704 const string& opts ) = 0; 02705 02712 virtual bool checkDmMapsTo( const string& device ) = 0; 02713 02719 virtual void removeDmTableTo( const string& device ) = 0; 02720 02729 virtual int renameCryptDm( const string& device, 02730 const string& new_name ) = 0; 02731 02743 virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info, 02744 bool get_content, ContentInfo& content_info, bool use_cache) = 0; 02745 02753 virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0; 02754 02764 virtual void activateHld( bool val ) = 0; 02765 02774 virtual void activateMultipath( bool val ) = 0; 02775 02784 virtual void rescanEverything() = 0; 02785 02794 virtual bool rescanCryptedObjects() = 0; 02795 02799 virtual void dumpObjectList() = 0; 02800 02804 virtual void dumpCommitInfos() const = 0; 02805 02815 virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0; 02816 02825 virtual int setUserdata(const string& device, const map<string, string>& userdata) = 0; 02826 02834 virtual int getUserdata(const string& device, map<string, string>& userdata) = 0; 02835 02836 }; 02837 02838 02842 void initDefaultLogger( const string& logdir ); 02843 02848 typedef void (*CallbackLogDo)( int level, const string& component, const char* file, 02849 int line, const char* function, const string& content ); 02850 02855 typedef bool (*CallbackLogQuery)( int level, const string& component ); 02856 02860 void setLogDoCallback( CallbackLogDo pfc ); 02861 02865 CallbackLogDo getLogDoCallback(); 02866 02870 void setLogQueryCallback( CallbackLogQuery pfc ); 02871 02875 CallbackLogQuery getLogQueryCallback(); 02876 02880 struct Environment 02881 { 02882 Environment(bool readonly, const string& logdir = "/var/log/YaST2") 02883 : readonly(readonly), testmode(false), autodetect(true), 02884 instsys(false), logdir(logdir), testdir("tmp") 02885 { 02886 storage::initDefaultLogger( logdir ); 02887 } 02888 02889 bool readonly; 02890 bool testmode; 02891 bool autodetect; 02892 bool instsys; 02893 string logdir; 02894 string testdir; 02895 }; 02896 02897 02903 StorageInterface* createStorageInterface(const Environment& env); 02904 02905 02913 StorageInterface* createStorageInterfacePid(const Environment& env, int& SWIG_OUTPUT(locker_pid)); 02914 02915 02919 void destroyStorageInterface(StorageInterface*); 02920 02921 } 02922 02923 02924 #endif