libstorage
StorageInterface.h
1 /*
2  * Copyright (c) [2004-2014] Novell, Inc.
3  *
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as published
8  * by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, contact Novell, Inc.
17  *
18  * To contact Novell about this file by physical or electronic mail, you may
19  * find current contact information at www.novell.com.
20  */
21 
22 
23 #ifndef STORAGE_INTERFACE_H
24 #define STORAGE_INTERFACE_H
25 
26 
27 #include <string>
28 #include <deque>
29 #include <list>
30 #include <map>
31 
32 using std::string;
33 using std::deque;
34 using std::list;
35 using std::map;
36 
37 
38 #include "storage/StorageVersion.h"
39 #include "storage/StorageSwig.h"
40 
41 
139 namespace storage
140 {
141  enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS,
142  SWAP, HFSPLUS, NFS, NFS4, TMPFS, FSNONE };
143 
144  enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
145 
146  enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
147 
148  enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
149  ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
150 
151  enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
152 
153  enum MdParity { PAR_DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC,
154  RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC, PAR_FIRST, PAR_LAST,
155  LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6, RIGHT_ASYMMETRIC_6,
156  RIGHT_SYMMETRIC_6, PAR_FIRST_6,
157  PAR_NEAR_2, PAR_OFFSET_2, PAR_FAR_2,
158  PAR_NEAR_3, PAR_OFFSET_3, PAR_FAR_3 };
159 
160  enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO,
161  CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE };
162 
163  enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS };
164 
165  enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC };
166 
167  enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE };
168 
169  enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF };
170 
171  enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER };
172 
173 
178  typedef void (*CallbackProgressBar)(const string& id, unsigned cur, unsigned max);
179 
184  typedef void (*CallbackShowInstallInfo)(const string& id);
185 
190  typedef void (*CallbackInfoPopup)(const string& text);
191 
198  typedef bool (*CallbackYesNoPopup)(const string& text);
199 
205  typedef bool (*CallbackCommitErrorPopup)(int error, const string& last_action,
206  const string& extended_message);
207 
213  typedef bool (*CallbackPasswordPopup)(const string& device, int attempts, string& password);
214 
215 
220  {
221  FsCapabilities() {}
222  bool isExtendable;
223  bool isExtendableWhileMounted;
224  bool isReduceable;
225  bool isReduceableWhileMounted;
226  bool supportsUuid;
227  bool supportsLabel;
228  bool labelWhileMounted;
229  unsigned int labelLength;
230  unsigned long long minimalFsSizeK;
231  };
232 
237  {
238  DlabelCapabilities() {}
239  unsigned maxPrimary;
240  bool extendedPossible;
241  unsigned maxLogical;
242  unsigned long long maxSectors;
243  };
244 
245 
246  struct UsedByInfo
247  {
248  UsedByInfo() : type(UB_NONE) {} // only for swig bindings
249  UsedByInfo(UsedByType type, const string& device) : type(type), device(device) {}
250  UsedByType type;
251  string device;
252  };
253 
254 
255  struct SubvolInfo
256  {
257  SubvolInfo(const string& path) : path(path) {}
258  string path;
259  };
260 
261 
262  struct ResizeInfo
263  {
264  ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(false) {}
265  unsigned long long df_freeK;
266  unsigned long long resize_freeK;
267  unsigned long long usedK;
268  bool resize_ok;
269  };
270 
271 
272  struct ContentInfo
273  {
274  ContentInfo() : windows(false), efi(false), homes(0) {}
275  bool windows;
276  bool efi;
277  unsigned homes;
278  };
279 
280 
281  struct DeviceInfo
282  {
283  DeviceInfo() {}
284 
285  string device;
286  string name;
287 
288  string udevPath;
289  list<string> udevId;
290 
291  list<UsedByInfo> usedBy;
292 
293  map<string, string> userdata;
294  };
295 
296 
300  struct ContainerInfo : public DeviceInfo
301  {
302  ContainerInfo() {}
303  CType type;
304  bool readonly;
305  };
306 
310  struct DiskInfo
311  {
312  DiskInfo() {}
313  unsigned long long sizeK;
314  unsigned long long cylSize;
315  unsigned long cyl;
316  unsigned long heads;
317  unsigned long sectors;
318  unsigned int sectorSize;
319  string disklabel;
320  string orig_disklabel;
321  unsigned maxPrimary;
322  bool extendedPossible;
323  unsigned maxLogical;
324  bool initDisk;
325  Transport transport;
326  bool has_fake_partition;
327  };
328 
332  struct LvmVgInfo
333  {
334  LvmVgInfo() {}
335  unsigned long long sizeK;
336  unsigned long long peSizeK;
337  unsigned long peCount;
338  unsigned long peFree;
339  string uuid;
340  bool lvm2;
341  bool create;
342  list<string> devices;
343  list<string> devices_add;
344  list<string> devices_rem;
345  };
346 
351  {
352  DmPartCoInfo() {}
353  DiskInfo d;
354  list<string> devices;
355  unsigned long minor;
356  };
357 
359  {
360  DmraidCoInfo() {}
361  DmPartCoInfo p;
362  };
363 
365  {
366  DmmultipathCoInfo() {}
367  DmPartCoInfo p;
368  string vendor;
369  string model;
370  };
371 
375  struct VolumeInfo : public DeviceInfo
376  {
377  VolumeInfo() {}
378  unsigned long long sizeK;
379  unsigned long major;
380  unsigned long minor;
381  string mount;
382  string crypt_device;
383  MountByType mount_by;
384  bool ignore_fstab;
385  string fstab_options;
386  string uuid;
387  string label;
388  string mkfs_options;
389  string tunefs_options;
390  string loop;
391  string dtxt;
392  EncryptType encryption;
393  string crypt_pwd;
394  FsType fs;
395  FsType detected_fs;
396  bool format;
397  bool create;
398  bool is_mounted;
399  bool resize;
400  bool ignore_fs;
401  unsigned long long origSizeK;
402  };
403 
405  {
406  PartitionAddInfo() {}
407  unsigned nr;
408  unsigned long cylStart;
409  unsigned long cylSize;
410  PartitionType partitionType;
411  unsigned id;
412  bool boot;
413  };
414 
419  {
420  PartitionInfo() {}
421  PartitionInfo& operator=( const PartitionAddInfo& rhs );
422  VolumeInfo v;
423  unsigned nr;
424  unsigned long cylStart;
425  unsigned long cylSize;
426  PartitionType partitionType;
427  unsigned id;
428  bool boot;
429  };
430 
434  struct LvmLvInfo
435  {
436  LvmLvInfo() {}
437  VolumeInfo v;
438  unsigned stripes;
439  unsigned stripeSizeK;
440  string uuid;
441  string status;
442  string allocation;
443  string dm_table;
444  string dm_target;
445  string origin;
446  string used_pool;
447  bool pool;
448  };
449 
454  {
456  bool active;
457  double allocated;
458  };
459 
463  struct MdInfo
464  {
465  MdInfo() {}
466  VolumeInfo v;
467  unsigned nr;
468  unsigned type;
469  unsigned parity;
470  string uuid;
471  string sb_ver;
472  unsigned long chunkSizeK;
473  list<string> devices;
474  list<string> spares;
475  bool inactive;
476  };
477 
481  struct MdStateInfo
482  {
483  MdStateInfo() {}
484  MdArrayState state;
485  };
486 
492  {
493  MdPartCoInfo() {}
494  DiskInfo d;
495  unsigned type; // RAID level
496  unsigned nr; // MD device number
497  unsigned parity; // Parity (not for all RAID level)
498  string uuid; // MD Device UUID
499  string sb_ver; // Metadata version
500  unsigned long chunkSizeK; // Chunksize (strip size)
501  list<string> devices;
502  list<string> spares;
503  };
504 
506  {
507  MdPartCoStateInfo() {}
508  MdArrayState state;
509  };
510 
514  struct MdPartInfo
515  {
516  MdPartInfo() {}
517  VolumeInfo v;
519  bool part;
520  };
521 
525  struct NfsInfo
526  {
527  NfsInfo() {}
528  VolumeInfo v;
529  };
530 
534  struct LoopInfo
535  {
536  LoopInfo() {}
537  VolumeInfo v;
538  bool reuseFile;
539  unsigned nr;
540  string file;
541  };
542 
546  struct BtrfsInfo
547  {
548  BtrfsInfo() {}
549  VolumeInfo v;
550  list<string> devices;
551  list<string> devices_add;
552  list<string> devices_rem;
553  list<string> subvol;
554  list<string> subvol_add;
555  list<string> subvol_rem;
556  };
557 
561  struct TmpfsInfo
562  {
563  TmpfsInfo() {}
564  VolumeInfo v;
565  };
566 
570  struct DmInfo
571  {
572  DmInfo() {}
573  VolumeInfo v;
574  unsigned nr;
575  string table;
576  string target;
577  };
578 
582  struct DmPartInfo
583  {
584  DmPartInfo() {}
585  VolumeInfo v;
587  bool part;
588  string table;
589  string target;
590  };
591 
595  struct DmraidInfo
596  {
597  DmraidInfo() {}
598  DmPartInfo p;
599  };
600 
605  {
606  DmmultipathInfo() {}
607  DmPartInfo p;
608  };
609 
613  struct ContVolInfo
614  {
615  ContVolInfo() : ctype(CUNKNOWN), num(-1) {}
616  CType ctype;
617  string cname;
618  string cdevice;
619  string vname;
620  string vdevice;
621  int num;
622  };
623 
628  {
629  PartitionSlotInfo() {}
630  unsigned long cylStart;
631  unsigned long cylSize;
632  bool primarySlot;
633  bool primaryPossible;
634  bool extendedSlot;
635  bool extendedPossible;
636  bool logicalSlot;
637  bool logicalPossible;
638  };
639 
643  struct CommitInfo
644  {
645  CommitInfo() {}
646  bool destructive;
647  string text;
648  };
649 
650 
654  enum ErrorCodes
655  {
656  STORAGE_NO_ERROR = 0,
657 
658  DISK_PARTITION_OVERLAPS_EXISTING = -1000,
659  DISK_PARTITION_EXCEEDS_DISK = -1001,
660  DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
661  DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
662  DISK_PARTITION_NO_FREE_NUMBER = -1004,
663  DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
664  DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
665  DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
666  DISK_PARTITION_NOT_FOUND = -1008,
667  DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
668  DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
669  DISK_SET_TYPE_INVALID_VOLUME = -1011,
670  DISK_SET_TYPE_PARTED_FAILED = -1012,
671  DISK_SET_LABEL_PARTED_FAILED = -1013,
672  DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
673  DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
674  DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
675  DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
676  DISK_PARTITION_ZERO_SIZE = -1018,
677  DISK_CHANGE_READONLY = -1019,
678  DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
679  DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
680  DISK_RESIZE_NO_SPACE = -1022,
681  DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
682  DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
683  DISK_COMMIT_NOTHING_TODO = -1025,
684  DISK_CREATE_PARTITION_NO_SPACE = -1026,
685  DISK_REMOVE_USED_BY = -1027,
686  DISK_INIT_NOT_POSSIBLE = -1028,
687  DISK_INVALID_PARTITION_ID = -1029,
688 
689  STORAGE_DISK_NOT_FOUND = -2000,
690  STORAGE_VOLUME_NOT_FOUND = -2001,
691  STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
692  STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
693  STORAGE_CHANGE_READONLY = -2004,
694  STORAGE_DISK_USED_BY = -2005,
695  STORAGE_LVM_VG_EXISTS = -2006,
696  STORAGE_LVM_VG_NOT_FOUND = -2007,
697  STORAGE_LVM_INVALID_DEVICE = -2008,
698  STORAGE_CONTAINER_NOT_FOUND = -2009,
699  STORAGE_VG_INVALID_NAME = -2010,
700  STORAGE_REMOVE_USED_VOLUME = -2011,
701  STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
702  STORAGE_NOT_YET_IMPLEMENTED = -2013,
703  STORAGE_MD_INVALID_NAME = -2014,
704  STORAGE_MD_NOT_FOUND = -2015,
705  STORAGE_MEMORY_EXHAUSTED = -2016,
706  STORAGE_LOOP_NOT_FOUND = -2017,
707  STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
708  STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
709  STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
710  STORAGE_INVALID_FSTAB_VALUE = -2025,
711  STORAGE_NO_FSTAB_PTR = -2026,
712  STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
713  STORAGE_DMRAID_CO_NOT_FOUND = -2028,
714  STORAGE_RESIZE_INVALID_CONTAINER = -2029,
715  STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030,
716  STORAGE_ZERO_DEVICE_FAILED = -2031,
717  STORAGE_INVALID_BACKUP_STATE_NAME = -2032,
718  STORAGE_MDPART_CO_NOT_FOUND = -2033,
719  STORAGE_DEVICE_NOT_FOUND = -2034,
720  STORAGE_BTRFS_CO_NOT_FOUND = -2035,
721  STORAGE_TMPFS_CO_NOT_FOUND = -2036,
722  STORAGE_VOLUME_NOT_ENCRYPTED = -2037,
723  STORAGE_DM_RENAME_FAILED = -2038,
724 
725  VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
726  VOLUME_FSTAB_EMPTY_MOUNT = -3001,
727  VOLUME_UMOUNT_FAILED = -3002,
728  VOLUME_MOUNT_FAILED = -3003,
729  VOLUME_FORMAT_UNKNOWN_FS = -3005,
730  VOLUME_FORMAT_FS_UNDETECTED = -3006,
731  VOLUME_FORMAT_FS_TOO_SMALL = -3007,
732  VOLUME_FORMAT_FAILED = -3008,
733  VOLUME_TUNE2FS_FAILED = -3009,
734  VOLUME_MKLABEL_FS_UNABLE = -3010,
735  VOLUME_MKLABEL_FAILED = -3011,
736  VOLUME_LOSETUP_NO_LOOP = -3012,
737  VOLUME_LOSETUP_FAILED = -3013,
738  VOLUME_CRYPT_NO_PWD = -3014,
739  VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
740  VOLUME_CRYPT_NOT_DETECTED = -3016,
741  VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
742  VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
743  VOLUME_MOUNT_POINT_INVALID = -3019,
744  VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
745  VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
746  VOLUME_LABEL_NOT_SUPPORTED = -3022,
747  VOLUME_LABEL_TOO_LONG = -3023,
748  VOLUME_LABEL_WHILE_MOUNTED = -3024,
749  VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
750  VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
751  VOLUME_RESIZE_FAILED = -3027,
752  VOLUME_ALREADY_IN_USE = -3028,
753  VOLUME_LOUNSETUP_FAILED = -3029,
754  VOLUME_DEVICE_NOT_PRESENT = -3030,
755  VOLUME_DEVICE_NOT_BLOCK = -3031,
756  VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
757  VOLUME_CRYPTFORMAT_FAILED = -3033,
758  VOLUME_CRYPTSETUP_FAILED = -3034,
759  VOLUME_CRYPTUNSETUP_FAILED = -3035,
760  VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
761  VOLUME_FORMAT_IMPOSSIBLE = -3037,
762  VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
763  VOLUME_REMOUNT_FAILED = -3039,
764  VOLUME_TUNEREISERFS_FAILED = -3040,
765  VOLUME_UMOUNT_NOT_MOUNTED = -3041,
766  VOLUME_BTRFS_ADD_FAILED = -3042,
767  VOLUME_CANNOT_TMP_MOUNT = -3043,
768  VOLUME_CANNOT_TMP_UMOUNT = -3044,
769  VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045,
770  VOLUME_BTRFS_SUBVOL_SETDEFAULT = -3046,
771 
772  LVM_CREATE_PV_FAILED = -4000,
773  LVM_PV_ALREADY_CONTAINED = -4001,
774  LVM_PV_DEVICE_UNKNOWN = -4002,
775  LVM_PV_DEVICE_USED = -4003,
776  LVM_VG_HAS_NONE_PV = -4004,
777  LVM_LV_INVALID_NAME = -4005,
778  LVM_LV_DUPLICATE_NAME = -4006,
779  LVM_LV_NO_SPACE = -4007,
780  LVM_LV_UNKNOWN_NAME = -4008,
781  LVM_LV_NOT_IN_LIST = -4009,
782  LVM_VG_CREATE_FAILED = -4010,
783  LVM_VG_EXTEND_FAILED = -4011,
784  LVM_VG_REDUCE_FAILED = -4012,
785  LVM_VG_REMOVE_FAILED = -4013,
786  LVM_LV_CREATE_FAILED = -4014,
787  LVM_LV_REMOVE_FAILED = -4015,
788  LVM_LV_RESIZE_FAILED = -4016,
789  LVM_PV_STILL_ADDED = -4017,
790  LVM_PV_REMOVE_NOT_FOUND = -4018,
791  LVM_CREATE_LV_INVALID_VOLUME = -4019,
792  LVM_REMOVE_LV_INVALID_VOLUME = -4020,
793  LVM_RESIZE_LV_INVALID_VOLUME = -4021,
794  LVM_CHANGE_READONLY = -4022,
795  LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
796  LVM_COMMIT_NOTHING_TODO = -4024,
797  LVM_LV_REMOVE_USED_BY = -4025,
798  LVM_LV_ALREADY_ON_DISK = -4026,
799  LVM_LV_NO_STRIPE_SIZE = -4027,
800  LVM_LV_UNKNOWN_ORIGIN = -4028,
801  LVM_LV_NOT_ON_DISK = -4029,
802  LVM_LV_NOT_SNAPSHOT = -4030,
803  LVM_LV_HAS_SNAPSHOTS = -4031,
804  LVM_LV_IS_SNAPSHOT = -4032,
805  LVM_LIST_EMPTY = -4033,
806  LVM_LV_NO_POOL_OR_SNAP = -4034,
807  LVM_LV_NO_POOL = -4035,
808  LVM_LV_UNKNOWN_POOL = -4036,
809  LVM_LV_INVALID_CHUNK_SIZE = -4037,
810  LVM_LV_POOL_NO_FORMAT = -4038,
811  LVM_LV_POOL_NO_MOUNT = -4039,
812 
813  FSTAB_ENTRY_NOT_FOUND = -5000,
814  FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
815  FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
816  FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
817  FSTAB_ADD_ENTRY_FOUND = -5004,
818 
819  MD_CHANGE_READONLY = -6000,
820  MD_DUPLICATE_NUMBER = -6001,
821  MD_TOO_FEW_DEVICES = -6002,
822  MD_DEVICE_UNKNOWN = -6003,
823  MD_DEVICE_USED = -6004,
824  MD_CREATE_INVALID_VOLUME = -6005,
825  MD_REMOVE_FAILED = -6006,
826  MD_NOT_IN_LIST = -6007,
827  MD_CREATE_FAILED = -6008,
828  MD_UNKNOWN_NUMBER = -6009,
829  MD_REMOVE_USED_BY = -6010,
830  MD_NUMBER_TOO_LARGE = -6011,
831  MD_REMOVE_INVALID_VOLUME = -6012,
832  MD_REMOVE_CREATE_NOT_FOUND = -6013,
833  MD_NO_RESIZE_ON_DISK = -6014,
834  MD_ADD_DUPLICATE = -6015,
835  MD_REMOVE_NONEXISTENT = -6016,
836  MD_NO_CHANGE_ON_DISK = -6017,
837  MD_NO_CREATE_UNKNOWN = -6018,
838  MD_STATE_NOT_ON_DISK = -6019,
839  MD_PARTITION_NOT_FOUND = -6020,
840  MD_INVALID_PARITY = -6021,
841  MD_TOO_MANY_SPARES = -6022,
842  MD_GET_STATE_FAILED = -6023,
843  MD_DUPLICATE_NAME = -6024,
844 
845  MDPART_CHANGE_READONLY = -6100,
846  MDPART_INTERNAL_ERR = -6101,
847  MDPART_INVALID_VOLUME = -6012,
848  MDPART_PARTITION_NOT_FOUND = -6103,
849  MDPART_REMOVE_PARTITION_LIST_ERASE = -6104,
850  MDPART_COMMIT_NOTHING_TODO = -6105,
851  MDPART_NO_REMOVE = -6106,
852  MDPART_DEVICE_NOT_FOUND = -6107,
853 
854  LOOP_CHANGE_READONLY = -7000,
855  LOOP_DUPLICATE_FILE = -7001,
856  LOOP_UNKNOWN_FILE = -7002,
857  LOOP_REMOVE_USED_BY = -7003,
858  LOOP_FILE_CREATE_FAILED = -7004,
859  LOOP_CREATE_INVALID_VOLUME = -7005,
860  LOOP_REMOVE_FILE_FAILED = -7006,
861  LOOP_REMOVE_INVALID_VOLUME = -7007,
862  LOOP_NOT_IN_LIST = -7008,
863  LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
864  LOOP_MODIFY_EXISTING = -7010,
865 
866  PEC_PE_SIZE_INVALID = -9000,
867  PEC_PV_NOT_FOUND = -9001,
868  PEC_REMOVE_PV_IN_USE = -9002,
869  PEC_REMOVE_PV_SIZE_NEEDED = -9003,
870  PEC_LV_NO_SPACE_STRIPED = -9004,
871  PEC_LV_NO_SPACE_SINGLE = -9005,
872  PEC_LV_PE_DEV_NOT_FOUND = -9006,
873 
874  DM_CHANGE_READONLY = -10000,
875  DM_UNKNOWN_TABLE = -10001,
876  DM_REMOVE_USED_BY = -10002,
877  DM_REMOVE_CREATE_NOT_FOUND = -10003,
878  DM_REMOVE_INVALID_VOLUME = -10004,
879  DM_REMOVE_FAILED = -10005,
880  DM_NOT_IN_LIST = -10006,
881 
882  DASD_NOT_POSSIBLE = -11000,
883  DASD_FDASD_FAILED = -11001,
884  DASD_DASDFMT_FAILED = -11002,
885 
886  DMPART_CHANGE_READONLY = -12001,
887  DMPART_INTERNAL_ERR = -12002,
888  DMPART_INVALID_VOLUME = -12003,
889  DMPART_PARTITION_NOT_FOUND = -12004,
890  DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
891  DMPART_COMMIT_NOTHING_TODO = -12006,
892  DMPART_NO_REMOVE = -12007,
893 
894  DMRAID_REMOVE_FAILED = -13001,
895 
896  NFS_VOLUME_NOT_FOUND = -14001,
897  NFS_CHANGE_READONLY = -14002,
898  NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
899  NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
900  NFS_REMOVE_INVALID_VOLUME = -14005,
901 
902  BTRFS_COMMIT_INVALID_VOLUME = -15001,
903  BTRFS_CANNOT_TMP_MOUNT = -15002,
904  BTRFS_CANNOT_TMP_UMOUNT = -15003,
905  BTRFS_DELETE_SUBVOL_FAIL = -15004,
906  BTRFS_CREATE_SUBVOL_FAIL = -15005,
907  BTRFS_VOLUME_NOT_FOUND = -15006,
908  BTRFS_SUBVOL_EXISTS = -15007,
909  BTRFS_SUBVOL_NON_EXISTS = -15008,
910  BTRFS_REMOVE_NOT_FOUND = -15009,
911  BTRFS_REMOVE_NO_BTRFS = -15010,
912  BTRFS_REMOVE_INVALID_VOLUME = -15011,
913  BTRFS_CHANGE_READONLY = -15012,
914  BTRFS_DEV_ALREADY_CONTAINED = -15013,
915  BTRFS_DEVICE_UNKNOWN = -15014,
916  BTRFS_DEVICE_USED = -15015,
917  BTRFS_HAS_NONE_DEV = -15016,
918  BTRFS_DEV_NOT_FOUND = -15017,
919  BTRFS_EXTEND_FAIL = -15018,
920  BTRFS_REDUCE_FAIL = -15019,
921  BTRFS_LIST_EMPTY = -15020,
922  BTRFS_RESIZE_INVALID_VOLUME = -15021,
923  BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022,
924 
925  TMPFS_REMOVE_INVALID_VOLUME = -16001,
926  TMPFS_REMOVE_NO_TMPFS = -16002,
927  TMPFS_REMOVE_NOT_FOUND = -16003,
928 
929  CONTAINER_INTERNAL_ERROR = -99000,
930  CONTAINER_INVALID_VIRTUAL_CALL = -99001,
931 
932  };
933 
934 
939  {
940  public:
941 
942  StorageInterface () {}
943  virtual ~StorageInterface () {}
944 
948  virtual void getContainers( deque<ContainerInfo>& infos) = 0;
949 
957  virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
958 
967  virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
968  DiskInfo& info ) = 0;
969 
977  virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
978 
987  virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
988  LvmVgInfo& info) = 0;
989 
997  virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
998 
1007  virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
1008  DmraidCoInfo& info) = 0;
1009 
1017  virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0;
1018 
1027  virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
1028  DmmultipathCoInfo& info) = 0;
1029 
1037  virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0;
1038 
1039 
1048  virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
1049  MdPartCoInfo& info) = 0;
1050 
1056  virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0;
1057 
1063  virtual MultipathAutostart getMultipathAutostart() const = 0;
1064 
1070  virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
1071 
1079  virtual int getVolume( const string& device, VolumeInfo& info) = 0;
1080 
1088  virtual int getPartitionInfo( const string& disk,
1089  deque<PartitionInfo>& plist ) = 0;
1090 
1098  virtual int getLvmLvInfo( const string& name,
1099  deque<LvmLvInfo>& plist ) = 0;
1100 
1107  virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
1108 
1116  virtual int getMdPartInfo( const string& device,
1117  deque<MdPartInfo>& plist ) = 0;
1118 
1125  virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
1126 
1133  virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
1134 
1141  virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
1142 
1149  virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0;
1150 
1157  virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0;
1158 
1166  virtual int getDmraidInfo( const string& name,
1167  deque<DmraidInfo>& plist ) = 0;
1168 
1176  virtual int getDmmultipathInfo( const string& name,
1177  deque<DmmultipathInfo>& plist ) = 0;
1178 
1182  virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
1183 
1187  virtual bool getDlabelCapabilities(const string& dlabel,
1188  DlabelCapabilities& dlabelcapabilities) const = 0;
1189 
1193  virtual list<string> getAllUsedFs() const = 0;
1194 
1207  virtual int createPartition( const string& disk, PartitionType type,
1208  unsigned long startCyl,
1209  unsigned long sizeCyl,
1210  string& SWIG_OUTPUT(device) ) = 0;
1211 
1220  virtual int resizePartition( const string& device,
1221  unsigned long sizeCyl ) = 0;
1222 
1231  virtual int resizePartitionNoFs( const string& device,
1232  unsigned long sizeCyl ) = 0;
1233 
1244  virtual int updatePartitionArea( const string& device,
1245  unsigned long startCyl,
1246  unsigned long sizeCyl ) = 0;
1247 
1256  virtual int freeCylindersAroundPartition(const string& device,
1257  unsigned long& SWIG_OUTPUT(freeCylsBefore),
1258  unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0;
1259 
1269  virtual int nextFreePartition( const string& disk, PartitionType type,
1270  unsigned & SWIG_OUTPUT(nr),
1271  string& SWIG_OUTPUT(device) ) = 0;
1272 
1285  virtual int createPartitionKb( const string& disk, PartitionType type,
1286  unsigned long long startK,
1287  unsigned long long sizeK,
1288  string& SWIG_OUTPUT(device) ) = 0;
1289 
1300  virtual int createPartitionAny( const string& disk,
1301  unsigned long long sizeK,
1302  string& SWIG_OUTPUT(device) ) = 0;
1303 
1314  virtual int createPartitionMax( const string& disk, PartitionType type,
1315  string& SWIG_OUTPUT(device) ) = 0;
1316 
1324  virtual unsigned long long cylinderToKb( const string& disk,
1325  unsigned long sizeCyl) = 0;
1326 
1334  virtual unsigned long kbToCylinder( const string& disk,
1335  unsigned long long sizeK) = 0;
1336 
1343  virtual int removePartition (const string& partition) = 0;
1344 
1352  virtual int changePartitionId (const string& partition, unsigned id) = 0;
1353 
1360  virtual int forgetChangePartitionId (const string& partition ) = 0;
1361 
1369  virtual string getPartitionPrefix(const string& disk) = 0;
1370 
1379  virtual string getPartitionName(const string& disk, int partition_no) = 0;
1380 
1388  virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0;
1389 
1398  virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
1399 
1410  virtual int initializeDisk( const string& disk, bool value ) = 0;
1411 
1420  virtual string defaultDiskLabel(const string& device) = 0;
1421 
1430  virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
1431 
1439  virtual int changeLabelVolume( const string& device, const string& label ) = 0;
1440 
1448  virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
1449 
1457  virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0;
1458 
1467  virtual int changeMountPoint( const string& device, const string& mount ) = 0;
1468 
1476  virtual int getMountPoint( const string& device,
1477  string& SWIG_OUTPUT(mount) ) = 0;
1478 
1486  virtual int changeMountBy( const string& device, MountByType mby ) = 0;
1487 
1495  virtual int getMountBy( const string& device,
1496  MountByType& SWIG_OUTPUT(mby) ) = 0;
1497 
1507  virtual int changeFstabOptions( const string& device, const string& options ) = 0;
1508 
1517  virtual int getFstabOptions( const string& device,
1518  string& SWIG_OUTPUT(options) ) = 0;
1519 
1520 
1529  virtual int addFstabOptions( const string& device, const string& options ) = 0;
1530 
1540  virtual int removeFstabOptions( const string& device, const string& options ) = 0;
1541 
1549  virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
1550 
1557  virtual int forgetCryptPassword( const string& device ) = 0;
1558 
1566  virtual int getCryptPassword( const string& device,
1567  string& SWIG_OUTPUT(pwd) ) = 0;
1568 
1577  virtual int verifyCryptPassword( const string& device,
1578  const string& pwd, bool erase ) = 0;
1579 
1586  virtual bool needCryptPassword( const string& device ) = 0;
1587 
1595  virtual int setCrypt( const string& device, bool val ) = 0;
1596 
1605  virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
1606 
1614  virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1615 
1625  virtual int setIgnoreFstab( const string& device, bool val ) = 0;
1626 
1634  virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1635 
1645  virtual int changeDescText( const string& device, const string& txt ) = 0;
1646 
1661  virtual int addFstabEntry( const string& device, const string& mount,
1662  const string& vfs, const string& options,
1663  unsigned freq, unsigned passno ) = 0;
1664 
1665 
1673  virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0;
1674 
1682  virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0;
1683 
1690  virtual int forgetResizeVolume( const string& device ) = 0;
1691 
1706  virtual void setRecursiveRemoval( bool val ) = 0;
1707 
1713  virtual bool getRecursiveRemoval() const = 0;
1714 
1724  virtual int getRecursiveUsing(const list<string>& devices, bool itself,
1725  list<string>& using_devices) = 0;
1726 
1736  virtual int getRecursiveUsedBy(const list<string>& devices, bool itself,
1737  list<string>& usedby_devices) = 0;
1738 
1752  virtual void setZeroNewPartitions( bool val ) = 0;
1753 
1759  virtual bool getZeroNewPartitions() const = 0;
1760 
1772  virtual void setPartitionAlignment( PartAlign val ) = 0;
1773 
1779  virtual PartAlign getPartitionAlignment() const = 0;
1780 
1786  virtual void setDefaultMountBy( MountByType val ) = 0;
1787 
1793  virtual MountByType getDefaultMountBy() const = 0;
1794 
1800  virtual void setDefaultFs(FsType val) = 0;
1801 
1807  virtual FsType getDefaultFs() const = 0;
1808 
1814  virtual void setDefaultSubvolName( const string& val) = 0;
1815 
1821  virtual string getDefaultSubvolName() const = 0;
1822 
1828  virtual bool getEfiBoot() = 0;
1829 
1840  virtual void setRootPrefix( const string& root ) = 0;
1841 
1847  virtual string getRootPrefix() const = 0;
1848 
1854  virtual void setDetectMountedVolumes( bool val ) = 0;
1855 
1861  virtual bool getDetectMountedVolumes() const = 0;
1862 
1870  virtual int removeVolume( const string& device ) = 0;
1871 
1882  virtual int createLvmVg( const string& name,
1883  unsigned long long peSizeK, bool lvm1,
1884  const deque<string>& devs ) = 0;
1885 
1893  virtual int removeLvmVg( const string& name ) = 0;
1894 
1902  virtual int extendLvmVg( const string& name,
1903  const deque<string>& devs ) = 0;
1904 
1912  virtual int shrinkLvmVg( const string& name,
1913  const deque<string>& devs ) = 0;
1914 
1926  virtual int createLvmLv( const string& vg, const string& name,
1927  unsigned long long sizeK, unsigned stripes,
1928  string& SWIG_OUTPUT(device) ) = 0;
1929 
1936  virtual int removeLvmLvByDevice( const string& device ) = 0;
1937 
1945  virtual int removeLvmLv( const string& vg, const string& name ) = 0;
1946 
1956  virtual int changeLvStripeCount( const string& vg, const string& name,
1957  unsigned long stripes ) = 0;
1958 
1968  virtual int changeLvStripeSize( const string& vg, const string& name,
1969  unsigned long long stripeSizeK) = 0;
1970 
1981  virtual int createLvmLvSnapshot(const string& vg, const string& origin,
1982  const string& name, unsigned long long cowSizeK,
1983  string& SWIG_OUTPUT(device) ) = 0;
1984 
1992  virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0;
1993 
2004  virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name,
2005  LvmLvSnapshotStateInfo& info) = 0;
2006 
2016  virtual int createLvmLvPool(const string& vg, const string& name,
2017  unsigned long long sizeK,
2018  string& SWIG_OUTPUT(device) ) = 0;
2019 
2030  virtual int createLvmLvThin(const string& vg, const string& name,
2031  const string& pool,
2032  unsigned long long sizeK,
2033  string& SWIG_OUTPUT(device) ) = 0;
2034 
2044  virtual int changeLvChunkSize( const string& vg, const string& name,
2045  unsigned long long chunkSizeK) = 0;
2046 
2054  virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr),
2055  string& SWIG_OUTPUT(device)) = 0;
2056 
2066  virtual int createMd(const string& name, MdType md_type, const list<string>& devices,
2067  const list<string>& spares) = 0;
2068 
2078  virtual int createMdAny(MdType md_type, const list<string>& devices,
2079  const list<string>& spares,
2080  string& SWIG_OUTPUT(device) ) = 0;
2081 
2090  virtual int removeMd( const string& name, bool destroySb ) = 0;
2091 
2101  virtual int extendMd(const string& name, const list<string>& devices,
2102  const list<string>& spares) = 0;
2103 
2113  virtual int updateMd(const string& name, const list<string>& devices,
2114  const list<string>& spares) = 0;
2115 
2125  virtual int shrinkMd(const string& name, const list<string>& devices,
2126  const list<string>& spares) = 0;
2127 
2136  virtual int changeMdType(const string& name, MdType md_type) = 0;
2137 
2146  virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0;
2147 
2156  virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
2157 
2164  virtual int checkMd( const string& name ) = 0;
2165 
2175  virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0;
2176 
2186  virtual int getMdPartCoStateInfo(const string& name,
2187  MdPartCoStateInfo& info) = 0;
2188 
2201  virtual int computeMdSize(MdType md_type, const list<string>& devices,
2202  const list<string>& spares, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2203 
2211  virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0;
2212 
2223  virtual int removeMdPartCo(const string& name, bool destroySb ) = 0;
2224 
2235  virtual int addNfsDevice(const string& nfsDev, const string& opts,
2236  unsigned long long sizeK, const string& mp,
2237  bool nfs4) = 0;
2238 
2248  virtual int checkNfsDevice(const string& nfsDev, const string& opts,
2249  bool nfs4, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2250 
2267  virtual int createFileLoop( const string& lname, bool reuseExisting,
2268  unsigned long long sizeK,
2269  const string& mp, const string& pwd,
2270  string& SWIG_OUTPUT(device) ) = 0;
2271 
2289  virtual int modifyFileLoop( const string& device, const string& lname,
2290  bool reuseExisting,
2291  unsigned long long sizeK ) = 0;
2292 
2301  virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
2302 
2309  virtual int removeDmraid( const string& name ) = 0;
2310 
2318  virtual bool existSubvolume( const string& device, const string& name ) = 0;
2319 
2327  virtual int createSubvolume( const string& device, const string& name ) = 0;
2328 
2336  virtual int removeSubvolume( const string& device, const string& name ) = 0;
2337 
2346  virtual int extendBtrfsVolume( const string& name,
2347  const deque<string>& devs ) = 0;
2348 
2357  virtual int shrinkBtrfsVolume( const string& name,
2358  const deque<string>& devs ) = 0;
2359 
2367  virtual int addTmpfsMount( const string& mp, const string& opts ) = 0;
2368 
2375  virtual int removeTmpfsMount( const string& mp ) = 0;
2376 
2382  virtual void getCommitInfos(list<CommitInfo>& infos) const = 0;
2383 
2389  virtual const string& getLastAction() const = 0;
2390 
2397  virtual const string& getExtendedErrorMessage() const = 0;
2398 
2399 // temporarily disable callback function for swig
2400 #ifndef SWIG
2401 
2407  virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0;
2408 
2414  virtual CallbackProgressBar getCallbackProgressBar() const = 0;
2415 
2416 
2422  virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0;
2423 
2429  virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
2430 
2431 
2438  virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0;
2439 
2446  virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
2447 
2448 
2455  virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0;
2456 
2463  virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
2464 
2465 
2471  virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0;
2472 
2478  virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0;
2479 
2480 
2486  virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0;
2487 
2494  virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0;
2495 
2496 #endif
2497 
2503  virtual void setCacheChanges (bool cache) = 0;
2504 
2508  virtual bool isCacheChanges () const = 0;
2509 
2514  virtual int commit() = 0;
2515 
2519  virtual string getErrorString(int error) const = 0;
2520 
2527  virtual int createBackupState( const string& name ) = 0;
2528 
2535  virtual int restoreBackupState( const string& name ) = 0;
2536 
2543  virtual bool checkBackupState(const string& name) const = 0;
2544 
2553  virtual bool equalBackupStates(const string& lhs, const string& rhs,
2554  bool verbose_log) const = 0;
2555 
2563  virtual int removeBackupState( const string& name ) = 0;
2564 
2572  virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0;
2573 
2584  virtual bool umountDevice( const string& device ) = 0;
2585 
2598  virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0;
2599 
2610  virtual bool mountDevice( const string& device, const string& mp ) = 0;
2611 
2622  virtual int activateEncryption( const string& device, bool on ) = 0;
2623 
2635  virtual bool mountDeviceOpts( const string& device, const string& mp,
2636  const string& opts ) = 0;
2637 
2649  virtual bool mountDeviceRo( const string& device, const string& mp,
2650  const string& opts ) = 0;
2651 
2658  virtual bool checkDmMapsTo( const string& device ) = 0;
2659 
2665  virtual void removeDmTableTo( const string& device ) = 0;
2666 
2675  virtual int renameCryptDm( const string& device,
2676  const string& new_name ) = 0;
2677 
2689  virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info,
2690  bool get_content, ContentInfo& content_info, bool use_cache) = 0;
2691 
2699  virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
2700 
2710  virtual void activateHld( bool val ) = 0;
2711 
2720  virtual void activateMultipath( bool val ) = 0;
2721 
2730  virtual void rescanEverything() = 0;
2731 
2740  virtual bool rescanCryptedObjects() = 0;
2741 
2745  virtual void dumpObjectList() = 0;
2746 
2750  virtual void dumpCommitInfos() const = 0;
2751 
2761  virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0;
2762 
2771  virtual int setUserdata(const string& device, const map<string, string>& userdata) = 0;
2772 
2780  virtual int getUserdata(const string& device, map<string, string>& userdata) = 0;
2781 
2782  };
2783 
2784 
2788  void initDefaultLogger( const string& logdir );
2789 
2794  typedef void (*CallbackLogDo)( int level, const string& component, const char* file,
2795  int line, const char* function, const string& content );
2796 
2801  typedef bool (*CallbackLogQuery)( int level, const string& component );
2802 
2806  void setLogDoCallback( CallbackLogDo pfc );
2807 
2811  CallbackLogDo getLogDoCallback();
2812 
2816  void setLogQueryCallback( CallbackLogQuery pfc );
2817 
2821  CallbackLogQuery getLogQueryCallback();
2822 
2827  {
2828  Environment(bool readonly, const string& logdir = "/var/log/YaST2")
2829  : readonly(readonly), testmode(false), autodetect(true),
2830  instsys(false), logdir(logdir), testdir("tmp")
2831  {
2832  storage::initDefaultLogger( logdir );
2833  }
2834 
2835  bool readonly;
2836  bool testmode;
2837  bool autodetect;
2838  bool instsys;
2839  string logdir;
2840  string testdir;
2841  };
2842 
2843 
2849  StorageInterface* createStorageInterface(const Environment& env);
2850 
2851 
2859  StorageInterface* createStorageInterfacePid(const Environment& env, int& SWIG_OUTPUT(locker_pid));
2860 
2861 
2865  void destroyStorageInterface(StorageInterface*);
2866 
2867 }
2868 
2869 
2870 #endif
virtual void activateMultipath(bool val)=0
virtual int nextFreeMd(unsigned &SWIG_OUTPUT(nr), string &SWIG_OUTPUT(device))=0
virtual int addFstabEntry(const string &device, const string &mount, const string &vfs, const string &options, unsigned freq, unsigned passno)=0
virtual int createMd(const string &name, MdType md_type, const list< string > &devices, const list< string > &spares)=0
virtual int extendMd(const string &name, const list< string > &devices, const list< string > &spares)=0
Definition: StorageInterface.h:604
virtual int resizePartition(const string &device, unsigned long sizeCyl)=0
Definition: StorageInterface.h:627
virtual int createMdAny(MdType md_type, const list< string > &devices, const list< string > &spares, string &SWIG_OUTPUT(device))=0
virtual bool checkDeviceMounted(const string &device, list< string > &mps)=0
virtual int addTmpfsMount(const string &mp, const string &opts)=0
virtual int removeLvmVg(const string &name)=0
virtual void getVolumes(deque< VolumeInfo > &infos)=0
virtual int getNfsInfo(deque< NfsInfo > &plist)=0
virtual int removeMdPartCo(const string &name, bool destroySb)=0
virtual int updatePartitionArea(const string &device, unsigned long startCyl, unsigned long sizeCyl)=0
Definition: StorageInterface.h:219
virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc)=0
virtual int getLoopInfo(deque< LoopInfo > &plist)=0
virtual int removeBackupState(const string &name)=0
virtual int forgetResizeVolume(const string &device)=0
virtual bool checkBackupState(const string &name) const =0
virtual int getLvmLvInfo(const string &name, deque< LvmLvInfo > &plist)=0
virtual int setCryptPassword(const string &device, const string &pwd)=0
virtual int changeMountBy(const string &device, MountByType mby)=0
virtual PartAlign getPartitionAlignment() const =0
Definition: StorageInterface.h:272
virtual int createBackupState(const string &name)=0
virtual int checkMd(const string &name)=0
virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc)=0
Definition: StorageInterface.h:525
virtual int getDmInfo(deque< DmInfo > &plist)=0
virtual const string & getLastAction() const =0
virtual bool readFstab(const string &dir, deque< VolumeInfo > &infos)=0
virtual int changeFormatVolume(const string &device, bool format, FsType fs)=0
virtual int getDmmultipathInfo(const string &name, deque< DmmultipathInfo > &plist)=0
virtual bool mountDeviceOpts(const string &device, const string &mp, const string &opts)=0
Definition: StorageInterface.h:491
virtual int getContMdPartCoInfo(const string &name, ContainerInfo &cinfo, MdPartCoInfo &info)=0
Definition: StorageInterface.h:595
virtual void activateHld(bool val)=0
virtual int addNfsDevice(const string &nfsDev, const string &opts, unsigned long long sizeK, const string &mp, bool nfs4)=0
virtual int changeMountPoint(const string &device, const string &mount)=0
Definition: StorageInterface.h:481
virtual int shrinkMd(const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int getMdStateInfo(const string &name, MdStateInfo &info)=0
Definition: StorageInterface.h:2826
Definition: StorageInterface.h:582
Definition: StorageInterface.h:546
virtual void setZeroNewPartitions(bool val)=0
virtual int resizeVolumeNoFs(const string &device, unsigned long long newSizeK)=0
virtual MountByType getDefaultMountBy() const =0
virtual int changeDescText(const string &device, const string &txt)=0
virtual CallbackProgressBar getCallbackProgressBar() const =0
virtual int changePartitionId(const string &partition, unsigned id)=0
virtual void getContainers(deque< ContainerInfo > &infos)=0
virtual int createPartitionMax(const string &disk, PartitionType type, string &SWIG_OUTPUT(device))=0
virtual int getUnusedPartitionSlots(const string &disk, list< PartitionSlotInfo > &slots)=0
Definition: StorageInterface.h:404
virtual int getContDmraidCoInfo(const string &name, ContainerInfo &cinfo, DmraidCoInfo &info)=0
virtual int createFileLoop(const string &lname, bool reuseExisting, unsigned long long sizeK, const string &mp, const string &pwd, string &SWIG_OUTPUT(device))=0
virtual int getUserdata(const string &device, map< string, string > &userdata)=0
Definition: StorageInterface.h:262
virtual int shrinkLvmVg(const string &name, const deque< string > &devs)=0
virtual int setIgnoreFstab(const string &device, bool val)=0
Definition: StorageInterface.h:332
virtual unsigned long kbToCylinder(const string &disk, unsigned long long sizeK)=0
Definition: StorageInterface.h:463
virtual bool umountDevice(const string &device)=0
virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc)=0
virtual int changeLabelVolume(const string &device, const string &label)=0
virtual int getMdPartInfo(const string &device, deque< MdPartInfo > &plist)=0
virtual int createLvmLvPool(const string &vg, const string &name, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual int removeMd(const string &name, bool destroySb)=0
virtual int changeLvChunkSize(const string &vg, const string &name, unsigned long long chunkSizeK)=0
Definition: StorageInterface.h:364
virtual int createPartition(const string &disk, PartitionType type, unsigned long startCyl, unsigned long sizeCyl, string &SWIG_OUTPUT(device))=0
Definition: StorageInterface.h:350
virtual int getLvmLvSnapshotStateInfo(const string &vg, const string &name, LvmLvSnapshotStateInfo &info)=0
virtual int changeMdParity(const string &name, MdParity ptype)=0
virtual bool getDetectMountedVolumes() const =0
Definition: StorageInterface.h:281
virtual int nextFreePartition(const string &disk, PartitionType type, unsigned &SWIG_OUTPUT(nr), string &SWIG_OUTPUT(device))=0
virtual void dumpCommitInfos() const =0
Definition: StorageInterface.h:643
virtual int forgetChangePartitionId(const string &partition)=0
virtual bool getDlabelCapabilities(const string &dlabel, DlabelCapabilities &dlabelcapabilities) const =0
virtual int addFstabOptions(const string &device, const string &options)=0
virtual int setUserdata(const string &device, const map< string, string > &userdata)=0
virtual int getContLvmVgInfo(const string &name, ContainerInfo &cinfo, LvmVgInfo &info)=0
virtual int getContDiskInfo(const string &disk, ContainerInfo &cinfo, DiskInfo &info)=0
virtual int resizePartitionNoFs(const string &device, unsigned long sizeCyl)=0
virtual int setCrypt(const string &device, bool val)=0
Abstract class defining the interface for libstorage.
Definition: StorageInterface.h:938
virtual bool getFreeInfo(const string &device, bool get_resize, ResizeInfo &resize_info, bool get_content, ContentInfo &content_info, bool use_cache)=0
Definition: StorageInterface.h:613
virtual int changeLvStripeSize(const string &vg, const string &name, unsigned long long stripeSizeK)=0
virtual int getDmraidCoInfo(const string &name, DmraidCoInfo &info)=0
virtual int getTmpfsInfo(deque< TmpfsInfo > &plist)=0
virtual int getVolume(const string &device, VolumeInfo &info)=0
virtual CallbackInfoPopup getCallbackInfoPopup() const =0
virtual int shrinkBtrfsVolume(const string &name, const deque< string > &devs)=0
virtual int createPartitionKb(const string &disk, PartitionType type, unsigned long long startK, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual int getMountPoint(const string &device, string &SWIG_OUTPUT(mount))=0
virtual int initializeDisk(const string &disk, bool value)=0
virtual int getContVolInfo(const string &dev, ContVolInfo &info)=0
Definition: StorageInterface.h:255
Definition: StorageInterface.h:505
virtual void setRootPrefix(const string &root)=0
virtual int changeMdType(const string &name, MdType md_type)=0
virtual string getRootPrefix() const =0
virtual int createLvmLvThin(const string &vg, const string &name, const string &pool, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual void setDefaultSubvolName(const string &val)=0
virtual int getContDmmultipathCoInfo(const string &name, ContainerInfo &cinfo, DmmultipathCoInfo &info)=0
virtual int extendBtrfsVolume(const string &name, const deque< string > &devs)=0
virtual int resizeVolume(const string &device, unsigned long long newSizeK)=0
Definition: StorageInterface.h:514
Definition: StorageInterface.h:358
virtual void dumpObjectList()=0
virtual CallbackPasswordPopup getCallbackPasswordPopup() const =0
virtual void setCallbackProgressBar(CallbackProgressBar pfnc)=0
virtual bool rescanCryptedObjects()=0
Definition: StorageInterface.h:418
virtual int getMdInfo(deque< MdInfo > &plist)=0
virtual list< int > getMdAllowedParity(MdType md_type, unsigned devnr)=0
virtual string getPartitionName(const string &disk, int partition_no)=0
virtual int extendLvmVg(const string &name, const deque< string > &devs)=0
virtual int removePartition(const string &partition)=0
Definition: StorageInterface.h:534
virtual int createSubvolume(const string &device, const string &name)=0
virtual bool getZeroNewPartitions() const =0
virtual int activateEncryption(const string &device, bool on)=0
Definition: StorageInterface.h:453
virtual int removeLvmLvByDevice(const string &device)=0
virtual void removeDmTableTo(const string &device)=0
virtual int getCrypt(const string &device, bool &SWIG_OUTPUT(val))=0
virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc)=0
virtual int changeMdChunk(const string &name, unsigned long chunkSizeK)=0
virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const =0
virtual int setCryptType(const string &device, bool val, EncryptType typ)=0
virtual FsType getDefaultFs() const =0
virtual int createLvmVg(const string &name, unsigned long long peSizeK, bool lvm1, const deque< string > &devs)=0
virtual string getPartitionPrefix(const string &disk)=0
virtual int getMdPartCoInfo(const string &name, MdPartCoInfo &info)=0
virtual bool equalBackupStates(const string &lhs, const string &rhs, bool verbose_log) const =0
Definition: StorageInterface.h:300
virtual int getDiskInfo(const string &disk, DiskInfo &info)=0
virtual string defaultDiskLabel(const string &device)=0
virtual int createLvmLv(const string &vg, const string &name, unsigned long long sizeK, unsigned stripes, string &SWIG_OUTPUT(device))=0
virtual int createPartitionAny(const string &disk, unsigned long long sizeK, string &SWIG_OUTPUT(device))=0
virtual void rescanEverything()=0
virtual const string & getExtendedErrorMessage() const =0
virtual string getErrorString(int error) const =0
virtual bool getRecursiveRemoval() const =0
virtual int changeMkfsOptVolume(const string &device, const string &opts)=0
virtual int commit()=0
virtual void setPartitionAlignment(PartAlign val)=0
Definition: StorageInterface.h:570
virtual unsigned long long cylinderToKb(const string &disk, unsigned long sizeCyl)=0
Definition: StorageInterface.h:561
virtual string getDefaultSubvolName() const =0
virtual int getLvmVgInfo(const string &name, LvmVgInfo &info)=0
virtual bool checkDmMapsTo(const string &device)=0
virtual int removeVolume(const string &device)=0
virtual void setDefaultMountBy(MountByType val)=0
virtual int destroyPartitionTable(const string &disk, const string &label)=0
virtual bool needCryptPassword(const string &device)=0
virtual int getMdPartCoStateInfo(const string &name, MdPartCoStateInfo &info)=0
virtual bool getEfiBoot()=0
virtual bool getFsCapabilities(FsType fstype, FsCapabilities &fscapabilities) const =0
virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const =0
virtual int getDmraidInfo(const string &name, deque< DmraidInfo > &plist)=0
virtual void setDefaultFs(FsType val)=0
virtual int getPartitionInfo(const string &disk, deque< PartitionInfo > &plist)=0
virtual int computeMdSize(MdType md_type, const list< string > &devices, const list< string > &spares, unsigned long long &SWIG_OUTPUT(sizeK))=0
Definition: StorageInterface.h:434
virtual int removeSubvolume(const string &device, const string &name)=0
virtual int forgetCryptPassword(const string &device)=0
virtual MultipathAutostart getMultipathAutostart() const =0
virtual int updateMd(const string &name, const list< string > &devices, const list< string > &spares)=0
virtual int removeLvmLv(const string &vg, const string &name)=0
virtual int renameCryptDm(const string &device, const string &new_name)=0
virtual int getMountBy(const string &device, MountByType &SWIG_OUTPUT(mby))=0
virtual int modifyFileLoop(const string &device, const string &lname, bool reuseExisting, unsigned long long sizeK)=0
virtual int getBtrfsInfo(deque< BtrfsInfo > &plist)=0
virtual int removeFileLoop(const string &lname, bool removeFile)=0
virtual bool existSubvolume(const string &device, const string &name)=0
virtual int verifyCryptPassword(const string &device, const string &pwd, bool erase)=0
virtual int changeLvStripeCount(const string &vg, const string &name, unsigned long stripes)=0
Definition: StorageInterface.h:375
virtual int getDmmultipathCoInfo(const string &name, DmmultipathCoInfo &info)=0
virtual int changeTunefsOptVolume(const string &device, const string &opts)=0
virtual int getRecursiveUsing(const list< string > &devices, bool itself, list< string > &using_devices)=0
virtual bool isCacheChanges() const =0
virtual void setDetectMountedVolumes(bool val)=0
virtual int freeCylindersAroundPartition(const string &device, unsigned long &SWIG_OUTPUT(freeCylsBefore), unsigned long &SWIG_OUTPUT(freeCylsAfter))=0
virtual int checkNfsDevice(const string &nfsDev, const string &opts, bool nfs4, unsigned long long &SWIG_OUTPUT(sizeK))=0
virtual int removeDmraid(const string &name)=0
virtual int getFstabOptions(const string &device, string &SWIG_OUTPUT(options))=0
Definition: StorageInterface.h:236
virtual int removeTmpfsMount(const string &mp)=0
virtual int getIgnoreFstab(const string &device, bool &SWIG_OUTPUT(val))=0
virtual int restoreBackupState(const string &name)=0
Definition: StorageInterface.h:310
virtual void getCommitInfos(list< CommitInfo > &infos) const =0
Definition: StorageInterface.h:246
virtual int getCryptPassword(const string &device, string &SWIG_OUTPUT(pwd))=0
virtual bool mountDevice(const string &device, const string &mp)=0
virtual void setMultipathAutostart(MultipathAutostart multipath_autostart)=0
virtual void setCacheChanges(bool cache)=0
virtual bool mountDeviceRo(const string &device, const string &mp, const string &opts)=0
virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc)=0
virtual int removeFstabOptions(const string &device, const string &options)=0
virtual int removeLvmLvSnapshot(const string &vg, const string &name)=0
virtual void setRecursiveRemoval(bool val)=0
virtual int createLvmLvSnapshot(const string &vg, const string &origin, const string &name, unsigned long long cowSizeK, string &SWIG_OUTPUT(device))=0
virtual CallbackYesNoPopup getCallbackYesNoPopup() const =0
virtual bool umountDeviceUns(const string &device, bool unsetup)=0
virtual list< string > getAllUsedFs() const =0
virtual int getRecursiveUsedBy(const list< string > &devices, bool itself, list< string > &usedby_devices)=0
virtual int changeFstabOptions(const string &device, const string &options)=0