Author: fehr
Date: Mon Jan 21 15:04:24 2008
New Revision: 43789
URL: http://svn.opensuse.org/viewcvs/yast?rev=43789&view=rev
Log:
undo changes for SP2 in SP1
Modified:
branches/SuSE-SLE-10-SP1-Branch/storage/VERSION
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/bindings/ycp/LibStorage.i
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/doc/autodocs/.cvsignore
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EtcFstab.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Makefile.am
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/StorageInterface.h
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.cc
branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.h
branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes
branches/SuSE-SLE-10-SP1-Branch/storage/scripts/create_udev_cdrom_rules
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_create.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_ui.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_check_generated.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/nfs.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_custom_part.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_part_proposal.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/FileSystems.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Partitions.ycp
branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/VERSION?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/VERSION (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/VERSION Mon Jan 21 15:04:24 2008
@@ -1 +1 @@
-2.13.96
+2.13.94
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/bindings/ycp/LibStorage.i
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/bindings/ycp/LibStorage.i?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/bindings/ycp/LibStorage.i (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/bindings/ycp/LibStorage.i Mon Jan 21 15:04:24 2008
@@ -26,7 +26,6 @@
specialize_sequence(storage::MdInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::LoopInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::DmInfo, TO_PACK, FROM_PACK, CHECK)
-specialize_sequence(storage::NfsInfo, TO_PACK, FROM_PACK, CHECK)
%include "../../src/StorageInterface.h"
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/doc/autodocs/.cvsignore?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/doc/autodocs/.cvsignore (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/doc/autodocs/.cvsignore Mon Jan 21 15:04:24 2008
@@ -7,5 +7,3 @@
doxygen.log
doxygen.conf
installdox
-tab_?.gif
-tabs.css
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.cc Mon Jan 21 15:04:24 2008
@@ -346,9 +346,7 @@
if( (pos=i->find_first_of( delim ))!=string::npos )
{
k = i->substr( 0, pos );
- string::size_type pos2 = i->find_first_not_of( delim, pos+1 );
- if( pos2 != string::npos )
- v = i->substr( pos2 );
+ v = i->substr( i->find_first_not_of( delim, pos+1 ) );
}
if( !removeSur.empty() )
{
@@ -361,8 +359,7 @@
if( !v.empty() && (pos=v.find_last_of(removeSur))==v.size()-1 )
v.erase( v.find_last_not_of(removeSur)+1 );
}
- if( !k.empty() && !v.empty() )
- ret[k] = v;
+ ret[k] = v;
}
return( ret );
}
@@ -389,15 +386,9 @@
return( ret );
}
-bool isNfsDev( const string& dev )
- {
- return( !dev.empty() && dev[0]!='/' &&
- dev.find( ':' )!=string::npos );
- }
-
void normalizeDevice( string& dev )
{
- if( dev.find( "/dev/" )!=0 && !isNfsDev(dev) )
+ if( dev.find( "/dev/" )!=0 )
dev = "/dev/" + dev;
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/AppUtil.h Mon Jan 21 15:04:24 2008
@@ -48,7 +48,6 @@
void normalizeDevice( string& dev );
string undevDevice( const string& dev );
void undevDevice( string& dev );
-bool isNfsDev( const string& dev );
bool runningFromSystem();
void delay(int Microsec_iv);
unsigned getMajorDevices( const string& driver );
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.cc Mon Jan 21 15:04:24 2008
@@ -314,14 +314,8 @@
}
}
-void
-Container::logDifference( const Container& c ) const
- {
- y2milestone( "%s", getDiffString(c).c_str() );
- }
-
string
-Container::getDiffString( const Container& c ) const
+Container::logDifference( const Container& c ) const
{
string ret = "Name:" + nm;
if( nm!=c.nm )
@@ -381,15 +375,46 @@
if( !ret )
{
if( verbose )
- y2milestone( "%s", getDiffString( *c ).c_str() );
+ y2milestone( "%s", logDifference( *c ).c_str() );
}
else
{
- ret = equalContent( *c );
- if( !ret && verbose )
- logDifference( *c );
- if( typ==COTYPE_LAST_ENTRY || typ==CUNKNOWN )
- y2err( "Unknown Container:" << *c );
+ switch( typ )
+ {
+ case DISK:
+ ret = ((const Disk*)this)->equalContent( *(const Disk*)c );
+ if( !ret && verbose )
+ ((const Disk*)this)->logDifference( *(const Disk*)c );
+ break;
+ case MD:
+ ret = ((const MdCo*)this)->equalContent( *(const MdCo*)c );
+ if( !ret && verbose )
+ ((const MdCo*)this)->logDifference( *(const MdCo*)c );
+ break;
+ case LOOP:
+ ret = ((const LoopCo*)this)->equalContent( *(const LoopCo*)c );
+ if( !ret && verbose )
+ ((const LoopCo*)this)->logDifference( *(const LoopCo*)c );
+ break;
+ case LVM:
+ ret = ((const LvmVg*)this)->equalContent( *(const LvmVg*)c );
+ if( !ret && verbose )
+ ((const LvmVg*)this)->logDifference( *(const LvmVg*)c );
+ break;
+ case DM:
+ ret = ((const DmCo*)this)->equalContent( *(const DmCo*)c );
+ if( !ret && verbose )
+ ((const DmCo*)this)->logDifference( *(const DmCo*)c );
+ break;
+ case EVMS:
+ ret = ((const EvmsCo*)this)->equalContent( *(const EvmsCo*)c );
+ if( !ret && verbose )
+ ((const EvmsCo*)this)->logDifference( *(const EvmsCo*)c );
+ break;
+ default:
+ ret = this->equalContent( *c );
+ break;
+ }
}
return( ret );
}
@@ -415,6 +440,5 @@
*this = rhs;
}
-string Container::type_names[] = { "UNKNOWN", "DISK", "MD", "LOOP", "LVM",
- "DM", "EVMS", "NFS" };
+string Container::type_names[] = { "UNKNOWN", "DISK", "MD", "LOOP", "LVM", "DM", "EVMS" };
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Container.h Mon Jan 21 15:04:24 2008
@@ -43,9 +43,8 @@
{ return( !(*this ( const Container& rhs ) const
{ return( !(*this<=rhs) ); }
- virtual bool equalContent( const Container& rhs ) const;
- virtual string getDiffString( const Container& c ) const;
- virtual void logDifference( const Container& c ) const;
+ bool equalContent( const Container& rhs ) const;
+ string logDifference( const Container& c ) const;
virtual void getCommitActions( std::liststorage::commitAction*& l ) const;
virtual int getToCommit( storage::CommitStage stage,
@@ -132,7 +131,7 @@
public:
Container( Storage * const, const string& Name, storage::CType typ );
Container( const Container& );
- Storage * getStorage() const { return sto; }
+ Storage * const getStorage() const { return sto; }
virtual ~Container();
const string& name() const { return nm; }
const string& device() const { return dev; }
@@ -154,7 +153,7 @@
virtual string createText(bool doing=true) const;
virtual int resizeVolume( Volume* v, unsigned long long newSize );
virtual int removeVolume( Volume* v );
- static storage::CType staticType() { return storage::CUNKNOWN; }
+ static storage::CType const staticType() { return storage::CUNKNOWN; }
friend std::ostream& operator<< (std::ostream& s, const Container &c );
virtual Container* getCopy() const { return( new Container( *this ) ); }
bool compareContainer( const Container* c, bool verbose ) const;
@@ -184,8 +183,8 @@
static bool stageCreate( const Volume& v )
{ return( v.created()||v.needExtend()); }
- static string type_names[COTYPE_LAST_ENTRY];
- static unsigned order[COTYPE_LAST_ENTRY];
+ static string type_names[EVMS+1];
+ static unsigned order[EVMS+1];
Storage * const sto;
storage::CType typ;
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.cc Mon Jan 21 15:04:24 2008
@@ -413,7 +413,7 @@
if( detected_label.empty() )
detected_label = dlabel;
if( dlabel.empty() )
- dlabel = defaultLabel(size_k);
+ dlabel = defaultLabel();
setLabelData( dlabel );
if (label == "unsupported")
@@ -961,23 +961,21 @@
return( ret );
}
-#define TB (1024ULL * 1024ULL * 1024ULL)
-#define EB (1024ULL * 1024ULL * 1024ULL * 1024ULL)
-#define PB (1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
-
-string Disk::defaultLabel( unsigned long long size_k )
+string Disk::defaultLabel()
{
string ret = "msdos";
if( Storage::arch()=="ia64" )
ret = "gpt";
else if( Storage::arch()=="sparc" )
ret = "sun";
- if( size_k>2*TB )
- ret = "gpt";
- y2milestone( "size_k:%llu ret:%s", size_k, ret.c_str() );
+ y2milestone( "ret %s", ret.c_str() );
return( ret );
}
+#define TB (1024ULL * 1024ULL * 1024ULL)
+#define EB (1024ULL * 1024ULL * 1024ULL * 1024ULL)
+#define PB (1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
+
Disk::label_info Disk::labels[] = {
{ "msdos", true, 4, 63, 2*TB },
{ "gpt", false, 128, 0, 16*PB },
@@ -2498,119 +2496,108 @@
}
-
-void Disk::logDifference( const Container& d ) const
+void Disk::logDifference( const Disk& d ) const
{
- string log = getDiffString( d );
- const Disk * p = dynamic_cast(&d);
- if( p != NULL )
+ string log = Container::logDifference( d );
+ if( cyl!=d.cyl )
+ log += " Cyl:" + decString(cyl) + "-->" + decString(d.cyl);
+ if( head!=d.head )
+ log += " Head:" + decString(head) + "-->" + decString(d.head);
+ if( sector!=d.sector )
+ log += " Sect:" + decString(sector) + "-->" + decString(d.sector);
+ if( mjr!=d.mjr )
+ log += " Mjr:" + decString(mjr) + "-->" + decString(d.mjr);
+ if( mnr!=d.mnr )
+ log += " Mnr:" + decString(mnr) + "-->" + decString(d.mnr);
+ if( range!=d.range )
+ log += " Range:" + decString(range) + "-->" + decString(d.range);
+ if( size_k!=d.size_k )
+ log += " SizeK:" + decString(size_k) + "-->" + decString(d.size_k);
+ if( label!=d.label )
+ log += " Label:" + label + "-->" + d.label;
+ if( sysfs_dir!=d.sysfs_dir )
+ log += " SysfsDir:" + sysfs_dir + "-->" + d.sysfs_dir;
+ if( max_primary!=d.max_primary )
+ log += " MaxPrimary:" + decString(max_primary) + "-->" + decString(d.max_primary);
+ if( ext_possible!=d.ext_possible )
{
- if( cyl!=p->cyl )
- log += " Cyl:" + decString(cyl) + "-->" + decString(p->cyl);
- if( head!=p->head )
- log += " Head:" + decString(head) + "-->" + decString(p->head);
- if( sector!=p->sector )
- log += " Sect:" + decString(sector) + "-->" + decString(p->sector);
- if( mjr!=p->mjr )
- log += " Mjr:" + decString(mjr) + "-->" + decString(p->mjr);
- if( mnr!=p->mnr )
- log += " Mnr:" + decString(mnr) + "-->" + decString(p->mnr);
- if( range!=p->range )
- log += " Range:" + decString(range) + "-->" + decString(p->range);
- if( size_k!=p->size_k )
- log += " SizeK:" + decString(size_k) + "-->" + decString(p->size_k);
- if( label!=p->label )
- log += " Label:" + label + "-->" + p->label;
- if( sysfs_dir!=p->sysfs_dir )
- log += " SysfsDir:" + sysfs_dir + "-->" + p->sysfs_dir;
- if( max_primary!=p->max_primary )
- log += " MaxPrimary:" + decString(max_primary) + "-->" + decString(p->max_primary);
- if( ext_possible!=p->ext_possible )
- {
- if( p->ext_possible )
- log += " -->ExtPossible";
- else
- log += " ExtPossible-->";
- }
- if( max_logical!=p->max_logical )
- log += " MaxLogical:" + decString(max_logical) + "-->" + decString(p->max_logical);
- if( init_disk!=p->init_disk )
- {
- if( p->init_disk )
- log += " -->InitDisk";
- else
- log += " InitDisk-->";
- }
- if( iscsi!=p->iscsi )
+ if( d.ext_possible )
+ log += " -->ExtPossible";
+ else
+ log += " ExtPossible-->";
+ }
+ if( max_logical!=d.max_logical )
+ log += " MaxLogical:" + decString(max_logical) + "-->" + decString(d.max_logical);
+ if( init_disk!=d.init_disk )
+ {
+ if( d.init_disk )
+ log += " -->InitDisk";
+ else
+ log += " InitDisk-->";
+ }
+ if( iscsi!=d.iscsi )
+ {
+ if( d.init_disk )
+ log += " -->iSCSI";
+ else
+ log += " iSCSI-->";
+ }
+ y2milestone( "%s", log.c_str() );
+ ConstPartPair p=partPair();
+ ConstPartIter i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstPartPair pc=d.partPair();
+ ConstPartIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j!=pc.end() )
{
- if( p->iscsi )
- log += " -->iSCSI";
- else
- log += " iSCSI-->";
- }
- y2milestone( "%s", log.c_str() );
- ConstPartPair pp=partPair();
- ConstPartIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstPartPair pc=p->partPair();
- ConstPartIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->partPair();
- i=pp.begin();
- while( i!=pp.end() )
- {
- ConstPartPair pc=partPair();
- ConstPartIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
+ if( !i->equalContent( *j ) )
+ i->logDifference( *j );
}
+ else
+ y2mil( " -->" << *i );
+ ++i;
+ }
+ p=d.partPair();
+ i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstPartPair pc=partPair();
+ ConstPartIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j==pc.end() )
+ y2mil( " <--" << *i );
+ ++i;
}
- else
- y2mil( "" << log );
}
-bool Disk::equalContent( const Container& rhs ) const
+bool Disk::equalContent( const Disk& rhs ) const
{
- const Disk * p = NULL;
- bool ret = Container::equalContent(rhs);
+ bool ret = Container::equalContent(rhs) &&
+ cyl==rhs.cyl && head==rhs.head && sector==rhs.sector &&
+ mjr==rhs.mjr && mnr==rhs.mnr && range==rhs.range &&
+ size_k==rhs.size_k && max_primary==rhs.max_primary &&
+ ext_possible==rhs.ext_possible && max_logical==rhs.max_logical &&
+ init_disk==rhs.init_disk && label==rhs.label && iscsi==rhs.iscsi &&
+ sysfs_dir==rhs.sysfs_dir;
if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
- ret = cyl==p->cyl && head==p->head && sector==p->sector &&
- mjr==p->mjr && mnr==p->mnr && range==p->range &&
- size_k==p->size_k && max_primary==p->max_primary &&
- ext_possible==p->ext_possible && max_logical==p->max_logical &&
- init_disk==p->init_disk && label==p->label &&
- iscsi==p->iscsi && sysfs_dir==p->sysfs_dir;
- if( ret && p )
- {
- ConstPartPair pp = partPair();
- ConstPartPair pc = p->partPair();
- ConstPartIter i = pp.begin();
+ {
+ ConstPartPair p = partPair();
+ ConstPartPair pc = rhs.partPair();
+ ConstPartIter i = p.begin();
ConstPartIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
+ while( ret && i!=p.end() && j!=pc.end() )
{
ret = ret && i->equalContent( *j );
++i;
++j;
}
- ret = ret && i==pp.end() && j==pc.end();
+ ret == ret && i==p.end() && j==pc.end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Disk.h Mon Jan 21 15:04:24 2008
@@ -52,7 +52,7 @@
unsigned numPartitions() const;
bool isDasd() const { return( nm.find("dasd")==0 ); }
bool isLogical( unsigned nr ) const;
- static storage::CType staticType() { return storage::DISK; }
+ static storage::CType const staticType() { return storage::DISK; }
friend std::ostream& operator<< (std::ostream&, const Disk& );
void triggerUdevUpdate();
@@ -93,8 +93,8 @@
unsigned long kbToCylinder( unsigned long long ) const;
string getPartName( unsigned nr ) const;
void getInfo( storage::DiskInfo& info ) const;
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& d ) const;
+ bool equalContent( const Disk& rhs ) const;
+ void logDifference( const Disk& d ) const;
Disk& operator= ( const Disk& rhs );
bool FakeDisk() const { return(range==1); }
@@ -198,7 +198,7 @@
bool haveBsdPart( const std::list& pl) const;
void setLabelData( const string& );
- static string defaultLabel( unsigned long long size_k );
+ static string defaultLabel();
static label_info labels[];
static string p_disks[];
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.cc Mon Jan 21 15:04:24 2008
@@ -305,7 +305,7 @@
num = mnr;
}
-const PeContainer* Dm::pec() const
+const PeContainer* const Dm::pec() const
{
return(dynamic_cast(cont));
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Dm.h Mon Jan 21 15:04:24 2008
@@ -62,7 +62,7 @@
protected:
void init();
- const PeContainer* pec() const;
+ const PeContainer* const pec() const;
virtual const string shortPrintedName() const { return( "Dm" ); }
string getDevice( const string& majmin );
static void getDmMajor();
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.cc Mon Jan 21 15:04:24 2008
@@ -292,65 +292,59 @@
}
-void DmCo::logDifference( const Container& d ) const
+void DmCo::logDifference( const DmCo& d ) const
{
- y2mil( "" << getDiffString( d ));
- const DmCo * p = dynamic_cast(&d);
- if( p != NULL )
+ string log = Container::logDifference( d );
+ y2milestone( "%s", log.c_str() );
+ ConstDmPair p=dmPair();
+ ConstDmIter i=p.begin();
+ while( i!=p.end() )
{
- ConstDmPair pp=dmPair();
- ConstDmIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstDmPair pc=p->dmPair();
- ConstDmIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->dmPair();
- i=pp.begin();
- while( i!=pp.end() )
+ ConstDmPair pc=d.dmPair();
+ ConstDmIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j!=pc.end() )
{
- ConstDmPair pc=dmPair();
- ConstDmIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
+ if( !i->equalContent( *j ) )
+ i->logDifference( *j );
}
+ else
+ y2mil( " -->" << *i );
+ ++i;
+ }
+ p=d.dmPair();
+ i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstDmPair pc=dmPair();
+ ConstDmIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j==pc.end() )
+ y2mil( " <--" << *i );
+ ++i;
}
}
-bool DmCo::equalContent( const Container& rhs ) const
+bool DmCo::equalContent( const DmCo& rhs ) const
{
- const DmCo * p = NULL;
bool ret = Container::equalContent(rhs);
if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
{
- ConstDmPair pp = dmPair();
- ConstDmPair pc = p->dmPair();
- ConstDmIter i = pp.begin();
+ ConstDmPair p = dmPair();
+ ConstDmPair pc = rhs.dmPair();
+ ConstDmIter i = p.begin();
ConstDmIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
+ while( ret && i!=p.end() && j!=pc.end() )
{
ret = ret && i->equalContent( *j );
++i;
++j;
}
- ret = ret && i==pp.end() && j==pc.end();
+ ret == ret && i==p.end() && j==pc.end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/DmCo.h Mon Jan 21 15:04:24 2008
@@ -16,10 +16,10 @@
DmCo( Storage * const s, bool detect, ProcPart& ppart );
DmCo( const DmCo& rhs );
virtual ~DmCo();
- static storage::CType staticType() { return storage::DM; }
+ static storage::CType const staticType() { return storage::DM; }
friend std::ostream& operator<< (std::ostream&, const DmCo& );
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& d ) const;
+ bool equalContent( const DmCo& rhs ) const;
+ void logDifference( const DmCo& d ) const;
void updateDmMaps();
int removeDm( const string& table );
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EtcFstab.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EtcFstab.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EtcFstab.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EtcFstab.h Mon Jan 21 15:04:24 2008
@@ -16,8 +16,7 @@
struct FstabEntry
{
- FstabEntry() { freq=passno=0;
- crypto=cryptt=loop=noauto=dmcrypt=tmpcrypt=false;
+ FstabEntry() { freq=passno=0; crypto=cryptt=loop=noauto=dmcrypt=false;
encr=storage::ENC_NONE; mount_by=storage::MOUNTBY_DEVICE; }
FstabEntry& operator=( const FstabChange& rhs );
friend std::ostream& operator<< (std::ostream& s, const FstabEntry &v );
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.cc Mon Jan 21 15:04:24 2008
@@ -86,7 +86,7 @@
}
}
-const EvmsCo* Evms::evmsCo() const
+const EvmsCo* const Evms::evmsCo() const
{
return(dynamic_cast(cont));
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Evms.h Mon Jan 21 15:04:24 2008
@@ -28,7 +28,7 @@
void getInfo(storage::EvmsInfo&) const;
bool equalContent( const Evms& rhs ) const;
void logDifference( const Evms& d ) const;
- const EvmsCo* evmsCo() const;
+ const EvmsCo* const evmsCo() const;
protected:
void init( const string& name );
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.cc Mon Jan 21 15:04:24 2008
@@ -576,8 +576,8 @@
int EvmsAccess::pluginFilterFunction( const char* plugin )
{
- static const char *ExcludeList[] = { "/ext2-", "/reiser-", "/jfs-", "/xfs-",
- "/swap-", "/ocfs2-", "/ntfs-", "/hb2-" };
+ static char *ExcludeList[] = { "/ext2-", "/reiser-", "/jfs-", "/xfs-",
+ "/swap-", "/ocfs2-", "/ntfs-", "/hb2-" };
int ret = 0;
unsigned i = 0;
while( !ret && i::const_iterator Ptr_Ci = objects.begin();
@@ -1111,7 +1111,7 @@
else
{
option->count = count;
- option->option[0].name = (char *)"name";
+ option->option[0].name = "name";
option->option[0].is_number_based = false;
option->option[0].type = EVMS_Type_String;
option->option[0].flags = 0;
@@ -1120,13 +1120,13 @@
option->option[1].flags = 0;
if( NewMeta_bv )
{
- option->option[1].name = (char *)"extent_size";
+ option->option[1].name = "extent_size";
option->option[1].type = EVMS_Type_Unsigned_Int64;
option->option[1].value.i64 = PeSizeK_lv*2;
}
else
{
- option->option[1].name = (char *)"pe_size";
+ option->option[1].name = "pe_size";
option->option[1].type = EVMS_Type_Unsigned_Int32;
option->option[1].value.i32 = PeSizeK_lv*2;
}
@@ -1247,12 +1247,12 @@
else
{
option->count = count;
- option->option[0].name = (char *)"name";
+ option->option[0].name = "name";
option->option[0].is_number_based = false;
option->option[0].type = EVMS_Type_String;
option->option[0].flags = 0;
option->option[0].value.s = (char*)LvName_Cv.c_str();
- option->option[1].name = (char *)"size";
+ option->option[1].name = "size";
option->option[1].is_number_based = false;
option->option[1].flags = 0;
if( lvm2 )
@@ -1267,7 +1267,7 @@
}
if( Stripe_lv>1 )
{
- option->option[2].name = (char *)"stripes";
+ option->option[2].name = "stripes";
option->option[2].is_number_based = false;
option->option[2].flags = 0;
if( lvm2 )
@@ -1282,7 +1282,7 @@
}
if( StripeSizeK_lv )
{
- option->option[3].name = (char *)"stripe_size";
+ option->option[3].name = "stripe_size";
option->option[3].is_number_based = false;
option->option[3].flags = 0;
if( lvm2 )
@@ -1762,13 +1762,13 @@
option.option[0].flags = 0;
if( !lvm2 )
{
- option.option[0].name = (char *)"add_size";
+ option.option[0].name = "add_size";
option.option[0].type = EVMS_Type_Unsigned_Int32;
option.option[0].value.i32 = (SizeK_lv-Rg_p->sizeK())*2;
}
else
{
- option.option[0].name = (char *)"size";
+ option.option[0].name = "size";
option.option[0].type = EVMS_Type_Unsigned_Int64;
option.option[0].value.i64 = (SizeK_lv-Rg_p->sizeK())*2;
}
@@ -1788,13 +1788,13 @@
option.option[0].is_number_based = false;
if( !lvm2 )
{
- option.option[0].name = (char *)"remove_size";
+ option.option[0].name = "remove_size";
option.option[0].type = EVMS_Type_Unsigned_Int32;
option.option[0].value.i32 = (Rg_p->sizeK()-SizeK_lv)*2;
}
else
{
- option.option[0].name = (char *)"size";
+ option.option[0].name = "size";
option.option[0].type = EVMS_Type_Unsigned_Int64;
option.option[0].value.i64 = (Rg_p->sizeK()-SizeK_lv)*2;
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsAccess.h Mon Jan 21 15:04:24 2008
@@ -33,7 +33,7 @@
ObjType type() const { return typ; };
const string& name() const { return nam; };
- object_handle_t id() const { return idt; };
+ const object_handle_t id() const { return idt; };
void disownPtr() { own_ptr = false; };
void output( std::ostream& Stream ) const;
@@ -61,8 +61,8 @@
public:
EvmsDataObject( EvmsObject *const obj );
EvmsDataObject( object_handle_t id );
- const EvmsObject * consumedBy() const { return consumed; };
- const EvmsObject * volume() const { return vol; };
+ const EvmsObject *const consumedBy() const { return consumed; };
+ const EvmsObject *const volume() const { return vol; };
void output( std::ostream& Stream ) const;
virtual void addRelation( EvmsAccess* Acc );
@@ -141,8 +141,8 @@
class EvmsAccess
{
public:
- EvmsObject * addObject( object_handle_t id );
- EvmsObject * find( object_handle_t id );
+ EvmsObject *const addObject( object_handle_t id );
+ EvmsObject *const find( object_handle_t id );
EvmsAccess();
~EvmsAccess();
void output( std::ostream &Stream ) const;
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.cc Mon Jan 21 15:04:24 2008
@@ -1872,89 +1872,76 @@
}
-void EvmsCo::logDifference( const Container& d ) const
+void EvmsCo::logDifference( const EvmsCo& d ) const
{
- const EvmsCo * p = dynamic_cast(&d);
- if( p )
+ string log = PeContainer::logDifference( d );
+ if( lvm1!=d.lvm1 )
{
- string log = PeContainer::getDiffString( *p );
- if( lvm1!=p->lvm1 )
- {
- if( p->lvm1 )
- log += " -->lvm1";
- else
- log += " lvm1-->";
- }
- if( container!=p->container )
- {
- if( p->container )
- log += " -->cont";
- else
- log += " cont-->";
- }
- if( uuid!=p->uuid )
- log += " UUID:" + uuid + "-->" + p->uuid;
- y2milestone( "%s", log.c_str() );
- ConstEvmsPair pp=evmsPair();
- ConstEvmsIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstEvmsPair pc=p->evmsPair();
- ConstEvmsIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->evmsPair();
- i=pp.begin();
- while( i!=pp.end() )
+ if( d.lvm1 )
+ log += " -->lvm1";
+ else
+ log += " lvm1-->";
+ }
+ if( container!=d.container )
+ {
+ if( d.container )
+ log += " -->cont";
+ else
+ log += " cont-->";
+ }
+ if( uuid!=d.uuid )
+ log += " UUID:" + uuid + "-->" + d.uuid;
+ y2milestone( "%s", log.c_str() );
+ ConstEvmsPair p=evmsPair();
+ ConstEvmsIter i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstEvmsPair pc=d.evmsPair();
+ ConstEvmsIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j!=pc.end() )
{
- ConstEvmsPair pc=evmsPair();
- ConstEvmsIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
+ if( !i->equalContent( *j ) )
+ i->logDifference( *j );
}
+ else
+ y2mil( " -->" << *i );
+ ++i;
+ }
+ p=d.evmsPair();
+ i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstEvmsPair pc=evmsPair();
+ ConstEvmsIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j==pc.end() )
+ y2mil( " <--" << *i );
+ ++i;
}
- else
- y2mil( "" << Container::getDiffString(d) );
}
-bool EvmsCo::equalContent( const Container& rhs ) const
+bool EvmsCo::equalContent( const EvmsCo& rhs ) const
{
- const EvmsCo * p = NULL;
- bool ret = Container::equalContent(rhs);
+ bool ret = PeContainer::equalContent(rhs,false) &&
+ uuid==rhs.uuid && lvm1==rhs.lvm1 && container==rhs.container;
if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
- {
- ret = PeContainer::equalContent(*p,false) &&
- uuid==p->uuid && lvm1==p->lvm1 && container==p->container;
- }
- if( ret && p )
{
- ConstEvmsPair pp = evmsPair();
- ConstEvmsPair pc = p->evmsPair();
- ConstEvmsIter i = pp.begin();
+ ConstEvmsPair p = evmsPair();
+ ConstEvmsPair pc = rhs.evmsPair();
+ ConstEvmsIter i = p.begin();
ConstEvmsIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
+ while( ret && i!=p.end() && j!=pc.end() )
{
ret = ret && i->equalContent( *j );
++i;
++j;
}
- ret = ret && i==pp.end() && j==pc.end();
+ ret == ret && i==p.end() && j==pc.end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/EvmsCo.h Mon Jan 21 15:04:24 2008
@@ -92,7 +92,7 @@
unsigned numVol() const { return vols.size(); }
bool lvm2() const { return( !lvm1 ); }
bool isContainer() const { return( container ); }
- static storage::CType staticType() { return storage::EVMS; }
+ static storage::CType const staticType() { return storage::EVMS; }
friend std::ostream& operator<< (std::ostream&, const EvmsCo& );
int removeCo();
@@ -119,8 +119,8 @@
int removeVolume( Volume* v );
void addVolume( Evms* v );
void getInfo( storage::EvmsCoInfo& info ) const;
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& d ) const;
+ bool equalContent( const EvmsCo& rhs ) const;
+ void logDifference( const EvmsCo& d ) const;
bool checkConsistency() const;
void updateMd();
void changeDeviceName( const string& old, const string& nw );
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.cc Mon Jan 21 15:04:24 2008
@@ -345,65 +345,59 @@
}
-void LoopCo::logDifference( const Container& d ) const
+void LoopCo::logDifference( const LoopCo& d ) const
{
- y2mil( "" << getDiffString( d ));
- const LoopCo * p = dynamic_cast(&d);
- if( p != NULL )
+ string log = Container::logDifference( d );
+ y2milestone( "%s", log.c_str() );
+ ConstLoopPair p=loopPair();
+ ConstLoopIter i=p.begin();
+ while( i!=p.end() )
{
- ConstLoopPair pp=loopPair();
- ConstLoopIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstLoopPair pc=p->loopPair();
- ConstLoopIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->loopPair();
- i=pp.begin();
- while( i!=pp.end() )
+ ConstLoopPair pc=d.loopPair();
+ ConstLoopIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j!=pc.end() )
{
- ConstLoopPair pc=loopPair();
- ConstLoopIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
+ if( !i->equalContent( *j ) )
+ i->logDifference( *j );
}
+ else
+ y2mil( " -->" << *i );
+ ++i;
+ }
+ p=d.loopPair();
+ i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstLoopPair pc=loopPair();
+ ConstLoopIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j==pc.end() )
+ y2mil( " <--" << *i );
+ ++i;
}
}
-bool LoopCo::equalContent( const Container& rhs ) const
+bool LoopCo::equalContent( const LoopCo& rhs ) const
{
- const LoopCo * p = NULL;
bool ret = Container::equalContent(rhs);
if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
{
- ConstLoopPair pp = loopPair();
- ConstLoopPair pc = p->loopPair();
- ConstLoopIter i = pp.begin();
+ ConstLoopPair p = loopPair();
+ ConstLoopPair pc = rhs.loopPair();
+ ConstLoopIter i = p.begin();
ConstLoopIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
+ while( ret && i!=p.end() && j!=pc.end() )
{
ret = ret && i->equalContent( *j );
++i;
++j;
}
- ret = ret && i==pp.end() && j==pc.end();
+ ret == ret && i==p.end() && j==pc.end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LoopCo.h Mon Jan 21 15:04:24 2008
@@ -17,7 +17,7 @@
LoopCo( const LoopCo& rhs );
virtual ~LoopCo();
- static storage::CType staticType() { return storage::LOOP; }
+ static storage::CType const staticType() { return storage::LOOP; }
friend std::ostream& operator<< (std::ostream&, const LoopCo& );
int createLoop( const string& file, bool reuseExisting,
@@ -28,8 +28,8 @@
void loopIds( std::list<unsigned>& l ) const;
int removeVolume( Volume* v );
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& d ) const;
+ bool equalContent( const LoopCo& rhs ) const;
+ void logDifference( const LoopCo& d ) const;
protected:
// iterators over LOOP volumes
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.cc Mon Jan 21 15:04:24 2008
@@ -1436,83 +1436,72 @@
}
-void LvmVg::logDifference( const Container& d ) const
+void LvmVg::logDifference( const LvmVg& d ) const
{
- const LvmVg * p = dynamic_cast(&d);
- if( p )
+ string log = PeContainer::logDifference( d );
+ if( status!=d.status )
+ log += " status:" + status + "-->" + d.status;
+ if( lvm1!=d.lvm1 )
{
- string log = PeContainer::getDiffString( *p );
- if( status!=p->status )
- log += " status:" + status + "-->" + p->status;
- if( lvm1!=p->lvm1 )
- {
- if( p->lvm1 )
- log += " -->lvm1";
- else
- log += " lvm1-->";
- }
- if( uuid!=p->uuid )
- log += " UUID:" + uuid + "-->" + p->uuid;
- y2milestone( "%s", log.c_str() );
- ConstLvmLvPair pp=lvmLvPair();
- ConstLvmLvIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstLvmLvPair pc=p->lvmLvPair();
- ConstLvmLvIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->lvmLvPair();
- i=pp.begin();
- while( i!=pp.end() )
+ if( d.lvm1 )
+ log += " -->lvm1";
+ else
+ log += " lvm1-->";
+ }
+ if( uuid!=d.uuid )
+ log += " UUID:" + uuid + "-->" + d.uuid;
+ y2milestone( "%s", log.c_str() );
+ ConstLvmLvPair p=lvmLvPair();
+ ConstLvmLvIter i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstLvmLvPair pc=d.lvmLvPair();
+ ConstLvmLvIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j!=pc.end() )
{
- ConstLvmLvPair pc=lvmLvPair();
- ConstLvmLvIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
+ if( !i->equalContent( *j ) )
+ i->logDifference( *j );
}
+ else
+ y2mil( " -->" << *i );
+ ++i;
+ }
+ p=d.lvmLvPair();
+ i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstLvmLvPair pc=lvmLvPair();
+ ConstLvmLvIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j==pc.end() )
+ y2mil( " <--" << *i );
+ ++i;
}
- else
- y2mil( "" << Container::getDiffString(d) );
}
-bool LvmVg::equalContent( const Container& rhs ) const
+bool LvmVg::equalContent( const LvmVg& rhs ) const
{
- const LvmVg * p = NULL;
- bool ret = Container::equalContent(rhs);
+ bool ret = PeContainer::equalContent(rhs,false) &&
+ status==rhs.status && uuid==rhs.uuid && lvm1==rhs.lvm1 &&
+ inactiv==rhs.inactiv && num_lv==rhs.num_lv;
if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
- ret = PeContainer::equalContent(*p,false) &&
- status==p->status && uuid==p->uuid && lvm1==p->lvm1 &&
- inactiv==p->inactiv && num_lv==p->num_lv;
- if( ret && p )
{
- ConstLvmLvPair pp = lvmLvPair();
- ConstLvmLvPair pc = p->lvmLvPair();
- ConstLvmLvIter i = pp.begin();
+ ConstLvmLvPair p = lvmLvPair();
+ ConstLvmLvPair pc = rhs.lvmLvPair();
+ ConstLvmLvIter i = p.begin();
ConstLvmLvIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
+ while( ret && i!=p.end() && j!=pc.end() )
{
ret = ret && i->equalContent( *j );
++i;
++j;
}
- ret = ret && i==pp.end() && j==pc.end();
+ ret == ret && i==p.end() && j==pc.end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/LvmVg.h Mon Jan 21 15:04:24 2008
@@ -19,7 +19,7 @@
unsigned numLv() const { return vols.size(); }
bool lvm2() const { return( !lvm1 ); }
bool inactive() const { return( inactiv ); }
- static storage::CType staticType() { return storage::LVM; }
+ static storage::CType const staticType() { return storage::LVM; }
friend std::ostream& operator<< (std::ostream&, const LvmVg& );
int removeVg();
@@ -43,8 +43,8 @@
int resizeVolume( Volume* v, unsigned long long newSize );
int removeVolume( Volume* v );
void getInfo( storage::LvmVgInfo& info ) const;
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& rhs ) const;
+ bool equalContent( const LvmVg& rhs ) const;
+ void logDifference( const LvmVg& rhs ) const;
static void activate( bool val=true );
static void getVgs( std::list<string>& l );
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Makefile.am?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Makefile.am (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Makefile.am Mon Jan 21 15:04:24 2008
@@ -33,7 +33,6 @@
DmCo.cc DmCo.h \
MdCo.cc MdCo.h \
LoopCo.cc LoopCo.h \
- NfsCo.cc NfsCo.h \
Volume.cc Volume.h \
Partition.cc Partition.h \
Dm.cc Dm.h \
@@ -41,7 +40,6 @@
Evms.cc Evms.h \
Md.cc Md.h \
Loop.cc Loop.h \
- Nfs.cc Nfs.h \
SystemCmd.cc SystemCmd.h \
OutputProcessor.cc OutputProcessor.h \
Regex.cc Regex.h \
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc Mon Jan 21 15:04:24 2008
@@ -592,21 +592,6 @@
getStorage()->waitForDevice( m->device() );
getMdData( m->nr() );
updateEntry( m );
- bool used_as_pv = m->getUsedByType()==UB_EVMS ||
- m->getUsedByType()==UB_LVM;
- y2milestone( "zeroNew:%d used_as_pv:%d",
- getStorage()->getZeroNewPartitions(), used_as_pv );
- if( used_as_pv || getStorage()->getZeroNewPartitions() )
- {
- string cmd;
- SystemCmd c;
- cmd = "dd if=/dev/zero of=" + m->device() + " bs=1k count=200";
- c.execute( cmd );
- cmd = "dd if=/dev/zero of=" + m->device() +
- " seek=" + decString(m->sizeK()-10) +
- " bs=1k count=10";
- c.execute( cmd );
- }
}
}
else
@@ -688,65 +673,59 @@
}
-void MdCo::logDifference( const Container& d ) const
+void MdCo::logDifference( const MdCo& d ) const
{
- y2mil( "" << getDiffString( d ));
- const MdCo * p = dynamic_cast(&d);
- if( p != NULL )
+ string log = Container::logDifference( d );
+ y2milestone( "%s", log.c_str() );
+ ConstMdPair p=mdPair();
+ ConstMdIter i=p.begin();
+ while( i!=p.end() )
{
- ConstMdPair pp=mdPair();
- ConstMdIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstMdPair pc=p->mdPair();
- ConstMdIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->mdPair();
- i=pp.begin();
- while( i!=pp.end() )
- {
- ConstMdPair pc=mdPair();
- ConstMdIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
+ ConstMdPair pc=d.mdPair();
+ ConstMdIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j!=pc.end() )
+ {
+ if( !i->equalContent( *j ) )
+ i->logDifference( *j );
}
+ else
+ y2mil( " -->" << *i );
+ ++i;
+ }
+ p=d.mdPair();
+ i=p.begin();
+ while( i!=p.end() )
+ {
+ ConstMdPair pc=mdPair();
+ ConstMdIter j = pc.begin();
+ while( j!=pc.end() &&
+ (i->device()!=j->device() || i->created()!=j->created()) )
+ ++j;
+ if( j==pc.end() )
+ y2mil( " <--" << *i );
+ ++i;
}
}
-bool MdCo::equalContent( const Container& rhs ) const
+bool MdCo::equalContent( const MdCo& rhs ) const
{
- const MdCo * p = NULL;
bool ret = Container::equalContent(rhs);
if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
{
- ConstMdPair pp = mdPair();
- ConstMdPair pc = p->mdPair();
- ConstMdIter i = pp.begin();
+ ConstMdPair p = mdPair();
+ ConstMdPair pc = rhs.mdPair();
+ ConstMdIter i = p.begin();
ConstMdIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
+ while( ret && i!=p.end() && j!=pc.end() )
{
ret = ret && i->equalContent( *j );
++i;
++j;
}
- ret = ret && i==pp.end() && j==pc.end();
+ ret == ret && i==p.end() && j==pc.end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.h Mon Jan 21 15:04:24 2008
@@ -18,7 +18,7 @@
MdCo( const MdCo& rhs );
virtual ~MdCo();
- static storage::CType staticType() { return storage::MD; }
+ static storage::CType const staticType() { return storage::MD; }
friend std::ostream& operator<< (std::ostream&, const MdCo& );
int createMd( unsigned num, storage::MdType type,
@@ -30,8 +30,8 @@
int changeMdChunk( unsigned num, unsigned long chunk );
int changeMdParity( unsigned num, storage::MdParity ptype );
int checkMd( unsigned num );
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& d ) const;
+ bool equalContent( const MdCo& rhs ) const;
+ void logDifference( const MdCo& d ) const;
unsigned unusedNumber();
void syncRaidtab();
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.cc Mon Jan 21 15:04:24 2008
@@ -1,113 +0,0 @@
-/*
- Textdomain "storage"
-*/
-
-#include <sstream>
-
-#include
-
-#include "y2storage/Nfs.h"
-#include "y2storage/StorageTypes.h"
-#include "y2storage/Container.h"
-#include "y2storage/AppUtil.h"
-#include "y2storage/Storage.h"
-#include "y2storage/SystemCmd.h"
-
-using namespace storage;
-using namespace std;
-
-Nfs::Nfs( const NfsCo& d, const string& NfsDev ) :
- Volume( d, 0, 0 )
- {
- y2debug( "constructed nfs dev:%s", NfsDev.c_str() );
- if( d.type() != NFSC )
- y2error( "constructed nfs with wrong container" );
- dev = canonicalName(NfsDev);
- if( dev != NfsDev )
- alt_names.push_back( NfsDev );
- init();
- }
-
-Nfs::~Nfs()
- {
- y2debug( "destructed nfs %s", dev.c_str() );
- }
-
-string Nfs::removeText( bool doing ) const
- {
- string txt;
- if( doing )
- {
- // displayed text during action, %1$s is replaced by volume name e.g. hilbert:/work
- txt = sformat( _("Removing nfs volume %1$s"), dev.c_str() );
- }
- else
- {
- // displayed text before action, %1$s is replaced by volume name e.g. hilbert:/work
- txt = sformat( _("Remove nfs volume %1$s"), dev.c_str() );
- }
- return( txt );
- }
-
-void
-Nfs::init()
- {
- numeric = false;
- nm = dev;
- setFs(NFS);
- }
-
-string Nfs::canonicalName( const string& d )
- {
- string dev(d);
- string::size_type pos = 0;
- while( (pos=dev.find("//",pos))!=string::npos )
- dev.erase(pos,1);
- if( !dev.empty() && *dev.rbegin()=='/' )
- dev.erase(dev.size()-1);
- if( dev!=d )
- y2mil( "dev:" << dev << " d:" << d );
- return(dev);
- }
-
-void Nfs::getInfo( NfsInfo& tinfo ) const
- {
- ((Volume*)this)->getInfo( info.v );
- tinfo = info;
- }
-
-namespace storage
-{
-
-std::ostream& operator<< (std::ostream& s, const Nfs& l )
- {
- s << "Nfs " << *(Volume*)&l;
- return( s );
- }
-
-}
-
-bool Nfs::equalContent( const Nfs& rhs ) const
- {
- return( Volume::equalContent(rhs) );
- }
-
-void Nfs::logDifference( const Nfs& rhs ) const
- {
- string log = Volume::logDifference( rhs );
- y2milestone( "%s", log.c_str() );
- }
-
-Nfs& Nfs::operator= ( const Nfs& rhs )
- {
- y2debug( "operator= from %s", rhs.nm.c_str() );
- *((Volume*)this) = rhs;
- return( *this );
- }
-
-Nfs::Nfs( const NfsCo& d, const Nfs& rhs ) : Volume(d)
- {
- y2debug( "constructed nfs by copy constructor from %s", rhs.nm.c_str() );
- *this = rhs;
- }
-
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Nfs.h Mon Jan 21 15:04:24 2008
@@ -1,38 +0,0 @@
-#ifndef NFS_H
-#define NFS_H
-
-#include "y2storage/Volume.h"
-
-namespace storage
-{
-class NfsCo;
-
-class Nfs : public Volume
- {
- public:
- Nfs( const NfsCo& d, const string& NfsDev );
- Nfs( const NfsCo& d, const Nfs& rhs );
- virtual ~Nfs();
- friend std::ostream& operator<< (std::ostream& s, const Nfs& l );
-
- static string canonicalName( const string& dev );
- static bool notDeleted( const Nfs& l ) { return( !l.deleted() ); }
-
- virtual void print( std::ostream& s ) const { s << *this; }
-
- void getInfo( storage::NfsInfo& info ) const;
- bool equalContent( const Nfs& rhs ) const;
- void logDifference( const Nfs& d ) const;
-
- string removeText( bool doing=true ) const;
-
- protected:
- void init();
- Nfs& operator=( const Nfs& );
-
- mutable storage::NfsInfo info;
- };
-
-}
-
-#endif
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.cc Mon Jan 21 15:04:24 2008
@@ -1,297 +0,0 @@
-/*
- Textdomain "storage"
-*/
-
-#include <iostream>
-#include <sstream>
-
-#include "y2storage/NfsCo.h"
-#include "y2storage/Nfs.h"
-#include "y2storage/AppUtil.h"
-#include "y2storage/ProcMounts.h"
-#include "y2storage/Storage.h"
-#include "y2storage/EtcFstab.h"
-
-using namespace storage;
-using namespace std;
-
-NfsCo::NfsCo( Storage * const s, ProcMounts& mounts ) :
- Container(s,"nfs",staticType())
- {
- y2debug( "constructing NfsCo detect" );
- init();
- getNfsData( mounts );
- }
-
-NfsCo::NfsCo( Storage * const s ) :
- Container(s,"nfs",staticType())
- {
- y2debug( "constructing NfsCo" );
- init();
- }
-
-NfsCo::NfsCo( Storage * const s, const string& file ) :
- Container(s,"nfs",staticType())
- {
- y2debug( "constructing NfsCo file:%s", file.c_str() );
- init();
- }
-
-NfsCo::~NfsCo()
- {
- y2debug( "destructed NfsCo" );
- }
-
-void
-NfsCo::init()
- {
- }
-
-bool NfsCo::isNfsDev( const string& dev )
- {
- bool ret = dev.find( ":/" )device(), nfs ))
- {
- ret = NFS_VOLUME_NOT_FOUND;
- }
- if( readonly() )
- {
- ret = NFS_CHANGE_READONLY;
- }
- if( ret==0 )
- {
- if( nfs->created() )
- {
- if( !removeFromList( &(*nfs) ))
- ret = NFS_REMOVE_VOLUME_CREATE_NOT_FOUND;
- }
- else
- nfs->setDeleted();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-NfsCo::doRemove( Volume* v )
- {
- Nfs * p = dynamic_cast(v);
- int ret = 0;
- if( p != NULL )
- {
- if( !silent )
- {
- getStorage()->showInfoCb( p->removeText(true) );
- }
- y2milestone( "doRemove container %s name %s", name().c_str(),
- p->name().c_str() );
- ret = v->prepareRemove();
- if( ret==0 )
- {
- if( !removeFromList( p ) )
- ret = NFS_REMOVE_VOLUME_LIST_ERASE;
- }
- }
- else
- {
- ret = NFS_REMOVE_INVALID_VOLUME;
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-NfsCo::addNfs( const string& nfsDev, unsigned long long sizeK,
- const string& mp )
- {
- y2mil( "nfsDev:" << nfsDev << " sizeK:" << sizeK << " mp:" << mp );
- Nfs *n = new Nfs( *this, nfsDev );
- n->changeMount( mp );
- n->setSize( sizeK );
- addToList( n );
- return( 0 );
- }
-
-void
-NfsCo::getNfsData( ProcMounts& mounts )
- {
- y2mil( "begin fstab:" << getStorage()->getFstab() );
- list<FstabEntry> l;
- getStorage()->getFstab()->getEntries(l);
- for( list<FstabEntry>::const_iterator i=l.begin(); i!=l.end(); ++i )
- {
- if( i->fs == "nfs" )
- {
- Nfs *n = new Nfs( *this, i->device );
- n->setMount( i->mount );
- string op = mergeString(i->opts, "," );
- if( op != "defaults" )
- n->setFstabOption( op );
- addToList( n );
- }
- }
- l.clear();
- mounts.getEntries(l);
- const char * ign_opt[] = { "hard", "rw", "v3", "v2", "lock" };
- const char * ign_beg[] = { "proto=", "addr=", "vers=" };
- for( list<FstabEntry>::iterator i=l.begin(); i!=l.end(); ++i )
- {
- if( i->fs == "nfs" )
- {
- Nfs *n = NULL;
- NfsIter nfs;
- if( findNfs( i->device, nfs ))
- {
- n = &(*nfs);
- }
- else
- {
- n = new Nfs( *this, i->device );
- list<string>::iterator si = i->opts.begin();
- unsigned pos = 0;
- while( si!=i->opts.end() )
- {
- pos=0;
- while( posopts.erase(si);
- else
- {
- pos=0;
- while( posfind(ign_beg[pos])!=0 )
- ++pos;
- if( posopts.erase(si);
- else
- ++si;
- }
- }
- n->setIgnoreFstab();
- n->setFstabOption( mergeString(i->opts, "," ) );
- addToList( n );
- }
- unsigned long long sz = getStorage()->getDfSize( i->mount );
- n->setSize( sz );
- }
- }
- l.clear();
- }
-
-bool
-NfsCo::findNfs( const string& dev, NfsIter& i )
- {
- NfsPair p=nfsPair();
- i=p.begin();
- while( i!=p.end() && i->device()!=dev )
- ++i;
- return( i!=p.end() );
- }
-
-bool
-NfsCo::findNfs( const string& dev )
- {
- NfsIter i;
- return( findNfs( dev, i ));
- }
-
-
-void NfsCo::logData( const string& Dir ) {;}
-
-namespace storage
-{
-
-inline std::ostream& operator<< (std::ostream& s, const NfsCo& d )
- {
- s << *((Container*)&d);
- return( s );
- }
-
-}
-
-void NfsCo::logDifference( const Container& d ) const
- {
- y2mil( "" << Container::getDiffString( d ));
- const NfsCo* p = dynamic_cast(&d);
- if( p != NULL )
- {
- ConstNfsPair pp=nfsPair();
- ConstNfsIter i=pp.begin();
- while( i!=pp.end() )
- {
- ConstNfsPair pc=p->nfsPair();
- ConstNfsIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j!=pc.end() )
- {
- if( !i->equalContent( *j ) )
- i->logDifference( *j );
- }
- else
- y2mil( " -->" << *i );
- ++i;
- }
- pp=p->nfsPair();
- i=pp.begin();
- while( i!=pp.end() )
- {
- ConstNfsPair pc=nfsPair();
- ConstNfsIter j = pc.begin();
- while( j!=pc.end() &&
- (i->device()!=j->device() || i->created()!=j->created()) )
- ++j;
- if( j==pc.end() )
- y2mil( " <--" << *i );
- ++i;
- }
- }
- }
-
-bool NfsCo::equalContent( const Container& rhs ) const
- {
- const NfsCo* p = NULL;
- bool ret = Container::equalContent(rhs);
- if( ret )
- p = dynamic_cast(&rhs);
- if( ret && p )
- {
- ConstNfsPair pp = nfsPair();
- ConstNfsPair pc = p->nfsPair();
- ConstNfsIter i = pp.begin();
- ConstNfsIter j = pc.begin();
- while( ret && i!=pp.end() && j!=pc.end() )
- {
- ret = ret && i->equalContent( *j );
- ++i;
- ++j;
- }
- ret = ret && i==pp.end() && j==pc.end();
- }
- return( ret );
- }
-
-NfsCo::NfsCo( const NfsCo& rhs ) : Container(rhs)
- {
- y2debug( "constructed NfsCo by copy constructor from %s", rhs.nm.c_str() );
- *this = rhs;
- ConstNfsPair p = rhs.nfsPair();
- for( ConstNfsIter i=p.begin(); i!=p.end(); ++i )
- {
- Nfs * p = new Nfs( *this, *i );
- vols.push_back( p );
- }
- }
-
-
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/NfsCo.h Mon Jan 21 15:04:24 2008
@@ -1,95 +0,0 @@
-#ifndef NFS_CO_H
-#define NFS_CO_H
-
-#include "y2storage/Container.h"
-#include "y2storage/Nfs.h"
-
-namespace storage
-{
-class NfsCo : public Container
- {
- friend class Storage;
-
- public:
- NfsCo( Storage * const s, ProcMounts& mounts );
- NfsCo( Storage * const s );
- NfsCo( const NfsCo& rhs );
-
- virtual ~NfsCo();
- static storage::CType staticType() { return storage::NFSC; }
- friend std::ostream& operator<< ( std::ostream&, const NfsCo& );
- int addNfs( const string& nfsDev, unsigned long long sizeK,
- const string& mp );
-
- static bool isNfsDev( const string& dev );
- int removeVolume( Volume* v );
- int doRemove( Volume* );
-
- bool equalContent( const Container& rhs ) const;
- void logDifference( const Container& d ) const;
-
- protected:
- // iterators over NFS volumes
- // protected typedefs for iterators over NFS volumes
- typedef CastIterator NfsInter;
- typedef CastIterator NfsCInter;
- template< class Pred >
- struct NfsPI { typedef ContainerIter type; };
- template< class Pred >
- struct NfsCPI { typedef ContainerIter type; };
- typedef CheckFnc<const Nfs> CheckFncNfs;
- typedef CheckerIterator< CheckFncNfs, NfsPI<CheckFncNfs>::type,
- NfsInter, Nfs > NfsPIterator;
- typedef CheckerIterator< CheckFncNfs, NfsCPI<CheckFncNfs>::type,
- NfsCInter, const Nfs > NfsCPIterator;
- typedef DerefIterator NfsIter;
- typedef DerefIterator ConstNfsIter;
- typedef IterPair<NfsIter> NfsPair;
- typedef IterPair<ConstNfsIter> ConstNfsPair;
-
- NfsPair nfsPair( bool (* Check)( const Nfs& )=NULL)
- {
- return( NfsPair( nfsBegin( Check ), nfsEnd( Check ) ));
- }
- NfsIter nfsBegin( bool (* Check)( const Nfs& )=NULL)
- {
- IterPair<NfsInter> p( (NfsInter(begin())), (NfsInter(end())) );
- return( NfsIter( NfsPIterator( p, Check )) );
- }
- NfsIter nfsEnd( bool (* Check)( const Nfs& )=NULL)
- {
- IterPair<NfsInter> p( (NfsInter(begin())), (NfsInter(end())) );
- return( NfsIter( NfsPIterator( p, Check, true )) );
- }
-
- ConstNfsPair nfsPair( bool (* Check)( const Nfs& )=NULL) const
- {
- return( ConstNfsPair( nfsBegin( Check ), nfsEnd( Check ) ));
- }
- ConstNfsIter nfsBegin( bool (* Check)( const Nfs& )=NULL) const
- {
- IterPair<NfsCInter> p( (NfsCInter(begin())), (NfsCInter(end())) );
- return( ConstNfsIter( NfsCPIterator( p, Check )) );
- }
- ConstNfsIter nfsEnd( bool (* Check)( const Nfs& )=NULL) const
- {
- IterPair<NfsCInter> p( (NfsCInter(begin())), (NfsCInter(end())) );
- return( ConstNfsIter( NfsCPIterator( p, Check, true )) );
- }
-
- NfsCo( Storage * const s, const string& File );
-
- bool findNfs( const string& dev, NfsIter& i );
- bool findNfs( const string& dev );
- void getNfsData( ProcMounts& mounts );
- void init();
-
- virtual void print( std::ostream& s ) const { s << *this; }
- virtual Container* getCopy() const { return( new NfsCo( *this ) ); }
-
- void logData( const string& Dir );
- };
-
-}
-
-#endif
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.cc Mon Jan 21 15:04:24 2008
@@ -283,7 +283,7 @@
return( txt );
}
-const Disk* Partition::disk() const
+const Disk* const Partition::disk() const
{
return(dynamic_cast(cont));
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Partition.h Mon Jan 21 15:04:24 2008
@@ -57,7 +57,7 @@
string setTypeText( bool doing=true ) const;
int setFormat( bool format=true, storage::FsType fs=storage::REISERFS );
int changeMount( const string& val );
- const Disk* disk() const;
+ const Disk* const disk() const;
bool isWindows() const;
friend std::ostream& operator<< (std::ostream& s, const Partition &p );
static bool notDeleted( const Partition&d ) { return( !d.deleted() ); }
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.cc Mon Jan 21 15:04:24 2008
@@ -617,77 +617,74 @@
}
-string PeContainer::getDiffString( const Container& rhs ) const
+string PeContainer::logDifference( const PeContainer& rhs ) const
{
- string ret = Container::getDiffString( rhs );
- const PeContainer* p = dynamic_cast(&rhs);
- if( p )
- {
- if( pe_size!=p->pe_size )
- ret += " PeSize:" + decString(pe_size) + "-->" + decString(p->pe_size);
- if( num_pe!=p->num_pe )
- ret += " PE:" + decString(num_pe) + "-->" + decString(p->num_pe);
- if( free_pe!=p->free_pe )
- ret += " Free:" + decString(free_pe) + "-->" + decString(p->free_pe);
- string tmp;
- list<Pv>::const_iterator i = pv.begin();
- list<Pv>::const_iterator j;
- while( i!=pv.end() )
- {
- j = find( p->pv.begin(), p->pv.end(), *i );
- if( j==p->pv.end() )
- tmp += i->device + "-->";
- ++i;
- }
- i = p->pv.begin();
- while( i!=p->pv.end() )
- {
- j = find( pv.begin(), pv.end(), *i );
- if( j==pv.end() )
- tmp += "<--" + i->device;
- ++i;
- }
- if( !tmp.empty() )
- ret += " Pv:" + tmp;
- tmp.erase();
- i = pv_add.begin();
- while( i!=pv_add.end() )
- {
- j = find( p->pv_add.begin(), p->pv_add.end(), *i );
- if( j==p->pv_add.end() )
- tmp += i->device + "-->";
- ++i;
- }
- i = p->pv_add.begin();
- while( i!=p->pv_add.end() )
- {
- j = find( pv_add.begin(), pv_add.end(), *i );
- if( j==pv_add.end() )
- tmp += "<--" + i->device;
- ++i;
- }
- if( !tmp.empty() )
- ret += " PvAdd:" + tmp;
- tmp.erase();
- i = pv_remove.begin();
- while( i!=pv_remove.end() )
- {
- j = find( p->pv_remove.begin(), p->pv_remove.end(), *i );
- if( j==p->pv_remove.end() )
- tmp += i->device + "-->";
- ++i;
- }
- i = p->pv_remove.begin();
- while( i!=p->pv_remove.end() )
- {
- j = find( pv_remove.begin(), pv_remove.end(), *i );
- if( j==pv_remove.end() )
- tmp += "<--" + i->device;
- ++i;
- }
- if( !tmp.empty() )
- ret += " PvRemove:" + tmp;
+ string ret = Container::logDifference( rhs );
+ if( pe_size!=rhs.pe_size )
+ ret += " PeSize:" + decString(pe_size) + "-->" + decString(rhs.pe_size);
+ if( num_pe!=rhs.num_pe )
+ ret += " PE:" + decString(num_pe) + "-->" + decString(rhs.num_pe);
+ if( free_pe!=rhs.free_pe )
+ ret += " Free:" + decString(free_pe) + "-->" + decString(rhs.free_pe);
+ string tmp;
+ list<Pv>::const_iterator i = pv.begin();
+ list<Pv>::const_iterator j;
+ while( i!=pv.end() )
+ {
+ j = find( rhs.pv.begin(), rhs.pv.end(), *i );
+ if( j==rhs.pv.end() )
+ tmp += i->device + "-->";
+ ++i;
+ }
+ i = rhs.pv.begin();
+ while( i!=rhs.pv.end() )
+ {
+ j = find( pv.begin(), pv.end(), *i );
+ if( j==pv.end() )
+ tmp += "<--" + i->device;
+ ++i;
+ }
+ if( !tmp.empty() )
+ ret += " Pv:" + tmp;
+ tmp.erase();
+ i = pv_add.begin();
+ while( i!=pv_add.end() )
+ {
+ j = find( rhs.pv_add.begin(), rhs.pv_add.end(), *i );
+ if( j==rhs.pv_add.end() )
+ tmp += i->device + "-->";
+ ++i;
+ }
+ i = rhs.pv_add.begin();
+ while( i!=rhs.pv_add.end() )
+ {
+ j = find( pv_add.begin(), pv_add.end(), *i );
+ if( j==pv_add.end() )
+ tmp += "<--" + i->device;
+ ++i;
+ }
+ if( !tmp.empty() )
+ ret += " PvAdd:" + tmp;
+ tmp.erase();
+ i = pv_remove.begin();
+ while( i!=pv_remove.end() )
+ {
+ j = find( rhs.pv_remove.begin(), rhs.pv_remove.end(), *i );
+ if( j==rhs.pv_remove.end() )
+ tmp += i->device + "-->";
+ ++i;
+ }
+ i = rhs.pv_remove.begin();
+ while( i!=rhs.pv_remove.end() )
+ {
+ j = find( pv_remove.begin(), pv_remove.end(), *i );
+ if( j==pv_remove.end() )
+ tmp += "<--" + i->device;
+ ++i;
}
+ if( !tmp.empty() )
+ ret += " PvRemove:" + tmp;
+ tmp.erase();
return( ret );
}
@@ -730,7 +727,7 @@
CVIter j = begin();
while( ret && i!=rhs.end() && j!=end() )
ret = ret && ((Dm*)(&(*j)))->equalContent( *(Dm*)(&(*i)));
- ret = ret && i==rhs.end() && j==end();
+ ret == ret && i==rhs.end() && j==end();
}
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/PeContainer.h Mon Jan 21 15:04:24 2008
@@ -30,7 +30,7 @@
void unuseDev();
void changeDeviceName( const string& old, const string& nw );
bool equalContent( const PeContainer& rhs, bool comp_vol=true ) const;
- virtual string getDiffString( const Container& d ) const;
+ string logDifference( const PeContainer& d ) const;
protected:
struct Pv
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.cc Mon Jan 21 15:04:24 2008
@@ -25,6 +25,7 @@
getline( mounts, line );
while( mounts.good() )
{
+ y2mil( "line:\"" << line << "\"" );
string dev = extractNthWord( 0, line );
if( dev.find( "/by-label/" ) != string::npos )
{
@@ -50,10 +51,7 @@
}
if( dev!= "rootfs" && dev!="/dev/root" )
{
- co[dev].device = dev;
- co[dev].mount = extractNthWord( 1, line );
- co[dev].fs = extractNthWord( 2, line );
- co[dev].opts = splitString( extractNthWord( 3, line ), "," );
+ co[dev] = extractNthWord( 1, line );
}
getline( mounts, line );
}
@@ -65,8 +63,7 @@
{
dev = sto->findNormalDevice( dev );
}
- co[dev].device = dev;
- co[dev].mount = "/";
+ co[dev] = "/";
}
mounts.close();
mounts.clear();
@@ -83,26 +80,19 @@
y2mil( "dev:" << dev );
dev.erase( pos );
}
- co[dev].device = dev;
- co[dev].mount = "swap";
- co[dev].fs = "swap";
+ co[dev] = "swap";
getline( mounts, line );
}
- map::const_iterator i = co.begin();
- while( i!=co.end() )
- {
- y2mil( "co:[" << i->first << "]-->" << i->second );
- ++i;
- }
+ y2mil( "co:" << co );
}
string
ProcMounts::getMount( const string& dev ) const
{
string ret;
- map::const_iterator i = co.find( dev );
+ map::const_iterator i = co.find( dev );
if( i!=co.end() )
- ret = i->second.mount;
+ ret = i->second;
return( ret );
}
@@ -123,19 +113,12 @@
ProcMounts::allMounts() const
{
map ret;
- for( map::const_iterator i = co.begin(); i!=co.end(); ++i )
+ map::const_iterator i = co.begin();
+ for( map::const_iterator i = co.begin(); i!=co.end(); ++i )
{
- ret[i->second.mount] = i->first;
+ ret[i->second] = i->first;
}
return( ret );
}
-void ProcMounts::getEntries( list<FstabEntry>& l ) const
- {
- l.clear();
- for( map::const_iterator i = co.begin(); i!=co.end(); ++i )
- {
- l.push_back( i->second );
- }
- }
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/ProcMounts.h Mon Jan 21 15:04:24 2008
@@ -5,8 +5,6 @@
#include <list>
#include <map>
-#include "y2storage/EtcFstab.h"
-
namespace storage
{
class Storage;
@@ -18,9 +16,8 @@
string getMount( const string& Dev ) const;
string getMount( const std::list<string>& dl ) const;
std::map allMounts() const;
- void getEntries( std::list<FstabEntry>& l ) const;
protected:
- std::map co;
+ std::map co;
};
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.cc Mon Jan 21 15:04:24 2008
@@ -259,10 +259,7 @@
{
fstab = new EtcFstab( "/etc", isRootMounted() );
detectLoops( ppart );
- ProcMounts pm( this );
- if( !instsys() )
- detectNfs( pm );
- detectFsData( vBegin(), vEnd(), pm );
+ detectFsData( vBegin(), vEnd() );
}
EvmsCoIterator e = findEvmsCo( "" );
if( e!=evCoEnd() )
@@ -485,26 +482,6 @@
}
}
-void Storage::detectNfs( ProcMounts& mounts )
- {
- if( test() )
- {
- string file = testdir+"/nfs";
- if( access( file.c_str(), R_OK )==0 )
- {
- addToList( new NfsCo( this, file ) );
- }
- }
- else
- {
- NfsCo * v = new NfsCo( this, mounts );
- if( !v->isEmpty() )
- addToList( v );
- else
- delete v;
- }
- }
-
void
Storage::detectLvmVgs()
{
@@ -772,8 +749,7 @@
}
void
-Storage::detectFsData( const VolIterator& begin, const VolIterator& end,
- ProcMounts& mounts )
+Storage::detectFsData( const VolIterator& begin, const VolIterator& end )
{
y2milestone( "detectFsData begin" );
SystemCmd Blkid( "BLKID_SKIP_CHECK_MDRAID=1 /sbin/blkid -c /dev/null" );
@@ -787,12 +763,13 @@
y2mil( "detect:" << *i );
}
}
+ ProcMounts Mounts( this );
for( VolIterator i=begin; i!=end; ++i )
{
if( i->getUsedByType()==UB_NONE )
{
if( detectMounted )
- i->getMountData( mounts );
+ i->getMountData( Mounts );
i->getFstabData( *fstab );
y2mil( "detect:" << *i );
if( i->getFs()==FSUNKNOWN && i->getEncryption()==ENC_NONE )
@@ -1430,13 +1407,7 @@
string
Storage::defaultDiskLabel() const
{
- return( Disk::defaultLabel(0) );
- }
-
-string
-Storage::defaultDiskLabelSize( unsigned long long size_k ) const
- {
- return( Disk::defaultLabel(size_k) );
+ return( Disk::defaultLabel() );
}
unsigned long long
@@ -2447,8 +2418,7 @@
{
detectEvms();
VPair p = vPair( isEvms );
- ProcMounts pm( this );
- detectFsData( p.begin(), p.end(), pm );
+ detectFsData( p.begin(), p.end() );
EvmsCoPair ep = evCoPair();
EvmsCoIterator coi = ep.begin();
while( coi!=ep.end() && coi->device()!="/dev/evms" )
@@ -3150,87 +3120,6 @@
return( i != p.end() );
}
-bool Storage::haveNfs( NfsCo*& co )
- {
- co = NULL;
- CPair p = cPair();
- ContIterator i = p.begin();
- while( i != p.end() && i->type()!=NFSC )
- ++i;
- if( i != p.end() )
- co = static_cast(&(*i));
- return( i != p.end() );
- }
-
-int
-Storage::addNfsDevice( const string& nfsDev, const string& opts,
- unsigned long long sizeK, const string& mp )
- {
- int ret = 0;
- assertInit();
- y2mil( "name:" << nfsDev << " sizeK:" << sizeK << " mp:" << mp );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- NfsCo *co = NULL;
- bool have = true;
- if( ret==0 )
- {
- have = haveNfs(co);
- if( !have )
- co = new NfsCo( this );
- }
- if( ret==0 && co!=NULL )
- {
- if( sizeK==0 )
- checkNfsDevice( nfsDev, opts, sizeK );
- ret = co->addNfs( nfsDev, sizeK, mp );
- }
- if( !have )
- {
- if( ret==0 )
- addToList( co );
- else if( co!=NULL )
- delete co;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::checkNfsDevice( const string& nfsDev, const string& opts,
- unsigned long long& sizeK )
- {
- int ret = 0;
- assertInit();
- NfsCo co( this );
- string mdir = tmpDir() + "/tmp_mp";
- unlink( mdir.c_str() );
- rmdir( mdir.c_str() );
- createPath( mdir );
- ret = co.addNfs( nfsDev, 0, "" );
- if( !opts.empty() )
- co.vBegin()->setFstabOption( opts );
- if( instsys() )
- {
- SystemCmd c;
- c.execute( "/sbin/portmap" );
- }
- if( ret==0 && (ret=co.vBegin()->mount( mdir ))==0 )
- {
- sizeK = getDfSize( mdir );
- ret = co.vBegin()->umount( mdir );
- }
- y2mil( "name:" << nfsDev << " opts:" << opts << " ret:" << ret <<
- " sizeK:" << sizeK );
- return( ret );
- }
-
int
Storage::createFileLoop( const string& lname, bool reuseExisting,
unsigned long long sizeK, const string& mp,
@@ -4229,20 +4118,6 @@
return( ret );
}
-int Storage::getNfsInfo( dequestorage::NfsInfo& plist )
- {
- int ret = 0;
- plist.clear();
- assertInit();
- ConstNfsPair p = nfsPair(Nfs::notDeleted);
- for( ConstNfsIterator i = p.begin(); i != p.end(); ++i )
- {
- plist.push_back( NfsInfo() );
- i->getInfo( plist.back() );
- }
- return( ret );
- }
-
int Storage::getLoopInfo( dequestorage::LoopInfo& plist )
{
int ret = 0;
@@ -4304,7 +4179,7 @@
static FsCapabilitiesX ext2Caps (true, false, true, false, true, true,
true, 16, 16);
- static FsCapabilitiesX ext3Caps (true, true, true, false, true, true,
+ static FsCapabilitiesX ext3Caps (true, false, true, false, true, true,
true, 16, 10*1024);
static FsCapabilitiesX xfsCaps (true, true, false, false, true, true,
@@ -4325,9 +4200,6 @@
static FsCapabilitiesX hfsCaps (false, false, false, false, false, false,
false, 0, 10*1024);
- static FsCapabilitiesX nfsCaps (false, false, false, false, false, false,
- false, 0, 10*1024);
-
switch (fstype)
{
case REISERFS:
@@ -4362,10 +4234,6 @@
fscapabilities = hfsCaps;
return true;
- case NFS:
- fscapabilities = nfsCaps;
- return true;
-
case SWAP:
fscapabilities = swapCaps;
return true;
@@ -4577,7 +4445,7 @@
}
void
-Storage::logCo( Container* c ) const
+Storage::logCo( Container* c )
{
std::ostringstream b;
c->print( b );
@@ -5073,11 +4941,6 @@
{
if( haveMd(md) )
md->syncRaidtab();
- if( instsys() )
- {
- string path = root()+"/etc/fstab";
- unlink( path.c_str() );
- }
int ret = fstab->changeRootPrefix( root()+"/etc" );
if( ret!=0 )
y2error( "changeRootPrefix returns %d", ret );
@@ -5183,32 +5046,10 @@
return( ret );
}
-unsigned long long
-Storage::getDfSize( const string& mp )
- {
- unsigned long long ret = 0;
- struct statvfs64 fsbuf;
- if( statvfs64( mp.c_str(), &fsbuf )==0 )
- {
- ret = fsbuf.f_blocks;
- ret *= fsbuf.f_bsize;
- ret /= 1024;
- y2milestone( "blocks:%llu free:%llu bsize:%lu", fsbuf.f_blocks,
- fsbuf.f_bfree, fsbuf.f_bsize );
- }
- else
- {
- y2war( "errno:" << errno << " " << strerror(errno));
- }
- y2mil( "mp:" << mp << " ret:" << ret );
- return( ret );
- }
-
bool
Storage::getFreeInfo( const string& device, unsigned long long& resize_free,
unsigned long long& df_free,
- unsigned long long& used, bool& win, bool& efi,
- bool use_cache )
+ unsigned long long& used, bool& win, bool use_cache )
{
bool ret = false;
assertInit();
@@ -5218,7 +5059,7 @@
if( findVolume( device, vol ) )
{
if( use_cache && getFreeInf( vol->device(), df_free, resize_free,
- used, win, efi, ret ))
+ used, win, ret ))
{
}
else
@@ -5241,8 +5082,8 @@
mp = vol->getMount();
if( !mp.empty() )
{
- struct statvfs64 fsbuf;
- ret = statvfs64( mp.c_str(), &fsbuf )==0;
+ struct statvfs fsbuf;
+ ret = statvfs( mp.c_str(), &fsbuf )==0;
if( ret )
{
df_free = fsbuf.f_bfree;
@@ -5252,8 +5093,8 @@
used = fsbuf.f_blocks-fsbuf.f_bfree;
used *= fsbuf.f_bsize;
used /= 1024;
- y2milestone( "blocks:%llu free:%llu bsize:%lu",
- fsbuf.f_blocks, fsbuf.f_bfree, fsbuf.f_bsize );
+ y2milestone( "blocks:%lu free:%lu bsize:%lu", fsbuf.f_blocks,
+ fsbuf.f_bfree, fsbuf.f_bsize );
y2milestone( "free:%llu used:%llu", df_free, used );
}
if( ret && vol->getFs()==NTFS )
@@ -5291,9 +5132,6 @@
win = access( f.c_str(), R_OK )==0;
i++;
}
- efi = vol->getFs()==VFAT && checkDir( mp + "/efi" );
- if( efi )
- win = false;
}
if( needUmount )
{
@@ -5308,8 +5146,7 @@
if( !ret )
vol->crUnsetup();
}
- setFreeInfo( vol->device(), df_free, resize_free, used, win, efi,
- ret );
+ setFreeInfo( vol->device(), df_free, resize_free, used, win, ret );
}
}
if( ret )
@@ -5321,21 +5158,19 @@
void Storage::setFreeInfo( const string& device, unsigned long long df_free,
unsigned long long resize_free,
- unsigned long long used, bool win, bool efi,
- bool resize_ok )
+ unsigned long long used, bool win, bool resize_ok )
{
- y2milestone( "device:%s df_free:%llu resize_free:%llu used:%llu win:%d efi:%d",
- device.c_str(), df_free, resize_free, used, win, efi );
+ y2milestone( "device:%s df_free:%llu resize_free:%llu used:%llu win:%d",
+ device.c_str(), df_free, resize_free, used, win );
- FreeInfo inf( df_free, resize_free, used, win, efi, resize_ok );
+ FreeInfo inf( df_free, resize_free, used, win, resize_ok );
freeInfo[device] = inf;
}
bool
Storage::getFreeInf( const string& device, unsigned long long& df_free,
unsigned long long& resize_free,
- unsigned long long& used, bool& win, bool& efi,
- bool& resize_ok )
+ unsigned long long& used, bool& win, bool& resize_ok )
{
map::iterator i = freeInfo.find( device );
bool ret = i!=freeInfo.end();
@@ -5345,13 +5180,12 @@
resize_free = i->second.resize_free;
used = i->second.used;
win = i->second.win;
- efi = i->second.efi;
resize_ok = i->second.rok;
}
y2milestone( "device:%s ret:%d", device.c_str(), ret );
if( ret )
- y2milestone( "df_free:%llu resize_free:%llu used:%llu win:%d efi:%d resize_ok:%d",
- df_free, resize_free, used, win, efi, resize_ok );
+ y2milestone( "df_free:%llu resize_free:%llu used:%llu win:%d resize_ok:%d",
+ df_free, resize_free, used, win, resize_ok );
return( ret );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Storage.h Mon Jan 21 15:04:24 2008
@@ -21,8 +21,6 @@
#include "y2storage/DmCo.h"
#include "y2storage/LoopCo.h"
#include "y2storage/Loop.h"
-#include "y2storage/NfsCo.h"
-#include "y2storage/Nfs.h"
#include "y2storage/FilterIterator.h"
#include "y2storage/DerefIterator.h"
#include "y2storage/ListListIterator.h"
@@ -118,8 +116,6 @@
{ return( d.type()==storage::MD ); }
static bool isLoop( const Container&d )
{ return( d.type()==storage::LOOP ); }
- static bool isNfs( const Container&d )
- { return( d.type()==storage::NFSC ); }
static bool isDm( const Container&d )
{ return( d.type()==storage::DM ); }
struct FreeInfo
@@ -128,15 +124,12 @@
unsigned long long df_free;
unsigned long long used;
bool win;
- bool efi;
bool rok;
- FreeInfo() { resize_free=df_free=used=0; efi=win=rok=false; }
+ FreeInfo() { resize_free=df_free=used=0; win=rok=false; }
FreeInfo( unsigned long long df,
unsigned long long resize,
- unsigned long long usd, bool w=false, bool e=false,
- bool r=true )
- { resize_free=resize; df_free=df; used=usd; win=w;
- efi=e, rok=r; }
+ unsigned long long usd, bool w=false, bool r=true )
+ { resize_free=resize; df_free=df; used=usd; win=w; rok=r; }
};
public:
@@ -163,7 +156,7 @@
void handleLogFile( const string& name );
static bool testFilesEqual( const string& n1, const string& n2 );
void printInfo( std::ostream& str );
- void logCo( Container* c ) const;
+ void logCo( Container* c );
void logCo( const string& device );
void logProcData( const string& l="" );
storage::UsedByType usedBy( const string& dev );
@@ -210,7 +203,6 @@
dequestorage::EvmsInfo& plist );
int getMdInfo( dequestorage::MdInfo& plist );
int getDmInfo( dequestorage::DmInfo& plist );
- int getNfsInfo( dequestorage::NfsInfo& plist );
int getLoopInfo( dequestorage::LoopInfo& plist );
int getContVolInfo( const string& dev, ContVolInfo& info);
@@ -241,7 +233,6 @@
int destroyPartitionTable( const string& disk, const string& label );
int initializeDisk( const string& disk, bool value );
string defaultDiskLabel() const;
- string defaultDiskLabelSize( unsigned long long size_k ) const;
unsigned long long maxSizeLabelK( const string& label ) const;
int changeFormatVolume( const string& device, bool format,
@@ -289,9 +280,7 @@
bool readFstab( const string& dir, dequestorage::VolumeInfo& infos);
bool getFreeInfo( const string& device, unsigned long long& resize_free,
unsigned long long& df_free,
- unsigned long long& used, bool& win, bool& efi,
- bool use_cache );
- unsigned long long getDfSize( const string& mp );
+ unsigned long long& used, bool& win, bool use_cache );
int createBackupState( const string& name );
int removeBackupState( const string& name );
int restoreBackupState( const string& name );
@@ -345,11 +334,6 @@
int checkMd( const string& name );
- int addNfsDevice( const string& nfsDev, const string& opts,
- unsigned long long sizeK, const string& mp );
- int checkNfsDevice( const string& nfsDev, const string& opts,
- unsigned long long& sizeK );
-
int createFileLoop( const string& lname, bool reuseExisting,
unsigned long long sizeK, const string& mp,
const string& pwd, string& device );
@@ -1192,66 +1176,6 @@
return( typename ConstLoopI<Pred>::type( typename ConstLoopPI<Pred>::type(pair, p, true )) );
}
-// iterators over nfs devices
- protected:
- // protected typedefs for iterators over nfs devices
- typedef CastIterator ConstNfsInter;
- template< class Pred >
- struct ConstNfsPI { typedef ContainerIter type; };
- typedef CheckFnc<const Nfs> CheckFncNfs;
- typedef CheckerIterator< CheckFncNfs, ConstNfsPI<CheckFncNfs>::type,
- ConstNfsInter, Nfs > ConstNfsPIterator;
- public:
- // public typedefs for iterators over nfs devices
- template< class Pred >
- struct ConstNfsI
- { typedef ContainerDerIter type; };
- template< class Pred >
- struct NfsCondIPair
- { typedef MakeCondIterPair type;};
- typedef DerefIterator ConstNfsIterator;
- typedef IterPair<ConstNfsIterator> ConstNfsPair;
-
- // public member functions for iterators over nfs devices
- ConstNfsPair nfsPair( bool (* CheckNfs)( const Nfs& )=NULL ) const
- {
- return( ConstNfsPair( nfsBegin( CheckNfs ), nfsEnd( CheckNfs ) ));
- }
- ConstNfsIterator nfsBegin( bool (* CheckNfs)( const Nfs& )=NULL ) const
- {
- ConstVolInter b( contPair( isNfs ) );
- ConstVolInter e( contPair( isNfs ), true );
- IterPair<ConstNfsInter> p( (ConstNfsInter(b)), (ConstNfsInter(e)) );
- return( ConstNfsIterator( ConstNfsPIterator(p, CheckNfs )));
- }
- ConstNfsIterator nfsEnd( bool (* CheckNfs)( const Nfs& )=NULL ) const
- {
- ConstVolInter b( contPair( isNfs ) );
- ConstVolInter e( contPair( isNfs ), true );
- IterPair<ConstNfsInter> p( (ConstNfsInter(b)), (ConstNfsInter(e)) );
- return( ConstNfsIterator( ConstNfsPIterator(p, CheckNfs, true )));
- }
- template< class Pred > typename NfsCondIPair<Pred>::type nfsCondPair( const Pred& p ) const
- {
- return( typename NfsCondIPair<Pred>::type( nfsCondBegin( p ), nfsCondEnd( p ) ) );
- }
- template< class Pred > typename ConstNfsI<Pred>::type nfsCondBegin( const Pred& p ) const
- {
- ConstVolInter b( contPair( isNfs ) );
- ConstVolInter e( contPair( isNfs ), true );
- IterPair<ConstNfsInter> pair( (ConstNfsInter(b)), (ConstNfsInter(e)) );
- return( typename ConstNfsI<Pred>::type( typename ConstNfsPI<Pred>::type(pair, p) ) );
- }
- template< class Pred > typename ConstNfsI<Pred>::type nfsCondEnd( const Pred& p ) const
- {
- ConstVolInter b( contPair( isNfs ) );
- ConstVolInter e( contPair( isNfs ), true );
- IterPair<ConstNfsInter> pair( (ConstNfsInter(b)), (ConstNfsInter(e)) );
- return( typename ConstNfsI<Pred>::type( typename ConstNfsPI<Pred>::type(pair, p, true )) );
- }
-
// iterators over device mapper devices
protected:
// protected typedefs for iterators over device mapper devices
@@ -1320,13 +1244,11 @@
void detectMultipath();
void detectMds();
void detectLoops( ProcPart& ppart );
- void detectNfs( ProcMounts& mounts );
void detectLvmVgs();
void detectEvms();
void detectDm( ProcPart& ppart );
void initDisk( DiskData& data, ProcPart& pp );
- void detectFsData( const VolIterator& begin, const VolIterator& end,
- ProcMounts& mounts );
+ void detectFsData( const VolIterator& begin, const VolIterator& end );
void detectFsDataTestMode( const string& file,
const VolIterator& begin,
const VolIterator& end );
@@ -1347,7 +1269,6 @@
bool findContainer( const string& device, ContIterator& c );
bool haveMd( MdCo*& md );
- bool haveNfs( NfsCo*& co );
bool haveLoop( LoopCo*& loop );
bool haveEvms();
void handleEvmsRemoveDevice( const Disk* disk, const string& d,
@@ -1371,12 +1292,10 @@
void deleteBackups();
void setFreeInfo( const string& device, unsigned long long df_free,
unsigned long long resize_free,
- unsigned long long used, bool win, bool efi,
- bool resize_ok );
+ unsigned long long used, bool win, bool resize_ok );
bool getFreeInf( const string& device, unsigned long long& df_free,
unsigned long long& resize_free,
- unsigned long long& used, bool& win, bool& efi,
- bool& resize_ok );
+ unsigned long long& used, bool& win, bool& resize_ok );
// protected internal member variables
bool readonly;
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/StorageInterface.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/StorageInterface.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/StorageInterface.h Mon Jan 21 15:04:24 2008
@@ -80,7 +80,7 @@
namespace storage
{
- enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, VFAT, XFS, JFS, HFS, NTFS, SWAP, NFS, FSNONE };
+ enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, VFAT, XFS, JFS, HFS, NTFS, SWAP, FSNONE };
enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY };
@@ -96,8 +96,7 @@
enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_EVMS, UB_DM };
- enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, EVMS, NFSC,
- COTYPE_LAST_ENTRY };
+ enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, EVMS };
/**
@@ -311,15 +310,6 @@
};
/**
- * Contains info about a nfs volumes
- */
- struct NfsInfo
- {
- NfsInfo() {};
- VolumeInfo v;
- };
-
- /**
* Contains info about a file based loop devices.
*/
struct LoopInfo
@@ -456,9 +446,6 @@
VOLUME_CRYPTFORMAT_FAILED = -3033,
VOLUME_CRYPTSETUP_FAILED = -3034,
VOLUME_CRYPTUNSETUP_FAILED = -3035,
- VOLUME_FORMAT_NOT_IMPLEMENTED = -3036,
- VOLUME_FORMAT_NFS_IMPOSSIBLE = -3037,
- VOLUME_CRYPT_NFS_IMPOSSIBLE = -3038,
LVM_CREATE_PV_FAILED = -4000,
LVM_PV_ALREADY_CONTAINED = -4001,
@@ -594,12 +581,6 @@
DASD_FDASD_FAILED = -11001,
DASD_DASDFMT_FAILED = -11002,
- NFS_VOLUME_NOT_FOUND = -14001,
- NFS_CHANGE_READONLY = -14002,
- NFS_REMOVE_VOLUME_CREATE_NOT_FOUND = -14003,
- NFS_REMOVE_VOLUME_LIST_ERASE = -14004,
- NFS_REMOVE_INVALID_VOLUME = -14005,
-
CONTAINER_INTERNAL_ERROR = -99000,
CONTAINER_INVALID_VIRTUAL_CALL = -99001,
@@ -736,14 +717,6 @@
virtual int getMdInfo( deque<MdInfo>& plist ) = 0;
/**
- * Query infos for nfs devices in system
- *
- * @param plist list of records that get filled with nfs info
- * @return zero if all is ok, a negative number to indicate an error
- */
- virtual int getNfsInfo( deque<NfsInfo>& plist ) = 0;
-
- /**
* Query infos for file based loop devices in system
*
* @param plist list of records that get filled with loop specific info
@@ -959,17 +932,6 @@
virtual string defaultDiskLabel() const = 0;
/**
- * Query the default disk label of the architecture of the
- * machine (e.g. msdos for ix86, gpt for ia64, ...) for a disk
- * with certain size
- *
- * @param size_k size of disk in kilobyte
- *
- * @return default disk label of the disk
- */
- virtual string defaultDiskLabelSize( unsigned long long size_k ) const = 0;
-
- /**
* Query the maximal allowed size the given disk label supports.
*
* @return maximal supported size of disk label
@@ -1631,30 +1593,6 @@
virtual int checkMd( const string& name ) = 0;
/**
- * Add knowdlege about existence of nfs device.
- *
- * @param nfsDev name of nfs device
- * @param sizeK size of the nfs device
- * @param opts mount options for nfs mount
- * @param mp mount point of the nfs device
- * @return zero if all is ok, a negative number to indicate an error
- */
- virtual int addNfsDevice( const string& nfsDev, const string& opts,
- unsigned long long sizeK,
- const string& mp ) = 0;
-
- /**
- * Check accessability and size of nfs device.
- *
- * @param nfsDev name of nfs device
- * @param opts mount options for nfs mount
- * @param sizeK size of the nfs device
- * @return zero if all is ok, a negative number to indicate an error
- */
- virtual int checkNfsDevice( const string& nfsDev, const string& opts,
- unsigned long long& sizeK ) = 0;
-
- /**
* Create a file based loop device. Encryption is automatically
* activated on the loop device.
*
@@ -1922,7 +1860,7 @@
unsigned long long& resize_free,
unsigned long long& df_free,
unsigned long long& used,
- bool& win, bool& efi, bool use_cache ) = 0;
+ bool& win, bool use_cache ) = 0;
/**
* Read fstab and cryptotab, if existent, from a specified directory and
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.cc?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.cc (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.cc Mon Jan 21 15:04:24 2008
@@ -467,10 +467,6 @@
{
ret = VOLUME_FORMAT_FS_TOO_SMALL;
}
- else if( new_fs == NFS )
- {
- ret = VOLUME_FORMAT_NFS_IMPOSSIBLE;
- }
else
{
fs = new_fs;
@@ -1075,11 +1071,8 @@
}
if( ret==0 && !mp.empty() && !cont->getStorage()->test() )
{
- if( fs!=NFS )
- {
- cont->getStorage()->removeDmTableTo( *this );
- ret = checkDevice(mountDevice());
- }
+ cont->getStorage()->removeDmTableTo( *this );
+ ret = checkDevice(mountDevice());
if( ret==0 )
ret = mount( lmount );
}
@@ -1121,17 +1114,11 @@
int Volume::resizeFs()
{
- SystemCmd c;
- string cmd;
int ret = 0;
- if( encryption!=ENC_NONE && !dmcrypt_dev.empty() )
- {
- cmd = "cryptsetup resize ";
- cmd += dmcrypt_dev.substr(dmcrypt_dev.rfind( '/' )+1);
- c.execute( cmd );
- }
if( !format && !ignore_fs )
{
+ string cmd;
+ SystemCmd c;
switch( fs )
{
case SWAP:
@@ -1250,8 +1237,6 @@
{
if( !loop_active && !isTmpCryptMp(mp) && crypt_pwd.empty() )
ret = VOLUME_CRYPT_NO_PWD;
- if( ret == 0 && cType()==NFSC )
- ret = VOLUME_CRYPT_NFS_IMPOSSIBLE;
if( ret==0 && format )
{
encryption = typ;
@@ -2264,7 +2249,7 @@
{
changed = true;
che.fs = fs_names[fs];
- if( fs==NFS || fs==SWAP || encryption!=ENC_NONE )
+ if( fs==SWAP )
che.freq = che.passno = 0;
else
{
@@ -2279,13 +2264,6 @@
if( !dmcrypt() )
che.loop_dev = fstab_loop_dev;
che.dentry = de;
- if( encryption!=ENC_NONE )
- che.freq = che.passno = 0;
- else
- {
- che.freq = 1;
- che.passno = (mp=="/") ? 1 : 2;
- }
}
if( changed )
{
@@ -2315,8 +2293,8 @@
che.fs = fs_names[fs];
getFstabOpts( che.opts );
che.mount = mp;
- if( fs != NFS && fs != SWAP && fs != FSUNKNOWN && fs != NTFS &&
- fs != VFAT && !is_loop && !dmcrypt() && !optNoauto() )
+ if( fs != SWAP && fs != FSUNKNOWN && fs != NTFS && fs != VFAT &&
+ !is_loop && !dmcrypt() && !optNoauto() )
{
che.freq = 1;
che.passno = (mp=="/") ? 1 : 2;
@@ -2596,17 +2574,13 @@
{
s << "Device:" << v.dev;
if( v.numeric )
- {
- if( v.num>0 )
- s << " Nr:" << v.num;
- }
- else if( v.nm!=v.dev )
+ s << " Nr:" << v.num;
+ else
s << " Name:" << v.nm;
s << " SizeK:" << v.size_k;
if( v.size_k != v.orig_size_k )
s << " orig_SizeK:" << v.orig_size_k;
- if( v.mjr!=0 || v.mnr!=0 )
- s << " Node <" << v.mjr << ":" << v.mnr << ">";
+ s << " Node <" << v.mjr << ":" << v.mnr << ">";
if( v.ronly )
s << " readonly";
if( v.del )
@@ -2896,8 +2870,7 @@
}
string Volume::fs_names[] = { "unknown", "reiserfs", "ext2", "ext3", "vfat",
- "xfs", "jfs", "hfs", "ntfs", "swap", "nfs",
- "none" };
+ "xfs", "jfs", "hfs", "ntfs", "swap", "none" };
string Volume::mb_names[] = { "device", "uuid", "label", "id", "path" };
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.h?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.h (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/Volume.h Mon Jan 21 15:04:24 2008
@@ -91,8 +91,7 @@
void initLabel( const string& lbl ) { label=orig_label=lbl; }
storage::MountByType getMountBy() const { return mount_by; }
const string& getFstabOption() const { return fstab_opt; }
- void setFstabOption( const string& val ) { orig_fstab_opt=fstab_opt=val; }
- void setMount( const string& val ) { orig_mp=mp=val; }
+ void setFstabOption( const string& val ) { fstab_opt=val; }
void updateFstabOptions();
bool needFstabUpdate() const;
const string& getMkfsOption() const { return mkfs_opt; }
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes Mon Jan 21 15:04:24 2008
@@ -1,55 +1,4 @@
-------------------------------------------------------------------
-Wed Jan 16 13:13:33 CET 2008 - fehr@suse.de
-
-- make sure NFS entries in fstab get zero passno field
-
--------------------------------------------------------------------
-Tue Jan 15 15:41:36 CET 2008 - fehr@suse.de
-
-- adapt size restrictions of disk label to parted (#352484)
-- use gpt as default disk label for disks larger 2TB
-- merge proofread texts back into ycp
-- version 2.13.96
-
--------------------------------------------------------------------
-Mon Jan 14 15:46:38 CET 2008 - fehr@suse.de
-
-- backport NFS support for SLES10 SP2 (feature #300779)
-
--------------------------------------------------------------------
-Thu Oct 25 17:55:57 CEST 2007 - fehr@suse.de
-
-- fix problem when more than one device name translation could be
- applied (#332520)
-- version 2.13.95
-
--------------------------------------------------------------------
-Thu Oct 11 13:08:33 CEST 2007 - fehr@suse.de
-
-- add support for online resize of ext3 (feature #301943)
-- fix performance hog with large number of disks and swap areas (#267262)
-- fix bug in member function equalContent (#245734)
-- correctly compute maximal allowable cylinder (#273286)
-- overwrite newly created md devices as partitions (#266538)
-- handle EVMS over md correctly in GetUsedEvmsDisks (#266538)
-- fixed crash during detection caused by empty key-value-pair (#278169)
-- improve discrimination between EFI and win partitions (#287289)
-- fix missing initialisation of tmpcrypt (#307219)
-- fix case of nonzero passno for encrypted fstab entries (#307221)
-- fix problem with resizing encrypted volumes (#307219)
-
--------------------------------------------------------------------
-Mon Oct 8 10:49:37 CEST 2007 - fehr@suse.de
-
-- fix bug in script create_udev_cdrom_rules (#331125)
-
--------------------------------------------------------------------
-Wed Aug 1 17:35:09 CEST 2007 - fehr@suse.de
-
-- fix having obsolete LVM entries displayed after removal of disk
- label (#290779)
-
--------------------------------------------------------------------
Mon May 14 16:19:05 CEST 2007 - fehr@suse.de
- fix wrong crypttab entry for encrypted swap with password (#273572)
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/scripts/create_udev_cdrom_rules
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/scripts/create_udev_cdrom_rules?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/scripts/create_udev_cdrom_rules (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/scripts/create_udev_cdrom_rules Mon Jan 21 15:04:24 2008
@@ -6,6 +6,6 @@
then
for i in $FILES
do
- echo add > $i
+ echo add > $FILES
done
fi
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_create.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_create.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_create.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_create.ycp Mon Jan 21 15:04:24 2008
@@ -27,7 +27,6 @@
y2milestone( "create_partitions disk:%1",
haskey(disk,"partitions")?remove(disk,"partitions"):disk );
y2milestone( "create_partitions partitions %1", partitions );
- flex_init_swapable( tgmap );
boolean ret = false;
boolean has_flex = has_flex_proposal();
string vm = Storage::ProposalVM();
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_ui.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_ui.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_ui.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/auto_part_ui.ycp Mon Jan 21 15:04:24 2008
@@ -271,7 +271,7 @@
vb = add (vb,
`Left(`HBox(`HSpacing(3), `CheckBox( `id(`home),
// Label text
- _("Propose Separate &Home Partition"),
+ _("Propose Separate &Home Partition" ),
cfg["home"]:false ))));
vb = add (vb, `VSpacing(1) );
vb = add( vb,
@@ -285,7 +285,7 @@
_("Create &EVMS Based Proposal"),
cfg["prop_evms"]:false ))));
vbox = add (vbox, `VSpacing(1.5) );
- term frame = `HVCenter(`Frame( _("Proposal type"), `HVCenter(vb) ));
+ term frame = `HVCenter(`Frame( _( "Proposal type" ), `HVCenter(vb) ));
vbox = add (vbox, frame );
return( vbox );
}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_check_generated.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_check_generated.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_check_generated.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_check_generated.ycp Mon Jan 21 15:04:24 2008
@@ -322,7 +322,7 @@
whole_disk = false;
}
- if( !part["format"]:false && part["used_fs"]:`unknown!=`nfs &&
+ if( !part["format"]:false &&
FileSystems::IsSystemMp( part["mount"]:"", false ) )
{
partition_mounted_but_not_formated = true;
@@ -607,7 +607,7 @@
if (ret == true) retval = `again;
}
- if ( (!have_swap && Stage::initial() && root_fs!=`nfs) || show_all_popups )
+ if ( (!have_swap && Stage::initial ()) || show_all_popups )
{
// popup text
boolean ret = Popup::YesNo(_("
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp Mon Jan 21 15:04:24 2008
@@ -483,8 +483,8 @@
// help text, richtext format
helptext = helptext + _("<p><b>Volume Label:</b>
-The name entered in this field is used as the volume label. This usually makes sense only
-when you activate the option for mounting by volume label.
+The name entered in this field is used as the volume label. This normally only
+makes sense when you activate the option for mounting by volume label.
A volume label cannot contain the / character or spaces.
");
@@ -1520,7 +1520,7 @@
-define boolean DDZeroPartitionTable( string del_dev, integer size_k )
+define boolean DDZeroPartitionTable( string del_dev )
``{
// popup text
if( Popup::YesNo(sformat(_("CAUTION
@@ -1530,7 +1530,7 @@
Really do this?
"), del_dev)))
{
- Storage::DeletePartitionTable(del_dev,size_k);
+ Storage::DeletePartitionTable(del_dev);
return true;
}
return false;
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp Mon Jan 21 15:04:24 2008
@@ -552,14 +552,6 @@
return( ret );
};
-define map CheckDeviceFinalOk( map new )
- ``{
- y2milestone( "CheckDeviceFinalOk new:%1", new );
- map ret = CheckCryptOk( new );
- y2milestone( "CheckDeviceFinalOk ret:%1", ret );
- return( ret );
- };
-
define map HandleFsChanged( boolean init, map new, map file_systems )
``{
list<string> not_used_mp = [];
@@ -614,9 +606,8 @@
UI::ChangeWidget( `id(`mount_point), `Value, new["mount"]:"" );
UI::ChangeWidget(`id(`fstab_options), `Enabled, true );
- if( UI::WidgetExists( `id(`fs_options) ))
- UI::ChangeWidget(`id(`fs_options), `Enabled,
- new["format"]:false && selected_fs[`options]:[] != [] );
+ UI::ChangeWidget(`id(`fs_options), `Enabled,
+ new["format"]:false && selected_fs[`options]:[] != [] );
string fstopt = FileSystems::DefaultFstabOptions( new );
if( size(fstopt)>0 && size(new["fstopt"]:"")==0 )
new["fstopt"] = fstopt;
@@ -664,14 +655,7 @@
new = filter(string key, any value, new, ``( key != "fstopt"));
}
}
- if( !init && ret == `mount_point &&
- UI::WidgetExists( `id(`fstab_options) ))
- {
- string mp = (string)UI::QueryWidget(`id(`mount_point), `Value);
- UI::ChangeWidget( `id(`fstab_options), `Enabled, size(mp)>0 );
- }
- if( (init && UI::WidgetExists( `id(`format))) ||
- ret == `format_true || ret == `format_false )
+ if( init || ret == `format_true || ret == `format_false )
{
boolean format = UI::QueryWidget(`id(`format), `CurrentButton) ==
`format_true;
@@ -682,15 +666,11 @@
// format partition
new["format"] = format;
- if( UI::WidgetExists( `id(`fs) ))
- {
- UI::ChangeWidget( `id(`fs), `Enabled, format );
- }
- if( UI::WidgetExists( `id(`fs_options) ))
- {
- UI::ChangeWidget( `id(`fs_options), `Enabled,
- format && selected_fs[`options]:[] != [] );
- }
+ ////////////////////////////////////////////////
+ // modify widgets
+ UI::ChangeWidget( `id(`fs), `Enabled, format );
+ UI::ChangeWidget( `id(`fs_options), `Enabled,
+ format && selected_fs[`options]:[] != [] );
if( UI::WidgetExists( `id(`crypt_fs) ))
{
UI::ChangeWidget( `id(`crypt_fs), `Enabled,
@@ -761,9 +741,7 @@
}
if( init || ret == `fs )
{
- symbol new_fs = used_fs;
- if( UI::WidgetExists( `id(`fs) ))
- new_fs = (symbol)UI::QueryWidget(`id(`fs), `Value);
+ symbol new_fs = (symbol)UI::QueryWidget(`id(`fs), `Value);
if( init )
{
if( !new["format"]:false && new["detected_fs"]:`unknown != `unknown )
@@ -773,6 +751,8 @@
if( used_fs != new_fs )
UI::ChangeWidget(`id(`fs), `Value, new_fs );
}
+ y2milestone( "HandlePartWidgetChanges new_fs %1",
+ UI::QueryWidget(`id(`fs), `Value) );
y2milestone( "HandlePartWidgetChanges init=%1 used_fs:%2 new_fs:%3",
init, used_fs, new_fs );
if( init || used_fs != new_fs )
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp Mon Jan 21 15:04:24 2008
@@ -77,32 +77,6 @@
}
return( ret );
};
-
-
-map swapable = $[];
-
-define void flex_init_swapable( map tg )
- ``{
- swapable = $[];
- foreach( string dev, map disk, tg,
- ``{
- list<map> sw = filter( map p, disk["partitions"]:[],
- ``(p["type"]:`unknown!=`extended &&
- !p["delete"]:false &&
- p["detected_fs"]:`unknown==`swap));
- sw = filter( map p, sw, ``(Storage::CheckSwapable(p["device"]:"")));
- foreach( map p, sw,
- ``{
- swapable[p["device"]:""] = true;
- });
- });
- y2milestone( "flex_init_swapable %1", swapable );
- }
-
-define boolean check_swapable( string dev )
- {
- return( swapable[dev]:false );
- }
define string pinfo_name()
``{
@@ -1634,8 +1608,7 @@
{
win = p["winfo"]:$[];
y2milestone( "try_resize_windows win=%1", win );
- if( win != nil && win["ok"]:false && p["size_k"]:0 > 1024*1024 &&
- !win["efi"]:false )
+ if( win != nil && win["ok"]:false && p["size_k"]:0 > 1024*1024 )
{
p["winfo"] = win;
p["resize"] = true;
@@ -1703,7 +1676,7 @@
list<integer> exist_pnr = sort( maplist( map e, plist, ``(e["nr"]:0) ));
integer max_prim = Partitions::MaxPrimary(disk["label"]:"msdos");
boolean has_ext = Partitions::HasExtended( disk["label"]:"msdos" );
- integer max_pos_cyl = Storage::MaxCylLabel( disk, 0 );
+ integer max_pos_cyl = Storage::MaxCylLabel( disk );
integer end = 0;
if( has_ext )
{
@@ -1714,8 +1687,8 @@
if( size(ext)>0 )
{
end = ext["region",0]:0 + ext["region",1]:1-1;
- if( end > ext["region",0]:0 + max_pos_cyl )
- end = ext["region",0]:0 + max_pos_cyl;
+ if( end > max_pos_cyl )
+ end = max_pos_cyl;
gap = get_gaps( ext["region",0]:0, end,
filter( map p, plist, ``(p["nr"]:0>max_prim)),
add_exist_linux );
@@ -1735,6 +1708,7 @@
if( end > max_pos_cyl )
end = max_pos_cyl;
gap = (list<map>)union( gap, get_gaps( 0, end, plist, add_exist_linux ));
+ gap = filter( map g, gap, ``(g["end"]:0<=max_pos_cyl) );
integer av_size = 0;
gap = maplist( map e, gap,
``{
@@ -2169,7 +2143,7 @@
``(p["type"]:`unknown!=`free &&
!p["delete"]:false &&
p["detected_fs"]:`unknown==`swap));
- swaps = filter( map p, swaps, ``(check_swapable(p["device"]:"")));
+ swaps = filter( map p, swaps, ``(Storage::CheckSwapable(p["device"]:"")));
swaps = sort( map a, map b, swaps, ``(a["size_k"]:0>b["size_k"]:0));
y2milestone( "can_swap_reuse swaps %1", swaps );
if( swaps[0,"size_k"]:0 >= 128*1024 )
@@ -2205,7 +2179,7 @@
``(p["type"]:`unknown!=`extended &&
!p["delete"]:false &&
p["detected_fs"]:`unknown==`swap));
- sw = filter( map p, sw, ``(check_swapable(p["device"]:"")));
+ sw = filter( map p, sw, ``(Storage::CheckSwapable(p["device"]:"")));
y2milestone( "can_swap_reuse disk %1 sw %2", dev, sw );
swaps = (list<map>)union( swaps, sw );
});
@@ -2519,7 +2493,7 @@
if( ret )
{
if( assert_cons_fs )
- ret = p["winfo","ok"]:false && !p["winfo","efi"]:false;
+ ret = p["winfo","ok"]:false;
else
ret = size(p["winfo"]:$[])>0;
}
@@ -2648,7 +2622,6 @@
map get_inst_proposal( map target )
{
y2milestone( "get_inst_proposal start" );
- flex_init_swapable( target );
map ret = $[];
target = Storage::AddWinInfo(target);
ret["target"] = target;
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/nfs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/nfs.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/nfs.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/include/nfs.ycp Mon Jan 21 15:04:24 2008
@@ -1,300 +0,0 @@
-/**
- * File:
- * nfs.ycp
- *
- * Module:
- * Configuration nfs mounts setup
- *
- * Summary:
- * Functions for nfs mounts file setup
- *
- * Authors:
- * Thomas Fehr
- *
- * $Id:$
- *
- */
-
-{
-
- textdomain "storage";
-
- import "Wizard";
- import "Storage";
- import "FileSystems";
- import "Partitions";
- import "Label";
-
- include "partitioning/partition_defines.ycp";
- include "partitioning/custom_part_dialogs.ycp";
- include "partitioning/custom_part_lib.ycp";
-
-/**
- * NfsDlgHelp
- * @return string
- */
-define string NfsDlgHelp( string sv, string sp )
- ``{
- // help text richtext format
- // %1 is replaced by description text for server name
- string helptext = sformat( _("
-<p><b>%1:</b><br>This must be the name of a nfs server.
-The server needs to be accessible.</p>
-"), sv );
-
- // help text richtext format, continued
- // %1 is replaced by description text for nfs path
- helptext = helptext + sformat( _("
-<p><b>%1:</b><br>This is the absolute path exported on the
-nfs server.
-"), sp );
-
- return helptext;
- };
-
-
-define term NfsOptionsDlg( string sv, list<string> sl, string sp, list<string> spl )
- {
- term widget =
- `VBox(
- `VSpacing(),
- `MinWidth( 56, `ComboBox( `id(`nfs_server), `opt(`editable), sv, sl )),
- `VSpacing(1),
- `MinWidth( 56, `ComboBox( `id(`nfs_path), `opt(`editable), sp, spl )),
- `VSpacing()
- );
- return widget;
- };
-
-
-/**
- * NfsExpertDlg dialog
- * edit nfs options
- */
-define map NfsExpertDlg( boolean edit, map part, list<string> dlist )
- ``{
- y2milestone( "NfsExpertDlg edit:%1 oart:%2", edit, part );
- y2milestone( "NfsExpertDlg dlist:%1", dlist );
- string caption = "";
- if( edit )
- {
- // heading text
- caption = _("Change NFS Path Setup");
- }
- else
- {
- // heading text
- caption = _("Add New NFS Path");
- }
-
- // label text
- string sv = _("&Name of NFS Server");
- // label text
- string sp = _("Absolute &Path on NFS Server");
-
- list<string> slp = maplist( string s, dlist, ``(substring(s,search(s,":")+1)));
- slp = toset(slp);
- list<string> sl = maplist( string s, dlist, ``(substring(s,0,search(s,":"))));
- sl = toset(sl);
- y2milestone( "NfsExpertDlg sl:%1", sl );
- y2milestone( "NfsExpertDlg sp:%1", slp );
-
- term contents = `VBox( `HSpacing( 60 ),
- `HBox( `HSpacing(2),
- NfsOptionsDlg(sv,sl,sp,slp),
- `HSpacing(2)
- ),
- `VSpacing(1),
- `HBox( `HSpacing(2),
- `Top(`ReplacePoint( `id(`mount_dlg_rp),
- MountDlg( part, [] ))),
- `HSpacing(30)),
- `VSpacing(3)
- );
-
- contents = `VBox(
- `Heading(caption),
- `VSpacing(1),
- `VStretch(),
- contents,
- `VSpacing(1),
- `VStretch(),
- `HBox(
- `PushButton(`id(`ok), `opt(`default),
- Label::OKButton() ),
- `PushButton(`id(`cancel), Label::CancelButton() )
- ));
-
-
-
- string ht = NfsDlgHelp( deletechars(sv,"&"),
- deletechars(sp,"&"));
- UI::OpenDialog( `opt(`decorated ),
- `HBox( `HWeight(30,`RichText(ht)),
- `HStretch(),
- `HSpacing(1),
- `HWeight(70, contents ),
- `HSpacing(1),
- `HStretch()
- ));
-
- ////////////////////////////////////////////////////////////////
- // configure main dialog for the first call
- string lsize = ByteToHumanStringWithZero(part["size_k"]:0*1024);
-
- sl = splitstring( part["device"]:"", ":" );
-
- UI::ChangeWidget( `id(`nfs_server), `Value, sl[0]:"" );
- UI::ChangeWidget( `id(`nfs_server), `ValidChars,
- FileSystems::nchars + "-._" );
- UI::ChangeWidget( `id(`nfs_server), `Enabled, !edit );
- UI::ChangeWidget( `id(`nfs_path), `Value, sl[1]:"" );
- UI::ChangeWidget( `id(`nfs_path), `ValidChars,
- FileSystems::nchars + "-._/" );
- UI::ChangeWidget( `id(`nfs_path), `Enabled, !edit );
-
- map retval = part;
- symbol ret = `ok;
-
- retval = HandlePartWidgetChanges( true, ret, $[], part, retval );
-
- repeat
- {
- ret = (symbol)UI::UserInput();
- y2milestone( "NfsExpertDlg %1", ret);
-
- ////////////////////////////////////////////////////////////
- if( ret != `cancel )
- {
- retval = HandlePartWidgetChanges( false, ret, $[], part, retval );
- }
-
- if( ret == `ok )
- {
- if( !edit )
- {
- string server = (string)UI::QueryWidget( `id(`nfs_server), `Value);
- string spath = (string)UI::QueryWidget( `id(`nfs_path), `Value);
- y2milestone( "NfsExpertDlg server:%1 path:%2", server, spath );
- if( size(server)==0 )
- {
- Popup::Error( sformat(_("The NFS server name \'%1\' is invalid."),server));
- ret = `again;
- UI::SetFocus(`id(`nfs_server));
- continue;
- }
- if( size(spath)==0 || substring( spath, 0, 1 )!= "/" )
- {
- Popup::Error( sformat(_("The NFS path name \"%1\" is invalid.
-It must not be empty and must start with a \"/\".
-"), spath ));
- ret = `again;
- UI::SetFocus(`id(`nfs_path));
- continue;
- }
- string dev = server + ":" + spath;
- integer sizeK = Storage::CheckNfsVolume( dev,
- retval["fstopt"]:"" );
- if( sizeK<=0 )
- {
- Popup::Error( sformat(_("The NFS mount
- \"%1\"
-is not accessible.
-"), dev ));
- ret = `again;
- UI::SetFocus(`id(`nfs_server));
- continue;
- }
- retval["device"] = dev;
- retval["size_k"] = sizeK;
- }
- y2milestone( "NfsExpertDlg retval:%1", retval );
- map ret_mp = CheckOkMount( part["device"]:"", part, retval );
- retval = ret_mp["map"]:$[];
- y2milestone( "NfsExpertDlg ret_mp %1 part %2", ret_mp, part );
- if( !ret_mp["ok"]:false )
- {
- if( ret_mp["field"]:`none != `none )
- UI::SetFocus(`id( ret_mp["field"]:`none ));
- ret = `again;
- continue;
- }
-
- ret_mp = CheckDeviceFinalOk( retval );
- if( !ret_mp["ok"]:false )
- {
- ret = `again;
- }
- else
- {
- retval = ret_mp["map"]:$[];
- }
- }
- } until( ret == `ok || ret == `cancel || ret == `next ||
- ret == `back || ret == `abort );
-
- retval["symbol"] = ret;
- y2milestone( "NfsExpertDlg ret:%1 retval=%2", ret, retval );
- UI::CloseDialog();
- return retval;
- }
-
-
-/**
- * NfsSetup dialog
- *
- * Provide dialog for settings of nfs related parameters
- */
-define symbol NfsSetup( boolean edit )
- ``{
- string id = Storage::GetWizardKey();
- string key = "/dev/nfs";
- y2milestone( "NfsSetup edit %1 id %2", edit, id );
- map part = $[];
- map tg = Storage::GetTargetMap();
- if( edit )
- {
- part = Storage::GetPartition( tg, id );
- }
- else
- {
- part["type"] = `nfs;
- part["used_fs"] = `nfs;
- part["detected_fs"] = `nfs;
- part["create"] = true;
- }
- y2milestone( "NfsSetup part %1", part );
-
- list<string> l = maplist( map p, tg["/dev/nfs","partitions"]:[],
- ``(p["device"]:""));
- part = NfsExpertDlg( edit, part, l );
-
- symbol ret = part["symbol"]:`next;
- // remove symbol key from data
- part = filter( string key, any value, part, ``( key != "symbol" ));
-
- if( ret == `ok )
- {
- if( !haskey( tg, "/dev/nfs" ) )
- tg["/dev/nfs"] = $[ "type" : `CT_NFS, "partitions" : [] ];
- list<map> pl = tg["/dev/nfs","partitions"]:[];
- if( edit )
- {
- integer idx = 0;
- foreach( map p, pl,
- ``{
- if( p["device"]:"" == part["device"]:"" )
- pl[idx] = part;
- idx = idx + 1;
- });
- }
- else
- pl = add( pl, part );
- tg["/dev/nfs","partitions"] = pl;
- Storage::SetTargetMap( tg );
- }
- y2milestone( "NfsSetup ret = %1", ret );
- return ret;
- }
-
-}
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_custom_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_custom_part.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_custom_part.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_custom_part.ycp Mon Jan 21 15:04:24 2008
@@ -54,7 +54,6 @@
include "partitioning/partition_defines.ycp";
include "partitioning/loop.ycp";
- include "partitioning/nfs.ycp";
include "partitioning/lvm_ui_dialogs.ycp";
include "partitioning/lvm_pv_lib.ycp";
include "partitioning/raid_lib.ycp";
@@ -91,7 +90,6 @@
boolean button_reread = true; // Should the "Reread Partition"-Button be shown in Expert menu
boolean button_raid = true; // Should the "RAID" -Button be shown in main window
boolean button_loop = true; // Should the "LOOP" -Button be shown in main window
- boolean button_nfs = true; // Should the "NFS" -Button be shown in main window
boolean button_lvm = true; // Should the "LVM" -Button be shown in main window
// Should the "EVMS" -Button be shown in main window
boolean button_evms = ProductFeatures::GetBooleanFeature ("partitioning", "evms_config");
@@ -935,13 +933,13 @@
// order should be md, then loop, then LVM, then EVMS
map disk_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_LOOP : 2, `CT_LVM : 3,
- `CT_EVMS : 4, `CT_DM : 5, `CT_NFS : 6 ];
+ `CT_EVMS : 4, `CT_DM : 5 ];
list<string> keys = maplist( string dev, map disk, targets,
``{return(dev);} );
keys = sort( string a, string b, keys,
``{
- integer oa = disk_order[targets[a,"type"]:`CT_UNKNOWN]:7;
- integer ob = disk_order[targets[b,"type"]:`CT_UNKNOWN]:7;
+ integer oa = disk_order[targets[a,"type"]:`CT_UNKNOWN]:6;
+ integer ob = disk_order[targets[b,"type"]:`CT_UNKNOWN]:6;
return( (oa==ob) ? (ahttp://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_part_proposal.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_part_proposal.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/inst_part_proposal.ycp Mon Jan 21 15:04:24 2008
@@ -163,9 +163,9 @@
// help text continued
// %1 is replaced by button text
help_text = help_text + sformat(_("<p>
-To make only small adjustments to the proposed
-setup (like e.g. changing filesystem types), choose
-<b>%1</b> and do these modification in the expert
+If you want to do only small adjustments to the proposed
+setup (like e.g. changing filesystem types) choose
+<b>%1</b> and do these modification in expert
partioner dialog.</p>
"), deletechars(modify_str,"&"));
@@ -183,14 +183,12 @@
// help text continued
// %1 is replaced by button text
help_text = help_text + _("<p>
-To create an LVM or EVMS based proposal, choose the corresponding button.</p>
-");
+To create a LVM or EVMS based proposal choose the corresponding button.</p>");
else
// help text continued
// %1 is replaced by button text
help_text = help_text + _("<p>
-To create an LVM based proposal, choose the corresponding button.</p>
-");
+To create a LVM based proposal choose the corresponding button.</p>");
if( proposal_firsttime )
{
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/FileSystems.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/FileSystems.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/FileSystems.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/FileSystems.ycp Mon Jan 21 15:04:24 2008
@@ -39,7 +39,6 @@
LibStorage::HFS() : `hfs,
LibStorage::NTFS() : `ntfs,
LibStorage::SWAP() : `swap,
- LibStorage::NFS() : `nfs,
LibStorage::FSNONE() : `none
]
];
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Partitions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Partitions.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Partitions.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Partitions.ycp Mon Jan 21 15:04:24 2008
@@ -51,7 +51,6 @@
global string lv_name = "LV";
global string dm_name = "DM";
global string loop_name = "Loop Device";
- global string nfs_name = "NFS";
// filesystems for /win
/* FAT32, Win95-Fat32, Win95LBA, Win95-Fat16 */
Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp?rev=43789&r1=43788&r2=43789&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp Mon Jan 21 15:04:24 2008
@@ -54,7 +54,6 @@
import "LibStorage::MdInfo";
import "LibStorage::LoopInfo";
import "LibStorage::DmInfo";
- import "LibStorage::NfsInfo";
import "LibStorage::ContainerInfo";
import "LibStorage::DiskInfo";
import "LibStorage::LvmVgInfo";
@@ -68,8 +67,7 @@
LibStorage::LOOP() : `CT_LOOP,
LibStorage::LVM() : `CT_LVM,
LibStorage::EVMS() : `CT_EVMS,
- LibStorage::DM() : `CT_DM,
- LibStorage::NFSC() : `CT_NFS
+ LibStorage::DM() : `CT_DM
]
];
@@ -154,7 +152,7 @@
map DiskMap = $[];
map ClassifiedSettings = $[];
map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_LOOP : 2, `CT_DM : 3,
- `CT_LVM : 4, `CT_EVMS : 5, `CT_NFS : 6 ];
+ `CT_LVM : 4, `CT_EVMS : 5 ];
list<string> hw_packages = [];
list<string> no_propose_disks = nil;
boolean proposal_evms = false;
@@ -308,9 +306,9 @@
list<string> tl = splitstring( device, "=" );
ls = [ "dev", "disk", "", tl[1]:"" ];
ls[2] = (search( device, "LABEL=" )==0)?"by-label":"by-uuid";
- y2milestone( "GetDiskPartitionTg ls:%1", ls );
+ y2milestone( "GetDiskPartition ls:%1", ls );
}
- y2debug( "GetDiskPartitionTg size:%1 ls:%2", size(ls), ls );
+ y2debug( "GetDiskPartition size:%1 ls:%2", size(ls), ls );
if( size(ls)>=4 && ls[1]:"" == "disk" &&
contains( [ "by-id", "by-path", "by-uuid", "by-label" ], ls[2]:"" ))
@@ -364,7 +362,7 @@
{
num = tointeger( substring( id, l[0]:0+5 ));
id = substring( id, 0, l[0]:0 );
- y2debug( "GetDiskPartitionTg id:%1 num:%2", id, num );
+ y2debug( "GetDiskPartition id:%1 num:%2", id, num );
}
foreach( string dev, map disk, tg,
``{
@@ -393,7 +391,7 @@
{
num = tointeger( substring( id, l[0]:0+5 ));
id = substring( id, 0, l[0]:0 );
- y2debug( "GetDiskPartitionTg id:%1 num:%2", id, num );
+ y2debug( "GetDiskPartition id:%1 num:%2", id, num );
}
foreach( string dev, map disk, tg,
``{
@@ -413,7 +411,7 @@
});
}
}
- else if( search( device, "/" )==0 )
+ else
{
if( search( device, "/dev/hd" )==0 ||
search( device, "/dev/sd" )==0 ||
@@ -504,11 +502,7 @@
ret["nr"] = "";
}
}
- else
- {
- ret = $[ "disk" : "/dev/nfs", "nr" : device ];
- }
- y2debug( "GetDiskPartitionTg device:%1 ret:%2", device, ret );
+ y2debug( "GetDiskPartition device:%1 ret:%2", device, ret );
return( ret );
};
@@ -700,12 +694,11 @@
integer resize_free = 0;
integer df_free = 0;
boolean win_disk = false;
- boolean efi = false;
boolean r = false;
r = LibStorage::StorageInterface::getFreeInfo( sint, device, resize_free,
df_free, used, win_disk,
- efi, used_fs==`ntfs );
+ used_fs==`ntfs );
resize_free = resize_free * 1024; // Byte
df_free = df_free * 1024; // Byte
@@ -788,7 +781,6 @@
"df_free" : df_free,
"used":used,
"win_disk":win_disk,
- "efi":efi,
"linux_size":linux_size,
"max_win_size":used + resize_free + add_free - min_linux_size,
"ntfs" : (used_fs == `ntfs),
@@ -1443,24 +1435,6 @@
c["partitions"] = add( c["partitions"]:[], p );
});
}
- else if( c["type"]:`CT_UNKNOWN == `CT_NFS )
- {
- list<any> pinfos = [];
- y2milestone( "before getNfsInfo" );
- ret = LibStorage::StorageInterface::getNfsInfo( sint, pinfos );
- y2milestone( "after getNfsInfo" );
- if( ret<0 )
- y2warning( "getNfsInfo ret:%1", ret );
- foreach( any info, pinfos,
- ``{
- map p = $[];
- vinfo = LibStorage::NfsInfo::swig_v_get(info);
- p = volumeMap( vinfo, p );
- p["type"] = `nfs;
- p["fstype"] = Partitions::nfs_name;
- c["partitions"] = add( c["partitions"]:[], p );
- });
- }
//y2milestone ("getContainerInfo container %1", remove( c, "partitions" ) );
y2milestone ("getContainerInfo container %1", c );
return( c );
@@ -2170,21 +2144,20 @@
integer ret = 0;
string tmp = disk["label"]:"";
ret = LibStorage::StorageInterface::maxSizeLabelK( sint, tmp );
- y2milestone( "MaxSizeLabelK %1 is %2", disk["label"]:"", ret );
+ y2milestone( "MaxSizeLabel %1 is %2", disk["label"]:"", ret );
return( ret );
}
-global integer MaxCylLabel( map disk, integer start_cyl )
+global integer MaxCylLabel( map disk )
{
integer ret = MaxSizeLabelK(disk);
y2milestone( "MaxCylLabel val_k:%1 cyl_size:%2", ret, disk["cyl_size"]:1 );
- integer cylk2 = disk["cyl_size"]:1/512;
- if( cylk2<2 )
- cylk2 = 2;
- y2milestone( "MaxCylLabel val_k:%1 cylk2:%2", ret, cylk2 );
- ret = ret*2 / cylk2 - 1;
- ret = ret + start_cyl;
- y2milestone( "MaxCylLabel ret:%1", ret );
+ integer cylk = disk["cyl_size"]:1/1024;
+ if( cylk<1 )
+ cylk = 1;
+ y2milestone( "MaxCylLabel val_k:%1 cylk:%2", ret, cylk );
+ ret = ret / cylk;
+ y2milestone( "MaxCylLabel ret %1", ret );
return( ret );
}
@@ -2736,35 +2709,6 @@
return( ret==0 );
}
-global boolean AddNfsVolume( string nfsdev, string opts, integer sz, string mp )
- {
- y2milestone( "AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4", nfsdev, opts,
- sz, mp );
- integer ret = 0;
- string dummy = "";
- ret = LibStorage::StorageInterface::addNfsDevice( sint, nfsdev, opts, sz, mp );
- if( ret<0 )
- y2error( "AddNfsVolume sint ret:%1", ret );
- UpdateTargetMapDisk( "/dev/nfs" );
- return( ret==0 );
- }
-
-global integer CheckNfsVolume( string nfsdev, string opts )
- {
- y2milestone( "CheckNfsVolume dev:%1 opts:%2", nfsdev, opts );
- integer ret = 0;
- integer sz = 0;
- string dummy = "";
- ret = LibStorage::StorageInterface::checkNfsDevice( sint, nfsdev, opts,
- sz );
- if( ret<0 )
- y2error( "CheckNfsVolume sint ret:%1", ret );
- else
- ret = sz;
- y2milestone( "CheckNfsVolume ret:%1", ret );
- return( ret );
- }
-
global boolean CreateMd( integer nr, string type )
{
y2milestone( "CreateMd nr:%1 type:%2", nr, type );
@@ -2968,18 +2912,18 @@
* @param string the disk to deleted the partition table from
* @return boolean
*/
-global define boolean DeletePartitionTable(string disk, integer size_k)
+global define boolean DeletePartitionTable(string disk)
``{
- y2milestone( "DeletePartitionTable %1 size_k:%2", disk, size_k );
- string label =
- LibStorage::StorageInterface::defaultDiskLabelSize( sint, size_k );
+ y2milestone( "DeletePartitionTable %1", disk );
+ string label = LibStorage::StorageInterface::defaultDiskLabel( sint );
y2milestone( "DeletePartitionTable label:%1", label );
integer ret =
LibStorage::StorageInterface::destroyPartitionTable( sint, disk,
label );
if( ret<0 )
y2error( "DeletePartitionTable sint ret:%1", ret );
- UpdateTargetMap();
+ UpdateTargetMapDisk( disk );
+ UpdateTargetMapDisk( "/dev/evms" );
return( ret==0 );
}
@@ -3068,23 +3012,10 @@
p["stripesize"]:0 );
}
}
- else if( ctype == `CT_NFS )
- {
- ret = Storage::AddNfsVolume( p["device"]:"", p["fstopt"]:"",
- p["size_k"]:0, p["mount"]:"" );
- }
y2milestone( "CreateAny ret:%1", ret );
return( ret );
}
-define boolean IsEfiPartition( map p )
- {
- map m = GetFreeSpace( p["device"]:"", 0, p["used_fs"]:`none, false );
- boolean ret = m["efi"]:false;
- y2milestone( "IsEfiPartition ret:%1", ret );
- return( ret );
- }
-
/**
* Search in the list partitions for windows partitions and add the key
* "mount" to the found windows partitions.
@@ -3117,7 +3048,7 @@
((partnum<=max_prim)==primary) &&
foreign_nr < 24 &&
Partitions::IsDosWinNtPartition(fsid) &&
- (!Arch::ia64() || !IsEfiPartition(partition)) &&
+ (!Arch::ia64() || partition["size_k"]:0 >= 1024*1024) &&
contains( [`vfat, `ntfs], partition["used_fs"]:`none ))
{
new_partition["fstopt"] =
@@ -3324,15 +3255,10 @@
if( target[k,"delete"]:false && haskey( tg, k ) )
{
if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM )
- {
DeleteLvmVg( target[k,"name"]:"" );
- target[k,"delete"] = false;
- }
else if( target[k,"type"]:`CT_UNKNOWN==`CT_EVMS )
- {
DeleteEvmsCo( target[k,"name"]:"" );
- target[k,"delete"] = false;
- }
+ target[k,"delete"] = false;
}
});
keys = maplist( string k, any e, target, ``(k));
@@ -3353,6 +3279,7 @@
});
}
});
+ tg = GetTargetMap();
keys = maplist( string k, any e, tg, ``(k));
keys = sort( string a, string b, keys,
``( type_order[tg[a,"type"]:`CT_UNKNOWN]:6 >
@@ -3418,7 +3345,7 @@
else if( target[k,"type"]:`CT_UNKNOWN==`CT_EVMS )
DeleteEvmsCo( target[k,"name"]:"" );
else if( target[k,"type"]:`CT_UNKNOWN==`CT_DISK )
- DeletePartitionTable( k, target[k,"size_k"]:0 );
+ DeletePartitionTable( k );
}
});
keys = maplist( string k, any e, target, ``(k));
@@ -3675,16 +3602,10 @@
``{
string ret = disk;
map tg = GetTargetMap();
- if( haskey( tg[disk,"partitions",0]:$[], "nr" ))
- {
- list<map> ps = filter( map p, tg[disk,"partitions"]:[], ``(p["nr"]:01 )
- ps = sort( map a, map b, ps, ``(a["nr"]:0>b["nr"]:0));
- if( size(ps)>0 )
- ret = ps[0,"device"]:"";
- }
- else
- ret = tg[disk,"partitions",0,"device"]:disk;
+ list<map> ps = filter( map p, tg[disk,"partitions"]:[], ``(p["nr"]:0b["nr"]:0));
+ if( size(ps)>0 )
+ ret = ps[0,"device"]:"";
y2milestone( "GetIdSmaller disk:%1 delim:%2 ret:%3",
disk, delim, ret );
return( ret );
@@ -5098,16 +5019,16 @@
map dm = BuildDiskmap( oldv );
if( size(dm)>0 )
{
- ret = maplist( string n, ret, ``(HdDiskMap( n, dm )));
+ ret = maplist( string n, names, ``(HdDiskMap( n, dm )));
}
if( (oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0==0)) &&
Arch::board_iseries () )
{
- ret = maplist( string n, ret, ``(HdToIseries( n )));
+ ret = maplist( string n, names, ``(HdToIseries( n )));
}
if( oldv["major"]:0==9 )
{
- ret = maplist( string n, ret, ``(SLES9PersistentDevNames( n )));
+ ret = maplist( string n, names, ``(SLES9PersistentDevNames( n )));
}
y2milestone( "GetTranslatedDevices ret %1", ret );
return( ret );
@@ -5203,21 +5124,7 @@
``(p["used_by_type"]:`UB_NONE==`UB_LVM &&
p["used_by"]:""==namel)))>0) ))
{
- list<string> dl = [ disk ];
- if( disk=="/dev/md" )
- {
- list<map> tl = [];
- tl = filter( map p, data["partitions"]:[],
- ``((p["used_by_type"]:`UB_NONE==`UB_EVMS &&
- p["used_by"]:""==name)||
- (p["used_by_type"]:`UB_NONE==`UB_LVM &&
- p["used_by"]:""==namel)));
- dl = maplist( map p, tl, ``(p["device"]:""));
- dl = (list<string>)sort( dl );
- dl = (list<string>)toset( dl );
- y2milestone( "GetEvmsRealDisk dl %1", dl );
- }
- rdisk = (list<string>)union( rdisk, dl );
+ rdisk = (list<string>)union( rdisk, [ disk ] );
}
});
if( size(rdisk)==0 && !p["evms_native"]:false )
@@ -5247,16 +5154,12 @@
list<string> dl = GetEvmsRealDisk( tg, p );
foreach( string d, dl,
``{
- y2milestone( "GetUsedEvmsDisks d %1", d );
if( search( d, "/dev/md" ) == 0 )
{
list<string> ndl = [];
foreach( string dd, map pp, tg,
``{
- map pu = find( map p, pp["partitions"]:[],
- ``(p["used_by"]:""==substring(d,5)) );
- y2milestone( "GetUsedEvmsDisks disk:%1 used:%2", dd, pu );
- if( pu!=nil && size(pu)>0 )
+ if( pp["used_by"]:"" == substring(d,5) )
{
ndl = add( ndl, dd );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org