00001 #ifndef DASD_H
00002 #define DASD_H
00003
00004 #include "y2storage/Disk.h"
00005
00006 namespace storage
00007 {
00008
00009 class SystemCmd;
00010 class ProcPart;
00011
00012 class Dasd : public Disk
00013 {
00014 friend class Storage;
00015 public:
00016 Dasd( Storage * const s, const string& Name, unsigned long long Size );
00017 Dasd( const Dasd& rhs );
00018 virtual ~Dasd();
00019 int createPartition( storage::PartitionType type, long unsigned start,
00020 long unsigned len, string& device,
00021 bool checkRelaxed=false );
00022 int removePartition( unsigned nr );
00023 int changePartitionId( unsigned nr, unsigned id ) { return 0; }
00024 int resizePartition( Partition* p, unsigned long newCyl );
00025 int initializeDisk( bool value );
00026 string fdasdText() const;
00027 string dasdfmtText( bool doing ) const;
00028 static string dasdfmtTexts( bool single, const string& devs );
00029 void getCommitActions( std::list<storage::commitAction*>& l ) const;
00030 int getToCommit( storage::CommitStage stage, std::list<Container*>& col,
00031 std::list<Volume*>& vol );
00032 int commitChanges( storage::CommitStage stage );
00033 bool detectGeometry();
00034
00035 protected:
00036 enum DasdFormat { DASDF_NONE, DASDF_LDL, DASDF_CDL };
00037
00038 virtual void print( std::ostream& s ) const { s << *this; }
00039 virtual Container* getCopy() const { return( new Dasd( *this ) ); }
00040 bool detectPartitionsFdasd(ProcPart& ppart);
00041 bool detectPartitions( ProcPart& ppart );
00042 bool checkFdasdOutput( SystemCmd& Cmd, ProcPart& ppart );
00043 bool scanFdasdLine( const string& Line, unsigned& nr,
00044 unsigned long& start, unsigned long& csize );
00045 void getGeometry( SystemCmd& cmd, unsigned long& c,
00046 unsigned& h, unsigned& s );
00047 void redetectGeometry() {};
00048 int doCreate( Volume* v ) { return(doFdasd()); }
00049 int doRemove( Volume* v ) { return(init_disk?0:doFdasd()); }
00050 int doFdasd();
00051 int doResize( Volume* v );
00052 int doSetType( Volume* v ) { return 0; }
00053 int doCreateLabel() { return 0; }
00054 int doDasdfmt();
00055 DasdFormat fmt;
00056
00057 Dasd& operator= ( const Dasd& rhs );
00058 friend std::ostream& operator<< (std::ostream&, const Dasd& );
00059
00060 };
00061
00062 }
00063
00064 #endif