libstorage
StorageInterface.h
1 /*
2  * Copyright (c) [2004-2010] Novell, Inc.
3  *
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as published
8  * by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, contact Novell, Inc.
17  *
18  * To contact Novell about this file by physical or electronic mail, you may
19  * find current contact information at www.novell.com.
20  */
21 
22 
23 #ifndef STORAGE_INTERFACE_H
24 #define STORAGE_INTERFACE_H
25 
26 
27 #include <string>
28 #include <deque>
29 #include <list>
30 
31 using std::string;
32 using std::deque;
33 using std::list;
34 
35 
36 #include "storage/StorageVersion.h"
37 
38 #ifndef SWIG
39 #define SWIG_OUTPUT( var_name ) var_name
40 #else
41 #if defined(SWIGPYTHON) || defined(SWIGRUBY)
42 #define SWIG_OUTPUT( var_name ) OUTPUT
43 #else
44 #define SWIG_OUTPUT( var_name ) REFERENCE
45 #endif
46 #endif
47 
48 
146 namespace storage
147 {
148  enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS,
149  SWAP, HFSPLUS, NFS, NFS4, TMPFS, FSNONE };
150 
151  enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
152 
153  enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
154 
155  enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
156  ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
157 
158  enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
159 
160  enum MdParity { PAR_DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC,
161  RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC, PAR_FIRST, PAR_LAST,
162  LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6, RIGHT_ASYMMETRIC_6,
163  RIGHT_SYMMETRIC_6, PAR_FIRST_6,
164  PAR_NEAR_2, PAR_OFFSET_2, PAR_FAR_2,
165  PAR_NEAR_3, PAR_OFFSET_3, PAR_FAR_3 };
166 
167  enum MdArrayState { UNKNOWN, CLEAR, INACTIVE, SUSPENDED, READONLY, READ_AUTO,
168  CLEAN, ACTIVE, WRITE_PENDING, ACTIVE_IDLE };
169 
170  enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_MDPART, UB_DM, UB_DMRAID, UB_DMMULTIPATH, UB_BTRFS };
171 
172  enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH, MDPART, BTRFSC, TMPFSC };
173 
174  enum Transport { TUNKNOWN, SBP, ATA, FC, ISCSI, SAS, SATA, SPI, USB, FCOE };
175 
176  enum ImsmDriver { IMSM_UNDECIDED, IMSM_DMRAID, IMSM_MDADM };
177 
178  enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF };
179 
180  enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER };
181 
182 
187  typedef void (*CallbackProgressBar)(const string& id, unsigned cur, unsigned max);
188 
193  typedef void (*CallbackShowInstallInfo)(const string& id);
194 
199  typedef void (*CallbackInfoPopup)(const string& text);
200 
207  typedef bool (*CallbackYesNoPopup)(const string& text);
208 
214  typedef bool (*CallbackCommitErrorPopup)(int error, const string& last_action,
215  const string& extended_message);
216 
222  typedef bool (*CallbackPasswordPopup)(const string& device, int attempts, string& password);
223 
224 
229  {
230  FsCapabilities() {}
231  bool isExtendable;
232  bool isExtendableWhileMounted;
233  bool isReduceable;
234  bool isReduceableWhileMounted;
235  bool supportsUuid;
236  bool supportsLabel;
237  bool labelWhileMounted;
238  unsigned int labelLength;
239  unsigned long long minimalFsSizeK;
240  };
241 
246  {
247  DlabelCapabilities() {}
248  unsigned maxPrimary;
249  bool extendedPossible;
250  unsigned maxLogical;
251  unsigned long long maxSectors;
252  };
253 
254 
255  struct UsedByInfo
256  {
257  UsedByInfo(UsedByType type, const string& device) : type(type), device(device) {}
258  UsedByType type;
259  string device;
260  };
261 
262 
263  struct SubvolInfo
264  {
265  SubvolInfo(const string& path) : path(path) {}
266  string path;
267  };
268 
269 
270  struct ResizeInfo
271  {
272  ResizeInfo() : df_freeK(0), resize_freeK(0), usedK(0), resize_ok(false) {}
273  unsigned long long df_freeK;
274  unsigned long long resize_freeK;
275  unsigned long long usedK;
276  bool resize_ok;
277  };
278 
279 
280  struct ContentInfo
281  {
282  ContentInfo() : windows(false), efi(false), homes(0) {}
283  bool windows;
284  bool efi;
285  unsigned homes;
286  };
287 
288 
293  {
294  ContainerInfo() {}
295  CType type;
296  string device;
297  string name;
298  string udevPath;
299  string udevId;
300  list<UsedByInfo> usedBy;
301  UsedByType usedByType; // deprecated
302  string usedByDevice; // deprecated
303  bool readonly;
304  };
305 
309  struct DiskInfo
310  {
311  DiskInfo() {}
312  unsigned long long sizeK;
313  unsigned long long cylSize;
314  unsigned long cyl;
315  unsigned long heads;
316  unsigned long sectors;
317  unsigned int sectorSize;
318  string disklabel;
319  string orig_disklabel;
320  unsigned maxPrimary;
321  bool extendedPossible;
322  unsigned maxLogical;
323  bool initDisk;
324  Transport transport;
325  bool has_fake_partition;
326  bool iscsi; // deprecated
327  };
328 
332  struct LvmVgInfo
333  {
334  LvmVgInfo() {}
335  unsigned long long sizeK;
336  unsigned long long peSizeK;
337  unsigned long peCount;
338  unsigned long peFree;
339  string uuid;
340  bool lvm2;
341  bool create;
342  string devices;
343  string devices_add;
344  string devices_rem;
345  };
346 
351  {
352  DmPartCoInfo() {}
353  DiskInfo d;
354  string devices;
355  unsigned long minor;
356  };
357 
359  {
360  DmraidCoInfo() {}
361  DmPartCoInfo p;
362  };
363 
365  {
366  DmmultipathCoInfo() {}
367  DmPartCoInfo p;
368  string vendor;
369  string model;
370  };
371 
375  struct VolumeInfo
376  {
377  VolumeInfo() {}
378  unsigned long long sizeK;
379  unsigned long major;
380  unsigned long minor;
381  string name;
382  string device;
383  string mount;
384  string crypt_device;
385  MountByType mount_by;
386  string udevPath;
387  string udevId;
388  list<UsedByInfo> usedBy;
389  UsedByType usedByType; // deprecated
390  string usedByDevice; // deprecated
391  bool ignore_fstab;
392  string fstab_options;
393  string uuid;
394  string label;
395  string mkfs_options;
396  string tunefs_options;
397  string loop;
398  string dtxt;
399  EncryptType encryption;
400  string crypt_pwd;
401  FsType fs;
402  FsType detected_fs;
403  bool format;
404  bool create;
405  bool is_mounted;
406  bool resize;
407  bool ignore_fs;
408  unsigned long long origSizeK;
409  };
410 
412  {
413  PartitionAddInfo() {}
414  unsigned nr;
415  unsigned long cylStart;
416  unsigned long cylSize;
417  PartitionType partitionType;
418  unsigned id;
419  bool boot;
420  };
421 
426  {
427  PartitionInfo() {}
428  PartitionInfo& operator=( const PartitionAddInfo& rhs );
429  VolumeInfo v;
430  unsigned nr;
431  unsigned long cylStart;
432  unsigned long cylSize;
433  PartitionType partitionType;
434  unsigned id;
435  bool boot;
436  };
437 
441  struct LvmLvInfo
442  {
443  LvmLvInfo() {}
444  VolumeInfo v;
445  unsigned stripes;
446  unsigned stripeSizeK;
447  string uuid;
448  string status;
449  string allocation;
450  string dm_table;
451  string dm_target;
452  string origin;
453  string used_pool;
454  bool pool;
455  };
456 
461  {
463  bool active;
464  double allocated;
465  };
466 
470  struct MdInfo
471  {
472  MdInfo() {}
473  VolumeInfo v;
474  unsigned nr;
475  unsigned type;
476  unsigned parity;
477  string uuid;
478  string sb_ver;
479  unsigned long chunkSizeK;
480  string devices;
481  string spares;
482  bool inactive;
483  };
484 
488  struct MdStateInfo
489  {
490  MdStateInfo() {}
491  MdArrayState state;
492  };
493 
499  {
500  MdPartCoInfo() {}
501  DiskInfo d;
502  unsigned type; // RAID level
503  unsigned nr; // MD device number
504  unsigned parity; // Parity (not for all RAID level)
505  string uuid; // MD Device UUID
506  string sb_ver; // Metadata version
507  unsigned long chunkSizeK; // Chunksize (strip size)
508  string devices;
509  string spares;
510  };
511 
513  {
514  MdPartCoStateInfo() {}
515  MdArrayState state;
516  };
517 
521  struct MdPartInfo
522  {
523  MdPartInfo() {}
524  VolumeInfo v;
526  bool part;
527  };
528 
532  struct NfsInfo
533  {
534  NfsInfo() {}
535  VolumeInfo v;
536  };
537 
541  struct LoopInfo
542  {
543  LoopInfo() {}
544  VolumeInfo v;
545  bool reuseFile;
546  unsigned nr;
547  string file;
548  };
549 
553  struct BtrfsInfo
554  {
555  BtrfsInfo() {}
556  VolumeInfo v;
557  string devices;
558  string devices_add;
559  string devices_rem;
560  string subvol;
561  string subvol_add;
562  string subvol_rem;
563  };
564 
568  struct TmpfsInfo
569  {
570  TmpfsInfo() {}
571  VolumeInfo v;
572  };
573 
577  struct DmInfo
578  {
579  DmInfo() {}
580  VolumeInfo v;
581  unsigned nr;
582  string table;
583  string target;
584  };
585 
589  struct DmPartInfo
590  {
591  DmPartInfo() {}
592  VolumeInfo v;
594  bool part;
595  string table;
596  string target;
597  };
598 
602  struct DmraidInfo
603  {
604  DmraidInfo() {}
605  DmPartInfo p;
606  };
607 
612  {
613  DmmultipathInfo() {}
614  DmPartInfo p;
615  };
616 
620  struct ContVolInfo
621  {
622  ContVolInfo() : ctype(CUNKNOWN), num(-1) {}
623  CType ctype;
624  string cname;
625  string cdevice;
626  string vname;
627  string vdevice;
628  int num;
629  };
630 
635  {
636  PartitionSlotInfo() {}
637  unsigned long cylStart;
638  unsigned long cylSize;
639  bool primarySlot;
640  bool primaryPossible;
641  bool extendedSlot;
642  bool extendedPossible;
643  bool logicalSlot;
644  bool logicalPossible;
645  };
646 
650  struct CommitInfo
651  {
652  CommitInfo() {}
653  bool destructive;
654  string text;
655  };
656 
657 
661  enum ErrorCodes
662  {
663  STORAGE_NO_ERROR = 0,
664 
665  DISK_PARTITION_OVERLAPS_EXISTING = -1000,
666  DISK_PARTITION_EXCEEDS_DISK = -1001,
667  DISK_CREATE_PARTITION_EXT_ONLY_ONCE = -1002,
668  DISK_CREATE_PARTITION_EXT_IMPOSSIBLE = -1003,
669  DISK_PARTITION_NO_FREE_NUMBER = -1004,
670  DISK_CREATE_PARTITION_INVALID_VOLUME = -1005,
671  DISK_CREATE_PARTITION_INVALID_TYPE = -1006,
672  DISK_CREATE_PARTITION_PARTED_FAILED = -1007,
673  DISK_PARTITION_NOT_FOUND = -1008,
674  DISK_CREATE_PARTITION_LOGICAL_NO_EXT = -1009,
675  DISK_PARTITION_LOGICAL_OUTSIDE_EXT = -1010,
676  DISK_SET_TYPE_INVALID_VOLUME = -1011,
677  DISK_SET_TYPE_PARTED_FAILED = -1012,
678  DISK_SET_LABEL_PARTED_FAILED = -1013,
679  DISK_REMOVE_PARTITION_PARTED_FAILED = -1014,
680  DISK_REMOVE_PARTITION_INVALID_VOLUME = -1015,
681  DISK_REMOVE_PARTITION_LIST_ERASE = -1016,
682  DISK_DESTROY_TABLE_INVALID_LABEL = -1017,
683  DISK_PARTITION_ZERO_SIZE = -1018,
684  DISK_CHANGE_READONLY = -1019,
685  DISK_RESIZE_PARTITION_INVALID_VOLUME = -1020,
686  DISK_RESIZE_PARTITION_PARTED_FAILED = -1021,
687  DISK_RESIZE_NO_SPACE = -1022,
688  DISK_CHECK_RESIZE_INVALID_VOLUME = -1023,
689  DISK_REMOVE_PARTITION_CREATE_NOT_FOUND = -1024,
690  DISK_COMMIT_NOTHING_TODO = -1025,
691  DISK_CREATE_PARTITION_NO_SPACE = -1026,
692  DISK_REMOVE_USED_BY = -1027,
693  DISK_INIT_NOT_POSSIBLE = -1028,
694  DISK_INVALID_PARTITION_ID = -1029,
695 
696  STORAGE_DISK_NOT_FOUND = -2000,
697  STORAGE_VOLUME_NOT_FOUND = -2001,
698  STORAGE_REMOVE_PARTITION_INVALID_CONTAINER = -2002,
699  STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER = -2003,
700  STORAGE_CHANGE_READONLY = -2004,
701  STORAGE_DISK_USED_BY = -2005,
702  STORAGE_LVM_VG_EXISTS = -2006,
703  STORAGE_LVM_VG_NOT_FOUND = -2007,
704  STORAGE_LVM_INVALID_DEVICE = -2008,
705  STORAGE_CONTAINER_NOT_FOUND = -2009,
706  STORAGE_VG_INVALID_NAME = -2010,
707  STORAGE_REMOVE_USED_VOLUME = -2011,
708  STORAGE_REMOVE_USING_UNKNOWN_TYPE = -2012,
709  STORAGE_NOT_YET_IMPLEMENTED = -2013,
710  STORAGE_MD_INVALID_NAME = -2014,
711  STORAGE_MD_NOT_FOUND = -2015,
712  STORAGE_MEMORY_EXHAUSTED = -2016,
713  STORAGE_LOOP_NOT_FOUND = -2017,
714  STORAGE_CREATED_LOOP_NOT_FOUND = -2018,
715  STORAGE_CHANGE_AREA_INVALID_CONTAINER = -2023,
716  STORAGE_BACKUP_STATE_NOT_FOUND = -2024,
717  STORAGE_INVALID_FSTAB_VALUE = -2025,
718  STORAGE_NO_FSTAB_PTR = -2026,
719  STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
720  STORAGE_DMRAID_CO_NOT_FOUND = -2028,
721  STORAGE_RESIZE_INVALID_CONTAINER = -2029,
722  STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030,
723  STORAGE_ZERO_DEVICE_FAILED = -2031,
724  STORAGE_INVALID_BACKUP_STATE_NAME = -2032,
725  STORAGE_MDPART_CO_NOT_FOUND = -2033,
726  STORAGE_DEVICE_NOT_FOUND = -2034,
727  STORAGE_BTRFS_CO_NOT_FOUND = -2035,
728  STORAGE_TMPFS_CO_NOT_FOUND = -2036,
729  STORAGE_VOLUME_NOT_ENCRYPTED = -2037,
730  STORAGE_DM_RENAME_FAILED = -2038,
731 
732  VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
733  VOLUME_FSTAB_EMPTY_MOUNT = -3001,
734  VOLUME_UMOUNT_FAILED = -3002,
735  VOLUME_MOUNT_FAILED = -3003,
736  VOLUME_FORMAT_UNKNOWN_FS = -3005,
737  VOLUME_FORMAT_FS_UNDETECTED = -3006,
738  VOLUME_FORMAT_FS_TOO_SMALL = -3007,
739  VOLUME_FORMAT_FAILED = -3008,
740  VOLUME_TUNE2FS_FAILED = -3009,
741  VOLUME_MKLABEL_FS_UNABLE = -3010,
742  VOLUME_MKLABEL_FAILED = -3011,
743  VOLUME_LOSETUP_NO_LOOP = -3012,
744  VOLUME_LOSETUP_FAILED = -3013,
745  VOLUME_CRYPT_NO_PWD = -3014,
746  VOLUME_CRYPT_PWD_TOO_SHORT = -3015,
747  VOLUME_CRYPT_NOT_DETECTED = -3016,
748  VOLUME_FORMAT_EXTENDED_UNSUPPORTED = -3017,
749  VOLUME_MOUNT_EXTENDED_UNSUPPORTED = -3018,
750  VOLUME_MOUNT_POINT_INVALID = -3019,
751  VOLUME_MOUNTBY_NOT_ENCRYPTED = -3020,
752  VOLUME_MOUNTBY_UNSUPPORTED_BY_FS = -3021,
753  VOLUME_LABEL_NOT_SUPPORTED = -3022,
754  VOLUME_LABEL_TOO_LONG = -3023,
755  VOLUME_LABEL_WHILE_MOUNTED = -3024,
756  VOLUME_RESIZE_UNSUPPORTED_BY_FS = -3025,
757  VOLUME_RESIZE_UNSUPPORTED_BY_CONTAINER = -3026,
758  VOLUME_RESIZE_FAILED = -3027,
759  VOLUME_ALREADY_IN_USE = -3028,
760  VOLUME_LOUNSETUP_FAILED = -3029,
761  VOLUME_DEVICE_NOT_PRESENT = -3030,
762  VOLUME_DEVICE_NOT_BLOCK = -3031,
763  VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME = -3032,
764  VOLUME_CRYPTFORMAT_FAILED = -3033,
765  VOLUME_CRYPTSETUP_FAILED = -3034,
766  VOLUME_CRYPTUNSETUP_FAILED = -3035,
767  VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
768  VOLUME_FORMAT_IMPOSSIBLE = -3037,
769  VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
770  VOLUME_REMOUNT_FAILED = -3039,
771  VOLUME_TUNEREISERFS_FAILED = -3040,
772  VOLUME_UMOUNT_NOT_MOUNTED = -3041,
773  VOLUME_BTRFS_ADD_FAILED = -3042,
774  VOLUME_CANNOT_TMP_MOUNT = -3043,
775  VOLUME_CANNOT_TMP_UMOUNT = -3044,
776  VOLUME_BTRFS_SUBVOL_INIT_FAILED = -3045,
777  VOLUME_BTRFS_SUBVOL_DETDEFAULT = -3046,
778 
779  LVM_CREATE_PV_FAILED = -4000,
780  LVM_PV_ALREADY_CONTAINED = -4001,
781  LVM_PV_DEVICE_UNKNOWN = -4002,
782  LVM_PV_DEVICE_USED = -4003,
783  LVM_VG_HAS_NONE_PV = -4004,
784  LVM_LV_INVALID_NAME = -4005,
785  LVM_LV_DUPLICATE_NAME = -4006,
786  LVM_LV_NO_SPACE = -4007,
787  LVM_LV_UNKNOWN_NAME = -4008,
788  LVM_LV_NOT_IN_LIST = -4009,
789  LVM_VG_CREATE_FAILED = -4010,
790  LVM_VG_EXTEND_FAILED = -4011,
791  LVM_VG_REDUCE_FAILED = -4012,
792  LVM_VG_REMOVE_FAILED = -4013,
793  LVM_LV_CREATE_FAILED = -4014,
794  LVM_LV_REMOVE_FAILED = -4015,
795  LVM_LV_RESIZE_FAILED = -4016,
796  LVM_PV_STILL_ADDED = -4017,
797  LVM_PV_REMOVE_NOT_FOUND = -4018,
798  LVM_CREATE_LV_INVALID_VOLUME = -4019,
799  LVM_REMOVE_LV_INVALID_VOLUME = -4020,
800  LVM_RESIZE_LV_INVALID_VOLUME = -4021,
801  LVM_CHANGE_READONLY = -4022,
802  LVM_CHECK_RESIZE_INVALID_VOLUME = -4023,
803  LVM_COMMIT_NOTHING_TODO = -4024,
804  LVM_LV_REMOVE_USED_BY = -4025,
805  LVM_LV_ALREADY_ON_DISK = -4026,
806  LVM_LV_NO_STRIPE_SIZE = -4027,
807  LVM_LV_UNKNOWN_ORIGIN = -4028,
808  LVM_LV_NOT_ON_DISK = -4029,
809  LVM_LV_NOT_SNAPSHOT = -4030,
810  LVM_LV_HAS_SNAPSHOTS = -4031,
811  LVM_LV_IS_SNAPSHOT = -4032,
812  LVM_LIST_EMPTY = -4033,
813  LVM_LV_NO_POOL_OR_SNAP = -4034,
814  LVM_LV_NO_POOL = -4035,
815  LVM_LV_UNKNOWN_POOL = -4036,
816  LVM_LV_INVALID_CHUNK_SIZE = -4037,
817  LVM_LV_POOL_NO_FORMAT = -4038,
818  LVM_LV_POOL_NO_MOUNT = -4039,
819 
820  FSTAB_ENTRY_NOT_FOUND = -5000,
821  FSTAB_CHANGE_PREFIX_IMPOSSIBLE = -5001,
822  FSTAB_REMOVE_ENTRY_NOT_FOUND = -5002,
823  FSTAB_UPDATE_ENTRY_NOT_FOUND = -5003,
824  FSTAB_ADD_ENTRY_FOUND = -5004,
825 
826  MD_CHANGE_READONLY = -6000,
827  MD_DUPLICATE_NUMBER = -6001,
828  MD_TOO_FEW_DEVICES = -6002,
829  MD_DEVICE_UNKNOWN = -6003,
830  MD_DEVICE_USED = -6004,
831  MD_CREATE_INVALID_VOLUME = -6005,
832  MD_REMOVE_FAILED = -6006,
833  MD_NOT_IN_LIST = -6007,
834  MD_CREATE_FAILED = -6008,
835  MD_UNKNOWN_NUMBER = -6009,
836  MD_REMOVE_USED_BY = -6010,
837  MD_NUMBER_TOO_LARGE = -6011,
838  MD_REMOVE_INVALID_VOLUME = -6012,
839  MD_REMOVE_CREATE_NOT_FOUND = -6013,
840  MD_NO_RESIZE_ON_DISK = -6014,
841  MD_ADD_DUPLICATE = -6015,
842  MD_REMOVE_NONEXISTENT = -6016,
843  MD_NO_CHANGE_ON_DISK = -6017,
844  MD_NO_CREATE_UNKNOWN = -6018,
845  MD_STATE_NOT_ON_DISK = -6019,
846  MD_PARTITION_NOT_FOUND = -6020,
847  MD_INVALID_PARITY = -6021,
848  MD_TOO_MANY_SPARES = -6022,
849  MD_GET_STATE_FAILED = -6023,
850 
851  MDPART_CHANGE_READONLY = -6100,
852  MDPART_INTERNAL_ERR = -6101,
853  MDPART_INVALID_VOLUME = -6012,
854  MDPART_PARTITION_NOT_FOUND = -6103,
855  MDPART_REMOVE_PARTITION_LIST_ERASE = -6104,
856  MDPART_COMMIT_NOTHING_TODO = -6105,
857  MDPART_NO_REMOVE = -6106,
858  MDPART_DEVICE_NOT_FOUND = -6107,
859 
860  LOOP_CHANGE_READONLY = -7000,
861  LOOP_DUPLICATE_FILE = -7001,
862  LOOP_UNKNOWN_FILE = -7002,
863  LOOP_REMOVE_USED_BY = -7003,
864  LOOP_FILE_CREATE_FAILED = -7004,
865  LOOP_CREATE_INVALID_VOLUME = -7005,
866  LOOP_REMOVE_FILE_FAILED = -7006,
867  LOOP_REMOVE_INVALID_VOLUME = -7007,
868  LOOP_NOT_IN_LIST = -7008,
869  LOOP_REMOVE_CREATE_NOT_FOUND = -7009,
870  LOOP_MODIFY_EXISTING = -7010,
871 
872  PEC_PE_SIZE_INVALID = -9000,
873  PEC_PV_NOT_FOUND = -9001,
874  PEC_REMOVE_PV_IN_USE = -9002,
875  PEC_REMOVE_PV_SIZE_NEEDED = -9003,
876  PEC_LV_NO_SPACE_STRIPED = -9004,
877  PEC_LV_NO_SPACE_SINGLE = -9005,
878  PEC_LV_PE_DEV_NOT_FOUND = -9006,
879 
880  DM_CHANGE_READONLY = -10000,
881  DM_UNKNOWN_TABLE = -10001,
882  DM_REMOVE_USED_BY = -10002,
883  DM_REMOVE_CREATE_NOT_FOUND = -10003,
884  DM_REMOVE_INVALID_VOLUME = -10004,
885  DM_REMOVE_FAILED = -10005,
886  DM_NOT_IN_LIST = -10006,
887 
888  DASD_NOT_POSSIBLE = -11000,
889  DASD_FDASD_FAILED = -11001,
890  DASD_DASDFMT_FAILED = -11002,
891 
892  DMPART_CHANGE_READONLY = -12001,
893  DMPART_INTERNAL_ERR = -12002,
894  DMPART_INVALID_VOLUME = -12003,
895  DMPART_PARTITION_NOT_FOUND = -12004,
896  DMPART_REMOVE_PARTITION_LIST_ERASE = -12005,
897  DMPART_COMMIT_NOTHING_TODO = -12006,
898  DMPART_NO_REMOVE = -12007,
899 
900  DMRAID_REMOVE_FAILED = -13001,
901 
902  NFS_VOLUME_NOT_FOUND = -14001,
903  NFS_CHANGE_READONLY = -14002,
904  NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
905  NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
906  NFS_REMOVE_INVALID_VOLUME = -14005,
907 
908  BTRFS_COMMIT_INVALID_VOLUME = -15001,
909  BTRFS_CANNOT_TMP_MOUNT = -15002,
910  BTRFS_CANNOT_TMP_UMOUNT = -15003,
911  BTRFS_DELETE_SUBVOL_FAIL = -15004,
912  BTRFS_CREATE_SUBVOL_FAIL = -15005,
913  BTRFS_VOLUME_NOT_FOUND = -15006,
914  BTRFS_SUBVOL_EXISTS = -15007,
915  BTRFS_SUBVOL_NON_EXISTS = -15008,
916  BTRFS_REMOVE_NOT_FOUND = -15009,
917  BTRFS_REMOVE_NO_BTRFS = -15010,
918  BTRFS_REMOVE_INVALID_VOLUME = -15011,
919  BTRFS_CHANGE_READONLY = -15012,
920  BTRFS_DEV_ALREADY_CONTAINED = -15013,
921  BTRFS_DEVICE_UNKNOWN = -15014,
922  BTRFS_DEVICE_USED = -15015,
923  BTRFS_HAS_NONE_DEV = -15016,
924  BTRFS_DEV_NOT_FOUND = -15017,
925  BTRFS_EXTEND_FAIL = -15018,
926  BTRFS_REDUCE_FAIL = -15019,
927  BTRFS_LIST_EMPTY = -15020,
928  BTRFS_RESIZE_INVALID_VOLUME = -15021,
929  BTRFS_MULTIDEV_SHRINK_UNSUPPORTED = -15022,
930 
931  TMPFS_REMOVE_INVALID_VOLUME = -16001,
932  TMPFS_REMOVE_NO_TMPFS = -16002,
933  TMPFS_REMOVE_NOT_FOUND = -16003,
934 
935  CONTAINER_INTERNAL_ERROR = -99000,
936  CONTAINER_INVALID_VIRTUAL_CALL = -99001,
937 
938  };
939 
940 
945  {
946  public:
947 
948  StorageInterface () {}
949  virtual ~StorageInterface () {}
950 
954  virtual void getContainers( deque<ContainerInfo>& infos) = 0;
955 
963  virtual int getDiskInfo( const string& disk, DiskInfo& info) = 0;
964 
973  virtual int getContDiskInfo( const string& disk, ContainerInfo& cinfo,
974  DiskInfo& info ) = 0;
975 
983  virtual int getLvmVgInfo( const string& name, LvmVgInfo& info) = 0;
984 
993  virtual int getContLvmVgInfo( const string& name, ContainerInfo& cinfo,
994  LvmVgInfo& info) = 0;
995 
1003  virtual int getDmraidCoInfo( const string& name, DmraidCoInfo& info) = 0;
1004 
1013  virtual int getContDmraidCoInfo( const string& name, ContainerInfo& cinfo,
1014  DmraidCoInfo& info) = 0;
1015 
1023  virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0;
1024 
1033  virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
1034  DmmultipathCoInfo& info) = 0;
1035 
1043  virtual int getMdPartCoInfo( const string& name, MdPartCoInfo& info) = 0;
1044 
1045 
1054  virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
1055  MdPartCoInfo& info) = 0;
1056 
1062  virtual void setImsmDriver(ImsmDriver driver) = 0;
1063 
1069  virtual ImsmDriver getImsmDriver() const = 0;
1070 
1076  virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0;
1077 
1083  virtual MultipathAutostart getMultipathAutostart() const = 0;
1084 
1090  virtual void getVolumes( deque<VolumeInfo>& infos) = 0;
1091 
1099  virtual int getVolume( const string& device, VolumeInfo& info) = 0;
1100 
1108  virtual int getPartitionInfo( const string& disk,
1109  deque<PartitionInfo>& plist ) = 0;
1110 
1118  virtual int getLvmLvInfo( const string& name,
1119  deque<LvmLvInfo>& plist ) = 0;
1120 
1127  virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
1128 
1136  virtual int getMdPartInfo( const string& device,
1137  deque<MdPartInfo>& plist ) = 0;
1138 
1145  virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
1146 
1153  virtual int getLoopInfo( deque<LoopInfo>& plist ) = 0;
1154 
1161  virtual int getDmInfo( deque<DmInfo>& plist ) = 0;
1162 
1169  virtual int getBtrfsInfo( deque<BtrfsInfo>& plist ) = 0;
1170 
1177  virtual int getTmpfsInfo( deque<TmpfsInfo>& plist ) = 0;
1178 
1186  virtual int getDmraidInfo( const string& name,
1187  deque<DmraidInfo>& plist ) = 0;
1188 
1196  virtual int getDmmultipathInfo( const string& name,
1197  deque<DmmultipathInfo>& plist ) = 0;
1198 
1202  virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
1203 
1207  virtual bool getDlabelCapabilities(const string& dlabel,
1208  DlabelCapabilities& dlabelcapabilities) const = 0;
1209 
1213  virtual list<string> getAllUsedFs() const = 0;
1214 
1227  virtual int createPartition( const string& disk, PartitionType type,
1228  unsigned long startCyl,
1229  unsigned long sizeCyl,
1230  string& SWIG_OUTPUT(device) ) = 0;
1231 
1240  virtual int resizePartition( const string& device,
1241  unsigned long sizeCyl ) = 0;
1242 
1251  virtual int resizePartitionNoFs( const string& device,
1252  unsigned long sizeCyl ) = 0;
1253 
1264  virtual int updatePartitionArea( const string& device,
1265  unsigned long startCyl,
1266  unsigned long sizeCyl ) = 0;
1267 
1276  virtual int freeCylindersAroundPartition(const string& device, unsigned long& freeCylsBefore,
1277  unsigned long& freeCylsAfter) = 0;
1278 
1288  virtual int nextFreePartition( const string& disk, PartitionType type,
1289  unsigned & SWIG_OUTPUT(nr),
1290  string& SWIG_OUTPUT(device) ) = 0;
1291 
1304  virtual int createPartitionKb( const string& disk, PartitionType type,
1305  unsigned long long startK,
1306  unsigned long long sizeK,
1307  string& SWIG_OUTPUT(device) ) = 0;
1308 
1319  virtual int createPartitionAny( const string& disk,
1320  unsigned long long sizeK,
1321  string& SWIG_OUTPUT(device) ) = 0;
1322 
1333  virtual int createPartitionMax( const string& disk, PartitionType type,
1334  string& SWIG_OUTPUT(device) ) = 0;
1335 
1343  virtual unsigned long long cylinderToKb( const string& disk,
1344  unsigned long sizeCyl) = 0;
1345 
1353  virtual unsigned long kbToCylinder( const string& disk,
1354  unsigned long long sizeK) = 0;
1355 
1362  virtual int removePartition (const string& partition) = 0;
1363 
1371  virtual int changePartitionId (const string& partition, unsigned id) = 0;
1372 
1379  virtual int forgetChangePartitionId (const string& partition ) = 0;
1380 
1388  virtual string getPartitionPrefix(const string& disk) = 0;
1389 
1398  virtual string getPartitionName(const string& disk, int partition_no) = 0;
1399 
1407  virtual int getUnusedPartitionSlots(const string& disk, list<PartitionSlotInfo>& slots) = 0;
1408 
1417  virtual int destroyPartitionTable (const string& disk, const string& label) = 0;
1418 
1429  virtual int initializeDisk( const string& disk, bool value ) = 0;
1430 
1439  virtual string defaultDiskLabel(const string& device) = 0;
1440 
1449  virtual int changeFormatVolume( const string& device, bool format, FsType fs ) = 0;
1450 
1458  virtual int changeLabelVolume( const string& device, const string& label ) = 0;
1459 
1467  virtual int changeMkfsOptVolume( const string& device, const string& opts ) = 0;
1468 
1476  virtual int changeTunefsOptVolume( const string& device, const string& opts ) = 0;
1477 
1486  virtual int changeMountPoint( const string& device, const string& mount ) = 0;
1487 
1495  virtual int getMountPoint( const string& device,
1496  string& SWIG_OUTPUT(mount) ) = 0;
1497 
1505  virtual int changeMountBy( const string& device, MountByType mby ) = 0;
1506 
1514  virtual int getMountBy( const string& device,
1515  MountByType& SWIG_OUTPUT(mby) ) = 0;
1516 
1526  virtual int changeFstabOptions( const string& device, const string& options ) = 0;
1527 
1536  virtual int getFstabOptions( const string& device,
1537  string& SWIG_OUTPUT(options) ) = 0;
1538 
1539 
1548  virtual int addFstabOptions( const string& device, const string& options ) = 0;
1549 
1559  virtual int removeFstabOptions( const string& device, const string& options ) = 0;
1560 
1568  virtual int setCryptPassword( const string& device, const string& pwd ) = 0;
1569 
1576  virtual int forgetCryptPassword( const string& device ) = 0;
1577 
1585  virtual int getCryptPassword( const string& device,
1586  string& SWIG_OUTPUT(pwd) ) = 0;
1587 
1596  virtual int verifyCryptPassword( const string& device,
1597  const string& pwd, bool erase ) = 0;
1598 
1605  virtual bool needCryptPassword( const string& device ) = 0;
1606 
1614  virtual int setCrypt( const string& device, bool val ) = 0;
1615 
1624  virtual int setCryptType( const string& device, bool val, EncryptType typ ) = 0;
1625 
1633  virtual int getCrypt( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1634 
1644  virtual int setIgnoreFstab( const string& device, bool val ) = 0;
1645 
1653  virtual int getIgnoreFstab( const string& device, bool& SWIG_OUTPUT(val) ) = 0;
1654 
1664  virtual int changeDescText( const string& device, const string& txt ) = 0;
1665 
1680  virtual int addFstabEntry( const string& device, const string& mount,
1681  const string& vfs, const string& options,
1682  unsigned freq, unsigned passno ) = 0;
1683 
1684 
1692  virtual int resizeVolume(const string& device, unsigned long long newSizeK) = 0;
1693 
1701  virtual int resizeVolumeNoFs(const string& device, unsigned long long newSizeK) = 0;
1702 
1709  virtual int forgetResizeVolume( const string& device ) = 0;
1710 
1725  virtual void setRecursiveRemoval( bool val ) = 0;
1726 
1732  virtual bool getRecursiveRemoval() const = 0;
1733 
1743  virtual int getRecursiveUsing(const list<string>& devices, bool itself,
1744  list<string>& using_devices) = 0;
1745 
1755  virtual int getRecursiveUsedBy(const list<string>& devices, bool itself,
1756  list<string>& usedby_devices) = 0;
1757 
1771  virtual void setZeroNewPartitions( bool val ) = 0;
1772 
1778  virtual bool getZeroNewPartitions() const = 0;
1779 
1791  virtual void setPartitionAlignment( PartAlign val ) = 0;
1792 
1798  virtual PartAlign getPartitionAlignment() const = 0;
1799 
1805  virtual void setDefaultMountBy( MountByType val ) = 0;
1806 
1812  virtual MountByType getDefaultMountBy() const = 0;
1813 
1819  virtual void setDefaultFs(FsType val) = 0;
1820 
1826  virtual FsType getDefaultFs() const = 0;
1827 
1833  virtual void setDefaultSubvolName( const string& val) = 0;
1834 
1840  virtual string getDefaultSubvolName() const = 0;
1841 
1847  virtual bool getEfiBoot() = 0;
1848 
1859  virtual void setRootPrefix( const string& root ) = 0;
1860 
1866  virtual string getRootPrefix() const = 0;
1867 
1873  virtual void setDetectMountedVolumes( bool val ) = 0;
1874 
1880  virtual bool getDetectMountedVolumes() const = 0;
1881 
1889  virtual int removeVolume( const string& device ) = 0;
1890 
1901  virtual int createLvmVg( const string& name,
1902  unsigned long long peSizeK, bool lvm1,
1903  const deque<string>& devs ) = 0;
1904 
1912  virtual int removeLvmVg( const string& name ) = 0;
1913 
1921  virtual int extendLvmVg( const string& name,
1922  const deque<string>& devs ) = 0;
1923 
1931  virtual int shrinkLvmVg( const string& name,
1932  const deque<string>& devs ) = 0;
1933 
1945  virtual int createLvmLv( const string& vg, const string& name,
1946  unsigned long long sizeK, unsigned stripes,
1947  string& SWIG_OUTPUT(device) ) = 0;
1948 
1955  virtual int removeLvmLvByDevice( const string& device ) = 0;
1956 
1964  virtual int removeLvmLv( const string& vg, const string& name ) = 0;
1965 
1975  virtual int changeLvStripeCount( const string& vg, const string& name,
1976  unsigned long stripes ) = 0;
1977 
1987  virtual int changeLvStripeSize( const string& vg, const string& name,
1988  unsigned long long stripeSizeK) = 0;
1989 
2000  virtual int createLvmLvSnapshot(const string& vg, const string& origin,
2001  const string& name, unsigned long long cowSizeK,
2002  string& SWIG_OUTPUT(device) ) = 0;
2003 
2011  virtual int removeLvmLvSnapshot(const string& vg, const string& name) = 0;
2012 
2023  virtual int getLvmLvSnapshotStateInfo(const string& vg, const string& name,
2024  LvmLvSnapshotStateInfo& info) = 0;
2025 
2035  virtual int createLvmLvPool(const string& vg, const string& name,
2036  unsigned long long sizeK,
2037  string& SWIG_OUTPUT(device) ) = 0;
2038 
2049  virtual int createLvmLvThin(const string& vg, const string& name,
2050  const string& pool,
2051  unsigned long long sizeK,
2052  string& SWIG_OUTPUT(device) ) = 0;
2053 
2063  virtual int changeLvChunkSize( const string& vg, const string& name,
2064  unsigned long long chunkSizeK) = 0;
2065 
2073  virtual int nextFreeMd(unsigned& SWIG_OUTPUT(nr),
2074  string& SWIG_OUTPUT(device)) = 0;
2075 
2085  virtual int createMd(const string& name, MdType md_type, const list<string>& devices,
2086  const list<string>& spares) = 0;
2087 
2097  virtual int createMdAny(MdType md_type, const list<string>& devices,
2098  const list<string>& spares,
2099  string& SWIG_OUTPUT(device) ) = 0;
2100 
2109  virtual int removeMd( const string& name, bool destroySb ) = 0;
2110 
2120  virtual int extendMd(const string& name, const list<string>& devices,
2121  const list<string>& spares) = 0;
2122 
2132  virtual int updateMd(const string& name, const list<string>& devices,
2133  const list<string>& spares) = 0;
2134 
2144  virtual int shrinkMd(const string& name, const list<string>& devices,
2145  const list<string>& spares) = 0;
2146 
2155  virtual int changeMdType(const string& name, MdType md_type) = 0;
2156 
2165  virtual int changeMdChunk(const string& name, unsigned long chunkSizeK) = 0;
2166 
2175  virtual int changeMdParity( const string& name, MdParity ptype ) = 0;
2176 
2183  virtual int checkMd( const string& name ) = 0;
2184 
2194  virtual int getMdStateInfo(const string& name, MdStateInfo& info) = 0;
2195 
2205  virtual int getMdPartCoStateInfo(const string& name,
2206  MdPartCoStateInfo& info) = 0;
2207 
2220  virtual int computeMdSize(MdType md_type, const list<string>& devices,
2221  const list<string>& spares, unsigned long long& sizeK) = 0;
2222 
2230  virtual list<int> getMdAllowedParity(MdType md_type, unsigned devnr) = 0;
2231 
2242  virtual int removeMdPartCo(const string& name, bool destroySb ) = 0;
2243 
2254  virtual int addNfsDevice(const string& nfsDev, const string& opts,
2255  unsigned long long sizeK, const string& mp,
2256  bool nfs4) = 0;
2257 
2267  virtual int checkNfsDevice(const string& nfsDev, const string& opts,
2268  bool nfs4, unsigned long long& sizeK) = 0;
2269 
2286  virtual int createFileLoop( const string& lname, bool reuseExisting,
2287  unsigned long long sizeK,
2288  const string& mp, const string& pwd,
2289  string& SWIG_OUTPUT(device) ) = 0;
2290 
2308  virtual int modifyFileLoop( const string& device, const string& lname,
2309  bool reuseExisting,
2310  unsigned long long sizeK ) = 0;
2311 
2320  virtual int removeFileLoop( const string& lname, bool removeFile ) = 0;
2321 
2328  virtual int removeDmraid( const string& name ) = 0;
2329 
2337  virtual bool existSubvolume( const string& device, const string& name ) = 0;
2338 
2346  virtual int createSubvolume( const string& device, const string& name ) = 0;
2347 
2355  virtual int removeSubvolume( const string& device, const string& name ) = 0;
2356 
2365  virtual int extendBtrfsVolume( const string& name,
2366  const deque<string>& devs ) = 0;
2367 
2376  virtual int shrinkBtrfsVolume( const string& name,
2377  const deque<string>& devs ) = 0;
2378 
2386  virtual int addTmpfsMount( const string& mp, const string& opts ) = 0;
2387 
2394  virtual int removeTmpfsMount( const string& mp ) = 0;
2395 
2401  virtual void getCommitInfos(list<CommitInfo>& infos) const = 0;
2402 
2408  virtual const string& getLastAction() const = 0;
2409 
2416  virtual const string& getExtendedErrorMessage() const = 0;
2417 
2418 // temporarily disable callback function for swig
2419 #ifndef SWIG
2420 
2426  virtual void setCallbackProgressBar(CallbackProgressBar pfnc) = 0;
2427 
2433  virtual CallbackProgressBar getCallbackProgressBar() const = 0;
2434 
2435 
2441  virtual void setCallbackShowInstallInfo(CallbackShowInstallInfo pfnc) = 0;
2442 
2448  virtual CallbackShowInstallInfo getCallbackShowInstallInfo() const = 0;
2449 
2450 
2457  virtual void setCallbackInfoPopup(CallbackInfoPopup pfnc) = 0;
2458 
2465  virtual CallbackInfoPopup getCallbackInfoPopup() const = 0;
2466 
2467 
2474  virtual void setCallbackYesNoPopup(CallbackYesNoPopup pfnc) = 0;
2475 
2482  virtual CallbackYesNoPopup getCallbackYesNoPopup() const = 0;
2483 
2484 
2490  virtual void setCallbackCommitErrorPopup(CallbackCommitErrorPopup pfnc) = 0;
2491 
2497  virtual CallbackCommitErrorPopup getCallbackCommitErrorPopup() const = 0;
2498 
2499 
2505  virtual void setCallbackPasswordPopup(CallbackPasswordPopup pfnc) = 0;
2506 
2513  virtual CallbackPasswordPopup getCallbackPasswordPopup() const = 0;
2514 
2515 #endif
2516 
2522  virtual void setCacheChanges (bool cache) = 0;
2523 
2527  virtual bool isCacheChanges () const = 0;
2528 
2533  virtual int commit() = 0;
2534 
2538  virtual string getErrorString(int error) const = 0;
2539 
2546  virtual int createBackupState( const string& name ) = 0;
2547 
2554  virtual int restoreBackupState( const string& name ) = 0;
2555 
2562  virtual bool checkBackupState(const string& name) const = 0;
2563 
2572  virtual bool equalBackupStates(const string& lhs, const string& rhs,
2573  bool verbose_log) const = 0;
2574 
2582  virtual int removeBackupState( const string& name ) = 0;
2583 
2591  virtual bool checkDeviceMounted(const string& device, list<string>& mps) = 0;
2592 
2603  virtual bool umountDevice( const string& device ) = 0;
2604 
2617  virtual bool umountDeviceUns( const string& device, bool unsetup ) = 0;
2618 
2629  virtual bool mountDevice( const string& device, const string& mp ) = 0;
2630 
2641  virtual int activateEncryption( const string& device, bool on ) = 0;
2642 
2654  virtual bool mountDeviceOpts( const string& device, const string& mp,
2655  const string& opts ) = 0;
2656 
2668  virtual bool mountDeviceRo( const string& device, const string& mp,
2669  const string& opts ) = 0;
2670 
2677  virtual bool checkDmMapsTo( const string& device ) = 0;
2678 
2684  virtual void removeDmTableTo( const string& device ) = 0;
2685 
2694  virtual int renameCryptDm( const string& device,
2695  const string& new_name ) = 0;
2696 
2708  virtual bool getFreeInfo(const string& device, bool get_resize, ResizeInfo& resize_info,
2709  bool get_content, ContentInfo& content_info, bool use_cache) = 0;
2710 
2718  virtual bool readFstab( const string& dir, deque<VolumeInfo>& infos) = 0;
2719 
2729  virtual void activateHld( bool val ) = 0;
2730 
2739  virtual void activateMultipath( bool val ) = 0;
2740 
2749  virtual void rescanEverything() = 0;
2750 
2759  virtual bool rescanCryptedObjects() = 0;
2760 
2764  virtual void dumpObjectList() = 0;
2765 
2769  virtual void dumpCommitInfos() const = 0;
2770 
2780  virtual int getContVolInfo(const string& dev, ContVolInfo& info) = 0;
2781 
2782  };
2783 
2784 
2788  void initDefaultLogger();
2789 
2793  void initDefaultLogger( const string& logdir );
2794 
2799  typedef void (*CallbackLogDo)( int level, const string& component, const char* file,
2800  int line, const char* function, const string& content );
2801 
2806  typedef bool (*CallbackLogQuery)( int level, const string& component );
2807 
2811  void setLogDoCallback( CallbackLogDo pfc );
2812 
2816  CallbackLogDo getLogDoCallback();
2817 
2821  void setLogQueryCallback( CallbackLogQuery pfc );
2822 
2826  CallbackLogQuery getLogQueryCallback();
2827 
2832  {
2833  Environment(bool readonly, const string& logdr="/var/log/YaST2") : readonly(readonly), testmode(false), autodetect(true),
2834  instsys(false), logdir(logdr), testdir("tmp")
2835  {
2836  storage::initDefaultLogger( logdir );
2837  }
2838 
2839  bool readonly;
2840  bool testmode;
2841  bool autodetect;
2842  bool instsys;
2843  string logdir;
2844  string testdir;
2845  };
2846 
2847 
2853  StorageInterface* createStorageInterface(const Environment& env);
2854 
2855 
2863  StorageInterface* createStorageInterfacePid(const Environment& env, int& locker_pid);
2864 
2865 
2869  void destroyStorageInterface(StorageInterface*);
2870 
2871 }
2872 
2873 
2874 #endif