00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LVM_LV_H
00024 #define LVM_LV_H
00025
00026 #include <map>
00027
00028 #include "y2storage/Dm.h"
00029
00030 namespace storage
00031 {
00032
00033 class LvmVg;
00034
00035 class LvmLv : public Dm
00036 {
00037 public:
00038 LvmLv(const LvmVg& d, const string& name, const string& origin, unsigned long le,
00039 const string& uuid, const string& status, const string& alloc);
00040 LvmLv(const LvmVg& d, const string& name, const string& origin, unsigned long le,
00041 unsigned stripe);
00042 LvmLv(const LvmVg& d, const LvmLv& l);
00043
00044 virtual ~LvmLv();
00045
00046 const LvmVg* vg() const;
00047
00048 void calcSize();
00049
00050 void getState(LvmLvSnapshotStateInfo& info);
00051
00052 void setOrigin( const string& o ) { origin=o; }
00053 string getOrigin() const { return origin; }
00054
00055 bool isSnapshot() const { return !origin.empty(); }
00056 bool hasSnapshots() const;
00057
00058 void setUuid( const string& uuid ) { vol_uuid=uuid; }
00059 void setStatus( const string& s ) { status=s; }
00060 void setAlloc( const string& a ) { allocation=a; }
00061 friend std::ostream& operator<< (std::ostream& s, const LvmLv &p );
00062 virtual void print( std::ostream& s ) const { s << *this; }
00063 string removeText( bool doing ) const;
00064 string createText( bool doing ) const;
00065 string formatText( bool doing ) const;
00066 string resizeText( bool doing ) const;
00067 void getInfo( storage::LvmLvInfo& info ) const;
00068 bool equalContent( const LvmLv& rhs ) const;
00069 void logDifference( const LvmLv& d ) const;
00070
00071 protected:
00072 void init( const string& name );
00073 virtual const string shortPrintedName() const { return( "Lv" ); }
00074 LvmLv& operator=( const LvmLv& );
00075
00076 string origin;
00077
00078 string vol_uuid;
00079 string status;
00080 string allocation;
00081 mutable storage::LvmLvInfo info;
00082 };
00083
00084 }
00085
00086 #endif