libstorage
StorageInterface.h
1 /*
2  * Copyright (c) [2004-2015] Novell, Inc.
3  * Copyright (c) [2015] SUSE LLC
4  *
5  * All Rights Reserved.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of version 2 of the GNU General Public License as published
9  * by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, contact Novell, Inc.
18  *
19  * To contact Novell about this file by physical or electronic mail, you may
20  * find current contact information at www.novell.com.
21  */
22 
23 
24 #ifndef STORAGE_INTERFACE_H
25 #define STORAGE_INTERFACE_H
26 
27 
28 #include <string>
29 #include <vector>
30 #include <deque>
31 #include <list>
32 #include <map>
33 
34 using std::string;
35 using std::vector;
36 using std::deque;
37 using std::list;
38 using std::map;
39 
40 
41 #include "storage/StorageVersion.h"
42 #include "storage/StorageSwig.h"
43 
44 
142 namespace storage
143 {
144  enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS,
145  SWAP, HFSPLUS, NFS, NFS4, TMPFS, ISO9660, UDF, FSNONE };
146 
147  enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
148 
149  enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
150 
151  enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
152  ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
153 
154  enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
155 
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 };
162 
163  enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO,
164  CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE };
165 
166  enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS };
167 
168  enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC };
169 
170  enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE };
171 
172  enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF };
173 
174  enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER };
175 
176  enum DasdFormat { DASDF_NONE, DASDF_LDL, DASDF_CDL };
177 
178  enum DasdType { DASDTYPE_NONE, DASDTYPE_ECKD, DASDTYPE_FBA };
179 
184  typedef void (*CallbackProgressBar)(const string& id, unsigned cur, unsigned max);
185 
190  typedef void (*CallbackShowInstallInfo)(const string& id);
191 
196  typedef void (*CallbackInfoPopup)(const string& text);
197 
204  typedef bool (*CallbackYesNoPopup)(const string& text);
205 
211  typedef bool (*CallbackCommitErrorPopup)(int error, const string& last_action,
212  const string& extended_message);
213 
219  typedef bool (*CallbackPasswordPopup)(const string& device, int attempts, string& password);
220 
221 
227  {
228  public:
229 
230  virtual ~CommitCallbacks() {}
231 
232  virtual void post_root_filesystem_create() const {}
233  virtual void post_root_mount() const {}
234  virtual void post_root_fstab_add() const {}
235 
236  };
237 
238 
243  {
244  FsCapabilities() {}
245  bool isExtendable;
246  bool isExtendableWhileMounted;
247  bool isReduceable;
248  bool isReduceableWhileMounted;
249  bool supportsUuid;
250  bool supportsLabel;
251  bool labelWhileMounted;
252  unsigned int labelLength;
253  bool canFormat;
254  unsigned long long minimalFsSizeK;
255  };
256 
261  {
262  DlabelCapabilities() {}
263  unsigned maxPrimary;
264  bool extendedPossible;
265  unsigned maxLogical;
266  unsigned long long maxSectors;
267  };
268 
269 
270  struct UsedByInfo
271  {
272  UsedByInfo() : type(UB_NONE) {} // only for swig bindings
273  UsedByInfo(UsedByType type, const string& device) : type(type), device(device) {}
274  UsedByType type;
275  string device;
276  };
277 
278 
279  struct ResizeInfo
280  {
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;
285  bool resize_ok;
286  };
287 
288 
289  struct ContentInfo
290  {
291  ContentInfo() : windows(false), efi(false), homes(0) {}
292  bool windows;
293  bool efi;
294  unsigned homes;
295  };
296 
297 
298  struct DeviceInfo
299  {
300  DeviceInfo() {}
301 
302  string device;
303  string name;
304 
305  string udevPath;
306  list<string> udevId;
307 
308  list<UsedByInfo> usedBy;
309 
310  map<string, string> userdata;
311  };
312 
313 
317  struct ContainerInfo : public DeviceInfo
318  {
319  ContainerInfo() {}
320  CType type;
321  bool readonly;
322  };
323 
327  struct DiskInfo
328  {
329  DiskInfo() {}
330  unsigned long long sizeK;
331  unsigned long long cylSize;
332  unsigned long cyl;
333  unsigned long heads;
334  unsigned long sectors;
335  unsigned int sectorSize;
336  string disklabel;
337  string orig_disklabel;
338  unsigned maxPrimary;
339  bool extendedPossible;
340  unsigned maxLogical;
341  bool initDisk;
342  Transport transport;
343  bool has_fake_partition;
344  storage::DasdFormat dasd_format;
345  storage::DasdType dasd_type;
346  };
347 
351  struct LvmVgInfo
352  {
353  LvmVgInfo() {}
354  unsigned long long sizeK;
355  unsigned long long peSizeK;
356  unsigned long peCount;
357  unsigned long peFree;
358  string uuid;
359  bool lvm2;
360  bool create;
361  list<string> devices;
362  list<string> devices_add;
363  list<string> devices_rem;
364  };
365 
370  {
371  DmPartCoInfo() {}
372  DiskInfo d;
373  list<string> devices;
374  unsigned long minor;
375  };
376 
378  {
379  DmraidCoInfo() {}
380  DmPartCoInfo p;
381  };
382 
384  {
385  DmmultipathCoInfo() {}
386  DmPartCoInfo p;
387  string vendor;
388  string model;
389  };
390 
394  struct VolumeInfo : public DeviceInfo
395  {
396  VolumeInfo() {}
397  unsigned long long sizeK;
398  unsigned long major;
399  unsigned long minor;
400  string mount;
401  string crypt_device;
402  MountByType mount_by;
403  bool ignore_fstab;
404  string fstab_options;
405  string uuid;
406  string label;
407  string mkfs_options;
408  string tunefs_options;
409  string loop;
410  string dtxt;
411  EncryptType encryption;
412  string crypt_pwd;
413  FsType fs;
414  FsType detected_fs;
415  bool format;
416  bool create;
417  bool is_mounted;
418  bool resize;
419  bool ignore_fs;
420  unsigned long long origSizeK;
421  };
422 
426  struct RegionInfo
427  {
428  RegionInfo() : start(0), len(0) {}
429  RegionInfo(unsigned long long start, unsigned long long len) : start(start), len(len) {}
430  unsigned long long start;
431  unsigned long long len;
432  };
433 
435  {
436  PartitionAddInfo() {}
437  unsigned nr;
438  RegionInfo cylRegion;
439  PartitionType partitionType;
440  unsigned id;
441  bool boot;
442  };
443 
448  {
449  PartitionInfo() {}
450  PartitionInfo& operator=( const PartitionAddInfo& rhs );
451  VolumeInfo v;
452  unsigned nr;
453  RegionInfo cylRegion;
454  PartitionType partitionType;
455  unsigned id;
456  bool boot;
457  };
458 
462  struct LvmLvInfo
463  {
464  LvmLvInfo() {}
465  VolumeInfo v;
466  unsigned stripes;
467  unsigned stripeSizeK;
468  string uuid;
469  string status;
470  string dm_table;
471  string dm_target;
472  string origin;
473  string used_pool;
474  bool pool;
475  };
476 
481  {
483  bool active;
484  double allocated;
485  };
486 
490  struct MdInfo
491  {
492  MdInfo() {}
493  VolumeInfo v;
494  unsigned nr;
495  unsigned type;
496  unsigned parity;
497  string uuid;
498  string sb_ver;
499  unsigned long chunkSizeK;
500  list<string> devices;
501  list<string> spares;
502  bool inactive;
503  };
504 
508  struct MdStateInfo
509  {
510  MdStateInfo() {}
511  MdArrayState state;
512  };
513 
519  {
520  MdPartCoInfo() {}
521  DiskInfo d;
522  unsigned type; // RAID level
523  unsigned nr; // MD device number
524  unsigned parity; // Parity (not for all RAID level)
525  string uuid; // MD Device UUID
526  string sb_ver; // Metadata version
527  unsigned long chunkSizeK; // Chunksize (strip size)
528  list<string> devices;
529  list<string> spares;
530  };
531 
533  {
534  MdPartCoStateInfo() {}
535  MdArrayState state;
536  };
537 
541  struct MdPartInfo
542  {
543  MdPartInfo() {}
544  VolumeInfo v;
546  bool part;
547  };
548 
552  struct NfsInfo
553  {
554  NfsInfo() {}
555  VolumeInfo v;
556  };
557 
561  struct LoopInfo
562  {
563  LoopInfo() {}
564  VolumeInfo v;
565  bool reuseFile;
566  unsigned nr;
567  string file;
568  };
569 
570 
575  {
576  SubvolumeInfo()
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) {}
580 
581  string path;
582  bool nocow;
583 
584  bool created;
585  bool deleted;
586  };
587 
588 
592  struct BtrfsInfo
593  {
594  BtrfsInfo() {}
595  VolumeInfo v;
596  list<string> devices;
597  list<string> devices_add;
598  list<string> devices_rem;
599  vector<SubvolumeInfo> subvolumes;
600  };
601 
602 
606  struct TmpfsInfo
607  {
608  TmpfsInfo() {}
609  VolumeInfo v;
610  };
611 
615  struct DmInfo
616  {
617  DmInfo() {}
618  VolumeInfo v;
619  unsigned nr;
620  string table;
621  string target;
622  };
623 
627  struct DmPartInfo
628  {
629  DmPartInfo() {}
630  VolumeInfo v;
632  bool part;
633  string table;
634  string target;
635  };
636 
640  struct DmraidInfo
641  {
642  DmraidInfo() {}
643  DmPartInfo p;
644  };
645 
650  {
651  DmmultipathInfo() {}
652  DmPartInfo p;
653  };
654 
658  struct ContVolInfo
659  {
660  ContVolInfo() : ctype(CUNKNOWN), num(-1) {}
661  CType ctype;
662  string cname;
663  string cdevice;
664  string vname;
665  string vdevice;
666  int num;
667  };
668 
673  {
674  PartitionSlotInfo() {}
675  RegionInfo cylRegion;
676  unsigned nr;
677  string device;
678  bool primarySlot;
679  bool primaryPossible;
680  bool extendedSlot;
681  bool extendedPossible;
682  bool logicalSlot;
683  bool logicalPossible;
684  };
685 
689  struct CommitInfo
690  {
691  CommitInfo() {}
692  bool destructive;
693  string text;
694  };
695 
696 
700  enum ErrorCodes
701  {
702  STORAGE_NO_ERROR = 0,
703 
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,
734 
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,
770 
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,
817 
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,
858 
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,
864 
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,
890 
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,
899 
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,
911 
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,
919 
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,
927 
928  DASD_NOT_POSSIBLE = -11000,
929  DASD_DASDFMT_FAILED = -11002,
930 
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,
938 
939  DMRAID_REMOVE_FAILED = -13001,
940 
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,
946 
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,
969 
970  TMPFS_REMOVE_INVALID_VOLUME = -16001,
971  TMPFS_REMOVE_NO_TMPFS = -16002,
972  TMPFS_REMOVE_NOT_FOUND = -16003,
973 
974  CHATTR_FAILED = -17001,
975  QUOTA_RESTART_FAILED = -17002,
976 
977  CONTAINER_INTERNAL_ERROR = -99000,
978  CONTAINER_INVALID_VIRTUAL_CALL = -99001,
979 
980  };
981 
982 
987  {
988  public:
989 
990  StorageInterface () {}
991  virtual ~StorageInterface () {}
992 
996  virtual void getContainers( deque<ContainerInfo>& infos) = 0;
997 
1005  virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
1006 
1015  virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
1016  DiskInfo& info ) = 0;
1017 
1025  virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
1026 
1035  virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
1036  LvmVgInfo& info) = 0;
1037 
1045  virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
1046 
1055  virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
1056  DmraidCoInfo& info) = 0;
1057 
1065  virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0;
1066 
1075  virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
1076  DmmultipathCoInfo& info) = 0;
1077 
1085  virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0;
1086 
1087 
1096  virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
1097  MdPartCoInfo& info) = 0;
1098 
1104  virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0;
1105 
1111  virtual MultipathAutostart getMultipathAutostart() const = 0;
1112 
1118  virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
1119 
1127  virtual int getVolume( const string& device, VolumeInfo& info) = 0;
1128 
1136  virtual int getPartitionInfo( const string& disk,
1137  deque<PartitionInfo>& plist ) = 0;
1138 
1146  virtual int getLvmLvInfo( const string& name,
1147  deque<LvmLvInfo>& plist ) = 0;
1148 
1155  virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
1156 
1164  virtual int getMdPartInfo( const string& device,
1165  deque<MdPartInfo>& plist ) = 0;
1166 
1173  virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
1174 
1181  virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
1182 
1189  virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
1190 
1197  virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0;
1198 
1205  virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0;
1206 
1214  virtual int getDmraidInfo( const string& name,
1215  deque<DmraidInfo>& plist ) = 0;
1216 
1224  virtual int getDmmultipathInfo( const string& name,
1225  deque<DmmultipathInfo>& plist ) = 0;
1226 
1230  virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
1231 
1235  virtual bool getDlabelCapabilities(const string& dlabel,
1236  DlabelCapabilities& dlabelcapabilities) const = 0;
1237 
1241  virtual list<string> getAllUsedFs() const = 0;
1242 
1254  virtual int createPartition(const string& disk, PartitionType type,
1255  const RegionInfo& cylRegion,
1256  string& SWIG_OUTPUT(device)) = 0;
1257 
1266  virtual int resizePartition( const string& device,
1267  unsigned long sizeCyl ) = 0;
1268 
1277  virtual int resizePartitionNoFs( const string& device,
1278  unsigned long sizeCyl ) = 0;
1279 
1289  virtual int updatePartitionArea(const string& device, const RegionInfo& cylRegion) = 0;
1290 
1299  virtual int freeCylindersAroundPartition(const string& device,
1300  unsigned long& SWIG_OUTPUT(freeCylsBefore),
1301  unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0;
1302 
1316  virtual int nextFreePartition( const string& disk, PartitionType type,
1317  unsigned & SWIG_OUTPUT(nr),
1318  string& SWIG_OUTPUT(device) ) = 0;
1319 
1331  virtual int createPartitionKb(const string& disk, PartitionType type,
1332  const RegionInfo& kRegion,
1333  string& SWIG_OUTPUT(device)) = 0;
1334 
1345  virtual int createPartitionAny( const string& disk,
1346  unsigned long long sizeK,
1347  string& SWIG_OUTPUT(device) ) = 0;
1348 
1359  virtual int createPartitionMax( const string& disk, PartitionType type,
1360  string& SWIG_OUTPUT(device) ) = 0;
1361 
1369  virtual unsigned long long cylinderToKb( const string& disk,
1370  unsigned long sizeCyl) = 0;
1371 
1379  virtual unsigned long kbToCylinder( const string& disk,
1380  unsigned long long sizeK) = 0;
1381 
1388  virtual int removePartition (const string& partition) = 0;
1389 
1397  virtual int changePartitionId (const string& partition, unsigned id) = 0;
1398 
1405  virtual int forgetChangePartitionId (const string& partition ) = 0;
1406 
1414  virtual string getPartitionPrefix(const string& disk) = 0;
1415 
1424  virtual string getPartitionName(const string& disk, int partition_no) = 0;
1425 
1436  virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0;
1437 
1446  virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
1447 
1458  virtual int initializeDisk( const string& disk, bool value ) = 0;
1459 
1468  virtual string defaultDiskLabel(const string& device) = 0;
1469 
1478  virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
1479 
1487  virtual int changeLabelVolume( const string& device, const string& label ) = 0;
1488 
1496  virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
1497 
1505  virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0;
1506 
1515  virtual int changeMountPoint( const string& device, const string& mount ) = 0;
1516 
1524  virtual int getMountPoint( const string& device,
1525  string& SWIG_OUTPUT(mount) ) = 0;
1526 
1534  virtual int changeMountBy( const string& device, MountByType mby ) = 0;
1535 
1543  virtual int getMountBy( const string& device,
1544  MountByType& SWIG_OUTPUT(mby) ) = 0;
1545 
1555  virtual int changeFstabOptions( const string& device, const string& options ) = 0;
1556 
1565  virtual int getFstabOptions( const string& device,
1566  string& SWIG_OUTPUT(options) ) = 0;
1567 
1568 
1577  virtual int addFstabOptions( const string& device, const string& options ) = 0;
1578 
1588  virtual int removeFstabOptions( const string& device, const string& options ) = 0;
1589 
1597  virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
1598 
1605  virtual int forgetCryptPassword( const string& device ) = 0;
1606 
1614  virtual int getCryptPassword( const string& device,
1615  string& SWIG_OUTPUT(pwd) ) = 0;
1616 
1625  virtual int verifyCryptPassword( const string& device,
1626  const string& pwd, bool erase ) = 0;
1627 
1634  virtual bool needCryptPassword( const string& device ) = 0;
1635 
1643  virtual int setCrypt( const string& device, bool val ) = 0;
1644 
1653  virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
1654 
1662  virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1663 
1673  virtual int setIgnoreFstab( const string& device, bool val ) = 0;
1674 
1682  virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1683 
1693  virtual int changeDescText( const string& device, const string& txt ) = 0;
1694 
1709  virtual int addFstabEntry( const string& device, const string& mount,
1710  const string& vfs, const string& options,
1711  unsigned freq, unsigned passno ) = 0;
1712 
1713 
1721  virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0;
1722 
1730  virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0;
1731 
1738  virtual int forgetResizeVolume( const string& device ) = 0;
1739 
1754  virtual void setRecursiveRemoval( bool val ) = 0;
1755 
1761  virtual bool getRecursiveRemoval() const = 0;
1762 
1772  virtual int getRecursiveUsing(const list<string>& devices, bool itself,
1773  list<string>& using_devices) = 0;
1774 
1784  virtual int getRecursiveUsedBy(const list<string>& devices, bool itself,
1785  list<string>& usedby_devices) = 0;
1786 
1800  virtual void setZeroNewPartitions( bool val ) = 0;
1801 
1807  virtual bool getZeroNewPartitions() const = 0;
1808 
1820  virtual void setPartitionAlignment( PartAlign val ) = 0;
1821 
1827  virtual PartAlign getPartitionAlignment() const = 0;
1828 
1834  virtual void setDefaultMountBy( MountByType val ) = 0;
1835 
1841  virtual MountByType getDefaultMountBy() const = 0;
1842 
1848  virtual void setDefaultFs(FsType val) = 0;
1849 
1855  virtual FsType getDefaultFs() const = 0;
1856 
1862  virtual void setDefaultSubvolName( const string& val) = 0;
1863 
1869  virtual string getDefaultSubvolName() const = 0;
1870 
1876  virtual bool getEfiBoot() = 0;
1877 
1888  virtual void setRootPrefix( const string& root ) = 0;
1889 
1895  virtual string getRootPrefix() const = 0;
1896 
1902  virtual void setDetectMountedVolumes( bool val ) = 0;
1903 
1909  virtual bool getDetectMountedVolumes() const = 0;
1910 
1918  virtual int removeVolume( const string& device ) = 0;
1919 
1930  virtual int createLvmVg( const string& name,
1931  unsigned long long peSizeK, bool lvm1,
1932  const deque<string>& devs ) = 0;
1933 
1941  virtual int removeLvmVg( const string& name ) = 0;
1942 
1950  virtual int extendLvmVg( const string& name,
1951  const deque<string>& devs ) = 0;
1952 
1960  virtual int shrinkLvmVg( const string& name,
1961  const deque<string>& devs ) = 0;
1962 
1974  virtual int createLvmLv( const string& vg, const string& name,
1975  unsigned long long sizeK, unsigned stripes,
1976  string& SWIG_OUTPUT(device) ) = 0;
1977 
1984  virtual int removeLvmLvByDevice( const string& device ) = 0;
1985 
1993  virtual int removeLvmLv( const string& vg, const string& name ) = 0;
1994 
2004  virtual int changeLvStripeCount( const string& vg, const string& name,
2005  unsigned long stripes ) = 0;
2006 
2016  virtual int changeLvStripeSize( const string& vg, const string& name,
2017  unsigned long long stripeSizeK) = 0;
2018 
2029  virtual int createLvmLvSnapshot(const string& vg, const string& origin,
2030  const string& name, unsigned long long cowSizeK,
2031  string& SWIG_OUTPUT(device) ) = 0;
2032 
2040  virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0;
2041 
2052  virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name,
2053  LvmLvSnapshotStateInfo& info) = 0;
2054 
2064  virtual int createLvmLvPool(const string& vg, const string& name,
2065  unsigned long long sizeK,
2066  string& SWIG_OUTPUT(device) ) = 0;
2067 
2078  virtual int createLvmLvThin(const string& vg, const string& name,
2079  const string& pool,
2080  unsigned long long sizeK,
2081  string& SWIG_OUTPUT(device) ) = 0;
2082 
2092  virtual int changeLvChunkSize( const string& vg, const string& name,
2093  unsigned long long chunkSizeK) = 0;
2094 
2102  virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr),
2103  string& SWIG_OUTPUT(device)) = 0;
2104 
2114  virtual int createMd(const string& name, MdType md_type, const list<string>& devices,
2115  const list<string>& spares) = 0;
2116 
2126  virtual int createMdAny(MdType md_type, const list<string>& devices,
2127  const list<string>& spares,
2128  string& SWIG_OUTPUT(device) ) = 0;
2129 
2138  virtual int removeMd( const string& name, bool destroySb ) = 0;
2139 
2149  virtual int extendMd(const string& name, const list<string>& devices,
2150  const list<string>& spares) = 0;
2151 
2161  virtual int updateMd(const string& name, const list<string>& devices,
2162  const list<string>& spares) = 0;
2163 
2173  virtual int shrinkMd(const string& name, const list<string>& devices,
2174  const list<string>& spares) = 0;
2175 
2184  virtual int changeMdType(const string& name, MdType md_type) = 0;
2185 
2194  virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0;
2195 
2204  virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
2205 
2212  virtual int checkMd( const string& name ) = 0;
2213 
2223  virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0;
2224 
2234  virtual int getMdPartCoStateInfo(const string& name,
2235  MdPartCoStateInfo& info) = 0;
2236 
2249  virtual int computeMdSize(MdType md_type, const list<string>& devices,
2250  const list<string>& spares, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2251 
2259  virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0;
2260 
2271  virtual int removeMdPartCo(const string& name, bool destroySb ) = 0;
2272 
2283  virtual int addNfsDevice(const string& nfsDev, const string& opts,
2284  unsigned long long sizeK, const string& mp,
2285  bool nfs4) = 0;
2286 
2296  virtual int checkNfsDevice(const string& nfsDev, const string& opts,
2297  bool nfs4, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2298 
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;
2319 
2337  virtual int modifyFileLoop( const string& device, const string& lname,
2338  bool reuseExisting,
2339  unsigned long long sizeK ) = 0;
2340 
2349  virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
2350 
2357  virtual int removeDmraid( const string& name ) = 0;
2358 
2366  virtual bool existSubvolume( const string& device, const string& name ) = 0;
2367 
2376  virtual int createSubvolume(const string& device, const string& name, bool nocow) = 0;
2377 
2385  virtual int removeSubvolume( const string& device, const string& name ) = 0;
2386 
2395  virtual int extendBtrfsVolume( const string& name,
2396  const deque<string>& devs ) = 0;
2397 
2406  virtual int shrinkBtrfsVolume( const string& name,
2407  const deque<string>& devs ) = 0;
2408 
2416  virtual int addTmpfsMount( const string& mp, const string& opts ) = 0;
2417 
2424  virtual int removeTmpfsMount( const string& mp ) = 0;
2425 
2431  virtual void getCommitInfos(list<CommitInfo>& infos) const = 0;
2432 
2438  virtual const string& getLastAction() const = 0;
2439 
2446  virtual const string& getExtendedErrorMessage() const = 0;
2447 
2448 // temporarily disable callback function for swig
2449 #ifndef SWIG
2450 
2456  virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0;
2457 
2463  virtual CallbackProgressBar getCallbackProgressBar() const = 0;
2464 
2465 
2471  virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0;
2472 
2478  virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
2479 
2480 
2487  virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0;
2488 
2495  virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
2496 
2497 
2504  virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0;
2505 
2512  virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
2513 
2514 
2520  virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0;
2521 
2527  virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0;
2528 
2529 
2535  virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0;
2536 
2543  virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0;
2544 
2545 #endif
2546 
2552  virtual void setCacheChanges (bool cache) = 0;
2553 
2557  virtual bool isCacheChanges () const = 0;
2558 
2562  virtual void setCommitCallbacks(const CommitCallbacks* commit_callbacks) = 0;
2563 
2568  virtual int commit() = 0;
2569 
2573  virtual string getErrorString(int error) const = 0;
2574 
2581  virtual int createBackupState( const string& name ) = 0;
2582 
2589  virtual int restoreBackupState( const string& name ) = 0;
2590 
2597  virtual bool checkBackupState(const string& name) const = 0;
2598 
2607  virtual bool equalBackupStates(const string& lhs, const string& rhs,
2608  bool verbose_log) const = 0;
2609 
2617  virtual int removeBackupState( const string& name ) = 0;
2618 
2626  virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0;
2627 
2638  virtual bool umountDevice( const string& device ) = 0;
2639 
2652  virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0;
2653 
2664  virtual bool mountDevice( const string& device, const string& mp ) = 0;
2665 
2676  virtual int activateEncryption( const string& device, bool on ) = 0;
2677 
2689  virtual bool mountDeviceOpts( const string& device, const string& mp,
2690  const string& opts ) = 0;
2691 
2703  virtual bool mountDeviceRo( const string& device, const string& mp,
2704  const string& opts ) = 0;
2705 
2712  virtual bool checkDmMapsTo( const string& device ) = 0;
2713 
2719  virtual void removeDmTableTo( const string& device ) = 0;
2720 
2729  virtual int renameCryptDm( const string& device,
2730  const string& new_name ) = 0;
2731 
2743  virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info,
2744  bool get_content, ContentInfo& content_info, bool use_cache) = 0;
2745 
2753  virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
2754 
2764  virtual void activateHld( bool val ) = 0;
2765 
2774  virtual void activateMultipath( bool val ) = 0;
2775 
2784  virtual void rescanEverything() = 0;
2785 
2794  virtual bool rescanCryptedObjects() = 0;
2795 
2799  virtual void dumpObjectList() = 0;
2800 
2804  virtual void dumpCommitInfos() const = 0;
2805 
2815  virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0;
2816 
2825  virtual int setUserdata(const string& device, const map<string, string>& userdata) = 0;
2826 
2834  virtual int getUserdata(const string& device, map<string, string>& userdata) = 0;
2835 
2836  };
2837 
2838 
2842  void initDefaultLogger( const string& logdir );
2843 
2848  typedef void (*CallbackLogDo)( int level, const string& component, const char* file,
2849  int line, const char* function, const string& content );
2850 
2855  typedef bool (*CallbackLogQuery)( int level, const string& component );
2856 
2860  void setLogDoCallback( CallbackLogDo pfc );
2861 
2865  CallbackLogDo getLogDoCallback();
2866 
2870  void setLogQueryCallback( CallbackLogQuery pfc );
2871 
2875  CallbackLogQuery getLogQueryCallback();
2876 
2881  {
2882  Environment(bool readonly, const string& logdir = "/var/log/YaST2")
2883  : readonly(readonly), testmode(false), autodetect(true),
2884  instsys(false), logdir(logdir), testdir("tmp")
2885  {
2886  storage::initDefaultLogger( logdir );
2887  }
2888 
2889  bool readonly;
2890  bool testmode;
2891  bool autodetect;
2892  bool instsys;
2893  string logdir;
2894  string testdir;
2895  };
2896 
2897 
2903  StorageInterface* createStorageInterface(const Environment& env);
2904 
2905 
2913  StorageInterface* createStorageInterfacePid(const Environment& env, int& SWIG_OUTPUT(locker_pid));
2914 
2915 
2919  void destroyStorageInterface(StorageInterface*);
2920 
2921 }
2922 
2923 
2924 #endif
Definition: StorageInterface.h:649
Definition: StorageInterface.h:672
Definition: StorageInterface.h:242
Definition: StorageInterface.h:289
Definition: StorageInterface.h:552
Definition: StorageInterface.h:518
Definition: StorageInterface.h:640
Definition: StorageInterface.h:508
Definition: StorageInterface.h:2880
Definition: StorageInterface.h:627
Definition: StorageInterface.h:592
Definition: StorageInterface.h:434
Definition: StorageInterface.h:279
Definition: StorageInterface.h:426
Definition: StorageInterface.h:351
Definition: StorageInterface.h:490
Definition: StorageInterface.h:383
Definition: StorageInterface.h:369
Definition: StorageInterface.h:298
Definition: StorageInterface.h:689
Abstract class defining the interface for libstorage.
Definition: StorageInterface.h:986
Definition: StorageInterface.h:658
Definition: StorageInterface.h:226
Definition: StorageInterface.h:532
Definition: StorageInterface.h:541
Definition: StorageInterface.h:377
Definition: StorageInterface.h:447
Definition: StorageInterface.h:561
Definition: StorageInterface.h:480
Definition: StorageInterface.h:317
Definition: StorageInterface.h:615
Definition: StorageInterface.h:606
Definition: Graph.h:32
Definition: StorageInterface.h:462
Definition: StorageInterface.h:394
Definition: StorageInterface.h:260
Definition: StorageInterface.h:327
Definition: StorageInterface.h:270
Definition: StorageInterface.h:574