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