Dasd.h

Go to the documentation of this file.
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         bool detectPartitionsFdasd(ProcPart& ppart);
00040         bool detectPartitions( ProcPart& ppart );
00041         bool checkFdasdOutput( SystemCmd& Cmd, ProcPart& ppart );
00042         bool scanFdasdLine( const string& Line, unsigned& nr, 
00043                             unsigned long& start, unsigned long& csize );
00044         void getGeometry( SystemCmd& cmd, unsigned long& c,
00045                           unsigned& h, unsigned& s );
00046         void redetectGeometry() {};
00047         int doCreate( Volume* v ) { return(doFdasd()); }
00048         int doRemove( Volume* v ) { return(init_disk?0:doFdasd()); }
00049         int doFdasd();
00050         int doResize( Volume* v );
00051         int doSetType( Volume* v ) { return 0; }
00052         int doCreateLabel() { return 0; }
00053         int doDasdfmt();
00054         DasdFormat fmt;
00055 
00056         Dasd& operator= ( const Dasd& rhs );
00057         friend std::ostream& operator<< (std::ostream&, const Dasd& );
00058 
00059     };
00060 
00061 }
00062 
00063 #endif

Generated on Thu Jul 6 00:40:24 2006 for yast2-storage by  doxygen 1.4.6