libstorage
|
00001 /* 00002 * Copyright (c) [2004-2014] Novell, Inc. 00003 * 00004 * All Rights Reserved. 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of version 2 of the GNU General Public License as published 00008 * by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, but WITHOUT 00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 * more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, contact Novell, Inc. 00017 * 00018 * To contact Novell about this file by physical or electronic mail, you may 00019 * find current contact information at www.novell.com. 00020 */ 00021 00022 00023 #ifndef STORAGE_INTERFACE_H 00024 #define STORAGE_INTERFACE_H 00025 00026 00027 #include <string> 00028 #include <deque> 00029 #include <list> 00030 #include <map> 00031 00032 using std::string; 00033 using std::deque; 00034 using std::list; 00035 using std::map; 00036 00037 00038 #include "storage/StorageVersion.h" 00039 #include "storage/StorageSwig.h" 00040 00041 00139 namespace storage 00140 { 00141 enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS, 00142 SWAP, HFSPLUS, NFS, NFS4, TMPFS, FSNONE }; 00143 00144 enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY }; 00145 00146 enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH }; 00147 00148 enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD, 00149 ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN }; 00150 00151 enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH }; 00152 00153 enum MdParity { PAR_DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC, 00154 RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC, PAR_FIRST, PAR_LAST, 00155 LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6, RIGHT_ASYMMETRIC_6, 00156 RIGHT_SYMMETRIC_6, PAR_FIRST_6, 00157 PAR_NEAR_2, PAR_OFFSET_2, PAR_FAR_2, 00158 PAR_NEAR_3, PAR_OFFSET_3, PAR_FAR_3 }; 00159 00160 enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO, 00161 CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE }; 00162 00163 enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS }; 00164 00165 enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC }; 00166 00167 enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE }; 00168 00169 enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF }; 00170 00171 enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER }; 00172 00173 00178 typedef void (*CallbackProgressBar)(const string& id, unsigned cur, unsigned max); 00179 00184 typedef void (*CallbackShowInstallInfo)(const string& id); 00185 00190 typedef void (*CallbackInfoPopup)(const string& text); 00191 00198 typedef bool (*CallbackYesNoPopup)(const string& text); 00199 00205 typedef bool (*CallbackCommitErrorPopup)(int error, const string& last_action, 00206 const string& extended_message); 00207 00213 typedef bool (*CallbackPasswordPopup)(const string& device, int attempts, string& password); 00214 00215 00219 struct FsCapabilities 00220 { 00221 FsCapabilities() {} 00222 bool isExtendable; 00223 bool isExtendableWhileMounted; 00224 bool isReduceable; 00225 bool isReduceableWhileMounted; 00226 bool supportsUuid; 00227 bool supportsLabel; 00228 bool labelWhileMounted; 00229 unsigned int labelLength; 00230 unsigned long long minimalFsSizeK; 00231 }; 00232 00236 struct DlabelCapabilities 00237 { 00238 DlabelCapabilities() {} 00239 unsigned maxPrimary; 00240 bool extendedPossible; 00241 unsigned maxLogical; 00242 unsigned long long maxSectors; 00243 }; 00244 00245 00246 struct UsedByInfo 00247 { 00248 UsedByInfo() : type(UB_NONE) {} // only for swig bindings 00249 UsedByInfo(UsedByType type, const string& device) : type(type), device(device) {} 00250 UsedByType type; 00251 string device; 00252 }; 00253 00254 00255 struct ResizeInfo 00256 { 00257 ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(false) {} 00258 unsigned long long df_freeK; 00259 unsigned long long resize_freeK; 00260 unsigned long long usedK; 00261 bool resize_ok; 00262 }; 00263 00264 00265 struct ContentInfo 00266 { 00267 ContentInfo() : windows(false), efi(false), homes(0) {} 00268 bool windows; 00269 bool efi; 00270 unsigned homes; 00271 }; 00272 00273 00274 struct DeviceInfo 00275 { 00276 DeviceInfo() {} 00277 00278 string device; 00279 string name; 00280 00281 string udevPath; 00282 list<string> udevId; 00283 00284 list<UsedByInfo> usedBy; 00285 00286 map<string, string> userdata; 00287 }; 00288 00289 00293 struct ContainerInfo : public DeviceInfo 00294 { 00295 ContainerInfo() {} 00296 CType type; 00297 bool readonly; 00298 }; 00299 00303 struct DiskInfo 00304 { 00305 DiskInfo() {} 00306 unsigned long long sizeK; 00307 unsigned long long cylSize; 00308 unsigned long cyl; 00309 unsigned long heads; 00310 unsigned long sectors; 00311 unsigned int sectorSize; 00312 string disklabel; 00313 string orig_disklabel; 00314 unsigned maxPrimary; 00315 bool extendedPossible; 00316 unsigned maxLogical; 00317 bool initDisk; 00318 Transport transport; 00319 bool has_fake_partition; 00320 }; 00321 00325 struct LvmVgInfo 00326 { 00327 LvmVgInfo() {} 00328 unsigned long long sizeK; 00329 unsigned long long peSizeK; 00330 unsigned long peCount; 00331 unsigned long peFree; 00332 string uuid; 00333 bool lvm2; 00334 bool create; 00335 list<string> devices; 00336 list<string> devices_add; 00337 list<string> devices_rem; 00338 }; 00339 00343 struct DmPartCoInfo 00344 { 00345 DmPartCoInfo() {} 00346 DiskInfo d; 00347 list<string> devices; 00348 unsigned long minor; 00349 }; 00350 00351 struct DmraidCoInfo 00352 { 00353 DmraidCoInfo() {} 00354 DmPartCoInfo p; 00355 }; 00356 00357 struct DmmultipathCoInfo 00358 { 00359 DmmultipathCoInfo() {} 00360 DmPartCoInfo p; 00361 string vendor; 00362 string model; 00363 }; 00364 00368 struct VolumeInfo : public DeviceInfo 00369 { 00370 VolumeInfo() {} 00371 unsigned long long sizeK; 00372 unsigned long major; 00373 unsigned long minor; 00374 string mount; 00375 string crypt_device; 00376 MountByType mount_by; 00377 bool ignore_fstab; 00378 string fstab_options; 00379 string uuid; 00380 string label; 00381 string mkfs_options; 00382 string tunefs_options; 00383 string loop; 00384 string dtxt; 00385 EncryptType encryption; 00386 string crypt_pwd; 00387 FsType fs; 00388 FsType detected_fs; 00389 bool format; 00390 bool create; 00391 bool is_mounted; 00392 bool resize; 00393 bool ignore_fs; 00394 unsigned long long origSizeK; 00395 }; 00396 00400 struct RegionInfo 00401 { 00402 RegionInfo() : start(0), len(0) {} 00403 RegionInfo(unsigned long long start, unsigned long long len) : start(start), len(len) {} 00404 unsigned long long start; 00405 unsigned long long len; 00406 }; 00407 00408 struct PartitionAddInfo 00409 { 00410 PartitionAddInfo() {} 00411 unsigned nr; 00412 RegionInfo cylRegion; 00413 PartitionType partitionType; 00414 unsigned id; 00415 bool boot; 00416 }; 00417 00421 struct PartitionInfo 00422 { 00423 PartitionInfo() {} 00424 PartitionInfo& operator=( const PartitionAddInfo& rhs ); 00425 VolumeInfo v; 00426 unsigned nr; 00427 RegionInfo cylRegion; 00428 PartitionType partitionType; 00429 unsigned id; 00430 bool boot; 00431 }; 00432 00436 struct LvmLvInfo 00437 { 00438 LvmLvInfo() {} 00439 VolumeInfo v; 00440 unsigned stripes; 00441 unsigned stripeSizeK; 00442 string uuid; 00443 string status; 00444 string dm_table; 00445 string dm_target; 00446 string origin; 00447 string used_pool; 00448 bool pool; 00449 }; 00450 00454 struct LvmLvSnapshotStateInfo 00455 { 00456 LvmLvSnapshotStateInfo() {} 00457 bool active; 00458 double allocated; 00459 }; 00460 00464 struct MdInfo 00465 { 00466 MdInfo() {} 00467 VolumeInfo v; 00468 unsigned nr; 00469 unsigned type; 00470 unsigned parity; 00471 string uuid; 00472 string sb_ver; 00473 unsigned long chunkSizeK; 00474 list<string> devices; 00475 list<string> spares; 00476 bool inactive; 00477 }; 00478 00482 struct MdStateInfo 00483 { 00484 MdStateInfo() {} 00485 MdArrayState state; 00486 }; 00487 00492 struct MdPartCoInfo 00493 { 00494 MdPartCoInfo() {} 00495 DiskInfo d; 00496 unsigned type; // RAID level 00497 unsigned nr; // MD device number 00498 unsigned parity; // Parity (not for all RAID level) 00499 string uuid; // MD Device UUID 00500 string sb_ver; // Metadata version 00501 unsigned long chunkSizeK; // Chunksize (strip size) 00502 list<string> devices; 00503 list<string> spares; 00504 }; 00505 00506 struct MdPartCoStateInfo 00507 { 00508 MdPartCoStateInfo() {} 00509 MdArrayState state; 00510 }; 00511 00515 struct MdPartInfo 00516 { 00517 MdPartInfo() {} 00518 VolumeInfo v; 00519 PartitionAddInfo p; 00520 bool part; 00521 }; 00522 00526 struct NfsInfo 00527 { 00528 NfsInfo() {} 00529 VolumeInfo v; 00530 }; 00531 00535 struct LoopInfo 00536 { 00537 LoopInfo() {} 00538 VolumeInfo v; 00539 bool reuseFile; 00540 unsigned nr; 00541 string file; 00542 }; 00543 00547 struct BtrfsInfo 00548 { 00549 BtrfsInfo() {} 00550 VolumeInfo v; 00551 list<string> devices; 00552 list<string> devices_add; 00553 list<string> devices_rem; 00554 list<string> subvol; 00555 list<string> subvol_add; 00556 list<string> subvol_rem; 00557 }; 00558 00562 struct TmpfsInfo 00563 { 00564 TmpfsInfo() {} 00565 VolumeInfo v; 00566 }; 00567 00571 struct DmInfo 00572 { 00573 DmInfo() {} 00574 VolumeInfo v; 00575 unsigned nr; 00576 string table; 00577 string target; 00578 }; 00579 00583 struct DmPartInfo 00584 { 00585 DmPartInfo() {} 00586 VolumeInfo v; 00587 PartitionAddInfo p; 00588 bool part; 00589 string table; 00590 string target; 00591 }; 00592 00596 struct DmraidInfo 00597 { 00598 DmraidInfo() {} 00599 DmPartInfo p; 00600 }; 00601 00605 struct DmmultipathInfo 00606 { 00607 DmmultipathInfo() {} 00608 DmPartInfo p; 00609 }; 00610 00614 struct ContVolInfo 00615 { 00616 ContVolInfo() : ctype(CUNKNOWN), num(-1) {} 00617 CType ctype; 00618 string cname; 00619 string cdevice; 00620 string vname; 00621 string vdevice; 00622 int num; 00623 }; 00624 00628 struct PartitionSlotInfo 00629 { 00630 PartitionSlotInfo() {} 00631 RegionInfo cylRegion; 00632 unsigned nr; 00633 string device; 00634 bool primarySlot; 00635 bool primaryPossible; 00636 bool extendedSlot; 00637 bool extendedPossible; 00638 bool logicalSlot; 00639 bool logicalPossible; 00640 }; 00641 00645 struct CommitInfo 00646 { 00647 CommitInfo() {} 00648 bool destructive; 00649 string text; 00650 }; 00651 00652 00656 enum ErrorCodes 00657 { 00658 STORAGE_NO_ERROR = 0, 00659 00660 DISK_PARTITION_OVERLAPS_EXISTING = -1000, 00661 DISK_PARTITION_EXCEEDS_DISK = -1001, 00662 DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002, 00663 DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003, 00664 DISK_PARTITION_NO_FREE_NUMBER = -1004, 00665 DISK_CREATE_PARTITION_INVALID_VOLUME = -1005, 00666 DISK_CREATE_PARTITION_INVALID_TYPE = -1006, 00667 DISK_CREATE_PARTITION_PARTED_FAILED = -1007, 00668 DISK_PARTITION_NOT_FOUND = -1008, 00669 DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009, 00670 DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010, 00671 DISK_SET_TYPE_INVALID_VOLUME = -1011, 00672 DISK_SET_TYPE_PARTED_FAILED = -1012, 00673 DISK_SET_LABEL_PARTED_FAILED = -1013, 00674 DISK_REMOVE_PARTITION_PARTED_FAILED = -1014, 00675 DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015, 00676 DISK_REMOVE_PARTITION_LIST_ERASE = -1016, 00677 DISK_DESTROY_TABLE_INVALID_LABEL = -1017, 00678 DISK_PARTITION_ZERO_SIZE = -1018, 00679 DISK_CHANGE_READONLY = -1019, 00680 DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020, 00681 DISK_RESIZE_PARTITION_PARTED_FAILED = -1021, 00682 DISK_RESIZE_NO_SPACE = -1022, 00683 DISK_CHECK_RESIZE_INVALID_VOLUME = -1023, 00684 DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024, 00685 DISK_COMMIT_NOTHING_TODO = -1025, 00686 DISK_CREATE_PARTITION_NO_SPACE = -1026, 00687 DISK_REMOVE_USED_BY = -1027, 00688 DISK_INIT_NOT_POSSIBLE = -1028, 00689 DISK_INVALID_PARTITION_ID = -1029, 00690 00691 STORAGE_DISK_NOT_FOUND = -2000, 00692 STORAGE_VOLUME_NOT_FOUND = -2001, 00693 STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002, 00694 STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003, 00695 STORAGE_CHANGE_READONLY = -2004, 00696 STORAGE_DISK_USED_BY = -2005, 00697 STORAGE_LVM_VG_EXISTS = -2006, 00698 STORAGE_LVM_VG_NOT_FOUND = -2007, 00699 STORAGE_LVM_INVALID_DEVICE = -2008, 00700 STORAGE_CONTAINER_NOT_FOUND = -2009, 00701 STORAGE_VG_INVALID_NAME = -2010, 00702 STORAGE_REMOVE_USED_VOLUME = -2011, 00703 STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012, 00704 STORAGE_NOT_YET_IMPLEMENTED = -2013, 00705 STORAGE_MD_INVALID_NAME = -2014, 00706 STORAGE_MD_NOT_FOUND = -2015, 00707 STORAGE_MEMORY_EXHAUSTED = -2016, 00708 STORAGE_LOOP_NOT_FOUND = -2017, 00709 STORAGE_CREATED_LOOP_NOT_FOUND = -2018, 00710 STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023, 00711 STORAGE_BACKUP_STATE_NOT_FOUND = -2024, 00712 STORAGE_INVALID_FSTAB_VALUE = -2025, 00713 STORAGE_NO_FSTAB_PTR = -2026, 00714 STORAGE_DEVICE_NODE_NOT_FOUND = -2027, 00715 STORAGE_DMRAID_CO_NOT_FOUND = -2028, 00716 STORAGE_RESIZE_INVALID_CONTAINER = -2029, 00717 STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030, 00718 STORAGE_ZERO_DEVICE_FAILED = -2031, 00719 STORAGE_INVALID_BACKUP_STATE_NAME = -2032, 00720 STORAGE_MDPART_CO_NOT_FOUND = -2033, 00721 STORAGE_DEVICE_NOT_FOUND = -2034, 00722 STORAGE_BTRFS_CO_NOT_FOUND = -2035, 00723 STORAGE_TMPFS_CO_NOT_FOUND = -2036, 00724 STORAGE_VOLUME_NOT_ENCRYPTED = -2037, 00725 STORAGE_DM_RENAME_FAILED = -2038, 00726 00727 VOLUME_COMMIT_UNKNOWN_STAGE = -3000, 00728 VOLUME_FSTAB_EMPTY_MOUNT = -3001, 00729 VOLUME_UMOUNT_FAILED = -3002, 00730 VOLUME_MOUNT_FAILED = -3003, 00731 VOLUME_FORMAT_UNKNOWN_FS = -3005, 00732 VOLUME_FORMAT_FS_UNDETECTED = -3006, 00733 VOLUME_FORMAT_FS_TOO_SMALL = -3007, 00734 VOLUME_FORMAT_FAILED = -3008, 00735 VOLUME_TUNE2FS_FAILED = -3009, 00736 VOLUME_MKLABEL_FS_UNABLE = -3010, 00737 VOLUME_MKLABEL_FAILED = -3011, 00738 VOLUME_LOSETUP_NO_LOOP = -3012, 00739 VOLUME_LOSETUP_FAILED = -3013, 00740 VOLUME_CRYPT_NO_PWD = -3014, 00741 VOLUME_CRYPT_PWD_TOO_SHORT = -3015, 00742 VOLUME_CRYPT_NOT_DETECTED = -3016, 00743 VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017, 00744 VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018, 00745 VOLUME_MOUNT_POINT_INVALID = -3019, 00746 VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020, 00747 VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021, 00748 VOLUME_LABEL_NOT_SUPPORTED = -3022, 00749 VOLUME_LABEL_TOO_LONG = -3023, 00750 VOLUME_LABEL_WHILE_MOUNTED = -3024, 00751 VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025, 00752 VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026, 00753 VOLUME_RESIZE_FAILED = -3027, 00754 VOLUME_ALREADY_IN_USE = -3028, 00755 VOLUME_LOUNSETUP_FAILED = -3029, 00756 VOLUME_DEVICE_NOT_PRESENT = -3030, 00757 VOLUME_DEVICE_NOT_BLOCK = -3031, 00758 VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032, 00759 VOLUME_CRYPTFORMAT_FAILED = -3033, 00760 VOLUME_CRYPTSETUP_FAILED = -3034, 00761 VOLUME_CRYPTUNSETUP_FAILED = -3035, 00762 VOLUME_FORMAT_NOT_IMPLEMENTED = -3036, 00763 VOLUME_FORMAT_IMPOSSIBLE = -3037, 00764 VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038, 00765 VOLUME_REMOUNT_FAILED = -3039, 00766 VOLUME_TUNEREISERFS_FAILED = -3040, 00767 VOLUME_UMOUNT_NOT_MOUNTED = -3041, 00768 VOLUME_BTRFS_ADD_FAILED = -3042, 00769 VOLUME_CANNOT_TMP_MOUNT = -3043, 00770 VOLUME_CANNOT_TMP_UMOUNT = -3044, 00771 VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045, 00772 VOLUME_BTRFS_SUBVOL_SETDEFAULT = -3046, 00773 00774 LVM_CREATE_PV_FAILED = -4000, 00775 LVM_PV_ALREADY_CONTAINED = -4001, 00776 LVM_PV_DEVICE_UNKNOWN = -4002, 00777 LVM_PV_DEVICE_USED = -4003, 00778 LVM_VG_HAS_NONE_PV = -4004, 00779 LVM_LV_INVALID_NAME = -4005, 00780 LVM_LV_DUPLICATE_NAME = -4006, 00781 LVM_LV_NO_SPACE = -4007, 00782 LVM_LV_UNKNOWN_NAME = -4008, 00783 LVM_LV_NOT_IN_LIST = -4009, 00784 LVM_VG_CREATE_FAILED = -4010, 00785 LVM_VG_EXTEND_FAILED = -4011, 00786 LVM_VG_REDUCE_FAILED = -4012, 00787 LVM_VG_REMOVE_FAILED = -4013, 00788 LVM_LV_CREATE_FAILED = -4014, 00789 LVM_LV_REMOVE_FAILED = -4015, 00790 LVM_LV_RESIZE_FAILED = -4016, 00791 LVM_PV_STILL_ADDED = -4017, 00792 LVM_PV_REMOVE_NOT_FOUND = -4018, 00793 LVM_CREATE_LV_INVALID_VOLUME = -4019, 00794 LVM_REMOVE_LV_INVALID_VOLUME = -4020, 00795 LVM_RESIZE_LV_INVALID_VOLUME = -4021, 00796 LVM_CHANGE_READONLY = -4022, 00797 LVM_CHECK_RESIZE_INVALID_VOLUME = -4023, 00798 LVM_COMMIT_NOTHING_TODO = -4024, 00799 LVM_LV_REMOVE_USED_BY = -4025, 00800 LVM_LV_ALREADY_ON_DISK = -4026, 00801 LVM_LV_NO_STRIPE_SIZE = -4027, 00802 LVM_LV_UNKNOWN_ORIGIN = -4028, 00803 LVM_LV_NOT_ON_DISK = -4029, 00804 LVM_LV_NOT_SNAPSHOT = -4030, 00805 LVM_LV_HAS_SNAPSHOTS = -4031, 00806 LVM_LV_IS_SNAPSHOT = -4032, 00807 LVM_LIST_EMPTY = -4033, 00808 LVM_LV_NO_POOL_OR_SNAP = -4034, 00809 LVM_LV_NO_POOL = -4035, 00810 LVM_LV_UNKNOWN_POOL = -4036, 00811 LVM_LV_INVALID_CHUNK_SIZE = -4037, 00812 LVM_LV_POOL_NO_FORMAT = -4038, 00813 LVM_LV_POOL_NO_MOUNT = -4039, 00814 00815 FSTAB_ENTRY_NOT_FOUND = -5000, 00816 FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001, 00817 FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002, 00818 FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003, 00819 FSTAB_ADD_ENTRY_FOUND = -5004, 00820 00821 MD_CHANGE_READONLY = -6000, 00822 MD_DUPLICATE_NUMBER = -6001, 00823 MD_TOO_FEW_DEVICES = -6002, 00824 MD_DEVICE_UNKNOWN = -6003, 00825 MD_DEVICE_USED = -6004, 00826 MD_CREATE_INVALID_VOLUME = -6005, 00827 MD_REMOVE_FAILED = -6006, 00828 MD_NOT_IN_LIST = -6007, 00829 MD_CREATE_FAILED = -6008, 00830 MD_UNKNOWN_NUMBER = -6009, 00831 MD_REMOVE_USED_BY = -6010, 00832 MD_NUMBER_TOO_LARGE = -6011, 00833 MD_REMOVE_INVALID_VOLUME = -6012, 00834 MD_REMOVE_CREATE_NOT_FOUND = -6013, 00835 MD_NO_RESIZE_ON_DISK = -6014, 00836 MD_ADD_DUPLICATE = -6015, 00837 MD_REMOVE_NONEXISTENT = -6016, 00838 MD_NO_CHANGE_ON_DISK = -6017, 00839 MD_NO_CREATE_UNKNOWN = -6018, 00840 MD_STATE_NOT_ON_DISK = -6019, 00841 MD_PARTITION_NOT_FOUND = -6020, 00842 MD_INVALID_PARITY = -6021, 00843 MD_TOO_MANY_SPARES = -6022, 00844 MD_GET_STATE_FAILED = -6023, 00845 MD_DUPLICATE_NAME = -6024, 00846 00847 MDPART_CHANGE_READONLY = -6100, 00848 MDPART_INTERNAL_ERR = -6101, 00849 MDPART_INVALID_VOLUME = -6012, 00850 MDPART_PARTITION_NOT_FOUND = -6103, 00851 MDPART_REMOVE_PARTITION_LIST_ERASE = -6104, 00852 MDPART_COMMIT_NOTHING_TODO = -6105, 00853 MDPART_NO_REMOVE = -6106, 00854 MDPART_DEVICE_NOT_FOUND = -6107, 00855 00856 LOOP_CHANGE_READONLY = -7000, 00857 LOOP_DUPLICATE_FILE = -7001, 00858 LOOP_UNKNOWN_FILE = -7002, 00859 LOOP_REMOVE_USED_BY = -7003, 00860 LOOP_FILE_CREATE_FAILED = -7004, 00861 LOOP_CREATE_INVALID_VOLUME = -7005, 00862 LOOP_REMOVE_FILE_FAILED = -7006, 00863 LOOP_REMOVE_INVALID_VOLUME = -7007, 00864 LOOP_NOT_IN_LIST = -7008, 00865 LOOP_REMOVE_CREATE_NOT_FOUND = -7009, 00866 LOOP_MODIFY_EXISTING = -7010, 00867 00868 PEC_PE_SIZE_INVALID = -9000, 00869 PEC_PV_NOT_FOUND = -9001, 00870 PEC_REMOVE_PV_IN_USE = -9002, 00871 PEC_REMOVE_PV_SIZE_NEEDED = -9003, 00872 PEC_LV_NO_SPACE_STRIPED = -9004, 00873 PEC_LV_NO_SPACE_SINGLE = -9005, 00874 PEC_LV_PE_DEV_NOT_FOUND = -9006, 00875 00876 DM_CHANGE_READONLY = -10000, 00877 DM_UNKNOWN_TABLE = -10001, 00878 DM_REMOVE_USED_BY = -10002, 00879 DM_REMOVE_CREATE_NOT_FOUND = -10003, 00880 DM_REMOVE_INVALID_VOLUME = -10004, 00881 DM_REMOVE_FAILED = -10005, 00882 DM_NOT_IN_LIST = -10006, 00883 00884 DASD_NOT_POSSIBLE = -11000, 00885 DASD_DASDFMT_FAILED = -11002, 00886 00887 DMPART_CHANGE_READONLY = -12001, 00888 DMPART_INTERNAL_ERR = -12002, 00889 DMPART_INVALID_VOLUME = -12003, 00890 DMPART_PARTITION_NOT_FOUND = -12004, 00891 DMPART_REMOVE_PARTITION_LIST_ERASE = -12005, 00892 DMPART_COMMIT_NOTHING_TODO = -12006, 00893 DMPART_NO_REMOVE = -12007, 00894 00895 DMRAID_REMOVE_FAILED = -13001, 00896 00897 NFS_VOLUME_NOT_FOUND = -14001, 00898 NFS_CHANGE_READONLY = -14002, 00899 NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003, 00900 NFS_REMOVE_VOLUME_LIST_ERASE = -14004, 00901 NFS_REMOVE_INVALID_VOLUME = -14005, 00902 00903 BTRFS_COMMIT_INVALID_VOLUME = -15001, 00904 BTRFS_CANNOT_TMP_MOUNT = -15002, 00905 BTRFS_CANNOT_TMP_UMOUNT = -15003, 00906 BTRFS_DELETE_SUBVOL_FAIL = -15004, 00907 BTRFS_CREATE_SUBVOL_FAIL = -15005, 00908 BTRFS_VOLUME_NOT_FOUND = -15006, 00909 BTRFS_SUBVOL_EXISTS = -15007, 00910 BTRFS_SUBVOL_NON_EXISTS = -15008, 00911 BTRFS_REMOVE_NOT_FOUND = -15009, 00912 BTRFS_REMOVE_NO_BTRFS = -15010, 00913 BTRFS_REMOVE_INVALID_VOLUME = -15011, 00914 BTRFS_CHANGE_READONLY = -15012, 00915 BTRFS_DEV_ALREADY_CONTAINED = -15013, 00916 BTRFS_DEVICE_UNKNOWN = -15014, 00917 BTRFS_DEVICE_USED = -15015, 00918 BTRFS_HAS_NONE_DEV = -15016, 00919 BTRFS_DEV_NOT_FOUND = -15017, 00920 BTRFS_EXTEND_FAIL = -15018, 00921 BTRFS_REDUCE_FAIL = -15019, 00922 BTRFS_LIST_EMPTY = -15020, 00923 BTRFS_RESIZE_INVALID_VOLUME = -15021, 00924 BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022, 00925 00926 TMPFS_REMOVE_INVALID_VOLUME = -16001, 00927 TMPFS_REMOVE_NO_TMPFS = -16002, 00928 TMPFS_REMOVE_NOT_FOUND = -16003, 00929 00930 CONTAINER_INTERNAL_ERROR = -99000, 00931 CONTAINER_INVALID_VIRTUAL_CALL = -99001, 00932 00933 }; 00934 00935 00939 class StorageInterface 00940 { 00941 public: 00942 00943 StorageInterface () {} 00944 virtual ~StorageInterface () {} 00945 00949 virtual void getContainers( deque<ContainerInfo>& infos) = 0; 00950 00958 virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0; 00959 00968 virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo, 00969 DiskInfo& info ) = 0; 00970 00978 virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0; 00979 00988 virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo, 00989 LvmVgInfo& info) = 0; 00990 00998 virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0; 00999 01008 virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo, 01009 DmraidCoInfo& info) = 0; 01010 01018 virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0; 01019 01028 virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo, 01029 DmmultipathCoInfo& info) = 0; 01030 01038 virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0; 01039 01040 01049 virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo, 01050 MdPartCoInfo& info) = 0; 01051 01057 virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0; 01058 01064 virtual MultipathAutostart getMultipathAutostart() const = 0; 01065 01071 virtual void getVolumes( deque<VolumeInfo>& infos) = 0; 01072 01080 virtual int getVolume( const string& device, VolumeInfo& info) = 0; 01081 01089 virtual int getPartitionInfo( const string& disk, 01090 deque<PartitionInfo>& plist ) = 0; 01091 01099 virtual int getLvmLvInfo( const string& name, 01100 deque<LvmLvInfo>& plist ) = 0; 01101 01108 virtual int getMdInfo( deque<MdInfo>& plist ) = 0; 01109 01117 virtual int getMdPartInfo( const string& device, 01118 deque<MdPartInfo>& plist ) = 0; 01119 01126 virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0; 01127 01134 virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0; 01135 01142 virtual int getDmInfo( deque<DmInfo>& plist ) = 0; 01143 01150 virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0; 01151 01158 virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0; 01159 01167 virtual int getDmraidInfo( const string& name, 01168 deque<DmraidInfo>& plist ) = 0; 01169 01177 virtual int getDmmultipathInfo( const string& name, 01178 deque<DmmultipathInfo>& plist ) = 0; 01179 01183 virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0; 01184 01188 virtual bool getDlabelCapabilities(const string& dlabel, 01189 DlabelCapabilities& dlabelcapabilities) const = 0; 01190 01194 virtual list<string> getAllUsedFs() const = 0; 01195 01207 virtual int createPartition(const string& disk, PartitionType type, 01208 const RegionInfo& cylRegion, 01209 string& SWIG_OUTPUT(device)) = 0; 01210 01219 virtual int resizePartition( const string& device, 01220 unsigned long sizeCyl ) = 0; 01221 01230 virtual int resizePartitionNoFs( const string& device, 01231 unsigned long sizeCyl ) = 0; 01232 01242 virtual int updatePartitionArea(const string& device, const RegionInfo& cylRegion) = 0; 01243 01252 virtual int freeCylindersAroundPartition(const string& device, 01253 unsigned long& SWIG_OUTPUT(freeCylsBefore), 01254 unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0; 01255 01269 virtual int nextFreePartition( const string& disk, PartitionType type, 01270 unsigned & SWIG_OUTPUT(nr), 01271 string& SWIG_OUTPUT(device) ) = 0; 01272 01284 virtual int createPartitionKb(const string& disk, PartitionType type, 01285 const RegionInfo& kRegion, 01286 string& SWIG_OUTPUT(device)) = 0; 01287 01298 virtual int createPartitionAny( const string& disk, 01299 unsigned long long sizeK, 01300 string& SWIG_OUTPUT(device) ) = 0; 01301 01312 virtual int createPartitionMax( const string& disk, PartitionType type, 01313 string& SWIG_OUTPUT(device) ) = 0; 01314 01322 virtual unsigned long long cylinderToKb( const string& disk, 01323 unsigned long sizeCyl) = 0; 01324 01332 virtual unsigned long kbToCylinder( const string& disk, 01333 unsigned long long sizeK) = 0; 01334 01341 virtual int removePartition (const string& partition) = 0; 01342 01350 virtual int changePartitionId (const string& partition, unsigned id) = 0; 01351 01358 virtual int forgetChangePartitionId (const string& partition ) = 0; 01359 01367 virtual string getPartitionPrefix(const string& disk) = 0; 01368 01377 virtual string getPartitionName(const string& disk, int partition_no) = 0; 01378 01389 virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0; 01390 01399 virtual int destroyPartitionTable (const string& disk, const string& label) = 0; 01400 01411 virtual int initializeDisk( const string& disk, bool value ) = 0; 01412 01421 virtual string defaultDiskLabel(const string& device) = 0; 01422 01431 virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0; 01432 01440 virtual int changeLabelVolume( const string& device, const string& label ) = 0; 01441 01449 virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0; 01450 01458 virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0; 01459 01468 virtual int changeMountPoint( const string& device, const string& mount ) = 0; 01469 01477 virtual int getMountPoint( const string& device, 01478 string& SWIG_OUTPUT(mount) ) = 0; 01479 01487 virtual int changeMountBy( const string& device, MountByType mby ) = 0; 01488 01496 virtual int getMountBy( const string& device, 01497 MountByType& SWIG_OUTPUT(mby) ) = 0; 01498 01508 virtual int changeFstabOptions( const string& device, const string& options ) = 0; 01509 01518 virtual int getFstabOptions( const string& device, 01519 string& SWIG_OUTPUT(options) ) = 0; 01520 01521 01530 virtual int addFstabOptions( const string& device, const string& options ) = 0; 01531 01541 virtual int removeFstabOptions( const string& device, const string& options ) = 0; 01542 01550 virtual int setCryptPassword( const string& device, const string& pwd ) = 0; 01551 01558 virtual int forgetCryptPassword( const string& device ) = 0; 01559 01567 virtual int getCryptPassword( const string& device, 01568 string& SWIG_OUTPUT(pwd) ) = 0; 01569 01578 virtual int verifyCryptPassword( const string& device, 01579 const string& pwd, bool erase ) = 0; 01580 01587 virtual bool needCryptPassword( const string& device ) = 0; 01588 01596 virtual int setCrypt( const string& device, bool val ) = 0; 01597 01606 virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0; 01607 01615 virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0; 01616 01626 virtual int setIgnoreFstab( const string& device, bool val ) = 0; 01627 01635 virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0; 01636 01646 virtual int changeDescText( const string& device, const string& txt ) = 0; 01647 01662 virtual int addFstabEntry( const string& device, const string& mount, 01663 const string& vfs, const string& options, 01664 unsigned freq, unsigned passno ) = 0; 01665 01666 01674 virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0; 01675 01683 virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0; 01684 01691 virtual int forgetResizeVolume( const string& device ) = 0; 01692 01707 virtual void setRecursiveRemoval( bool val ) = 0; 01708 01714 virtual bool getRecursiveRemoval() const = 0; 01715 01725 virtual int getRecursiveUsing(const list<string>& devices, bool itself, 01726 list<string>& using_devices) = 0; 01727 01737 virtual int getRecursiveUsedBy(const list<string>& devices, bool itself, 01738 list<string>& usedby_devices) = 0; 01739 01753 virtual void setZeroNewPartitions( bool val ) = 0; 01754 01760 virtual bool getZeroNewPartitions() const = 0; 01761 01773 virtual void setPartitionAlignment( PartAlign val ) = 0; 01774 01780 virtual PartAlign getPartitionAlignment() const = 0; 01781 01787 virtual void setDefaultMountBy( MountByType val ) = 0; 01788 01794 virtual MountByType getDefaultMountBy() const = 0; 01795 01801 virtual void setDefaultFs(FsType val) = 0; 01802 01808 virtual FsType getDefaultFs() const = 0; 01809 01815 virtual void setDefaultSubvolName( const string& val) = 0; 01816 01822 virtual string getDefaultSubvolName() const = 0; 01823 01829 virtual bool getEfiBoot() = 0; 01830 01841 virtual void setRootPrefix( const string& root ) = 0; 01842 01848 virtual string getRootPrefix() const = 0; 01849 01855 virtual void setDetectMountedVolumes( bool val ) = 0; 01856 01862 virtual bool getDetectMountedVolumes() const = 0; 01863 01871 virtual int removeVolume( const string& device ) = 0; 01872 01883 virtual int createLvmVg( const string& name, 01884 unsigned long long peSizeK, bool lvm1, 01885 const deque<string>& devs ) = 0; 01886 01894 virtual int removeLvmVg( const string& name ) = 0; 01895 01903 virtual int extendLvmVg( const string& name, 01904 const deque<string>& devs ) = 0; 01905 01913 virtual int shrinkLvmVg( const string& name, 01914 const deque<string>& devs ) = 0; 01915 01927 virtual int createLvmLv( const string& vg, const string& name, 01928 unsigned long long sizeK, unsigned stripes, 01929 string& SWIG_OUTPUT(device) ) = 0; 01930 01937 virtual int removeLvmLvByDevice( const string& device ) = 0; 01938 01946 virtual int removeLvmLv( const string& vg, const string& name ) = 0; 01947 01957 virtual int changeLvStripeCount( const string& vg, const string& name, 01958 unsigned long stripes ) = 0; 01959 01969 virtual int changeLvStripeSize( const string& vg, const string& name, 01970 unsigned long long stripeSizeK) = 0; 01971 01982 virtual int createLvmLvSnapshot(const string& vg, const string& origin, 01983 const string& name, unsigned long long cowSizeK, 01984 string& SWIG_OUTPUT(device) ) = 0; 01985 01993 virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0; 01994 02005 virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name, 02006 LvmLvSnapshotStateInfo& info) = 0; 02007 02017 virtual int createLvmLvPool(const string& vg, const string& name, 02018 unsigned long long sizeK, 02019 string& SWIG_OUTPUT(device) ) = 0; 02020 02031 virtual int createLvmLvThin(const string& vg, const string& name, 02032 const string& pool, 02033 unsigned long long sizeK, 02034 string& SWIG_OUTPUT(device) ) = 0; 02035 02045 virtual int changeLvChunkSize( const string& vg, const string& name, 02046 unsigned long long chunkSizeK) = 0; 02047 02055 virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr), 02056 string& SWIG_OUTPUT(device)) = 0; 02057 02067 virtual int createMd(const string& name, MdType md_type, const list<string>& devices, 02068 const list<string>& spares) = 0; 02069 02079 virtual int createMdAny(MdType md_type, const list<string>& devices, 02080 const list<string>& spares, 02081 string& SWIG_OUTPUT(device) ) = 0; 02082 02091 virtual int removeMd( const string& name, bool destroySb ) = 0; 02092 02102 virtual int extendMd(const string& name, const list<string>& devices, 02103 const list<string>& spares) = 0; 02104 02114 virtual int updateMd(const string& name, const list<string>& devices, 02115 const list<string>& spares) = 0; 02116 02126 virtual int shrinkMd(const string& name, const list<string>& devices, 02127 const list<string>& spares) = 0; 02128 02137 virtual int changeMdType(const string& name, MdType md_type) = 0; 02138 02147 virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0; 02148 02157 virtual int changeMdParity( const string& name, MdParity ptype ) = 0; 02158 02165 virtual int checkMd( const string& name ) = 0; 02166 02176 virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0; 02177 02187 virtual int getMdPartCoStateInfo(const string& name, 02188 MdPartCoStateInfo& info) = 0; 02189 02202 virtual int computeMdSize(MdType md_type, const list<string>& devices, 02203 const list<string>& spares, unsigned long long& SWIG_OUTPUT(sizeK)) = 0; 02204 02212 virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0; 02213 02224 virtual int removeMdPartCo(const string& name, bool destroySb ) = 0; 02225 02236 virtual int addNfsDevice(const string& nfsDev, const string& opts, 02237 unsigned long long sizeK, const string& mp, 02238 bool nfs4) = 0; 02239 02249 virtual int checkNfsDevice(const string& nfsDev, const string& opts, 02250 bool nfs4, unsigned long long& SWIG_OUTPUT(sizeK)) = 0; 02251 02268 virtual int createFileLoop( const string& lname, bool reuseExisting, 02269 unsigned long long sizeK, 02270 const string& mp, const string& pwd, 02271 string& SWIG_OUTPUT(device) ) = 0; 02272 02290 virtual int modifyFileLoop( const string& device, const string& lname, 02291 bool reuseExisting, 02292 unsigned long long sizeK ) = 0; 02293 02302 virtual int removeFileLoop( const string& lname, bool removeFile ) = 0; 02303 02310 virtual int removeDmraid( const string& name ) = 0; 02311 02319 virtual bool existSubvolume( const string& device, const string& name ) = 0; 02320 02328 virtual int createSubvolume( const string& device, const string& name ) = 0; 02329 02337 virtual int removeSubvolume( const string& device, const string& name ) = 0; 02338 02347 virtual int extendBtrfsVolume( const string& name, 02348 const deque<string>& devs ) = 0; 02349 02358 virtual int shrinkBtrfsVolume( const string& name, 02359 const deque<string>& devs ) = 0; 02360 02368 virtual int addTmpfsMount( const string& mp, const string& opts ) = 0; 02369 02376 virtual int removeTmpfsMount( const string& mp ) = 0; 02377 02383 virtual void getCommitInfos(list<CommitInfo>& infos) const = 0; 02384 02390 virtual const string& getLastAction() const = 0; 02391 02398 virtual const string& getExtendedErrorMessage() const = 0; 02399 02400 // temporarily disable callback function for swig 02401 #ifndef SWIG 02402 02408 virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0; 02409 02415 virtual CallbackProgressBar getCallbackProgressBar() const = 0; 02416 02417 02423 virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0; 02424 02430 virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0; 02431 02432 02439 virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0; 02440 02447 virtual CallbackInfoPopup getCallbackInfoPopup() const = 0; 02448 02449 02456 virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0; 02457 02464 virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0; 02465 02466 02472 virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0; 02473 02479 virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0; 02480 02481 02487 virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0; 02488 02495 virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0; 02496 02497 #endif 02498 02504 virtual void setCacheChanges (bool cache) = 0; 02505 02509 virtual bool isCacheChanges () const = 0; 02510 02515 virtual int commit() = 0; 02516 02520 virtual string getErrorString(int error) const = 0; 02521 02528 virtual int createBackupState( const string& name ) = 0; 02529 02536 virtual int restoreBackupState( const string& name ) = 0; 02537 02544 virtual bool checkBackupState(const string& name) const = 0; 02545 02554 virtual bool equalBackupStates(const string& lhs, const string& rhs, 02555 bool verbose_log) const = 0; 02556 02564 virtual int removeBackupState( const string& name ) = 0; 02565 02573 virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0; 02574 02585 virtual bool umountDevice( const string& device ) = 0; 02586 02599 virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0; 02600 02611 virtual bool mountDevice( const string& device, const string& mp ) = 0; 02612 02623 virtual int activateEncryption( const string& device, bool on ) = 0; 02624 02636 virtual bool mountDeviceOpts( const string& device, const string& mp, 02637 const string& opts ) = 0; 02638 02650 virtual bool mountDeviceRo( const string& device, const string& mp, 02651 const string& opts ) = 0; 02652 02659 virtual bool checkDmMapsTo( const string& device ) = 0; 02660 02666 virtual void removeDmTableTo( const string& device ) = 0; 02667 02676 virtual int renameCryptDm( const string& device, 02677 const string& new_name ) = 0; 02678 02690 virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info, 02691 bool get_content, ContentInfo& content_info, bool use_cache) = 0; 02692 02700 virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0; 02701 02711 virtual void activateHld( bool val ) = 0; 02712 02721 virtual void activateMultipath( bool val ) = 0; 02722 02731 virtual void rescanEverything() = 0; 02732 02741 virtual bool rescanCryptedObjects() = 0; 02742 02746 virtual void dumpObjectList() = 0; 02747 02751 virtual void dumpCommitInfos() const = 0; 02752 02762 virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0; 02763 02772 virtual int setUserdata(const string& device, const map<string, string>& userdata) = 0; 02773 02781 virtual int getUserdata(const string& device, map<string, string>& userdata) = 0; 02782 02783 }; 02784 02785 02789 void initDefaultLogger( const string& logdir ); 02790 02795 typedef void (*CallbackLogDo)( int level, const string& component, const char* file, 02796 int line, const char* function, const string& content ); 02797 02802 typedef bool (*CallbackLogQuery)( int level, const string& component ); 02803 02807 void setLogDoCallback( CallbackLogDo pfc ); 02808 02812 CallbackLogDo getLogDoCallback(); 02813 02817 void setLogQueryCallback( CallbackLogQuery pfc ); 02818 02822 CallbackLogQuery getLogQueryCallback(); 02823 02827 struct Environment 02828 { 02829 Environment(bool readonly, const string& logdir = "/var/log/YaST2") 02830 : readonly(readonly), testmode(false), autodetect(true), 02831 instsys(false), logdir(logdir), testdir("tmp") 02832 { 02833 storage::initDefaultLogger( logdir ); 02834 } 02835 02836 bool readonly; 02837 bool testmode; 02838 bool autodetect; 02839 bool instsys; 02840 string logdir; 02841 string testdir; 02842 }; 02843 02844 02850 StorageInterface* createStorageInterface(const Environment& env); 02851 02852 02860 StorageInterface* createStorageInterfacePid(const Environment& env, int& SWIG_OUTPUT(locker_pid)); 02861 02862 02866 void destroyStorageInterface(StorageInterface*); 02867 02868 } 02869 02870 02871 #endif