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, ISO9660, UDF, 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  bool canFormat;
231  unsigned long long minimalFsSizeK;
232  };
233 
238  {
239  DlabelCapabilities() {}
240  unsigned maxPrimary;
241  bool extendedPossible;
242  unsigned maxLogical;
243  unsigned long long maxSectors;
244  };
245 
246 
247  struct UsedByInfo
248  {
249  UsedByInfo() : type(UB_NONE) {} // only for swig bindings
250  UsedByInfo(UsedByType type, const string& device) : type(type), device(device) {}
251  UsedByType type;
252  string device;
253  };
254 
255 
256  struct ResizeInfo
257  {
258  ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(false) {}
259  unsigned long long df_freeK;
260  unsigned long long resize_freeK;
261  unsigned long long usedK;
262  bool resize_ok;
263  };
264 
265 
266  struct ContentInfo
267  {
268  ContentInfo() : windows(false), efi(false), homes(0) {}
269  bool windows;
270  bool efi;
271  unsigned homes;
272  };
273 
274 
275  struct DeviceInfo
276  {
277  DeviceInfo() {}
278 
279  string device;
280  string name;
281 
282  string udevPath;
283  list<string> udevId;
284 
285  list<UsedByInfo> usedBy;
286 
287  map<string, string> userdata;
288  };
289 
290 
294  struct ContainerInfo : public DeviceInfo
295  {
296  ContainerInfo() {}
297  CType type;
298  bool readonly;
299  };
300 
304  struct DiskInfo
305  {
306  DiskInfo() {}
307  unsigned long long sizeK;
308  unsigned long long cylSize;
309  unsigned long cyl;
310  unsigned long heads;
311  unsigned long sectors;
312  unsigned int sectorSize;
313  string disklabel;
314  string orig_disklabel;
315  unsigned maxPrimary;
316  bool extendedPossible;
317  unsigned maxLogical;
318  bool initDisk;
319  Transport transport;
320  bool has_fake_partition;
321  };
322 
326  struct LvmVgInfo
327  {
328  LvmVgInfo() {}
329  unsigned long long sizeK;
330  unsigned long long peSizeK;
331  unsigned long peCount;
332  unsigned long peFree;
333  string uuid;
334  bool lvm2;
335  bool create;
336  list<string> devices;
337  list<string> devices_add;
338  list<string> devices_rem;
339  };
340 
345  {
346  DmPartCoInfo() {}
347  DiskInfo d;
348  list<string> devices;
349  unsigned long minor;
350  };
351 
353  {
354  DmraidCoInfo() {}
355  DmPartCoInfo p;
356  };
357 
359  {
360  DmmultipathCoInfo() {}
361  DmPartCoInfo p;
362  string vendor;
363  string model;
364  };
365 
369  struct VolumeInfo : public DeviceInfo
370  {
371  VolumeInfo() {}
372  unsigned long long sizeK;
373  unsigned long major;
374  unsigned long minor;
375  string mount;
376  string crypt_device;
377  MountByType mount_by;
378  bool ignore_fstab;
379  string fstab_options;
380  string uuid;
381  string label;
382  string mkfs_options;
383  string tunefs_options;
384  string loop;
385  string dtxt;
386  EncryptType encryption;
387  string crypt_pwd;
388  FsType fs;
389  FsType detected_fs;
390  bool format;
391  bool create;
392  bool is_mounted;
393  bool resize;
394  bool ignore_fs;
395  unsigned long long origSizeK;
396  };
397 
401  struct RegionInfo
402  {
403  RegionInfo() : start(0), len(0) {}
404  RegionInfo(unsigned long long start, unsigned long long len) : start(start), len(len) {}
405  unsigned long long start;
406  unsigned long long len;
407  };
408 
410  {
411  PartitionAddInfo() {}
412  unsigned nr;
413  RegionInfo cylRegion;
414  PartitionType partitionType;
415  unsigned id;
416  bool boot;
417  };
418 
423  {
424  PartitionInfo() {}
425  PartitionInfo& operator=( const PartitionAddInfo& rhs );
426  VolumeInfo v;
427  unsigned nr;
428  RegionInfo cylRegion;
429  PartitionType partitionType;
430  unsigned id;
431  bool boot;
432  };
433 
437  struct LvmLvInfo
438  {
439  LvmLvInfo() {}
440  VolumeInfo v;
441  unsigned stripes;
442  unsigned stripeSizeK;
443  string uuid;
444  string status;
445  string dm_table;
446  string dm_target;
447  string origin;
448  string used_pool;
449  bool pool;
450  };
451 
456  {
458  bool active;
459  double allocated;
460  };
461 
465  struct MdInfo
466  {
467  MdInfo() {}
468  VolumeInfo v;
469  unsigned nr;
470  unsigned type;
471  unsigned parity;
472  string uuid;
473  string sb_ver;
474  unsigned long chunkSizeK;
475  list<string> devices;
476  list<string> spares;
477  bool inactive;
478  };
479 
483  struct MdStateInfo
484  {
485  MdStateInfo() {}
486  MdArrayState state;
487  };
488 
494  {
495  MdPartCoInfo() {}
496  DiskInfo d;
497  unsigned type; // RAID level
498  unsigned nr; // MD device number
499  unsigned parity; // Parity (not for all RAID level)
500  string uuid; // MD Device UUID
501  string sb_ver; // Metadata version
502  unsigned long chunkSizeK; // Chunksize (strip size)
503  list<string> devices;
504  list<string> spares;
505  };
506 
508  {
509  MdPartCoStateInfo() {}
510  MdArrayState state;
511  };
512 
516  struct MdPartInfo
517  {
518  MdPartInfo() {}
519  VolumeInfo v;
521  bool part;
522  };
523 
527  struct NfsInfo
528  {
529  NfsInfo() {}
530  VolumeInfo v;
531  };
532 
536  struct LoopInfo
537  {
538  LoopInfo() {}
539  VolumeInfo v;
540  bool reuseFile;
541  unsigned nr;
542  string file;
543  };
544 
548  struct BtrfsInfo
549  {
550  BtrfsInfo() {}
551  VolumeInfo v;
552  list<string> devices;
553  list<string> devices_add;
554  list<string> devices_rem;
555  list<string> subvol;
556  list<string> subvol_add;
557  list<string> subvol_rem;
558  };
559 
563  struct TmpfsInfo
564  {
565  TmpfsInfo() {}
566  VolumeInfo v;
567  };
568 
572  struct DmInfo
573  {
574  DmInfo() {}
575  VolumeInfo v;
576  unsigned nr;
577  string table;
578  string target;
579  };
580 
584  struct DmPartInfo
585  {
586  DmPartInfo() {}
587  VolumeInfo v;
589  bool part;
590  string table;
591  string target;
592  };
593 
597  struct DmraidInfo
598  {
599  DmraidInfo() {}
600  DmPartInfo p;
601  };
602 
607  {
608  DmmultipathInfo() {}
609  DmPartInfo p;
610  };
611 
615  struct ContVolInfo
616  {
617  ContVolInfo() : ctype(CUNKNOWN), num(-1) {}
618  CType ctype;
619  string cname;
620  string cdevice;
621  string vname;
622  string vdevice;
623  int num;
624  };
625 
630  {
631  PartitionSlotInfo() {}
632  RegionInfo cylRegion;
633  unsigned nr;
634  string device;
635  bool primarySlot;
636  bool primaryPossible;
637  bool extendedSlot;
638  bool extendedPossible;
639  bool logicalSlot;
640  bool logicalPossible;
641  };
642 
646  struct CommitInfo
647  {
648  CommitInfo() {}
649  bool destructive;
650  string text;
651  };
652 
653 
657  enum ErrorCodes
658  {
659  STORAGE_NO_ERROR = 0,
660 
661  DISK_PARTITION_OVERLAPS_EXISTING = -1000,
662  DISK_PARTITION_EXCEEDS_DISK = -1001,
663  DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
664  DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
665  DISK_PARTITION_NO_FREE_NUMBER = -1004,
666  DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
667  DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
668  DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
669  DISK_PARTITION_NOT_FOUND = -1008,
670  DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
671  DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
672  DISK_SET_TYPE_INVALID_VOLUME = -1011,
673  DISK_SET_TYPE_PARTED_FAILED = -1012,
674  DISK_SET_LABEL_PARTED_FAILED = -1013,
675  DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
676  DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
677  DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
678  DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
679  DISK_PARTITION_ZERO_SIZE = -1018,
680  DISK_CHANGE_READONLY = -1019,
681  DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
682  DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
683  DISK_RESIZE_NO_SPACE = -1022,
684  DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
685  DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
686  DISK_COMMIT_NOTHING_TODO = -1025,
687  DISK_CREATE_PARTITION_NO_SPACE = -1026,
688  DISK_REMOVE_USED_BY = -1027,
689  DISK_INIT_NOT_POSSIBLE = -1028,
690  DISK_INVALID_PARTITION_ID = -1029,
691 
692  STORAGE_DISK_NOT_FOUND = -2000,
693  STORAGE_VOLUME_NOT_FOUND = -2001,
694  STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
695  STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
696  STORAGE_CHANGE_READONLY = -2004,
697  STORAGE_DISK_USED_BY = -2005,
698  STORAGE_LVM_VG_EXISTS = -2006,
699  STORAGE_LVM_VG_NOT_FOUND = -2007,
700  STORAGE_LVM_INVALID_DEVICE = -2008,
701  STORAGE_CONTAINER_NOT_FOUND = -2009,
702  STORAGE_VG_INVALID_NAME = -2010,
703  STORAGE_REMOVE_USED_VOLUME = -2011,
704  STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
705  STORAGE_NOT_YET_IMPLEMENTED = -2013,
706  STORAGE_MD_INVALID_NAME = -2014,
707  STORAGE_MD_NOT_FOUND = -2015,
708  STORAGE_MEMORY_EXHAUSTED = -2016,
709  STORAGE_LOOP_NOT_FOUND = -2017,
710  STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
711  STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
712  STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
713  STORAGE_INVALID_FSTAB_VALUE = -2025,
714  STORAGE_NO_FSTAB_PTR = -2026,
715  STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
716  STORAGE_DMRAID_CO_NOT_FOUND = -2028,
717  STORAGE_RESIZE_INVALID_CONTAINER = -2029,
718  STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030,
719  STORAGE_ZERO_DEVICE_FAILED = -2031,
720  STORAGE_INVALID_BACKUP_STATE_NAME = -2032,
721  STORAGE_MDPART_CO_NOT_FOUND = -2033,
722  STORAGE_DEVICE_NOT_FOUND = -2034,
723  STORAGE_BTRFS_CO_NOT_FOUND = -2035,
724  STORAGE_TMPFS_CO_NOT_FOUND = -2036,
725  STORAGE_VOLUME_NOT_ENCRYPTED = -2037,
726  STORAGE_DM_RENAME_FAILED = -2038,
727 
728  VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
729  VOLUME_FSTAB_EMPTY_MOUNT = -3001,
730  VOLUME_UMOUNT_FAILED = -3002,
731  VOLUME_MOUNT_FAILED = -3003,
732  VOLUME_FORMAT_UNKNOWN_FS = -3005,
733  VOLUME_FORMAT_FS_UNDETECTED = -3006,
734  VOLUME_FORMAT_FS_TOO_SMALL = -3007,
735  VOLUME_FORMAT_FAILED = -3008,
736  VOLUME_TUNE2FS_FAILED = -3009,
737  VOLUME_MKLABEL_FS_UNABLE = -3010,
738  VOLUME_MKLABEL_FAILED = -3011,
739  VOLUME_LOSETUP_NO_LOOP = -3012,
740  VOLUME_LOSETUP_FAILED = -3013,
741  VOLUME_CRYPT_NO_PWD = -3014,
742  VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
743  VOLUME_CRYPT_NOT_DETECTED = -3016,
744  VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
745  VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
746  VOLUME_MOUNT_POINT_INVALID = -3019,
747  VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
748  VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
749  VOLUME_LABEL_NOT_SUPPORTED = -3022,
750  VOLUME_LABEL_TOO_LONG = -3023,
751  VOLUME_LABEL_WHILE_MOUNTED = -3024,
752  VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
753  VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
754  VOLUME_RESIZE_FAILED = -3027,
755  VOLUME_ALREADY_IN_USE = -3028,
756  VOLUME_LOUNSETUP_FAILED = -3029,
757  VOLUME_DEVICE_NOT_PRESENT = -3030,
758  VOLUME_DEVICE_NOT_BLOCK = -3031,
759  VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
760  VOLUME_CRYPTFORMAT_FAILED = -3033,
761  VOLUME_CRYPTSETUP_FAILED = -3034,
762  VOLUME_CRYPTUNSETUP_FAILED = -3035,
763  VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
764  VOLUME_FORMAT_IMPOSSIBLE = -3037,
765  VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
766  VOLUME_REMOUNT_FAILED = -3039,
767  VOLUME_TUNEREISERFS_FAILED = -3040,
768  VOLUME_UMOUNT_NOT_MOUNTED = -3041,
769  VOLUME_BTRFS_ADD_FAILED = -3042,
770  VOLUME_CANNOT_TMP_MOUNT = -3043,
771  VOLUME_CANNOT_TMP_UMOUNT = -3044,
772  VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045,
773  VOLUME_BTRFS_SUBVOL_SETDEFAULT = -3046,
774 
775  LVM_CREATE_PV_FAILED = -4000,
776  LVM_PV_ALREADY_CONTAINED = -4001,
777  LVM_PV_DEVICE_UNKNOWN = -4002,
778  LVM_PV_DEVICE_USED = -4003,
779  LVM_VG_HAS_NONE_PV = -4004,
780  LVM_LV_INVALID_NAME = -4005,
781  LVM_LV_DUPLICATE_NAME = -4006,
782  LVM_LV_NO_SPACE = -4007,
783  LVM_LV_UNKNOWN_NAME = -4008,
784  LVM_LV_NOT_IN_LIST = -4009,
785  LVM_VG_CREATE_FAILED = -4010,
786  LVM_VG_EXTEND_FAILED = -4011,
787  LVM_VG_REDUCE_FAILED = -4012,
788  LVM_VG_REMOVE_FAILED = -4013,
789  LVM_LV_CREATE_FAILED = -4014,
790  LVM_LV_REMOVE_FAILED = -4015,
791  LVM_LV_RESIZE_FAILED = -4016,
792  LVM_PV_STILL_ADDED = -4017,
793  LVM_PV_REMOVE_NOT_FOUND = -4018,
794  LVM_CREATE_LV_INVALID_VOLUME = -4019,
795  LVM_REMOVE_LV_INVALID_VOLUME = -4020,
796  LVM_RESIZE_LV_INVALID_VOLUME = -4021,
797  LVM_CHANGE_READONLY = -4022,
798  LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
799  LVM_COMMIT_NOTHING_TODO = -4024,
800  LVM_LV_REMOVE_USED_BY = -4025,
801  LVM_LV_ALREADY_ON_DISK = -4026,
802  LVM_LV_NO_STRIPE_SIZE = -4027,
803  LVM_LV_UNKNOWN_ORIGIN = -4028,
804  LVM_LV_NOT_ON_DISK = -4029,
805  LVM_LV_NOT_SNAPSHOT = -4030,
806  LVM_LV_HAS_SNAPSHOTS = -4031,
807  LVM_LV_IS_SNAPSHOT = -4032,
808  LVM_LIST_EMPTY = -4033,
809  LVM_LV_NO_POOL_OR_SNAP = -4034,
810  LVM_LV_NO_POOL = -4035,
811  LVM_LV_UNKNOWN_POOL = -4036,
812  LVM_LV_INVALID_CHUNK_SIZE = -4037,
813  LVM_LV_POOL_NO_FORMAT = -4038,
814  LVM_LV_POOL_NO_MOUNT = -4039,
815 
816  FSTAB_ENTRY_NOT_FOUND = -5000,
817  FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
818  FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
819  FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
820  FSTAB_ADD_ENTRY_FOUND = -5004,
821 
822  MD_CHANGE_READONLY = -6000,
823  MD_DUPLICATE_NUMBER = -6001,
824  MD_TOO_FEW_DEVICES = -6002,
825  MD_DEVICE_UNKNOWN = -6003,
826  MD_DEVICE_USED = -6004,
827  MD_CREATE_INVALID_VOLUME = -6005,
828  MD_REMOVE_FAILED = -6006,
829  MD_NOT_IN_LIST = -6007,
830  MD_CREATE_FAILED = -6008,
831  MD_UNKNOWN_NUMBER = -6009,
832  MD_REMOVE_USED_BY = -6010,
833  MD_NUMBER_TOO_LARGE = -6011,
834  MD_REMOVE_INVALID_VOLUME = -6012,
835  MD_REMOVE_CREATE_NOT_FOUND = -6013,
836  MD_NO_RESIZE_ON_DISK = -6014,
837  MD_ADD_DUPLICATE = -6015,
838  MD_REMOVE_NONEXISTENT = -6016,
839  MD_NO_CHANGE_ON_DISK = -6017,
840  MD_NO_CREATE_UNKNOWN = -6018,
841  MD_STATE_NOT_ON_DISK = -6019,
842  MD_PARTITION_NOT_FOUND = -6020,
843  MD_INVALID_PARITY = -6021,
844  MD_TOO_MANY_SPARES = -6022,
845  MD_GET_STATE_FAILED = -6023,
846  MD_DUPLICATE_NAME = -6024,
847 
848  MDPART_CHANGE_READONLY = -6100,
849  MDPART_INTERNAL_ERR = -6101,
850  MDPART_INVALID_VOLUME = -6012,
851  MDPART_PARTITION_NOT_FOUND = -6103,
852  MDPART_REMOVE_PARTITION_LIST_ERASE = -6104,
853  MDPART_COMMIT_NOTHING_TODO = -6105,
854  MDPART_NO_REMOVE = -6106,
855  MDPART_DEVICE_NOT_FOUND = -6107,
856 
857  LOOP_CHANGE_READONLY = -7000,
858  LOOP_DUPLICATE_FILE = -7001,
859  LOOP_UNKNOWN_FILE = -7002,
860  LOOP_REMOVE_USED_BY = -7003,
861  LOOP_FILE_CREATE_FAILED = -7004,
862  LOOP_CREATE_INVALID_VOLUME = -7005,
863  LOOP_REMOVE_FILE_FAILED = -7006,
864  LOOP_REMOVE_INVALID_VOLUME = -7007,
865  LOOP_NOT_IN_LIST = -7008,
866  LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
867  LOOP_MODIFY_EXISTING = -7010,
868 
869  PEC_PE_SIZE_INVALID = -9000,
870  PEC_PV_NOT_FOUND = -9001,
871  PEC_REMOVE_PV_IN_USE = -9002,
872  PEC_REMOVE_PV_SIZE_NEEDED = -9003,
873  PEC_LV_NO_SPACE_STRIPED = -9004,
874  PEC_LV_NO_SPACE_SINGLE = -9005,
875  PEC_LV_PE_DEV_NOT_FOUND = -9006,
876 
877  DM_CHANGE_READONLY = -10000,
878  DM_UNKNOWN_TABLE = -10001,
879  DM_REMOVE_USED_BY = -10002,
880  DM_REMOVE_CREATE_NOT_FOUND = -10003,
881  DM_REMOVE_INVALID_VOLUME = -10004,
882  DM_REMOVE_FAILED = -10005,
883  DM_NOT_IN_LIST = -10006,
884 
885  DASD_NOT_POSSIBLE = -11000,
886  DASD_DASDFMT_FAILED = -11002,
887 
888  DMPART_CHANGE_READONLY = -12001,
889  DMPART_INTERNAL_ERR = -12002,
890  DMPART_INVALID_VOLUME = -12003,
891  DMPART_PARTITION_NOT_FOUND = -12004,
892  DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
893  DMPART_COMMIT_NOTHING_TODO = -12006,
894  DMPART_NO_REMOVE = -12007,
895 
896  DMRAID_REMOVE_FAILED = -13001,
897 
898  NFS_VOLUME_NOT_FOUND = -14001,
899  NFS_CHANGE_READONLY = -14002,
900  NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
901  NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
902  NFS_REMOVE_INVALID_VOLUME = -14005,
903 
904  BTRFS_COMMIT_INVALID_VOLUME = -15001,
905  BTRFS_CANNOT_TMP_MOUNT = -15002,
906  BTRFS_CANNOT_TMP_UMOUNT = -15003,
907  BTRFS_DELETE_SUBVOL_FAIL = -15004,
908  BTRFS_CREATE_SUBVOL_FAIL = -15005,
909  BTRFS_VOLUME_NOT_FOUND = -15006,
910  BTRFS_SUBVOL_EXISTS = -15007,
911  BTRFS_SUBVOL_NON_EXISTS = -15008,
912  BTRFS_REMOVE_NOT_FOUND = -15009,
913  BTRFS_REMOVE_NO_BTRFS = -15010,
914  BTRFS_REMOVE_INVALID_VOLUME = -15011,
915  BTRFS_CHANGE_READONLY = -15012,
916  BTRFS_DEV_ALREADY_CONTAINED = -15013,
917  BTRFS_DEVICE_UNKNOWN = -15014,
918  BTRFS_DEVICE_USED = -15015,
919  BTRFS_HAS_NONE_DEV = -15016,
920  BTRFS_DEV_NOT_FOUND = -15017,
921  BTRFS_EXTEND_FAIL = -15018,
922  BTRFS_REDUCE_FAIL = -15019,
923  BTRFS_LIST_EMPTY = -15020,
924  BTRFS_RESIZE_INVALID_VOLUME = -15021,
925  BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022,
926 
927  TMPFS_REMOVE_INVALID_VOLUME = -16001,
928  TMPFS_REMOVE_NO_TMPFS = -16002,
929  TMPFS_REMOVE_NOT_FOUND = -16003,
930 
931  CONTAINER_INTERNAL_ERROR = -99000,
932  CONTAINER_INVALID_VIRTUAL_CALL = -99001,
933 
934  };
935 
936 
941  {
942  public:
943 
944  StorageInterface () {}
945  virtual ~StorageInterface () {}
946 
950  virtual void getContainers( deque<ContainerInfo>& infos) = 0;
951 
959  virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
960 
969  virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
970  DiskInfo& info ) = 0;
971 
979  virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
980 
989  virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
990  LvmVgInfo& info) = 0;
991 
999  virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
1000 
1009  virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
1010  DmraidCoInfo& info) = 0;
1011 
1019  virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0;
1020 
1029  virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
1030  DmmultipathCoInfo& info) = 0;
1031 
1039  virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0;
1040 
1041 
1050  virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
1051  MdPartCoInfo& info) = 0;
1052 
1058  virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0;
1059 
1065  virtual MultipathAutostart getMultipathAutostart() const = 0;
1066 
1072  virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
1073 
1081  virtual int getVolume( const string& device, VolumeInfo& info) = 0;
1082 
1090  virtual int getPartitionInfo( const string& disk,
1091  deque<PartitionInfo>& plist ) = 0;
1092 
1100  virtual int getLvmLvInfo( const string& name,
1101  deque<LvmLvInfo>& plist ) = 0;
1102 
1109  virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
1110 
1118  virtual int getMdPartInfo( const string& device,
1119  deque<MdPartInfo>& plist ) = 0;
1120 
1127  virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
1128 
1135  virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
1136 
1143  virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
1144 
1151  virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0;
1152 
1159  virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0;
1160 
1168  virtual int getDmraidInfo( const string& name,
1169  deque<DmraidInfo>& plist ) = 0;
1170 
1178  virtual int getDmmultipathInfo( const string& name,
1179  deque<DmmultipathInfo>& plist ) = 0;
1180 
1184  virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
1185 
1189  virtual bool getDlabelCapabilities(const string& dlabel,
1190  DlabelCapabilities& dlabelcapabilities) const = 0;
1191 
1195  virtual list<string> getAllUsedFs() const = 0;
1196 
1208  virtual int createPartition(const string& disk, PartitionType type,
1209  const RegionInfo& cylRegion,
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 
1243  virtual int updatePartitionArea(const string& device, const RegionInfo& cylRegion) = 0;
1244 
1253  virtual int freeCylindersAroundPartition(const string& device,
1254  unsigned long& SWIG_OUTPUT(freeCylsBefore),
1255  unsigned long& SWIG_OUTPUT(freeCylsAfter)) = 0;
1256 
1270  virtual int nextFreePartition( const string& disk, PartitionType type,
1271  unsigned & SWIG_OUTPUT(nr),
1272  string& SWIG_OUTPUT(device) ) = 0;
1273 
1285  virtual int createPartitionKb(const string& disk, PartitionType type,
1286  const RegionInfo& kRegion,
1287  string& SWIG_OUTPUT(device)) = 0;
1288 
1299  virtual int createPartitionAny( const string& disk,
1300  unsigned long long sizeK,
1301  string& SWIG_OUTPUT(device) ) = 0;
1302 
1313  virtual int createPartitionMax( const string& disk, PartitionType type,
1314  string& SWIG_OUTPUT(device) ) = 0;
1315 
1323  virtual unsigned long long cylinderToKb( const string& disk,
1324  unsigned long sizeCyl) = 0;
1325 
1333  virtual unsigned long kbToCylinder( const string& disk,
1334  unsigned long long sizeK) = 0;
1335 
1342  virtual int removePartition (const string& partition) = 0;
1343 
1351  virtual int changePartitionId (const string& partition, unsigned id) = 0;
1352 
1359  virtual int forgetChangePartitionId (const string& partition ) = 0;
1360 
1368  virtual string getPartitionPrefix(const string& disk) = 0;
1369 
1378  virtual string getPartitionName(const string& disk, int partition_no) = 0;
1379 
1390  virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0;
1391 
1400  virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
1401 
1412  virtual int initializeDisk( const string& disk, bool value ) = 0;
1413 
1422  virtual string defaultDiskLabel(const string& device) = 0;
1423 
1432  virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
1433 
1441  virtual int changeLabelVolume( const string& device, const string& label ) = 0;
1442 
1450  virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
1451 
1459  virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0;
1460 
1469  virtual int changeMountPoint( const string& device, const string& mount ) = 0;
1470 
1478  virtual int getMountPoint( const string& device,
1479  string& SWIG_OUTPUT(mount) ) = 0;
1480 
1488  virtual int changeMountBy( const string& device, MountByType mby ) = 0;
1489 
1497  virtual int getMountBy( const string& device,
1498  MountByType& SWIG_OUTPUT(mby) ) = 0;
1499 
1509  virtual int changeFstabOptions( const string& device, const string& options ) = 0;
1510 
1519  virtual int getFstabOptions( const string& device,
1520  string& SWIG_OUTPUT(options) ) = 0;
1521 
1522 
1531  virtual int addFstabOptions( const string& device, const string& options ) = 0;
1532 
1542  virtual int removeFstabOptions( const string& device, const string& options ) = 0;
1543 
1551  virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
1552 
1559  virtual int forgetCryptPassword( const string& device ) = 0;
1560 
1568  virtual int getCryptPassword( const string& device,
1569  string& SWIG_OUTPUT(pwd) ) = 0;
1570 
1579  virtual int verifyCryptPassword( const string& device,
1580  const string& pwd, bool erase ) = 0;
1581 
1588  virtual bool needCryptPassword( const string& device ) = 0;
1589 
1597  virtual int setCrypt( const string& device, bool val ) = 0;
1598 
1607  virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
1608 
1616  virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1617 
1627  virtual int setIgnoreFstab( const string& device, bool val ) = 0;
1628 
1636  virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1637 
1647  virtual int changeDescText( const string& device, const string& txt ) = 0;
1648 
1663  virtual int addFstabEntry( const string& device, const string& mount,
1664  const string& vfs, const string& options,
1665  unsigned freq, unsigned passno ) = 0;
1666 
1667 
1675  virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0;
1676 
1684  virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0;
1685 
1692  virtual int forgetResizeVolume( const string& device ) = 0;
1693 
1708  virtual void setRecursiveRemoval( bool val ) = 0;
1709 
1715  virtual bool getRecursiveRemoval() const = 0;
1716 
1726  virtual int getRecursiveUsing(const list<string>& devices, bool itself,
1727  list<string>& using_devices) = 0;
1728 
1738  virtual int getRecursiveUsedBy(const list<string>& devices, bool itself,
1739  list<string>& usedby_devices) = 0;
1740 
1754  virtual void setZeroNewPartitions( bool val ) = 0;
1755 
1761  virtual bool getZeroNewPartitions() const = 0;
1762 
1774  virtual void setPartitionAlignment( PartAlign val ) = 0;
1775 
1781  virtual PartAlign getPartitionAlignment() const = 0;
1782 
1788  virtual void setDefaultMountBy( MountByType val ) = 0;
1789 
1795  virtual MountByType getDefaultMountBy() const = 0;
1796 
1802  virtual void setDefaultFs(FsType val) = 0;
1803 
1809  virtual FsType getDefaultFs() const = 0;
1810 
1816  virtual void setDefaultSubvolName( const string& val) = 0;
1817 
1823  virtual string getDefaultSubvolName() const = 0;
1824 
1830  virtual bool getEfiBoot() = 0;
1831 
1842  virtual void setRootPrefix( const string& root ) = 0;
1843 
1849  virtual string getRootPrefix() const = 0;
1850 
1856  virtual void setDetectMountedVolumes( bool val ) = 0;
1857 
1863  virtual bool getDetectMountedVolumes() const = 0;
1864 
1872  virtual int removeVolume( const string& device ) = 0;
1873 
1884  virtual int createLvmVg( const string& name,
1885  unsigned long long peSizeK, bool lvm1,
1886  const deque<string>& devs ) = 0;
1887 
1895  virtual int removeLvmVg( const string& name ) = 0;
1896 
1904  virtual int extendLvmVg( const string& name,
1905  const deque<string>& devs ) = 0;
1906 
1914  virtual int shrinkLvmVg( const string& name,
1915  const deque<string>& devs ) = 0;
1916 
1928  virtual int createLvmLv( const string& vg, const string& name,
1929  unsigned long long sizeK, unsigned stripes,
1930  string& SWIG_OUTPUT(device) ) = 0;
1931 
1938  virtual int removeLvmLvByDevice( const string& device ) = 0;
1939 
1947  virtual int removeLvmLv( const string& vg, const string& name ) = 0;
1948 
1958  virtual int changeLvStripeCount( const string& vg, const string& name,
1959  unsigned long stripes ) = 0;
1960 
1970  virtual int changeLvStripeSize( const string& vg, const string& name,
1971  unsigned long long stripeSizeK) = 0;
1972 
1983  virtual int createLvmLvSnapshot(const string& vg, const string& origin,
1984  const string& name, unsigned long long cowSizeK,
1985  string& SWIG_OUTPUT(device) ) = 0;
1986 
1994  virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0;
1995 
2006  virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name,
2007  LvmLvSnapshotStateInfo& info) = 0;
2008 
2018  virtual int createLvmLvPool(const string& vg, const string& name,
2019  unsigned long long sizeK,
2020  string& SWIG_OUTPUT(device) ) = 0;
2021 
2032  virtual int createLvmLvThin(const string& vg, const string& name,
2033  const string& pool,
2034  unsigned long long sizeK,
2035  string& SWIG_OUTPUT(device) ) = 0;
2036 
2046  virtual int changeLvChunkSize( const string& vg, const string& name,
2047  unsigned long long chunkSizeK) = 0;
2048 
2056  virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr),
2057  string& SWIG_OUTPUT(device)) = 0;
2058 
2068  virtual int createMd(const string& name, MdType md_type, const list<string>& devices,
2069  const list<string>& spares) = 0;
2070 
2080  virtual int createMdAny(MdType md_type, const list<string>& devices,
2081  const list<string>& spares,
2082  string& SWIG_OUTPUT(device) ) = 0;
2083 
2092  virtual int removeMd( const string& name, bool destroySb ) = 0;
2093 
2103  virtual int extendMd(const string& name, const list<string>& devices,
2104  const list<string>& spares) = 0;
2105 
2115  virtual int updateMd(const string& name, const list<string>& devices,
2116  const list<string>& spares) = 0;
2117 
2127  virtual int shrinkMd(const string& name, const list<string>& devices,
2128  const list<string>& spares) = 0;
2129 
2138  virtual int changeMdType(const string& name, MdType md_type) = 0;
2139 
2148  virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0;
2149 
2158  virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
2159 
2166  virtual int checkMd( const string& name ) = 0;
2167 
2177  virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0;
2178 
2188  virtual int getMdPartCoStateInfo(const string& name,
2189  MdPartCoStateInfo& info) = 0;
2190 
2203  virtual int computeMdSize(MdType md_type, const list<string>& devices,
2204  const list<string>& spares, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2205 
2213  virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0;
2214 
2225  virtual int removeMdPartCo(const string& name, bool destroySb ) = 0;
2226 
2237  virtual int addNfsDevice(const string& nfsDev, const string& opts,
2238  unsigned long long sizeK, const string& mp,
2239  bool nfs4) = 0;
2240 
2250  virtual int checkNfsDevice(const string& nfsDev, const string& opts,
2251  bool nfs4, unsigned long long& SWIG_OUTPUT(sizeK)) = 0;
2252 
2269  virtual int createFileLoop( const string& lname, bool reuseExisting,
2270  unsigned long long sizeK,
2271  const string& mp, const string& pwd,
2272  string& SWIG_OUTPUT(device) ) = 0;
2273 
2291  virtual int modifyFileLoop( const string& device, const string& lname,
2292  bool reuseExisting,
2293  unsigned long long sizeK ) = 0;
2294 
2303  virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
2304 
2311  virtual int removeDmraid( const string& name ) = 0;
2312 
2320  virtual bool existSubvolume( const string& device, const string& name ) = 0;
2321 
2329  virtual int createSubvolume( const string& device, const string& name ) = 0;
2330 
2338  virtual int removeSubvolume( const string& device, const string& name ) = 0;
2339 
2348  virtual int extendBtrfsVolume( const string& name,
2349  const deque<string>& devs ) = 0;
2350 
2359  virtual int shrinkBtrfsVolume( const string& name,
2360  const deque<string>& devs ) = 0;
2361 
2369  virtual int addTmpfsMount( const string& mp, const string& opts ) = 0;
2370 
2377  virtual int removeTmpfsMount( const string& mp ) = 0;
2378 
2384  virtual void getCommitInfos(list<CommitInfo>& infos) const = 0;
2385 
2391  virtual const string& getLastAction() const = 0;
2392 
2399  virtual const string& getExtendedErrorMessage() const = 0;
2400 
2401 // temporarily disable callback function for swig
2402 #ifndef SWIG
2403 
2409  virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0;
2410 
2416  virtual CallbackProgressBar getCallbackProgressBar() const = 0;
2417 
2418 
2424  virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0;
2425 
2431  virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
2432 
2433 
2440  virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0;
2441 
2448  virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
2449 
2450 
2457  virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0;
2458 
2465  virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
2466 
2467 
2473  virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0;
2474 
2480  virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0;
2481 
2482 
2488  virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0;
2489 
2496  virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0;
2497 
2498 #endif
2499 
2505  virtual void setCacheChanges (bool cache) = 0;
2506 
2510  virtual bool isCacheChanges () const = 0;
2511 
2516  virtual int commit() = 0;
2517 
2521  virtual string getErrorString(int error) const = 0;
2522 
2529  virtual int createBackupState( const string& name ) = 0;
2530 
2537  virtual int restoreBackupState( const string& name ) = 0;
2538 
2545  virtual bool checkBackupState(const string& name) const = 0;
2546 
2555  virtual bool equalBackupStates(const string& lhs, const string& rhs,
2556  bool verbose_log) const = 0;
2557 
2565  virtual int removeBackupState( const string& name ) = 0;
2566 
2574  virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0;
2575 
2586  virtual bool umountDevice( const string& device ) = 0;
2587 
2600  virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0;
2601 
2612  virtual bool mountDevice( const string& device, const string& mp ) = 0;
2613 
2624  virtual int activateEncryption( const string& device, bool on ) = 0;
2625 
2637  virtual bool mountDeviceOpts( const string& device, const string& mp,
2638  const string& opts ) = 0;
2639 
2651  virtual bool mountDeviceRo( const string& device, const string& mp,
2652  const string& opts ) = 0;
2653 
2660  virtual bool checkDmMapsTo( const string& device ) = 0;
2661 
2667  virtual void removeDmTableTo( const string& device ) = 0;
2668 
2677  virtual int renameCryptDm( const string& device,
2678  const string& new_name ) = 0;
2679 
2691  virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info,
2692  bool get_content, ContentInfo& content_info, bool use_cache) = 0;
2693 
2701  virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
2702 
2712  virtual void activateHld( bool val ) = 0;
2713 
2722  virtual void activateMultipath( bool val ) = 0;
2723 
2732  virtual void rescanEverything() = 0;
2733 
2742  virtual bool rescanCryptedObjects() = 0;
2743 
2747  virtual void dumpObjectList() = 0;
2748 
2752  virtual void dumpCommitInfos() const = 0;
2753 
2763  virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0;
2764 
2773  virtual int setUserdata(const string& device, const map<string, string>& userdata) = 0;
2774 
2782  virtual int getUserdata(const string& device, map<string, string>& userdata) = 0;
2783 
2784  };
2785 
2786 
2790  void initDefaultLogger( const string& logdir );
2791 
2796  typedef void (*CallbackLogDo)( int level, const string& component, const char* file,
2797  int line, const char* function, const string& content );
2798 
2803  typedef bool (*CallbackLogQuery)( int level, const string& component );
2804 
2808  void setLogDoCallback( CallbackLogDo pfc );
2809 
2813  CallbackLogDo getLogDoCallback();
2814 
2818  void setLogQueryCallback( CallbackLogQuery pfc );
2819 
2823  CallbackLogQuery getLogQueryCallback();
2824 
2829  {
2830  Environment(bool readonly, const string& logdir = "/var/log/YaST2")
2831  : readonly(readonly), testmode(false), autodetect(true),
2832  instsys(false), logdir(logdir), testdir("tmp")
2833  {
2834  storage::initDefaultLogger( logdir );
2835  }
2836 
2837  bool readonly;
2838  bool testmode;
2839  bool autodetect;
2840  bool instsys;
2841  string logdir;
2842  string testdir;
2843  };
2844 
2845 
2851  StorageInterface* createStorageInterface(const Environment& env);
2852 
2853 
2861  StorageInterface* createStorageInterfacePid(const Environment& env, int& SWIG_OUTPUT(locker_pid));
2862 
2863 
2867  void destroyStorageInterface(StorageInterface*);
2868 
2869 }
2870 
2871 
2872 #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:606
virtual int resizePartition(const string &device, unsigned long sizeCyl)=0
Definition: StorageInterface.h:629
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
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 createPartition(const string &disk, PartitionType type, const RegionInfo &cylRegion, string &SWIG_OUTPUT(device))=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:266
virtual int createBackupState(const string &name)=0
virtual int checkMd(const string &name)=0
virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc)=0
Definition: StorageInterface.h:527
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:493
virtual int getContMdPartCoInfo(const string &name, ContainerInfo &cinfo, MdPartCoInfo &info)=0
Definition: StorageInterface.h:597
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:483
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:2828
Definition: StorageInterface.h:584
Definition: StorageInterface.h:548
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 int updatePartitionArea(const string &device, const RegionInfo &cylRegion)=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:409
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:256
Definition: StorageInterface.h:401
virtual int shrinkLvmVg(const string &name, const deque< string > &devs)=0
virtual int setIgnoreFstab(const string &device, bool val)=0
Definition: StorageInterface.h:326
virtual unsigned long kbToCylinder(const string &disk, unsigned long long sizeK)=0
Definition: StorageInterface.h:465
virtual bool umountDevice(const string &device)=0
virtual int createPartitionKb(const string &disk, PartitionType type, const RegionInfo &kRegion, string &SWIG_OUTPUT(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:358
Definition: StorageInterface.h:344
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:275
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:646
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:940
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:615
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 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:507
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:516
Definition: StorageInterface.h:352
virtual void dumpObjectList()=0
virtual CallbackPasswordPopup getCallbackPasswordPopup() const =0
virtual void setCallbackProgressBar(CallbackProgressBar pfnc)=0
virtual bool rescanCryptedObjects()=0
Definition: StorageInterface.h:422
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:536
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:455
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:294
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:572
virtual unsigned long long cylinderToKb(const string &disk, unsigned long sizeCyl)=0
Definition: StorageInterface.h:563
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: Graph.h:32
Definition: StorageInterface.h:437
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:369
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:237
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:304
virtual void getCommitInfos(list< CommitInfo > &infos) const =0
Definition: StorageInterface.h:247
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