Author: aschnell
Date: Thu Nov 13 13:16:46 2008
New Revision: 53269
URL: http://svn.opensuse.org/viewcvs/yast?rev=53269&view=rev
Log:
- avoid some operations if no dmraid/dmmultipath stuff is found
Modified:
trunk/storage/libstorage/src/Storage.cc
Modified: trunk/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=53269&r1=53268&r2=53269&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.cc (original)
+++ trunk/storage/libstorage/src/Storage.cc Thu Nov 13 13:16:46 2008
@@ -482,48 +482,50 @@
void
-Storage::detectDmraid( ProcPart& ppart )
- {
+Storage::detectDmraid(ProcPart& ppart)
+{
if( test() )
- {
+ {
glob_t globbuf;
if( glob( (testdir+"/dmraid_*[!~0-9]").c_str(), GLOB_NOSORT, 0,
&globbuf) == 0)
- {
+ {
// TODO: load test data
- }
- globfree (&globbuf);
}
+ globfree (&globbuf);
+ }
else if( getenv( "YAST2_STORAGE_NO_DMRAID" )==NULL )
- {
+ {
list<string> l;
- DmraidCo::getRaids( l );
- map by_id;
- if( !l.empty() )
+ DmraidCo::getRaids(l);
+ if (!l.empty())
+ {
+ map by_id;
getUdevMap("/dev/disk/by-id", by_id);
- for( list<string>::const_iterator i=l.begin(); i!=l.end(); ++i )
+ for( list<string>::const_iterator i=l.begin(); i!=l.end(); ++i )
{
- DmraidCo * v = new DmraidCo( this, *i, ppart );
- if( v->isValid() )
+ DmraidCo * v = new DmraidCo( this, *i, ppart );
+ if( v->isValid() )
{
- list<string> nm = by_id["dm-"+decString(v->minorNr())];
- if( !nm.empty() )
- v->setUdevData( nm );
- addToList( v );
+ list<string> nm = by_id["dm-"+decString(v->minorNr())];
+ if( !nm.empty() )
+ v->setUdevData( nm );
+ addToList( v );
}
- else
+ else
{
- y2milestone( "inactive DMRAID %s", i->c_str() );
- v->unuseDev();
- delete( v );
+ y2milestone( "inactive DMRAID %s", i->c_str() );
+ v->unuseDev();
+ delete( v );
}
}
}
}
+}
void
-Storage::detectDmmultipath( ProcPart& ppart )
+Storage::detectDmmultipath(ProcPart& ppart)
{
if( test() )
{
@@ -538,25 +540,27 @@
else if( getenv( "YAST2_STORAGE_NO_DMMULTIPATH" )==NULL )
{
list<string> l;
- DmmultipathCo::getMultipaths( l );
- map by_id;
- if( !l.empty() )
- getUdevMap("/dev/disk/by-id", by_id);
- for( list<string>::const_iterator i=l.begin(); i!=l.end(); ++i )
+ DmmultipathCo::getMultipaths(l);
+ if (!l.empty())
{
- DmmultipathCo * v = new DmmultipathCo( this, *i, ppart );
- if( v->isValid() )
- {
- list<string> nm = by_id["dm-"+decString(v->minorNr())];
- if( !nm.empty() )
- v->setUdevData( nm );
- addToList( v );
- }
- else
+ map by_id;
+ getUdevMap("/dev/disk/by-id", by_id);
+ for( list<string>::const_iterator i=l.begin(); i!=l.end(); ++i )
{
- y2mil("inactive DMMULTIPATH " << *i);
- v->unuseDev();
- delete v;
+ DmmultipathCo * v = new DmmultipathCo( this, *i, ppart );
+ if( v->isValid() )
+ {
+ list<string> nm = by_id["dm-"+decString(v->minorNr())];
+ if (!nm.empty())
+ v->setUdevData( nm );
+ addToList( v );
+ }
+ else
+ {
+ y2mil("inactive DMMULTIPATH " << *i);
+ v->unuseDev();
+ delete v;
+ }
}
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org