libstorage
StorageInterface.h
1 /*
2  * Copyright (c) [2004-2010] 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 
31 using std::string;
32 using std::deque;
33 using std::list;
34 
35 
36 #include "storage/StorageVersion.h"
37 #include "storage/StorageSwig.h"
38 
39 
137 namespace storage
138 {
139  enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS,
140  SWAP, HFSPLUS, NFS, NFS4, TMPFS, FSNONE };
141 
142  enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
143 
144  enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
145 
146  enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
147  ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
148 
149  enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
150 
151  enum MdParity { PAR_DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC,
152  RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC, PAR_FIRST, PAR_LAST,
153  LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6, RIGHT_ASYMMETRIC_6,
154  RIGHT_SYMMETRIC_6, PAR_FIRST_6,
155  PAR_NEAR_2, PAR_OFFSET_2, PAR_FAR_2,
156  PAR_NEAR_3, PAR_OFFSET_3, PAR_FAR_3 };
157 
158  enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO,
159  CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE };
160 
161  enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS };
162 
163  enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC };
164 
165  enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE };
166 
167  enum ImsmDriver { IMSM_UNDECIDED, IMSM_DMRAID, IMSM_MDADM };
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(UsedByType type, const string& device) : type(type), device(device) {}
249  UsedByType type;
250  string device;
251  };
252 
253 
254  struct SubvolInfo
255  {
256  SubvolInfo(const string& path) : path(path) {}
257  string path;
258  };
259 
260 
261  struct ResizeInfo
262  {
263  ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(false) {}
264  unsigned long long df_freeK;
265  unsigned long long resize_freeK;
266  unsigned long long usedK;
267  bool resize_ok;
268  };
269 
270 
271  struct ContentInfo
272  {
273  ContentInfo() : windows(false), efi(false), homes(0) {}
274  bool windows;
275  bool efi;
276  unsigned homes;
277  };
278 
279 
284  {
285  ContainerInfo() {}
286  CType type;
287  string device;
288  string name;
289  string udevPath;
290  string udevId;
291  list<UsedByInfo> usedBy;
292  UsedByType usedByType; // deprecated
293  string usedByDevice; // deprecated
294  bool readonly;
295  };
296 
300  struct DiskInfo
301  {
302  DiskInfo() {}
303  unsigned long long sizeK;
304  unsigned long long cylSize;
305  unsigned long cyl;
306  unsigned long heads;
307  unsigned long sectors;
308  unsigned int sectorSize;
309  string disklabel;
310  string orig_disklabel;
311  unsigned maxPrimary;
312  bool extendedPossible;
313  unsigned maxLogical;
314  bool initDisk;
315  Transport transport;
316  bool has_fake_partition;
317  bool iscsi; // deprecated
318  };
319 
323  struct LvmVgInfo
324  {
325  LvmVgInfo() {}
326  unsigned long long sizeK;
327  unsigned long long peSizeK;
328  unsigned long peCount;
329  unsigned long peFree;
330  string uuid;
331  bool lvm2;
332  bool create;
333  string devices;
334  string devices_add;
335  string devices_rem;
336  };
337 
342  {
343  DmPartCoInfo() {}
344  DiskInfo d;
345  string devices;
346  unsigned long minor;
347  };
348 
350  {
351  DmraidCoInfo() {}
352  DmPartCoInfo p;
353  };
354 
356  {
357  DmmultipathCoInfo() {}
358  DmPartCoInfo p;
359  string vendor;
360  string model;
361  };
362 
366  struct VolumeInfo
367  {
368  VolumeInfo() {}
369  unsigned long long sizeK;
370  unsigned long major;
371  unsigned long minor;
372  string name;
373  string device;
374  string mount;
375  string crypt_device;
376  MountByType mount_by;
377  string udevPath;
378  string udevId;
379  list<UsedByInfo> usedBy;
380  UsedByType usedByType; // deprecated
381  string usedByDevice; // deprecated
382  bool ignore_fstab;
383  string fstab_options;
384  string uuid;
385  string label;
386  string mkfs_options;
387  string tunefs_options;
388  string loop;
389  string dtxt;
390  EncryptType encryption;
391  string crypt_pwd;
392  FsType fs;
393  FsType detected_fs;
394  bool format;
395  bool create;
396  bool is_mounted;
397  bool resize;
398  bool ignore_fs;
399  unsigned long long origSizeK;
400  };
401 
403  {
404  PartitionAddInfo() {}
405  unsigned nr;
406  unsigned long cylStart;
407  unsigned long cylSize;
408  PartitionType partitionType;
409  unsigned id;
410  bool boot;
411  };
412 
417  {
418  PartitionInfo() {}
419  PartitionInfo& operator=( const PartitionAddInfo& rhs );
420  VolumeInfo v;
421  unsigned nr;
422  unsigned long cylStart;
423  unsigned long cylSize;
424  PartitionType partitionType;
425  unsigned id;
426  bool boot;
427  };
428 
432  struct LvmLvInfo
433  {
434  LvmLvInfo() {}
435  VolumeInfo v;
436  unsigned stripes;
437  unsigned stripeSizeK;
438  string uuid;
439  string status;
440  string allocation;
441  string dm_table;
442  string dm_target;
443  string origin;
444  string used_pool;
445  bool pool;
446  };
447 
452  {
454  bool active;
455  double allocated;
456  };
457 
461  struct MdInfo
462  {
463  MdInfo() {}
464  VolumeInfo v;
465  unsigned nr;
466  unsigned type;
467  unsigned parity;
468  string uuid;
469  string sb_ver;
470  unsigned long chunkSizeK;
471  string devices;
472  string spares;
473  bool inactive;
474  };
475 
479  struct MdStateInfo
480  {
481  MdStateInfo() {}
482  MdArrayState state;
483  };
484 
490  {
491  MdPartCoInfo() {}
492  DiskInfo d;
493  unsigned type; // RAID level
494  unsigned nr; // MD device number
495  unsigned parity; // Parity (not for all RAID level)
496  string uuid; // MD Device UUID
497  string sb_ver; // Metadata version
498  unsigned long chunkSizeK; // Chunksize (strip size)
499  string devices;
500  string spares;
501  };
502 
504  {
505  MdPartCoStateInfo() {}
506  MdArrayState state;
507  };
508 
512  struct MdPartInfo
513  {
514  MdPartInfo() {}
515  VolumeInfo v;
517  bool part;
518  };
519 
523  struct NfsInfo
524  {
525  NfsInfo() {}
526  VolumeInfo v;
527  };
528 
532  struct LoopInfo
533  {
534  LoopInfo() {}
535  VolumeInfo v;
536  bool reuseFile;
537  unsigned nr;
538  string file;
539  };
540 
544  struct BtrfsInfo
545  {
546  BtrfsInfo() {}
547  VolumeInfo v;
548  string devices;
549  string devices_add;
550  string devices_rem;
551  string subvol;
552  string subvol_add;
553  string subvol_rem;
554  };
555 
559  struct TmpfsInfo
560  {
561  TmpfsInfo() {}
562  VolumeInfo v;
563  };
564 
568  struct DmInfo
569  {
570  DmInfo() {}
571  VolumeInfo v;
572  unsigned nr;
573  string table;
574  string target;
575  };
576 
580  struct DmPartInfo
581  {
582  DmPartInfo() {}
583  VolumeInfo v;
585  bool part;
586  string table;
587  string target;
588  };
589 
593  struct DmraidInfo
594  {
595  DmraidInfo() {}
596  DmPartInfo p;
597  };
598 
603  {
604  DmmultipathInfo() {}
605  DmPartInfo p;
606  };
607 
611  struct ContVolInfo
612  {
613  ContVolInfo() : ctype(CUNKNOWN), num(-1) {}
614  CType ctype;
615  string cname;
616  string cdevice;
617  string vname;
618  string vdevice;
619  int num;
620  };
621 
626  {
627  PartitionSlotInfo() {}
628  unsigned long cylStart;
629  unsigned long cylSize;
630  bool primarySlot;
631  bool primaryPossible;
632  bool extendedSlot;
633  bool extendedPossible;
634  bool logicalSlot;
635  bool logicalPossible;
636  };
637 
641  struct CommitInfo
642  {
643  CommitInfo() {}
644  bool destructive;
645  string text;
646  };
647 
648 
652  enum ErrorCodes
653  {
654  STORAGE_NO_ERROR = 0,
655 
656  DISK_PARTITION_OVERLAPS_EXISTING = -1000,
657  DISK_PARTITION_EXCEEDS_DISK = -1001,
658  DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
659  DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
660  DISK_PARTITION_NO_FREE_NUMBER = -1004,
661  DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
662  DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
663  DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
664  DISK_PARTITION_NOT_FOUND = -1008,
665  DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
666  DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
667  DISK_SET_TYPE_INVALID_VOLUME = -1011,
668  DISK_SET_TYPE_PARTED_FAILED = -1012,
669  DISK_SET_LABEL_PARTED_FAILED = -1013,
670  DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
671  DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
672  DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
673  DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
674  DISK_PARTITION_ZERO_SIZE = -1018,
675  DISK_CHANGE_READONLY = -1019,
676  DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
677  DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
678  DISK_RESIZE_NO_SPACE = -1022,
679  DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
680  DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
681  DISK_COMMIT_NOTHING_TODO = -1025,
682  DISK_CREATE_PARTITION_NO_SPACE = -1026,
683  DISK_REMOVE_USED_BY = -1027,
684  DISK_INIT_NOT_POSSIBLE = -1028,
685  DISK_INVALID_PARTITION_ID = -1029,
686 
687  STORAGE_DISK_NOT_FOUND = -2000,
688  STORAGE_VOLUME_NOT_FOUND = -2001,
689  STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
690  STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
691  STORAGE_CHANGE_READONLY = -2004,
692  STORAGE_DISK_USED_BY = -2005,
693  STORAGE_LVM_VG_EXISTS = -2006,
694  STORAGE_LVM_VG_NOT_FOUND = -2007,
695  STORAGE_LVM_INVALID_DEVICE = -2008,
696  STORAGE_CONTAINER_NOT_FOUND = -2009,
697  STORAGE_VG_INVALID_NAME = -2010,
698  STORAGE_REMOVE_USED_VOLUME = -2011,
699  STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
700  STORAGE_NOT_YET_IMPLEMENTED = -2013,
701  STORAGE_MD_INVALID_NAME = -2014,
702  STORAGE_MD_NOT_FOUND = -2015,
703  STORAGE_MEMORY_EXHAUSTED = -2016,
704  STORAGE_LOOP_NOT_FOUND = -2017,
705  STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
706  STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
707  STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
708  STORAGE_INVALID_FSTAB_VALUE = -2025,
709  STORAGE_NO_FSTAB_PTR = -2026,
710  STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
711  STORAGE_DMRAID_CO_NOT_FOUND = -2028,
712  STORAGE_RESIZE_INVALID_CONTAINER = -2029,
713  STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030,
714  STORAGE_ZERO_DEVICE_FAILED = -2031,
715  STORAGE_INVALID_BACKUP_STATE_NAME = -2032,
716  STORAGE_MDPART_CO_NOT_FOUND = -2033,
717  STORAGE_DEVICE_NOT_FOUND = -2034,
718  STORAGE_BTRFS_CO_NOT_FOUND = -2035,
719  STORAGE_TMPFS_CO_NOT_FOUND = -2036,
720  STORAGE_VOLUME_NOT_ENCRYPTED = -2037,
721  STORAGE_DM_RENAME_FAILED = -2038,
722 
723  VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
724  VOLUME_FSTAB_EMPTY_MOUNT = -3001,
725  VOLUME_UMOUNT_FAILED = -3002,
726  VOLUME_MOUNT_FAILED = -3003,
727  VOLUME_FORMAT_UNKNOWN_FS = -3005,
728  VOLUME_FORMAT_FS_UNDETECTED = -3006,
729  VOLUME_FORMAT_FS_TOO_SMALL = -3007,
730  VOLUME_FORMAT_FAILED = -3008,
731  VOLUME_TUNE2FS_FAILED = -3009,
732  VOLUME_MKLABEL_FS_UNABLE = -3010,
733  VOLUME_MKLABEL_FAILED = -3011,
734  VOLUME_LOSETUP_NO_LOOP = -3012,
735  VOLUME_LOSETUP_FAILED = -3013,
736  VOLUME_CRYPT_NO_PWD = -3014,
737  VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
738  VOLUME_CRYPT_NOT_DETECTED = -3016,
739  VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
740  VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
741  VOLUME_MOUNT_POINT_INVALID = -3019,
742  VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
743  VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
744  VOLUME_LABEL_NOT_SUPPORTED = -3022,
745  VOLUME_LABEL_TOO_LONG = -3023,
746  VOLUME_LABEL_WHILE_MOUNTED = -3024,
747  VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
748  VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
749  VOLUME_RESIZE_FAILED = -3027,
750  VOLUME_ALREADY_IN_USE = -3028,
751  VOLUME_LOUNSETUP_FAILED = -3029,
752  VOLUME_DEVICE_NOT_PRESENT = -3030,
753  VOLUME_DEVICE_NOT_BLOCK = -3031,
754  VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
755  VOLUME_CRYPTFORMAT_FAILED = -3033,
756  VOLUME_CRYPTSETUP_FAILED = -3034,
757  VOLUME_CRYPTUNSETUP_FAILED = -3035,
758  VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
759  VOLUME_FORMAT_IMPOSSIBLE = -3037,
760  VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
761  VOLUME_REMOUNT_FAILED = -3039,
762  VOLUME_TUNEREISERFS_FAILED = -3040,
763  VOLUME_UMOUNT_NOT_MOUNTED = -3041,
764  VOLUME_BTRFS_ADD_FAILED = -3042,
765  VOLUME_CANNOT_TMP_MOUNT = -3043,
766  VOLUME_CANNOT_TMP_UMOUNT = -3044,
767  VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045,
768  VOLUME_BTRFS_SUBVOL_DETDEFAULT = -3046,
769 
770  LVM_CREATE_PV_FAILED = -4000,
771  LVM_PV_ALREADY_CONTAINED = -4001,
772  LVM_PV_DEVICE_UNKNOWN = -4002,
773  LVM_PV_DEVICE_USED = -4003,
774  LVM_VG_HAS_NONE_PV = -4004,
775  LVM_LV_INVALID_NAME = -4005,
776  LVM_LV_DUPLICATE_NAME = -4006,
777  LVM_LV_NO_SPACE = -4007,
778  LVM_LV_UNKNOWN_NAME = -4008,
779  LVM_LV_NOT_IN_LIST = -4009,
780  LVM_VG_CREATE_FAILED = -4010,
781  LVM_VG_EXTEND_FAILED = -4011,
782  LVM_VG_REDUCE_FAILED = -4012,
783  LVM_VG_REMOVE_FAILED = -4013,
784  LVM_LV_CREATE_FAILED = -4014,
785  LVM_LV_REMOVE_FAILED = -4015,
786  LVM_LV_RESIZE_FAILED = -4016,
787  LVM_PV_STILL_ADDED = -4017,
788  LVM_PV_REMOVE_NOT_FOUND = -4018,
789  LVM_CREATE_LV_INVALID_VOLUME = -4019,
790  LVM_REMOVE_LV_INVALID_VOLUME = -4020,
791  LVM_RESIZE_LV_INVALID_VOLUME = -4021,
792  LVM_CHANGE_READONLY = -4022,
793  LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
794  LVM_COMMIT_NOTHING_TODO = -4024,
795  LVM_LV_REMOVE_USED_BY = -4025,
796  LVM_LV_ALREADY_ON_DISK = -4026,
797  LVM_LV_NO_STRIPE_SIZE = -4027,
798  LVM_LV_UNKNOWN_ORIGIN = -4028,
799  LVM_LV_NOT_ON_DISK = -4029,
800  LVM_LV_NOT_SNAPSHOT = -4030,
801  LVM_LV_HAS_SNAPSHOTS = -4031,
802  LVM_LV_IS_SNAPSHOT = -4032,
803  LVM_LIST_EMPTY = -4033,
804  LVM_LV_NO_POOL_OR_SNAP = -4034,
805  LVM_LV_NO_POOL = -4035,
806  LVM_LV_UNKNOWN_POOL = -4036,
807  LVM_LV_INVALID_CHUNK_SIZE = -4037,
808  LVM_LV_POOL_NO_FORMAT = -4038,
809  LVM_LV_POOL_NO_MOUNT = -4039,
810 
811  FSTAB_ENTRY_NOT_FOUND = -5000,
812  FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
813  FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
814  FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
815  FSTAB_ADD_ENTRY_FOUND = -5004,
816 
817  MD_CHANGE_READONLY = -6000,
818  MD_DUPLICATE_NUMBER = -6001,
819  MD_TOO_FEW_DEVICES = -6002,
820  MD_DEVICE_UNKNOWN = -6003,
821  MD_DEVICE_USED = -6004,
822  MD_CREATE_INVALID_VOLUME = -6005,
823  MD_REMOVE_FAILED = -6006,
824  MD_NOT_IN_LIST = -6007,
825  MD_CREATE_FAILED = -6008,
826  MD_UNKNOWN_NUMBER = -6009,
827  MD_REMOVE_USED_BY = -6010,
828  MD_NUMBER_TOO_LARGE = -6011,
829  MD_REMOVE_INVALID_VOLUME = -6012,
830  MD_REMOVE_CREATE_NOT_FOUND = -6013,
831  MD_NO_RESIZE_ON_DISK = -6014,
832  MD_ADD_DUPLICATE = -6015,
833  MD_REMOVE_NONEXISTENT = -6016,
834  MD_NO_CHANGE_ON_DISK = -6017,
835  MD_NO_CREATE_UNKNOWN = -6018,
836  MD_STATE_NOT_ON_DISK = -6019,
837  MD_PARTITION_NOT_FOUND = -6020,
838  MD_INVALID_PARITY = -6021,
839  MD_TOO_MANY_SPARES = -6022,
840  MD_GET_STATE_FAILED = -6023,
841  MD_DUPLICATE_NAME = -6024,
842 
843  MDPART_CHANGE_READONLY = -6100,
844  MDPART_INTERNAL_ERR = -6101,
845  MDPART_INVALID_VOLUME = -6012,
846  MDPART_PARTITION_NOT_FOUND = -6103,
847  MDPART_REMOVE_PARTITION_LIST_ERASE = -6104,
848  MDPART_COMMIT_NOTHING_TODO = -6105,
849  MDPART_NO_REMOVE = -6106,
850  MDPART_DEVICE_NOT_FOUND = -6107,
851 
852  LOOP_CHANGE_READONLY = -7000,
853  LOOP_DUPLICATE_FILE = -7001,
854  LOOP_UNKNOWN_FILE = -7002,
855  LOOP_REMOVE_USED_BY = -7003,
856  LOOP_FILE_CREATE_FAILED = -7004,
857  LOOP_CREATE_INVALID_VOLUME = -7005,
858  LOOP_REMOVE_FILE_FAILED = -7006,
859  LOOP_REMOVE_INVALID_VOLUME = -7007,
860  LOOP_NOT_IN_LIST = -7008,
861  LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
862  LOOP_MODIFY_EXISTING = -7010,
863 
864  PEC_PE_SIZE_INVALID = -9000,
865  PEC_PV_NOT_FOUND = -9001,
866  PEC_REMOVE_PV_IN_USE = -9002,
867  PEC_REMOVE_PV_SIZE_NEEDED = -9003,
868  PEC_LV_NO_SPACE_STRIPED = -9004,
869  PEC_LV_NO_SPACE_SINGLE = -9005,
870  PEC_LV_PE_DEV_NOT_FOUND = -9006,
871 
872  DM_CHANGE_READONLY = -10000,
873  DM_UNKNOWN_TABLE = -10001,
874  DM_REMOVE_USED_BY = -10002,
875  DM_REMOVE_CREATE_NOT_FOUND = -10003,
876  DM_REMOVE_INVALID_VOLUME = -10004,
877  DM_REMOVE_FAILED = -10005,
878  DM_NOT_IN_LIST = -10006,
879 
880  DASD_NOT_POSSIBLE = -11000,
881  DASD_FDASD_FAILED = -11001,
882  DASD_DASDFMT_FAILED = -11002,
883 
884  DMPART_CHANGE_READONLY = -12001,
885  DMPART_INTERNAL_ERR = -12002,
886  DMPART_INVALID_VOLUME = -12003,
887  DMPART_PARTITION_NOT_FOUND = -12004,
888  DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
889  DMPART_COMMIT_NOTHING_TODO = -12006,
890  DMPART_NO_REMOVE = -12007,
891 
892  DMRAID_REMOVE_FAILED = -13001,
893 
894  NFS_VOLUME_NOT_FOUND = -14001,
895  NFS_CHANGE_READONLY = -14002,
896  NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
897  NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
898  NFS_REMOVE_INVALID_VOLUME = -14005,
899 
900  BTRFS_COMMIT_INVALID_VOLUME = -15001,
901  BTRFS_CANNOT_TMP_MOUNT = -15002,
902  BTRFS_CANNOT_TMP_UMOUNT = -15003,
903  BTRFS_DELETE_SUBVOL_FAIL = -15004,
904  BTRFS_CREATE_SUBVOL_FAIL = -15005,
905  BTRFS_VOLUME_NOT_FOUND = -15006,
906  BTRFS_SUBVOL_EXISTS = -15007,
907  BTRFS_SUBVOL_NON_EXISTS = -15008,
908  BTRFS_REMOVE_NOT_FOUND = -15009,
909  BTRFS_REMOVE_NO_BTRFS = -15010,
910  BTRFS_REMOVE_INVALID_VOLUME = -15011,
911  BTRFS_CHANGE_READONLY = -15012,
912  BTRFS_DEV_ALREADY_CONTAINED = -15013,
913  BTRFS_DEVICE_UNKNOWN = -15014,
914  BTRFS_DEVICE_USED = -15015,
915  BTRFS_HAS_NONE_DEV = -15016,
916  BTRFS_DEV_NOT_FOUND = -15017,
917  BTRFS_EXTEND_FAIL = -15018,
918  BTRFS_REDUCE_FAIL = -15019,
919  BTRFS_LIST_EMPTY = -15020,
920  BTRFS_RESIZE_INVALID_VOLUME = -15021,
921  BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022,
922 
923  TMPFS_REMOVE_INVALID_VOLUME = -16001,
924  TMPFS_REMOVE_NO_TMPFS = -16002,
925  TMPFS_REMOVE_NOT_FOUND = -16003,
926 
927  CONTAINER_INTERNAL_ERROR = -99000,
928  CONTAINER_INVALID_VIRTUAL_CALL = -99001,
929 
930  };
931 
932 
937  {
938  public:
939 
940  StorageInterface () {}
941  virtual ~StorageInterface () {}
942 
946  virtual void getContainers( deque<ContainerInfo>& infos) = 0;
947 
955  virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
956 
965  virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
966  DiskInfo& info ) = 0;
967 
975  virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
976 
985  virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
986  LvmVgInfo& info) = 0;
987 
995  virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
996 
1005  virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
1006  DmraidCoInfo& info) = 0;
1007 
1015  virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0;
1016 
1025  virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
1026  DmmultipathCoInfo& info) = 0;
1027 
1035  virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0;
1036 
1037 
1046  virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
1047  MdPartCoInfo& info) = 0;
1048 
1054  virtual void setImsmDriver(ImsmDriver driver) = 0;
1055 
1061  virtual ImsmDriver getImsmDriver() const = 0;
1062 
1068  virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0;
1069 
1075  virtual MultipathAutostart getMultipathAutostart() const = 0;
1076 
1082  virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
1083 
1091  virtual int getVolume( const string& device, VolumeInfo& info) = 0;
1092 
1100  virtual int getPartitionInfo( const string& disk,
1101  deque<PartitionInfo>& plist ) = 0;
1102 
1110  virtual int getLvmLvInfo( const string& name,
1111  deque<LvmLvInfo>& plist ) = 0;
1112 
1119  virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
1120 
1128  virtual int getMdPartInfo( const string& device,
1129  deque<MdPartInfo>& plist ) = 0;
1130 
1137  virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
1138 
1145  virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
1146 
1153  virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
1154 
1161  virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0;
1162 
1169  virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0;
1170 
1178  virtual int getDmraidInfo( const string& name,
1179  deque<DmraidInfo>& plist ) = 0;
1180 
1188  virtual int getDmmultipathInfo( const string& name,
1189  deque<DmmultipathInfo>& plist ) = 0;
1190 
1194  virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
1195 
1199  virtual bool getDlabelCapabilities(const string& dlabel,
1200  DlabelCapabilities& dlabelcapabilities) const = 0;
1201 
1205  virtual list<string> getAllUsedFs() const = 0;
1206 
1219  virtual int createPartition( const string& disk, PartitionType type,
1220  unsigned long startCyl,
1221  unsigned long sizeCyl,
1222  string& SWIG_OUTPUT(device) ) = 0;
1223 
1232  virtual int resizePartition( const string& device,
1233  unsigned long sizeCyl ) = 0;
1234 
1243  virtual int resizePartitionNoFs( const string& device,
1244  unsigned long sizeCyl ) = 0;
1245 
1256  virtual int updatePartitionArea( const string& device,
1257  unsigned long startCyl,
1258  unsigned long sizeCyl ) = 0;
1259 
1268  virtual int freeCylindersAroundPartition(const string& device,
1269  unsigned long& SWIG_OUTPUT(freeCylsBefore),
1270  unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0;
1271 
1281  virtual int nextFreePartition( const string& disk, PartitionType type,
1282  unsigned & SWIG_OUTPUT(nr),
1283  string& SWIG_OUTPUT(device) ) = 0;
1284 
1297  virtual int createPartitionKb( const string& disk, PartitionType type,
1298  unsigned long long startK,
1299  unsigned long long sizeK,
1300  string& SWIG_OUTPUT(device) ) = 0;
1301 
1312  virtual int createPartitionAny( const string& disk,
1313  unsigned long long sizeK,
1314  string& SWIG_OUTPUT(device) ) = 0;
1315 
1326  virtual int createPartitionMax( const string& disk, PartitionType type,
1327  string& SWIG_OUTPUT(device) ) = 0;
1328 
1336  virtual unsigned long long cylinderToKb( const string& disk,
1337  unsigned long sizeCyl) = 0;
1338 
1346  virtual unsigned long kbToCylinder( const string& disk,
1347  unsigned long long sizeK) = 0;
1348 
1355  virtual int removePartition (const string& partition) = 0;
1356 
1364  virtual int changePartitionId (const string& partition, unsigned id) = 0;
1365 
1372  virtual int forgetChangePartitionId (const string& partition ) = 0;
1373 
1381  virtual string getPartitionPrefix(const string& disk) = 0;
1382 
1391  virtual string getPartitionName(const string& disk, int partition_no) = 0;
1392 
1400  virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0;
1401 
1410  virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
1411 
1422  virtual int initializeDisk( const string& disk, bool value ) = 0;
1423 
1432  virtual string defaultDiskLabel(const string& device) = 0;
1433 
1442  virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
1443 
1451  virtual int changeLabelVolume( const string& device, const string& label ) = 0;
1452 
1460  virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
1461 
1469  virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0;
1470 
1479  virtual int changeMountPoint( const string& device, const string& mount ) = 0;
1480 
1488  virtual int getMountPoint( const string& device,
1489  string& SWIG_OUTPUT(mount) ) = 0;
1490 
1498  virtual int changeMountBy( const string& device, MountByType mby ) = 0;
1499 
1507  virtual int getMountBy( const string& device,
1508  MountByType& SWIG_OUTPUT(mby) ) = 0;
1509 
1519  virtual int changeFstabOptions( const string& device, const string& options ) = 0;
1520 
1529  virtual int getFstabOptions( const string& device,
1530  string& SWIG_OUTPUT(options) ) = 0;
1531 
1532 
1541  virtual int addFstabOptions( const string& device, const string& options ) = 0;
1542 
1552  virtual int removeFstabOptions( const string& device, const string& options ) = 0;
1553 
1561  virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
1562 
1569  virtual int forgetCryptPassword( const string& device ) = 0;
1570 
1578  virtual int getCryptPassword( const string& device,
1579  string& SWIG_OUTPUT(pwd) ) = 0;
1580 
1589  virtual int verifyCryptPassword( const string& device,
1590  const string& pwd, bool erase ) = 0;
1591 
1598  virtual bool needCryptPassword( const string& device ) = 0;
1599 
1607  virtual int setCrypt( const string& device, bool val ) = 0;
1608 
1617  virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
1618 
1626  virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1627 
1637  virtual int setIgnoreFstab( const string& device, bool val ) = 0;
1638 
1646  virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1647 
1657  virtual int changeDescText( const string& device, const string& txt ) = 0;
1658 
1673  virtual int addFstabEntry( const string& device, const string& mount,
1674  const string& vfs, const string& options,
1675  unsigned freq, unsigned passno ) = 0;
1676 
1677 
1685  virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0;
1686 
1694  virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0;
1695 
1702  virtual int forgetResizeVolume( const string& device ) = 0;
1703 
1718  virtual void setRecursiveRemoval( bool val ) = 0;
1719 
1725  virtual bool getRecursiveRemoval() const = 0;
1726 
1736  virtual int getRecursiveUsing(const list<string>& devices, bool itself,
1737  list<string>& using_devices) = 0;
1738 
1748  virtual int getRecursiveUsedBy(const list<string>& devices, bool itself,
1749  list<string>& usedby_devices) = 0;
1750 
1764  virtual void setZeroNewPartitions( bool val ) = 0;
1765 
1771  virtual bool getZeroNewPartitions() const = 0;
1772 
1784  virtual void setPartitionAlignment( PartAlign val ) = 0;
1785 
1791  virtual PartAlign getPartitionAlignment() const = 0;
1792 
1798  virtual void setDefaultMountBy( MountByType val ) = 0;
1799 
1805  virtual MountByType getDefaultMountBy() const = 0;
1806 
1812  virtual void setDefaultFs(FsType val) = 0;
1813 
1819  virtual FsType getDefaultFs() const = 0;
1820 
1826  virtual void setDefaultSubvolName( const string& val) = 0;
1827 
1833  virtual string getDefaultSubvolName() const = 0;
1834 
1840  virtual bool getEfiBoot() = 0;
1841 
1852  virtual void setRootPrefix( const string& root ) = 0;
1853 
1859  virtual string getRootPrefix() const = 0;
1860 
1866  virtual void setDetectMountedVolumes( bool val ) = 0;
1867 
1873  virtual bool getDetectMountedVolumes() const = 0;
1874 
1882  virtual int removeVolume( const string& device ) = 0;
1883 
1894  virtual int createLvmVg( const string& name,
1895  unsigned long long peSizeK, bool lvm1,
1896  const deque<string>& devs ) = 0;
1897 
1905  virtual int removeLvmVg( const string& name ) = 0;
1906 
1914  virtual int extendLvmVg( const string& name,
1915  const deque<string>& devs ) = 0;
1916 
1924  virtual int shrinkLvmVg( const string& name,
1925  const deque<string>& devs ) = 0;
1926 
1938  virtual int createLvmLv( const string& vg, const string& name,
1939  unsigned long long sizeK, unsigned stripes,
1940  string& SWIG_OUTPUT(device) ) = 0;
1941 
1948  virtual int removeLvmLvByDevice( const string& device ) = 0;
1949 
1957  virtual int removeLvmLv( const string& vg, const string& name ) = 0;
1958 
1968  virtual int changeLvStripeCount( const string& vg, const string& name,
1969  unsigned long stripes ) = 0;
1970 
1980  virtual int changeLvStripeSize( const string& vg, const string& name,
1981  unsigned long long stripeSizeK) = 0;
1982 
1993  virtual int createLvmLvSnapshot(const string& vg, const string& origin,
1994  const string& name, unsigned long long cowSizeK,
1995  string& SWIG_OUTPUT(device) ) = 0;
1996 
2004  virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0;
2005 
2016  virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name,
2017  LvmLvSnapshotStateInfo& info) = 0;
2018 
2028  virtual int createLvmLvPool(const string& vg, const string& name,
2029  unsigned long long sizeK,
2030  string& SWIG_OUTPUT(device) ) = 0;
2031 
2042  virtual int createLvmLvThin(const string& vg, const string& name,
2043  const string& pool,
2044  unsigned long long sizeK,
2045  string& SWIG_OUTPUT(device) ) = 0;
2046 
2056  virtual int changeLvChunkSize( const string& vg, const string& name,
2057  unsigned long long chunkSizeK) = 0;
2058 
2066  virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr),
2067  string& SWIG_OUTPUT(device)) = 0;
2068 
2078  virtual int createMd(const string& name, MdType md_type, const list<string>& devices,
2079  const list<string>& spares) = 0;
2080 
2090  virtual int createMdAny(MdType md_type, const list<string>& devices,
2091  const list<string>& spares,
2092  string& SWIG_OUTPUT(device) ) = 0;
2093 
2102  virtual int removeMd( const string& name, bool destroySb ) = 0;
2103 
2113  virtual int extendMd(const string& name, const list<string>& devices,
2114  const list<string>& spares) = 0;
2115 
2125  virtual int updateMd(const string& name, const list<string>& devices,
2126  const list<string>& spares) = 0;
2127 
2137  virtual int shrinkMd(const string& name, const list<string>& devices,
2138  const list<string>& spares) = 0;
2139 
2148  virtual int changeMdType(const string& name, MdType md_type) = 0;
2149 
2158  virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0;
2159 
2168  virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
2169 
2176  virtual int checkMd( const string& name ) = 0;
2177 
2187  virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0;
2188 
2198  virtual int getMdPartCoStateInfo(const string& name,
2199  MdPartCoStateInfo& info) = 0;
2200 
2213  virtual int computeMdSize(MdType md_type, const list<string>& devices,
2214  const list<string>& spares, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2215 
2223  virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0;
2224 
2235  virtual int removeMdPartCo(const string& name, bool destroySb ) = 0;
2236 
2247  virtual int addNfsDevice(const string& nfsDev, const string& opts,
2248  unsigned long long sizeK, const string& mp,
2249  bool nfs4) = 0;
2250 
2260  virtual int checkNfsDevice(const string& nfsDev, const string& opts,
2261  bool nfs4, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2262 
2279  virtual int createFileLoop( const string& lname, bool reuseExisting,
2280  unsigned long long sizeK,
2281  const string& mp, const string& pwd,
2282  string& SWIG_OUTPUT(device) ) = 0;
2283 
2301  virtual int modifyFileLoop( const string& device, const string& lname,
2302  bool reuseExisting,
2303  unsigned long long sizeK ) = 0;
2304 
2313  virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
2314 
2321  virtual int removeDmraid( const string& name ) = 0;
2322 
2330  virtual bool existSubvolume( const string& device, const string& name ) = 0;
2331 
2339  virtual int createSubvolume( const string& device, const string& name ) = 0;
2340 
2348  virtual int removeSubvolume( const string& device, const string& name ) = 0;
2349 
2358  virtual int extendBtrfsVolume( const string& name,
2359  const deque<string>& devs ) = 0;
2360 
2369  virtual int shrinkBtrfsVolume( const string& name,
2370  const deque<string>& devs ) = 0;
2371 
2379  virtual int addTmpfsMount( const string& mp, const string& opts ) = 0;
2380 
2387  virtual int removeTmpfsMount( const string& mp ) = 0;
2388 
2394  virtual void getCommitInfos(list<CommitInfo>& infos) const = 0;
2395 
2401  virtual const string& getLastAction() const = 0;
2402 
2409  virtual const string& getExtendedErrorMessage() const = 0;
2410 
2411 // temporarily disable callback function for swig
2412 #ifndef SWIG
2413 
2419  virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0;
2420 
2426  virtual CallbackProgressBar getCallbackProgressBar() const = 0;
2427 
2428 
2434  virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0;
2435 
2441  virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
2442 
2443 
2450  virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0;
2451 
2458  virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
2459 
2460 
2467  virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0;
2468 
2475  virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
2476 
2477 
2483  virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0;
2484 
2490  virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0;
2491 
2492 
2498  virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0;
2499 
2506  virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0;
2507 
2508 #endif
2509 
2515  virtual void setCacheChanges (bool cache) = 0;
2516 
2520  virtual bool isCacheChanges () const = 0;
2521 
2526  virtual int commit() = 0;
2527 
2531  virtual string getErrorString(int error) const = 0;
2532 
2539  virtual int createBackupState( const string& name ) = 0;
2540 
2547  virtual int restoreBackupState( const string& name ) = 0;
2548 
2555  virtual bool checkBackupState(const string& name) const = 0;
2556 
2565  virtual bool equalBackupStates(const string& lhs, const string& rhs,
2566  bool verbose_log) const = 0;
2567 
2575  virtual int removeBackupState( const string& name ) = 0;
2576 
2584  virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0;
2585 
2596  virtual bool umountDevice( const string& device ) = 0;
2597 
2610  virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0;
2611 
2622  virtual bool mountDevice( const string& device, const string& mp ) = 0;
2623 
2634  virtual int activateEncryption( const string& device, bool on ) = 0;
2635 
2647  virtual bool mountDeviceOpts( const string& device, const string& mp,
2648  const string& opts ) = 0;
2649 
2661  virtual bool mountDeviceRo( const string& device, const string& mp,
2662  const string& opts ) = 0;
2663 
2670  virtual bool checkDmMapsTo( const string& device ) = 0;
2671 
2677  virtual void removeDmTableTo( const string& device ) = 0;
2678 
2687  virtual int renameCryptDm( const string& device,
2688  const string& new_name ) = 0;
2689 
2701  virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info,
2702  bool get_content, ContentInfo& content_info, bool use_cache) = 0;
2703 
2711  virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
2712 
2722  virtual void activateHld( bool val ) = 0;
2723 
2732  virtual void activateMultipath( bool val ) = 0;
2733 
2742  virtual void rescanEverything() = 0;
2743 
2752  virtual bool rescanCryptedObjects() = 0;
2753 
2757  virtual void dumpObjectList() = 0;
2758 
2762  virtual void dumpCommitInfos() const = 0;
2763 
2773  virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0;
2774 
2775  };
2776 
2777 
2783  list<string> getPresentDisks();
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& logdr="/var/log/YaST2") : readonly(readonly), testmode(false), autodetect(true),
2829  instsys(false), logdir(logdr), testdir("tmp")
2830  {
2831  storage::initDefaultLogger( logdir );
2832  }
2833 
2834  bool readonly;
2835  bool testmode;
2836  bool autodetect;
2837  bool instsys;
2838  string logdir;
2839  string testdir;
2840  };
2841 
2842 
2848  StorageInterface* createStorageInterface(const Environment& env);
2849 
2850 
2858  StorageInterface* createStorageInterfacePid(const Environment& env, int& SWIG_OUTPUT(locker_pid));
2859 
2860 
2864  void destroyStorageInterface(StorageInterface*);
2865 
2866 }
2867 
2868 
2869 #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:602
virtual int resizePartition(const string &device, unsigned long sizeCyl)=0
Definition: StorageInterface.h:625
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 ImsmDriver getImsmDriver() const =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:271
virtual int createBackupState(const string &name)=0
virtual int checkMd(const string &name)=0
virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc)=0
Definition: StorageInterface.h:523
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:489
virtual int getContMdPartCoInfo(const string &name, ContainerInfo &cinfo, MdPartCoInfo &info)=0
Definition: StorageInterface.h:593
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:479
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:580
Definition: StorageInterface.h:544
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:402
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
Definition: StorageInterface.h:261
virtual int shrinkLvmVg(const string &name, const deque< string > &devs)=0
virtual int setIgnoreFstab(const string &device, bool val)=0
Definition: StorageInterface.h:323
virtual unsigned long kbToCylinder(const string &disk, unsigned long long sizeK)=0
Definition: StorageInterface.h:461
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 void setImsmDriver(ImsmDriver driver)=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:355
virtual int createPartition(const string &disk, PartitionType type, unsigned long startCyl, unsigned long sizeCyl, string &SWIG_OUTPUT(device))=0
Definition: StorageInterface.h:341
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
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:641
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 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:936
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:611
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:254
Definition: StorageInterface.h:503
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:512
Definition: StorageInterface.h:349
virtual void dumpObjectList()=0
virtual CallbackPasswordPopup getCallbackPasswordPopup() const =0
virtual void setCallbackProgressBar(CallbackProgressBar pfnc)=0
virtual bool rescanCryptedObjects()=0
Definition: StorageInterface.h:416
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:532
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:451
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:283
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:568
virtual unsigned long long cylinderToKb(const string &disk, unsigned long sizeCyl)=0
Definition: StorageInterface.h:559
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:432
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:366
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:300
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