Author: aschnell
Date: Tue Aug 5 12:47:16 2008
New Revision: 49695
URL: http://svn.opensuse.org/viewcvs/yast?rev=49695&view=rev
Log:
- removed more evms code
Modified:
trunk/storage/libstorage/src/EvmsCo.cc
trunk/storage/libstorage/src/Storage.cc
trunk/storage/libstorage/src/Storage.h
Modified: trunk/storage/libstorage/src/EvmsCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EvmsCo.cc?rev=49695&r1=49694&r2=49695&view=diff
==============================================================================
--- trunk/storage/libstorage/src/EvmsCo.cc (original)
+++ trunk/storage/libstorage/src/EvmsCo.cc Tue Aug 5 12:47:16 2008
@@ -1244,12 +1244,7 @@
bool EvmsCo::canDoEvms()
{
- bool ret = access( EXEC_PATH, X_OK )==0 &&
- getenv( "YAST2_STORAGE_NO_EVMS" )==NULL &&
- !Storage::getNoEv();
- ret = false; // hard disable EVMS
- y2mil( "ret:" << ret );
- return( ret );
+ return false;
}
void EvmsCo::activate( bool val )
Modified: trunk/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=49695&r1=49694&r2=49695&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.cc (original)
+++ trunk/storage/libstorage/src/Storage.cc Tue Aug 5 12:47:16 2008
@@ -2881,486 +2881,6 @@
return( ret );
}
-static bool isEvms( const Volume& v )
- {
- return( v.cType()==EVMS );
- }
-
-static bool evmsCo( const EvmsCo& co )
- {
- y2mil( "co:" << co );
- y2mil( "isContainer:" << co.isContainer() );
- return( co.isContainer());
- }
-
-static bool isDiskCreated( const Volume& v )
- {
- return( v.cType()==DISK && v.created() );
- }
-
-int Storage::evmsActivate( bool forced )
- {
- int ret = 0;
- assertInit();
- y2mil( "start forced:" << forced );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else
- {
- ConstEvmsPair p = evmsPair(evmsCo);
- if( !p.empty() && !forced )
- {
- y2warning( "evms already active:%u", p.length() );
- for( ConstEvmsIterator ei=p.begin(); ei!=p.end(); ++ei )
- y2war( "vol:" << *ei );
- }
- else
- {
- ret = EvmsCo::activateDevices();
- if( ret==0 )
- {
- detectEvms();
- VPair p = vPair( isEvms );
- ProcMounts pm( this );
- detectFsData( p.begin(), p.end(), pm );
- EvmsCoPair ep = evCoPair();
- EvmsCoIterator coi = ep.begin();
- while( coi!=ep.end() && coi->device()!="/dev/evms" )
- ++coi;
- if( coi!=ep.end() )
- {
- EvmsCo::EvmsPair vp = coi->evmsPair(EvmsCo::lvNotDeleted);
- EvmsCo::EvmsIter ei = vp.begin();
- p = vPair( Volume::isDeleted );
- while( ei!=vp.end() )
- {
- y2mil( "ev:" << *ei );
- string dev = EvmsCo::evmsToDev( ei->device() );
- y2mil( "disk dev:" << dev );
- VolIterator vi = p.begin();
- while( vi!=p.end() &&
- (!vi->deleted() || vi->device()!=dev) )
- ++vi;
- if( vi!=p.end() )
- {
- const Partition* p = dynamic_cast inserter(d);
- copy( devs.begin(), devs.end(), inserter );
- ret = v->extendCo( d );
- }
- if( ret==0 )
- addToList( v );
- else
- delete( v );
- }
- else
- {
- ret = STORAGE_EVMS_CO_EXISTS;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::modifyEvmsContainer( const string& old_name, const string& new_name,
- unsigned long long peSizeK, bool lvm1 )
- {
- int ret = 0;
- assertInit();
- y2mil( "old name:" << old_name << " new name:" << new_name <<
- " peSizeK:" << peSizeK << " lvm1:" << lvm1 );
- EvmsCoIterator i = findEvmsCo( old_name );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- if( new_name.empty() ||
- new_name.find_first_of( "\"\' /\n\t:*?" ) != string::npos )
- {
- ret = STORAGE_EVMS_INVALID_NAME;
- }
- else if( i != evCoEnd() )
- {
- y2mil( "orig co:" << *i );
- ret = i->modifyCo( new_name, peSizeK, lvm1 );
- if( ret==0 )
- {
- y2mil( "modi co:" << *i );
- Container *v = &(*i);
- ret = removeContainer( v, false );
- addToList( v );
- }
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::removeEvmsContainer( const string& name )
- {
- int ret = 0;
- assertInit();
- y2milestone( "name:%s", name.c_str() );
- EvmsCoIterator i = findEvmsCo( name );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- ret = i->removeCo();
- if( ret==0 && i->created() )
- ret = removeContainer( &(*i) );
- if( ret==0 )
- {
- string lvn = name;
- if( lvn.find( '/' )!=string::npos )
- lvn = lvn.substr( lvn.find( '/' )+1 );
- LvmVgIterator l = findLvmVg( lvn );
- if( l!=lvgEnd() )
- {
- removeContainer( &(*l) );
- }
- }
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::extendEvmsContainer( const string& name, const deque<string>& devs )
- {
- int ret = 0;
- assertInit();
- y2mil( "name:" << name << " devices:" << devs );
- EvmsCoIterator i = findEvmsCo( name );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- list<string> d;
- back_insert_iterator
inserter(d);
- copy( devs.begin(), devs.end(), inserter );
- ret = i->extendCo( d );
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::shrinkEvmsContainer( const string& name, const deque<string>& devs )
- {
- int ret = 0;
- assertInit();
- y2mil( "name:" << name << " devices:" << devs );
- EvmsCoIterator i = findEvmsCo( name );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- list<string> d;
- back_insert_iterator
inserter(d);
- copy( devs.begin(), devs.end(), inserter );
- ret = i->reduceCo( d );
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::createEvmsVolume( const string& co, const string& name,
- unsigned long long sizeM, unsigned stripe,
- string& device )
- {
- int ret = 0;
- assertInit();
- y2milestone( "co:%s name:%s sizeM:%llu stripe:%u", co.c_str(),
- name.c_str(), sizeM, stripe );
- EvmsCoIterator i = findEvmsCo( co );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- ret = i->createVol( name, sizeM*1024, stripe, device );
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
- return( ret );
- }
-
-int
-Storage::removeEvmsVolumeByDevice( const string& device )
- {
- int ret = 0;
- string co, name;
- string d = undevDevice( device );
- if( d.find( "evms/" )==0 )
- d.erase( 0, 5 );
- string::size_type pos = d.find( '/' );
- pos = d.find( '/', pos+1 );
- if( pos!=string::npos )
- {
- co = d.substr( 0, pos );
- name = d.substr( pos+1 );
- }
- if( !co.empty() && !name.empty() )
- ret = removeEvmsVolume( co, name );
- else
- ret = STORAGE_EVMS_INVALID_DEVICE;
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::removeEvmsVolume( const string& co, const string& name )
- {
- int ret = 0;
- assertInit();
- y2milestone( "co:%s name:%s", co.c_str(), name.c_str() );
- EvmsCoIterator i = findEvmsCo( co );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- ret = i->removeVol( name );
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::changeEvmsStripeCount( const string& coname, const string& name,
- unsigned long stripe )
- {
- int ret = 0;
- assertInit();
- y2milestone( "co:%s name:%s stripe:%lu", coname.c_str(), name.c_str(),
- stripe );
- EvmsCoIterator i = findEvmsCo( coname );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- ret = i->changeStripe( name, stripe );
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
-
-int
-Storage::changeEvmsStripeSize( const string& coname, const string& name,
- unsigned long long stripeSize )
- {
- int ret = 0;
- assertInit();
- y2milestone( "co:%s name:%s stripeSize:%llu", coname.c_str(),
- name.c_str(), stripeSize );
- EvmsCoIterator i = findEvmsCo( coname );
- if( readonly )
- {
- ret = STORAGE_CHANGE_READONLY;
- }
- else if( i != evCoEnd() )
- {
- ret = i->changeStripeSize( name, stripeSize );
- }
- else
- {
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
- }
- y2milestone( "ret:%d", ret );
- return( ret );
- }
int
Storage::nextFreeMd(int &nr, string &device)
@@ -4834,35 +4354,6 @@
return( ret );
}
-int Storage::getEvmsCoInfo( const string& name, EvmsCoInfo& info )
- {
- int ret = 0;
- assertInit();
- EvmsCoIterator i = findEvmsCo( name );
- if( i != evCoEnd() )
- {
- i->getInfo( info );
- }
- else
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- return( ret );
- }
-
-int Storage::getContEvmsCoInfo( const string& name, ContainerInfo& cinfo,
- EvmsCoInfo& info )
- {
- int ret = 0;
- assertInit();
- EvmsCoIterator i = findEvmsCo( name );
- if( i != evCoEnd() )
- {
- ((const Container*)&(*i))->getInfo( cinfo );
- i->getInfo( info );
- }
- else
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- return( ret );
- }
int Storage::getDmraidCoInfo( const string& name, DmraidCoInfo& info )
{
@@ -4894,26 +4385,6 @@
return( ret );
}
-int Storage::getEvmsInfo( const string& name,
- dequestorage::EvmsInfo& plist )
- {
- int ret = 0;
- plist.clear();
- assertInit();
- EvmsCoIterator i = findEvmsCo( name );
- if( i != evCoEnd() )
- {
- EvmsCo::EvmsPair p = i->evmsPair(EvmsCo::lvNotDeleted);
- for( EvmsCo::EvmsIter i2 = p.begin(); i2 != p.end(); ++i2 )
- {
- plist.push_back( EvmsInfo() );
- i2->getInfo( plist.back() );
- }
- }
- else
- ret = STORAGE_EVMS_CO_NOT_FOUND;
- return( ret );
- }
int Storage::getMdInfo( dequestorage::MdInfo& plist )
{
@@ -5897,12 +5368,6 @@
case UB_DMRAID:
//ret = removeDmraidCo( name );
break;
- case UB_EVMS:
- if( !name.empty() )
- ret = removeEvmsContainer( name );
- else
- ret = removeVolume( "/dev/evms/" + name );
- break;
case UB_NONE:
y2warning( "%s used by none", device.c_str() );
break;
@@ -6543,12 +6008,6 @@
}
}
-void Storage::setNoEvms( bool val )
- {
- y2mil( "val:" << val );
- no_evms=val;
- }
-
string Storage::byteToHumanString(unsigned long long size, bool classic, int precision,
bool omit_zeroes) const
@@ -6580,5 +6039,3 @@
storage::CallbackShowInstallInfo Storage::install_info_cb_ycp;
storage::CallbackInfoPopup Storage::info_popup_cb_ycp;
storage::CallbackYesNoPopup Storage::yesno_popup_cb_ycp;
-bool Storage::no_evms;
-
Modified: trunk/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=49695&r1=49694&r2=49695&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.h (original)
+++ trunk/storage/libstorage/src/Storage.h Tue Aug 5 12:47:16 2008
@@ -263,15 +263,11 @@
void getContainers( dequestorage::ContainerInfo& infos );
int getDiskInfo( const string& disk, storage::DiskInfo& info);
int getLvmVgInfo( const string& name, storage::LvmVgInfo& info);
- int getEvmsCoInfo( const string& name, storage::EvmsCoInfo& info);
int getDmraidCoInfo( const string& name, storage::DmraidCoInfo& info);
int getContDiskInfo( const string& disk, storage::ContainerInfo& cinfo,
storage::DiskInfo& info);
int getContLvmVgInfo( const string& name, storage::ContainerInfo& cinfo,
storage::LvmVgInfo& info);
- int getContEvmsCoInfo( const string& name,
- storage::ContainerInfo& cinfo,
- storage::EvmsCoInfo& info );
int getContDmraidCoInfo( const string& name,
storage::ContainerInfo& cinfo,
storage::DmraidCoInfo& info );
@@ -281,8 +277,6 @@
dequestorage::PartitionInfo& plist );
int getLvmLvInfo( const string& name,
dequestorage::LvmLvInfo& plist );
- int getEvmsInfo( const string& name,
- dequestorage::EvmsInfo& plist );
int getMdInfo( dequestorage::MdInfo& plist );
int getDmInfo( dequestorage::DmInfo& plist );
int getNfsInfo( dequestorage::NfsInfo& plist );
@@ -403,27 +397,6 @@
int changeLvStripeSize( const string& vg, const string& name,
unsigned long long stripeSize );
- int evmsActivate( bool force );
- int createEvmsContainer( const string& name, unsigned long long peSizeK,
- bool lvm1, const deque<string>& devs );
- int modifyEvmsContainer( const string& old_name, const string& new_name,
- unsigned long long peSizeK, bool lvm1 );
- int removeEvmsContainer( const string& name );
- int extendEvmsContainer( const string& name, const deque<string>& devs );
- int shrinkEvmsContainer( const string& name, const deque<string>& devs );
- int createEvmsVolume( const string& vg, const string& name,
- unsigned long long sizeM, unsigned stripe,
- string& device );
- int removeEvmsVolumeByDevice( const string& device );
- int removeEvmsVolume( const string& vg, const string& name );
- int changeEvmsStripeCount( const string& coname, const string& name,
- unsigned long stripes );
- int changeEvmsStripeSize( const string& coname, const string& name,
- unsigned long long stripeSize );
- void setNoEvms( bool val );
- bool getNoEvms() { return( no_evms ); }
- static bool getNoEv() { return( no_evms ); }
-
int nextFreeMd(int &nr, string &device);
int createMd( const string& name, storage::MdType rtype,
const deque<string>& devs );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org