00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DM_CO_H
00024 #define DM_CO_H
00025
00026 #include "y2storage/PeContainer.h"
00027 #include "y2storage/Dm.h"
00028
00029 namespace storage
00030 {
00031 class ProcPart;
00032
00033 class DmCo : public PeContainer
00034 {
00035 friend class Storage;
00036
00037 public:
00038 DmCo(Storage * const s, bool detect, ProcPart& ppart, bool only_crypt);
00039 DmCo( const DmCo& rhs );
00040
00041 void second(bool detect, ProcPart& ppart, bool only_crypt);
00042
00043 virtual ~DmCo();
00044
00045 static storage::CType staticType() { return storage::DM; }
00046 friend std::ostream& operator<< (std::ostream&, const DmCo& );
00047 bool equalContent( const Container& rhs ) const;
00048 void logDifference( const Container& d ) const;
00049 void updateDmMaps();
00050
00051 int removeDm( const string& table );
00052 int removeVolume( Volume* v );
00053
00054 protected:
00055 DmCo( Storage * const s, const string& File );
00056
00057 void getDmData(ProcPart& ppart, bool only_crypt);
00058 bool findDm( unsigned num, DmIter& i );
00059 bool findDm( unsigned num );
00060 bool findDm( const string& dev, DmIter& i );
00061 bool findDm( const string& dev );
00062 void addDm( Dm* m );
00063 void checkDm( Dm* m );
00064 void updateEntry( const Dm* m );
00065 virtual Container* getCopy() const { return( new DmCo( *this ) ); }
00066
00067 void init();
00068
00069 storage::EncryptType detectEncryption( const string& device ) const;
00070
00071 virtual void print( std::ostream& s ) const { s << *this; }
00072
00073 int doRemove( Volume* v );
00074
00075 void logData( const string& Dir );
00076 };
00077
00078 }
00079
00080 #endif