[yast-commit] r59268 - in /branches/tmp/mpatelcz/SP1-md/libstorage/src: DmPartCo.cc DmPartCo.h DmmultipathCo.cc DmmultipathCo.h DmraidCo.cc DmraidCo.h MdPart.cc MdPart.h MdPartCo.cc MdPartCo.h Storage.cc
Author: aschnell
Date: Tue Nov 3 11:02:03 2009
New Revision: 59268
URL: http://svn.opensuse.org/viewcvs/yast?rev=59268&view=rev
Log:
- simplified detection and removing now obsolete skipRAID()
Modified:
branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.cc
branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.h
branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.cc
branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.h
branches/tmp/mpatelcz/SP1-md/libstorage/src/DmraidCo.cc
branches/tmp/mpatelcz/SP1-md/libstorage/src/DmraidCo.h
branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.cc
branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.h
branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.cc
branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.h
branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.cc
Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.cc?rev=59268&r1=59267&r2=59268&view=diff
==============================================================================
--- branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.cc (original)
+++ branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.cc Tue Nov 3 11:02:03 2009
@@ -25,7 +25,7 @@
dev = name;
nm = undevName(name);
num_part = num_pe = free_pe = 0;
- active = valid = del_ptable = false;
+ active = del_ptable = false;
disk = NULL;
init( ppart );
}
@@ -280,8 +280,12 @@
activate_part(true);
}
getVolumes( ppart );
- active = valid = true;
+ active = true;
}
+ else
+ {
+ y2err("error dm " << nm << " table not found");
+ }
}
void
@@ -966,8 +970,6 @@
s << " delPT";
if( !d.active )
s << " inactive";
- if( !d.valid )
- s << " invalid";
return( s );
}
@@ -993,13 +995,6 @@
else
log += " active-->";
}
- if( valid!=p->valid )
- {
- if( p->valid )
- log += " -->valid";
- else
- log += " valid-->";
- }
}
return( log );
}
@@ -1044,7 +1039,7 @@
bool DmPartCo::equalContent( const DmPartCo& rhs ) const
{
bool ret = PeContainer::equalContent(rhs,false) &&
- active==rhs.active && valid==rhs.valid &&
+ active==rhs.active &&
del_ptable==rhs.del_ptable;
if( ret )
{
@@ -1067,7 +1062,6 @@
{
y2deb("constructed DmPartCo by copy constructor from " << rhs.nm);
active = rhs.active;
- valid = rhs.valid;
del_ptable = rhs.del_ptable;
disk = NULL;
if( rhs.disk )
Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.h?rev=59268&r1=59267&r2=59268&view=diff
==============================================================================
--- branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.h (original)
+++ branches/tmp/mpatelcz/SP1-md/libstorage/src/DmPartCo.h Tue Nov 3 11:02:03 2009
@@ -26,7 +26,6 @@
virtual ~DmPartCo();
unsigned long long sizeK() const { return size_k; }
- unsigned isValid() const { return valid; }
const string& labelName() const { return disk->labelName(); }
const string& udevPath() const { return udev_path; }
const std::list<string>& udevId() const { return udev_id; }
@@ -173,7 +172,6 @@
Disk* disk;
bool active;
- bool valid;
bool del_ptable;
unsigned num_part;
Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.cc?rev=59268&r1=59267&r2=59268&view=diff
==============================================================================
--- branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.cc (original)
+++ branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.cc Tue Nov 3 11:02:03 2009
@@ -157,10 +157,18 @@
}
-void
-DmmultipathCo::getMultipaths(list<string>& l)
+ bool
+ DmmultipathCo::isActivated(const string& name)
+ {
+ SystemCmd c(DMSETUPBIN " table " + quote(name));
+ return c.retcode() == 0 && c.numLines() >= 1 && isdigit(c.stdout()[0]);
+ }
+
+
+list<string>
+DmmultipathCo::getMultipaths()
{
- l.clear();
+ list<string> l;
SystemCmd c(MULTIPATHBIN " -d -v 2+ -ll");
if (c.numLines() > 0)
@@ -198,9 +206,17 @@
line = *c.getLine(i);
}
y2mil( "mp_list:" << mp_list );
+
if (mp_list.size() >= 1)
{
- l.push_back(unit);
+ if (isActivated(unit))
+ {
+ l.push_back(unit);
+ }
+ else
+ {
+ y2mil("ignoring inactive dmmultipath " << unit);
+ }
}
}
@@ -209,6 +225,7 @@
}
y2mil("detected multipaths " << l);
+ return l;
}
Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.h?rev=59268&r1=59267&r2=59268&view=diff
==============================================================================
--- branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.h (original)
+++ branches/tmp/mpatelcz/SP1-md/libstorage/src/DmmultipathCo.h Tue Nov 3 11:02:03 2009
@@ -98,7 +98,9 @@
static void activate( bool val=true );
static bool isActive() { return active; }
- static void getMultipaths( std::list<string>& l );
+ static bool isActivated(const string& name);
+ static list<string> getMultipaths();
+
static bool multipathNotDeleted( const Dmmultipath&d ) { return( !d.deleted() ); }
void logData( const string& Dir );
Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/DmraidCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/DmraidCo.cc?rev=59268&r1=59267&r2=59268&view=diff
==============================================================================
--- branches/tmp/mpatelcz/SP1-md/libstorage/src/DmraidCo.cc (original)
+++ branches/tmp/mpatelcz/SP1-md/libstorage/src/DmraidCo.cc Tue Nov 3 11:02:03 2009
@@ -128,55 +128,47 @@
}
}
-bool DmraidCo::skipRAID(const string& name)
-{
- /* Example:
- * isw_fgjagejdb_Vol0_R1:312576000:128:mirror:ok:0:2:0
- * Detect 'isw_' at position 0.
- */
- if( name.find("isw_") == 0 )
- {
- string::size_type pos = name.find(":");
- if( pos == string::npos )
- {
- return false;
- }
- string raid = name.substr(0,pos);
- y2mil("Found isw raid: " << raid);
- if( MdPartCo::isHandlingDev() == true || MdPartCo::isHandled(raid) == true)
- {
- return true;
- }
+
+ bool
+ DmraidCo::isActivated(const string& name)
+ {
+ SystemCmd c(DMSETUPBIN " table " + quote(name));
+ return c.retcode() == 0 && c.numLines() >= 1 && isdigit(c.stdout()[0]);
}
- return false;
-}
-void DmraidCo::getRaids( list<string>& l )
-{
- l.clear();
- SystemCmd c(DMRAIDBIN " -s -c -c -c");
- for( unsigned i=0; i
participants (1)
-
aschnell@svn.opensuse.org