Author: aschnell
Date: Sun Aug 17 19:00:05 2008
New Revision: 50146
URL: http://svn.opensuse.org/viewcvs/yast?rev=50146&view=rev
Log:
- merged multipath changes r:50082:50145 into trunk
Added:
trunk/storage/libstorage/src/Dmmultipath.cc
- copied unchanged from r50145, branches/tmp/aschnell/multipath/libstorage/src/Dmmultipath.cc
trunk/storage/libstorage/src/Dmmultipath.h
- copied unchanged from r50145, branches/tmp/aschnell/multipath/libstorage/src/Dmmultipath.h
trunk/storage/libstorage/src/DmmultipathCo.cc
- copied unchanged from r50145, branches/tmp/aschnell/multipath/libstorage/src/DmmultipathCo.cc
trunk/storage/libstorage/src/DmmultipathCo.h
- copied unchanged from r50145, branches/tmp/aschnell/multipath/libstorage/src/DmmultipathCo.h
Modified:
trunk/storage/VERSION
trunk/storage/libstorage/bindings/ycp/LibStorage.i
trunk/storage/libstorage/src/Container.cc
trunk/storage/libstorage/src/Disk.cc
trunk/storage/libstorage/src/Disk.h
trunk/storage/libstorage/src/DmCo.cc
trunk/storage/libstorage/src/DmPartCo.h
trunk/storage/libstorage/src/Makefile.am
trunk/storage/libstorage/src/Storage.cc
trunk/storage/libstorage/src/Storage.h
trunk/storage/libstorage/src/StorageInterface.h
trunk/storage/libstorage/src/StorageTypes.cc
trunk/storage/libstorage/src/StorageTypes.h
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/ep-hd.ycp
trunk/storage/storage/src/include/ep-main.ycp
trunk/storage/storage/src/modules/Partitions.ycp
trunk/storage/storage/src/modules/Storage.ycp
trunk/storage/storage/src/modules/StorageFields.ycp
trunk/storage/yast2-storage.spec.in
Modified: trunk/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/VERSION?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/VERSION (original)
+++ trunk/storage/VERSION Sun Aug 17 19:00:05 2008
@@ -1 +1 @@
-2.17.17
+2.17.18
Modified: trunk/storage/libstorage/bindings/ycp/LibStorage.i
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/bindings/ycp/LibStorage.i?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/bindings/ycp/LibStorage.i (original)
+++ trunk/storage/libstorage/bindings/ycp/LibStorage.i Sun Aug 17 19:00:05 2008
@@ -30,8 +30,10 @@
specialize_sequence(storage::NfsInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::DmPartCoInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::DmraidCoInfo, TO_PACK, FROM_PACK, CHECK)
+specialize_sequence(storage::DmmultipathCoInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::DmPartInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::DmraidInfo, TO_PACK, FROM_PACK, CHECK)
+specialize_sequence(storage::DmmultipathInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::PartitionSlotInfo, TO_PACK, FROM_PACK, CHECK)
%include "../../src/StorageInterface.h"
Modified: trunk/storage/libstorage/src/Container.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Container.cc?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Container.cc (original)
+++ trunk/storage/libstorage/src/Container.cc Sun Aug 17 19:00:05 2008
@@ -419,5 +419,5 @@
}
const string Container::type_names[] = { "UNKNOWN", "DISK", "MD", "LOOP", "LVM",
- "DM", "DMRAID", "NFS" };
+ "DM", "DMRAID", "NFS", "DMMULTIPATH" };
Modified: trunk/storage/libstorage/src/Disk.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Disk.cc (original)
+++ trunk/storage/libstorage/src/Disk.cc Sun Aug 17 19:00:05 2008
@@ -209,17 +209,6 @@
}
}
-void
-Disk::addMpAlias( const string& dev )
- {
- y2mil( "dev:" << dev );
- if( dev != device() &&
- find( mp_alias.begin(), mp_alias.end(), dev )==mp_alias.end() )
- {
- mp_alias.push_back( dev );
- y2mil( "mp_alias:" << mp_alias );
- }
- }
unsigned long long
Disk::cylinderToKb( unsigned long cylinder ) const
@@ -475,8 +464,6 @@
file << "UdevPath: " << udev_path << endl;
if( !udev_id.empty() )
file << "UdevId: " << udev_id << endl;
- if( !mp_alias.empty() )
- file << "MpAlias: " << mp_alias << endl;
file << "Major: " << mjr << endl;
file << "Minor: " << mnr << endl;
file << "Range: " << range << endl;
@@ -2628,8 +2615,6 @@
s << " UdevPath:" << d.udev_path;
if( !d.udev_id.empty() )
s << " UdevId:" << d.udev_id;
- if( !d.mp_alias.empty() )
- s << " MpAlias:" << d.mp_alias;
s << " MaxPrimary:" << d.max_primary;
if( d.ext_possible )
s << " ExtPossible MaxLogical:" << d.max_logical;
@@ -2783,7 +2768,6 @@
iscsi = rhs.iscsi;
udev_path = rhs.udev_path;
udev_id = rhs.udev_id;
- mp_alias = rhs.mp_alias;
logfile_name = rhs.logfile_name;
sysfs_dir = rhs.sysfs_dir;
dmp_slave = rhs.dmp_slave;
Modified: trunk/storage/libstorage/src/Disk.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.h?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Disk.h (original)
+++ trunk/storage/libstorage/src/Disk.h Sun Aug 17 19:00:05 2008
@@ -41,16 +41,13 @@
unsigned long numMinor() const { return range; }
unsigned long cylSizeB() const { return byte_cyl; }
unsigned maxPrimary() const { return max_primary; }
- bool extendedPossible() const { return ext_possible; };
+ bool extendedPossible() const { return ext_possible; }
unsigned maxLogical() const { return max_logical; }
const string& labelName() const { return label; }
const string& udevPath() const { return udev_path; }
const std::list<string>& udevId() const { return udev_id; }
void setSlave( bool val=true ) { dmp_slave=val; }
void setNumMinor( unsigned long val ) { range=val; }
- void addMpAlias( const string& dev );
- void clearMpAlias() { mp_alias.clear(); }
- const std::list<string>& mpAlias() const { return mp_alias; }
const string& sysfsDir() const { return sysfs_dir; }
unsigned numPartitions() const;
bool isDasd() const { return( nm.find("dasd")==0 ); }
@@ -218,18 +215,17 @@
string label;
string udev_path;
std::list<string> udev_id;
- std::list<string> mp_alias;
string detected_label;
string system_stderr;
string logfile_name;
string sysfs_dir;
unsigned max_primary;
bool ext_possible;
+ unsigned max_logical;
bool init_disk;
bool iscsi;
bool dmp_slave;
bool gpt_enlarge;
- unsigned max_logical;
unsigned long byte_cyl;
unsigned long range;
mutable storage::DiskInfo info;
Modified: trunk/storage/libstorage/src/DmCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmCo.cc?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/DmCo.cc (original)
+++ trunk/storage/libstorage/src/DmCo.cc Sun Aug 17 19:00:05 2008
@@ -112,6 +112,8 @@
Storage::ConstLvmLvPair lv = getStorage()->lvmLvPair();
Storage::ConstDmraidCoPair dmrco = getStorage()->dmraidCoPair();
Storage::ConstDmraidPair dmr = getStorage()->dmrPair();
+ Storage::ConstDmmultipathCoPair dmmco = getStorage()->dmmultipathCoPair();
+ Storage::ConstDmmultipathPair dmm = getStorage()->dmmPair();
y2milestone( "begin" );
SystemCmd c(DMSETUPBIN " ls | grep \"(.*)\"" );
for( unsigned i=0; iname()==table;
+ ++i;
+ }
+ }
+ if( !found )
+ {
+ Storage::ConstDmmultipathIterator i=dmm.begin();
+ while( !found && i!=dmm.end() )
+ {
+ found = i->getTableName()==table;
+ ++i;
+ }
+ }
+ if( !found )
+ {
string minor = extractNthWord( 2, line );
unsigned min_num;
string::size_type pos;
Modified: trunk/storage/libstorage/src/DmPartCo.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmPartCo.h?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/DmPartCo.h (original)
+++ trunk/storage/libstorage/src/DmPartCo.h Sun Aug 17 19:00:05 2008
@@ -54,9 +54,18 @@
int resizeVolume( Volume* v, unsigned long long newSize );
int removeVolume( Volume* v );
int removeDmPart();
- void getUnusedSpace( std::list<Region>& free, bool all=true,
- bool logical=false );
- bool hasExtended() const;
+
+ unsigned maxPrimary() const { return disk->maxPrimary(); }
+ bool extendedPossible() const { return disk->extendedPossible(); }
+ unsigned maxLogical() const { return disk->maxLogical(); }
+
+ unsigned int numPrimary() const { return disk->numPrimary(); }
+ bool hasExtended() const { return disk->hasExtended(); }
+ unsigned int numLogical() const { return disk->numLogical(); }
+
+ void getUnusedSpace(std::list<Region>& free, bool all = true, bool logical = false)
+ { disk->getUnusedSpace(free, all, logical); }
+
unsigned long long cylinderToKb( unsigned long val ) const
{ return disk->cylinderToKb( val ); }
unsigned long kbToCylinder( unsigned long long val ) const
Modified: trunk/storage/libstorage/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Makefile.am?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Makefile.am (original)
+++ trunk/storage/libstorage/src/Makefile.am Sun Aug 17 19:00:05 2008
@@ -30,7 +30,8 @@
PeContainer.cc PeContainer.h \
LvmVg.cc LvmVg.h \
DmPartCo.cc DmPartCo.h \
- DmraidCo.cc DmraidCo.h \
+ DmraidCo.cc DmraidCo.h \
+ DmmultipathCo.cc DmmultipathCo.h \
DmCo.cc DmCo.h \
MdCo.cc MdCo.h \
LoopCo.cc LoopCo.h \
@@ -40,7 +41,8 @@
Dm.cc Dm.h \
LvmLv.cc LvmLv.h \
DmPart.cc DmPart.h \
- Dmraid.cc Dmraid.h \
+ Dmraid.cc Dmraid.h \
+ Dmmultipath.cc Dmmultipath.h \
Md.cc Md.h \
Loop.cc Loop.h \
Nfs.cc Nfs.h \
Modified: trunk/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.cc (original)
+++ trunk/storage/libstorage/src/Storage.cc Sun Aug 17 19:00:05 2008
@@ -232,11 +232,13 @@
MdCo::activate( true, tmpDir() );
LvmVg::activate( true );
DmraidCo::activate( true );
+ DmmultipathCo::activate( true );
delete ppart;
ppart = new ProcPart;
}
detectMds();
detectDmraid( *ppart );
+ detectDmmultipath( *ppart );
detectLvmVgs();
detectDm( *ppart );
@@ -400,70 +402,9 @@
else if( autodetect )
{
autodetectDisks( ppart );
- detectMultipath();
}
}
-void
-Storage::detectMultipath()
- {
- bool acc_ok = access(MULTIPATHBIN, X_OK) == 0;
- y2mil( "detectMultipath acc_ok:" << acc_ok );
- if( acc_ok )
- {
- list<string> mp_list;
- string line;
- unsigned i=0;
- SystemCmd c(MULTIPATHBIN " -d -v 2+ -ll");
- if( i1 )
- {
- for( list<string>::const_iterator i=mp_list.begin();
- i!=mp_list.end(); ++i )
- {
- Storage::DiskIterator di = findDisk( *i );
- if( di != dEnd() )
- {
- di->clearMpAlias();
- for( list<string>::const_iterator j=mp_list.begin();
- j!=mp_list.end(); ++j )
- {
- if( i!=j )
- di->addMpAlias( *j );
- }
- }
- else
- y2war( "Disk not found:" << *i );
- }
- }
- }
- }
- }
void Storage::detectMds()
{
@@ -602,6 +543,50 @@
}
}
+
+void
+Storage::detectDmmultipath( ProcPart& ppart )
+{
+ if( test() )
+ {
+ glob_t globbuf;
+ if( glob( (testdir+"/dmmultipath_*[!~0-9]").c_str(), GLOB_NOSORT, 0,
+ &globbuf) == 0)
+ {
+ // TODO
+ }
+ globfree (&globbuf);
+ }
+ else if( getenv( "YAST2_STORAGE_NO_DMMULTIPATH" )==NULL )
+ {
+ list<string> l;
+ map by_id;
+ DmmultipathCo::getMultipaths( l );
+ if( !l.empty() )
+ getFindMap( "/dev/disk/by-id", by_id, false );
+ for( list<string>::const_iterator i=l.begin(); i!=l.end(); ++i )
+ {
+ DmmultipathCo * v = new DmmultipathCo( this, *i, ppart );
+ if( v->isValid() )
+ {
+ /*
+ 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;
+ }
+ }
+ }
+}
+
+
void
Storage::detectDm( ProcPart& ppart )
{
@@ -1045,7 +1030,7 @@
ret = i->createPartition( type, start, size, device, true );
}
}
- }
+ }
if( !done && ret==0 )
{
ret = STORAGE_DISK_NOT_FOUND;
@@ -1338,7 +1323,7 @@
ret = STORAGE_REMOVE_PARTITION_INVALID_CONTAINER;
}
}
- else if( cont->type()==DMRAID )
+ else if( cont->type()==DMRAID || cont->type()==DMMULTIPATH )
{
DmPartCo* disk = dynamic_cast(&(*cont));
if( disk!=NULL )
@@ -1403,7 +1388,7 @@
ret = STORAGE_CHANGE_AREA_INVALID_CONTAINER;
}
}
- else if( cont->type()==DMRAID )
+ else if( cont->type()==DMRAID || cont->type()==DMMULTIPATH )
{
DmPartCo* disk = dynamic_cast(&(*cont));
if( disk!=NULL )
@@ -1458,7 +1443,7 @@
ret = STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER;
}
}
- else if( cont->type()==DMRAID )
+ else if( cont->type()==DMRAID || cont->type()==DMMULTIPATH )
{
DmPartCo* disk = dynamic_cast(&(*cont));
if( disk!=NULL )
@@ -1530,7 +1515,7 @@
ret = STORAGE_RESIZE_INVALID_CONTAINER;
}
}
- else if( cont->type()==DMRAID )
+ else if( cont->type()==DMRAID || cont->type()==DMMULTIPATH )
{
DmPartCo* disk = dynamic_cast(&(*cont));
DmPart* p = dynamic_cast(&(*vol));
@@ -1588,7 +1573,7 @@
ret = STORAGE_CHANGE_PARTITION_ID_INVALID_CONTAINER;
}
}
- else if( cont->type()==DMRAID )
+ else if( cont->type()==DMRAID || cont->type()==DMMULTIPATH )
{
DmPartCo* disk = dynamic_cast(&(*cont));
if( disk!=NULL )
@@ -1624,22 +1609,66 @@
int ret = 0;
slots.clear();
assertInit();
- DiskIterator i = findDisk( disk );
- if( i != dEnd() )
+
+ // TODO: don't have code below twice
+
+ DiskIterator i1 = findDisk( disk );
+ DmPartCoIterator i2 = findDmPartCo( disk );
+
+ if (i1 != dEnd())
{
// maxPrimary() and maxLogical() include limits from partition table type and
// minor number range
- // TODO: check these restrictions
+ bool primaryPossible = i1->numPrimary() + (i1->hasExtended() ? 1 : 0) < i1->maxPrimary();
+ bool extendedPossible = primaryPossible && i1->extendedPossible() && !i1->hasExtended();
+ bool logicalPossible = i1->hasExtended() && i1->numLogical() < (i1->maxLogical() - i1->maxPrimary());
- bool primaryPossible = i->numPrimary() + (i->hasExtended() ? 1 : 0) < i->maxPrimary();
- bool extendedPossible = primaryPossible && i->extendedPossible() && !i->hasExtended();
- bool logicalPossible = i->hasExtended() && i->numLogical() < (i->maxLogical() - i->maxPrimary());
+ list<Region> regions;
+
+ i1->getUnusedSpace(regions, false, false);
+ for (list<Region>::const_iterator region=regions.begin(); region!=regions.end(); region++)
+ {
+ PartitionSlotInfo slot;
+ slot.cylStart = region->start();
+ slot.cylSize = region->len();
+ slot.primarySlot = true;
+ slot.primaryPossible = primaryPossible;
+ slot.extendedSlot = true;
+ slot.extendedPossible = extendedPossible;
+ slot.logicalSlot = false;
+ slot.logicalPossible = false;
+ slots.push_back(slot);
+ }
+
+ i1->getUnusedSpace(regions, false, true);
+ for (list<Region>::const_iterator region=regions.begin(); region!=regions.end(); region++)
+ {
+ PartitionSlotInfo slot;
+ slot.cylStart = region->start();
+ slot.cylSize = region->len();
+ slot.primarySlot = false;
+ slot.primaryPossible = false;
+ slot.extendedSlot = false;
+ slot.extendedPossible = false;
+ slot.logicalSlot = true;
+ slot.logicalPossible = logicalPossible;
+ slots.push_back(slot);
+ }
+ }
+ else if (i2 != dmpCoEnd())
+ {
+ // maxPrimary() and maxLogical() include limits from partition table type and
+ // minor number range
+
+ bool primaryPossible = i2->numPrimary() + (i2->hasExtended() ? 1 : 0) < i2->maxPrimary();
+ bool extendedPossible = primaryPossible && i2->extendedPossible() && !i2->hasExtended();
+ bool logicalPossible = i2->hasExtended() && i2->numLogical() < (i2->maxLogical() - i2->maxPrimary());
list<Region> regions;
- i->getUnusedSpace(regions, false, false);
- for( list<Region>::const_iterator region=regions.begin(); region!=regions.end(); region++ )
+ i2->getUnusedSpace(regions, false, false);
+ for (list<Region>::const_iterator region=regions.begin(); region!=regions.end(); region++)
{
PartitionSlotInfo slot;
slot.cylStart = region->start();
@@ -1653,8 +1682,8 @@
slots.push_back(slot);
}
- i->getUnusedSpace(regions, false, true);
- for( list<Region>::const_iterator region=regions.begin(); region!=regions.end(); region++ )
+ i2->getUnusedSpace(regions, false, true);
+ for (list<Region>::const_iterator region=regions.begin(); region!=regions.end(); region++)
{
PartitionSlotInfo slot;
slot.cylStart = region->start();
@@ -1672,7 +1701,7 @@
{
ret = STORAGE_DISK_NOT_FOUND;
}
- y2milestone( "ret:%d", ret );
+ y2mil("ret:" << ret);
return ret;
}
@@ -3710,9 +3739,10 @@
static bool isDmContainer( const Container& co )
- {
- return co.type()==DM || co.type()==LVM || co.type()==DMRAID;
- }
+{
+ return co.type()==DM || co.type()==LVM || co.type()==DMRAID || co.type()==DMMULTIPATH;
+}
+
bool Storage::removeDmMapsTo( const string& dev )
{
@@ -3872,6 +3902,7 @@
{
DiskIterator d;
DmraidCoIterator r;
+ DmmultipathCoIterator m;
std::pair p = Disk::getDiskPartition( dev );
if( p.first=="/dev/md" )
{
@@ -3913,6 +3944,14 @@
info.numeric = true;
info.nr = p.second;
}
+ else if( (m=findDmmultipathCo(p.first))!=dmmCoEnd() )
+ {
+ info.cname = m->device();
+ info.vname = dev.substr( dev.find_last_of('/')+1 );
+ info.type = DMMULTIPATH;
+ info.numeric = true;
+ info.nr = p.second;
+ }
else if( dev.find("/dev/disk/by-uuid/")==0 ||
dev.find("/dev/disk/by-label/")==0 ||
dev.find("UUID=")==0 || dev.find("LABEL=")==0 )
@@ -4121,6 +4160,39 @@
}
+int
+Storage::getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info )
+{
+ int ret = 0;
+ assertInit();
+ DmmultipathCoIterator i = findDmmultipathCo( name );
+ if( i != dmmCoEnd() )
+ {
+ i->getInfo( info );
+ }
+ else
+ ret = STORAGE_DMMULTIPATH_CO_NOT_FOUND;
+ return( ret );
+}
+
+int
+Storage::getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
+ DmmultipathCoInfo& info )
+{
+ int ret = 0;
+ assertInit();
+ DmmultipathCoIterator i = findDmmultipathCo( name );
+ if( i != dmmCoEnd() )
+ {
+ ((const Container*)&(*i))->getInfo( cinfo );
+ i->getInfo( info );
+ }
+ else
+ ret = STORAGE_DMMULTIPATH_CO_NOT_FOUND;
+ return( ret );
+}
+
+
int Storage::getMdInfo( dequestorage::MdInfo& plist )
{
int ret = 0;
@@ -4198,6 +4270,30 @@
return( ret );
}
+
+int
+Storage::getDmmultipathInfo( const string& name,
+ dequestorage::DmmultipathInfo& plist )
+{
+ int ret = 0;
+ plist.clear();
+ assertInit();
+ DmmultipathCoIterator i = findDmmultipathCo( name );
+ if( i != dmmCoEnd() )
+ {
+ DmmultipathCo::DmmultipathPair p = i->dmmultipathPair(DmmultipathCo::multipathNotDeleted);
+ for( DmmultipathCo::DmmultipathIter i2 = p.begin(); i2 != p.end(); ++i2 )
+ {
+ plist.push_back( DmmultipathInfo() );
+ i2->getInfo( plist.back() );
+ }
+ }
+ else
+ ret = STORAGE_DMMULTIPATH_CO_NOT_FOUND;
+ return( ret );
+}
+
+
string Storage::getAllUsedFs() const
{
list<FsType> fs;
@@ -4763,6 +4859,17 @@
return( ret );
}
+Storage::DmmultipathCoIterator Storage::findDmmultipathCo( const string& name )
+ {
+ assertInit();
+ DmmultipathCoPair p = dmmCoPair();
+ DmmultipathCoIterator ret=p.begin();
+ string tname = DmPartCo::undevName(name);
+ while( ret!=p.end() && (ret->deleted() || ret->name()!=tname))
+ ++ret;
+ return( ret );
+ }
+
Storage::DmPartCoIterator Storage::findDmPartCo( const string& name )
{
assertInit();
@@ -4956,6 +5063,8 @@
case UB_DMRAID:
//ret = removeDmraidCo( name );
break;
+ case UB_DMMULTIPATH:
+ break;
case UB_NONE:
y2war(device << " used by none");
break;
Modified: trunk/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.h (original)
+++ trunk/storage/libstorage/src/Storage.h Sun Aug 17 19:00:05 2008
@@ -16,6 +16,8 @@
#include "y2storage/LvmLv.h"
#include "y2storage/DmraidCo.h"
#include "y2storage/Dmraid.h"
+#include "y2storage/DmmultipathCo.h"
+#include "y2storage/Dmmultipath.h"
#include "y2storage/MdCo.h"
#include "y2storage/Md.h"
#include "y2storage/DmCo.h"
@@ -203,7 +205,7 @@
static SkipDeleted SkipDel;
static bool notDeleted( const Container&d ) { return( !d.deleted() ); };
static bool isDmPart( const Container&d )
- { return( d.type()==storage::DMRAID ); }
+ { return d.type() == storage::DMRAID || d.type() == storage::DMMULTIPATH; }
static void initDefaultLogger ();
@@ -263,6 +265,7 @@
int getDiskInfo( const string& disk, storage::DiskInfo& info);
int getLvmVgInfo( const string& name, storage::LvmVgInfo& info);
int getDmraidCoInfo( const string& name, storage::DmraidCoInfo& info);
+ int getDmmultipathCoInfo( const string& name, storage::DmmultipathCoInfo& info);
int getContDiskInfo( const string& disk, storage::ContainerInfo& cinfo,
storage::DiskInfo& info);
int getContLvmVgInfo( const string& name, storage::ContainerInfo& cinfo,
@@ -270,6 +273,9 @@
int getContDmraidCoInfo( const string& name,
storage::ContainerInfo& cinfo,
storage::DmraidCoInfo& info );
+ int getContDmmultipathCoInfo( const string& name,
+ storage::ContainerInfo& cinfo,
+ storage::DmmultipathCoInfo& info );
void getVolumes (dequestorage::VolumeInfo& vlist);
int getVolume( const string& device, storage::VolumeInfo& info);
int getPartitionInfo( const string& disk,
@@ -282,6 +288,8 @@
int getLoopInfo( dequestorage::LoopInfo& plist );
int getDmraidInfo( const string& name,
dequestorage::DmraidInfo& plist );
+ int getDmmultipathInfo( const string& name,
+ dequestorage::DmmultipathInfo& plist );
int getContVolInfo( const string& dev, ContVolInfo& info);
bool getFsCapabilities( storage::FsType fstype,
@@ -900,6 +908,90 @@
return( DmraidCoIterator( DmraidCoPIterator( p, CheckFnc, true )) );
}
+
+// iterators over DMMULTIPATH container
+ protected:
+ // protected typedefs for iterators over DMMULTIPATH container
+ typedef CastCheckIterator ContainerCDmmultipathIter;
+ template< class Pred >
+ struct ConstDmmultipathCoPI { typedef ContainerIter type; };
+ typedef CastCheckIterator ContainerDmmultipathIter;
+ template< class Pred >
+ struct DmmultipathCoPI { typedef ContainerIter type; };
+ template< class Pred >
+ struct DmmultipathCoI { typedef ContainerDerIter type; };
+ typedef CheckFnc<const DmmultipathCo> CheckFncDmmultipathCo;
+ typedef CheckerIterator< CheckFncDmmultipathCo, ConstDmmultipathCoPI<CheckFncDmmultipathCo>::type,
+ ContainerCDmmultipathIter, DmmultipathCo > ConstDmmultipathCoPIterator;
+ typedef CheckerIterator< CheckFncDmmultipathCo, DmmultipathCoPI<CheckFncDmmultipathCo>::type,
+ ContainerDmmultipathIter, DmmultipathCo > DmmultipathCoPIterator;
+ typedef DerefIterator DmmultipathCoIterator;
+ typedef IterPair<DmmultipathCoIterator> DmmultipathCoPair;
+
+ public:
+ // public typedefs for iterators over DMMULTIPATH container
+ typedef DerefIterator ConstDmmultipathCoIterator;
+ template< class Pred >
+ struct ConstDmmultipathCoI
+ { typedef ContainerDerIter type; };
+ template< class Pred >
+ struct DmmultipathCoCondIPair { typedef MakeCondIterPair type; };
+ typedef IterPair<ConstDmmultipathCoIterator> ConstDmmultipathCoPair;
+
+ // public member functions for iterators over DMMULTIPATH container
+ ConstDmmultipathCoPair dmmultipathCoPair( bool (* CheckFnc)( const DmmultipathCo& )=NULL ) const
+ {
+ return( ConstDmmultipathCoPair( dmmultipathCoBegin( CheckFnc ), dmmultipathCoEnd( CheckFnc ) ));
+ }
+ ConstDmmultipathCoIterator dmmultipathCoBegin( bool (* CheckFnc)( const DmmultipathCo& )=NULL ) const
+ {
+ IterPair<ContainerCDmmultipathIter> p( ContainerCDmmultipathIter( cont.begin(), cont.end() ),
+ ContainerCDmmultipathIter( cont.begin(), cont.end(), true ));
+ return( ConstDmmultipathCoIterator( ConstDmmultipathCoPIterator( p, CheckFnc )) );
+ }
+ ConstDmmultipathCoIterator dmmultipathCoEnd( bool (* CheckFnc)( const DmmultipathCo& )=NULL ) const
+ {
+ IterPair<ContainerCDmmultipathIter> p( ContainerCDmmultipathIter( cont.begin(), cont.end() ),
+ ContainerCDmmultipathIter( cont.begin(), cont.end(), true ));
+ return( ConstDmmultipathCoIterator( ConstDmmultipathCoPIterator( p, CheckFnc, true )) );
+ }
+ template< class Pred > typename DmmultipathCoCondIPair<Pred>::type dmmultipathCoCondPair( const Pred& p ) const
+ {
+ return( typename DmmultipathCoCondIPair<Pred>::type( dmmultipathCoCondBegin( p ), dmmultipathCoCondEnd( p ) ) );
+ }
+ template< class Pred > typename ConstDmmultipathCoI<Pred>::type dmmultipathCoCondBegin( const Pred& p ) const
+ {
+ IterPair<ContainerCDmmultipathIter> pair( ContainerCDmmultipathIter( cont.begin(), cont.end() ),
+ ContainerCDmmultipathIter( cont.begin(), cont.end(), true ));
+ return( typename ConstDmmultipathCoI<Pred>::type( typename ConstDmmultipathCoPI<Pred>::type( pair, p )) );
+ }
+ template< class Pred > typename ConstDmmultipathCoI<Pred>::type dmmultipathCoCondEnd( const Pred& p ) const
+ {
+ IterPair<ContainerCDmmultipathIter> pair( ContainerCDmmultipathIter( cont.begin(), cont.end() ),
+ ContainerCDmmultipathIter( cont.begin(), cont.end(), true ));
+ return( typename ConstDmmultipathCoI<Pred>::type( typename ConstDmmultipathCoPI<Pred>::type( pair, p, true )) );
+ }
+ protected:
+ // protected member functions for iterators over DMMULTIPATH container
+ DmmultipathCoPair dmmCoPair( bool (* CheckFnc)( const DmmultipathCo& )=NULL )
+ {
+ return( DmmultipathCoPair( dmmCoBegin( CheckFnc ), dmmCoEnd( CheckFnc ) ));
+ }
+ DmmultipathCoIterator dmmCoBegin( bool (* CheckFnc)( const DmmultipathCo& )=NULL )
+ {
+ IterPair<ContainerDmmultipathIter> p( ContainerDmmultipathIter( cont.begin(), cont.end() ),
+ ContainerDmmultipathIter( cont.begin(), cont.end(), true ));
+ return( DmmultipathCoIterator( DmmultipathCoPIterator( p, CheckFnc )) );
+ }
+ DmmultipathCoIterator dmmCoEnd( bool (* CheckFnc)( const DmmultipathCo& )=NULL )
+ {
+ IterPair<ContainerDmmultipathIter> p( ContainerDmmultipathIter( cont.begin(), cont.end() ),
+ ContainerDmmultipathIter( cont.begin(), cont.end(), true ));
+ return( DmmultipathCoIterator( DmmultipathCoPIterator( p, CheckFnc, true )) );
+ }
+
+
// iterators over volumes
protected:
// protected typedefs for iterators over volumes
@@ -1467,6 +1559,80 @@
return( typename ConstDmraidI<Pred>::type( typename ConstDmraidPI<Pred>::type(pair, p, true )) );
}
+
+// iterators over dmmultipath devices
+ protected:
+ // protected typedefs for iterators over dmmultipath devices
+ typedef ListListIterator ConstDmmultipathInter;
+ typedef CastIterator ConstDmmultipathInter2;
+ template< class Pred >
+ struct ConstDmmultipathPI { typedef ContainerIter type; };
+ typedef CheckFnc<const Dmmultipath> CheckFncDmmultipath;
+ typedef CheckerIterator< CheckFncDmmultipath, ConstDmmultipathPI<CheckFncDmmultipath>::type,
+ ConstDmmultipathInter2, Dmmultipath > ConstDmmultipathPIterator;
+ public:
+ // public typedefs for iterators over dmmultipath volumes
+ template< class Pred >
+ struct ConstDmmultipathI
+ { typedef ContainerDerIter type; };
+ template< class Pred >
+ struct DmmultipathCondIPair
+ { typedef MakeCondIterPair type; };
+ typedef DerefIterator ConstDmmultipathIterator;
+ typedef IterPair<ConstDmmultipathIterator> ConstDmmultipathPair;
+
+ // public member functions for iterators over dmmultipath volumes
+ ConstDmmultipathPair dmmPair( bool (* CheckDmmultipathCo)( const DmmultipathCo& )) const
+ {
+ return( ConstDmmultipathPair( dmmBegin( CheckDmmultipathCo ), dmmEnd( CheckDmmultipathCo ) ));
+ }
+ ConstDmmultipathPair dmmPair( bool (* CheckDmmultipath)( const Dmmultipath& )=NULL,
+ bool (* CheckDmmultipathCo)( const DmmultipathCo& )=NULL) const
+ {
+ return( ConstDmmultipathPair( dmmBegin( CheckDmmultipath, CheckDmmultipathCo ),
+ dmmEnd( CheckDmmultipath, CheckDmmultipathCo ) ));
+ }
+ ConstDmmultipathIterator dmmBegin( bool (* CheckDmmultipathCo)( const DmmultipathCo& )) const
+ {
+ return( dmmBegin( NULL, CheckDmmultipathCo ) );
+ }
+ ConstDmmultipathIterator dmmBegin( bool (* CheckDmmultipath)( const Dmmultipath& )=NULL,
+ bool (* CheckDmmultipathCo)( const DmmultipathCo& )=NULL) const
+ {
+ IterPair<ConstDmmultipathInter2> p( (ConstDmmultipathInter(dmmultipathCoPair( CheckDmmultipathCo ))),
+ (ConstDmmultipathInter(dmmultipathCoPair( CheckDmmultipathCo ), true )));
+ return( ConstDmmultipathIterator( ConstDmmultipathPIterator(p, CheckDmmultipath )));
+ }
+ ConstDmmultipathIterator dmmEnd( bool (* CheckDmmultipathCo)( const DmmultipathCo& )) const
+ {
+ return( dmmEnd( NULL, CheckDmmultipathCo ) );
+ }
+ ConstDmmultipathIterator dmmEnd( bool (* CheckDmmultipath)( const Dmmultipath& )=NULL,
+ bool (* CheckDmmultipathCo)( const DmmultipathCo& )=NULL) const
+ {
+ IterPair<ConstDmmultipathInter2> p( (ConstDmmultipathInter(dmmultipathCoPair( CheckDmmultipathCo ))),
+ (ConstDmmultipathInter(dmmultipathCoPair( CheckDmmultipathCo ), true )));
+ return( ConstDmmultipathIterator( ConstDmmultipathPIterator(p, CheckDmmultipath, true )));
+ }
+ template< class Pred > typename DmmultipathCondIPair<Pred>::type dmmCondPair( const Pred& p ) const
+ {
+ return( typename DmmultipathCondIPair<Pred>::type( dmmCondBegin( p ), dmmCondEnd( p ) ) );
+ }
+ template< class Pred > typename ConstDmmultipathI<Pred>::type dmmCondBegin( const Pred& p ) const
+ {
+ IterPair<ConstDmmultipathInter2> pair( (ConstDmmultipathInter( dmmultipathCoPair())),
+ (ConstDmmultipathInter( dmmultipathCoPair(), true )));
+ return( typename ConstDmmultipathI<Pred>::type( typename ConstDmmultipathPI<Pred>::type(pair, p) ) );
+ }
+ template< class Pred > typename ConstDmmultipathI<Pred>::type dmmCondEnd( const Pred& p ) const
+ {
+ IterPair<ConstDmmultipathInter2> pair( (ConstDmmultipathInter( dmmCoPair())),
+ (ConstDmmultipathInter( dmmCoPair(), true )));
+ return( typename ConstDmmultipathI<Pred>::type( typename ConstDmmultipathPI<Pred>::type(pair, p, true )) );
+ }
+
+
protected:
// protected internal member functions
void initialize();
@@ -1478,6 +1644,7 @@
void detectNfs( ProcMounts& mounts );
void detectLvmVgs();
void detectDmraid( ProcPart& ppart );
+ void detectDmmultipath( ProcPart& ppart );
void detectDm( ProcPart& ppart );
void initDisk( DiskData& data, ProcPart& pp );
void detectFsData( const VolIterator& begin, const VolIterator& end,
@@ -1497,6 +1664,7 @@
DiskIterator findDiskPath( const string& path );
LvmVgIterator findLvmVg( const string& name );
DmraidCoIterator findDmraidCo( const string& name );
+ DmmultipathCoIterator findDmmultipathCo( const string& name );
DmPartCoIterator findDmPartCo( const string& name );
bool findVolume( const string& device, ContIterator& c,
VolIterator& v );
Modified: trunk/storage/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/StorageInterface.h (original)
+++ trunk/storage/libstorage/src/StorageInterface.h Sun Aug 17 19:00:05 2008
@@ -112,9 +112,9 @@
enum MdParity { PAR_NONE, LEFT_ASYMMETRIC, LEFT_SYMMETRIC,
RIGHT_ASYMMETRIC, RIGHT_SYMMETRIC };
- enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_DM, UB_DMRAID };
+ enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_DM, UB_DMRAID, UB_DMMULTIPATH };
- enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC,
+ enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH,
COTYPE_LAST_ENTRY };
/**
@@ -231,6 +231,14 @@
DmPartCoInfo p;
};
+ struct DmmultipathCoInfo
+ {
+ DmmultipathCoInfo() {}
+ DmPartCoInfo p;
+ string vendor;
+ string model;
+ };
+
/**
* Contains info about a volume.
*/
@@ -394,6 +402,15 @@
};
/**
+ * Contains info about a DMMULTIPATH volume.
+ */
+ struct DmmultipathInfo
+ {
+ DmmultipathInfo() {}
+ DmPartInfo p;
+ };
+
+ /**
* Contains info about a DM volume.
*/
struct ContVolInfo
@@ -483,6 +500,7 @@
STORAGE_DEVICE_NODE_NOT_FOUND = -2027,
STORAGE_DMRAID_CO_NOT_FOUND = -2028,
STORAGE_RESIZE_INVALID_CONTAINER = -2029,
+ STORAGE_DMMULTIPATH_CO_NOT_FOUND = -2030,
VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
VOLUME_FSTAB_EMPTY_MOUNT = -3001,
@@ -712,6 +730,26 @@
DmraidCoInfo& info) = 0;
/**
+ * Query container info for a DMMULTIPATH container
+ *
+ * @param name name of container, e.g. 3600508b400105f590000900000300000
+ * @param info record that gets filled with DMMULTIPATH Container special data
+ * @return zero if all is ok, a negative number to indicate an error
+ */
+ virtual int getDmmultipathCoInfo( const string& name, DmmultipathCoInfo& info) = 0;
+
+ /**
+ * Query container info for a DMMULTIPATH container
+ *
+ * @param name name of container, e.g. 3600508b400105f590000900000300000
+ * @param cinfo record that gets filled with container general data
+ * @param info record that gets filled with DMMULTIPATH Container special data
+ * @return zero if all is ok, a negative number to indicate an error
+ */
+ virtual int getContDmmultipathCoInfo( const string& name, ContainerInfo& cinfo,
+ DmmultipathCoInfo& info) = 0;
+
+ /**
* Query all volumes found in system
*
* @param infos list of records that get filled with volume info
@@ -790,6 +828,16 @@
deque<DmraidInfo>& plist ) = 0;
/**
+ * Query infos for dmmultipath devices in system
+ *
+ * @param plist list of records that get filled with dmmultipath specific info
+ * @param name name of dmmultipath, e.g. 3600508b400105f590000900000300000
+ * @return zero if all is ok, a negative number to indicate an error
+ */
+ virtual int getDmmultipathInfo( const string& name,
+ deque<DmmultipathInfo>& plist ) = 0;
+
+ /**
* Query capabilities of a filesystem type.
*/
virtual bool getFsCapabilities (FsType fstype, FsCapabilities& fscapabilities) const = 0;
Modified: trunk/storage/libstorage/src/StorageTypes.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.cc?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/StorageTypes.cc (original)
+++ trunk/storage/libstorage/src/StorageTypes.cc Sun Aug 17 19:00:05 2008
@@ -65,6 +65,7 @@
return "/dev/" + ub_name;
case UB_DM:
+ case UB_DMMULTIPATH:
return "/dev/mapper/" + ub_name;
}
}
@@ -89,6 +90,9 @@
case storage::UB_DMRAID:
st = "dmraid";
break;
+ case UB_DMMULTIPATH:
+ st = "dmmultipath";
+ break;
default:
st = "UNKNOWN";
break;
Modified: trunk/storage/libstorage/src/StorageTypes.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.h?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/libstorage/src/StorageTypes.h (original)
+++ trunk/storage/libstorage/src/StorageTypes.h Sun Aug 17 19:00:05 2008
@@ -15,12 +15,13 @@
static const int order[COTYPE_LAST_ENTRY] = {
0, // CUNKNOWN
1, // DISK
- 3, // MD
+ 4, // MD
7, // LOOP
- 5, // LVM
- 4, // DM
+ 6, // LVM
+ 5, // DM
2, // DMRAID
- 8 // NFSC
+ 8, // NFSC
+ 3 // DMMULTIPATH
};
bool ret = order[a] < order[b];
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Sun Aug 17 19:00:05 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Sun Aug 17 18:51:16 CEST 2008 - aschnell@suse.de
+
+- added multipath support (fate #302616 and fate #304332)
+- fixed creation of partitions on dmraid
+- version 2.17.18
+
+-------------------------------------------------------------------
Thu Aug 14 17:43:43 CEST 2008 - kmachalkova@suse.cz
- First steps to integrate nfs-client into partitioner (making it
Modified: trunk/storage/storage/src/include/ep-hd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd.ycp?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-hd.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd.ycp Sun Aug 17 19:00:05 2008
@@ -23,7 +23,7 @@
{
symbol Predicate(map disk, map partition)
{
- return StorageFields::PredicateDiskType(disk, partition, [`CT_DMRAID, `CT_DISK]);
+ return StorageFields::PredicateDiskType(disk, partition, [`CT_DMRAID, `CT_DMMULTIPATH, `CT_DISK]);
}
boolean IsAvailable ( string client )
@@ -325,6 +325,36 @@
}
+ void CreateHdDiskDevicesTab(any user_data)
+ {
+ string part_device = (string) user_data;
+
+ symbol Predicate(map disk, map partition)
+ {
+ return StorageFields::PredicateUsedByDevice(disk, partition, [ part_device ]);
+ }
+
+ list<symbol> fields = StorageSettings::FilterTable([ `device, `udev_path, `udev_id, `size,
+ `format, `type, `used_by ]);
+
+ map target_map = Storage::GetTargetMap();
+
+ term table_header = StorageFields::TableHeader(fields);
+ list<term> table_contents = StorageFields::TableContents(fields, target_map, Predicate);
+
+ UI::ReplaceWidget(`tab_panel,
+ `VBox(
+ `Table(`id(`table), `opt(`keepSorting, `notify),
+ table_header, table_contents)
+ )
+ );
+
+ string helptext = _("<p>Disk TODO</p>");
+
+ Wizard::RestoreHelp(helptext + StorageFields::TableHelptext(fields));
+ }
+
+
void CreateHdDiskPanel(any user_data)
{
string device = (string) user_data;
@@ -336,7 +366,9 @@
`user_data : user_data ],
`partitions : $[ `create : CreateHdDiskPartitionsTab,
`handle : HandleHdDiskPartitionsTab,
- `user_data : user_data ] ];
+ `user_data : user_data ],
+ `devices : $[ `create : CreateHdDiskDevicesTab,
+ `user_data : user_data ] ];
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
@@ -344,7 +376,8 @@
`IconAndHeading(sformat(_("Hard Disk: %1"), device), hd_icon),
`DumbTab(`id(`tab), [
`item(`id(`overview), _("&Overview")),
- `item(`id(`partitions), _("&Partitions"))
+ `item(`id(`partitions), _("&Partitions")),
+ `item(`id(`devices), _("&Used Devices"))
],
`ReplacePoint(`id(`tab_panel), TabPanel::empty_panel)
)
Modified: trunk/storage/storage/src/include/ep-main.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-main.ycp?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-main.ycp (original)
+++ trunk/storage/storage/src/include/ep-main.ycp Sun Aug 17 19:00:05 2008
@@ -144,6 +144,7 @@
{
case `CT_DISK:
case `CT_DMRAID:
+ case `CT_DMMULTIPATH:
huhu(disk, `hd, $[ `create : CreateHdPartitionPanel, `handle : HandleHdPartitionPanel ],
$[ `create : CreateHdDiskPanel, `handle : HandleHdDiskPanel ]);
break;
Modified: trunk/storage/storage/src/modules/Partitions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Partitions.ycp?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Partitions.ycp (original)
+++ trunk/storage/storage/src/modules/Partitions.ycp Sun Aug 17 19:00:05 2008
@@ -56,6 +56,7 @@
global string dm_name = "DM";
global string loop_name = "Loop Device";
global string dmraid_name = "DM RAID";
+ global string dmmultipath_name = "DM Multipath";
global string nfs_name = "NFS";
// filesystems for /win
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Sun Aug 17 19:00:05 2008
@@ -56,6 +56,7 @@
import "LibStorage::DmInfo";
import "LibStorage::DmPartInfo";
import "LibStorage::DmraidInfo";
+ import "LibStorage::DmmultipathInfo";
import "LibStorage::NfsInfo";
import "LibStorage::ContainerInfo";
import "LibStorage::DiskInfo";
@@ -63,6 +64,7 @@
import "LibStorage::PartitionAddInfo";
import "LibStorage::DmPartCoInfo";
import "LibStorage::DmraidCoInfo";
+ import "LibStorage::DmmultipathCoInfo";
import "LibStorage::PartitionSlotInfo";
map conv_ctype =
@@ -73,6 +75,7 @@
LibStorage::LOOP() : `CT_LOOP,
LibStorage::LVM() : `CT_LVM,
LibStorage::DMRAID() : `CT_DMRAID,
+ LibStorage::DMMULTIPATH() : `CT_DMMULTIPATH,
LibStorage::DM() : `CT_DM,
LibStorage::NFSC() : `CT_NFS
]
@@ -84,6 +87,7 @@
"m" : $[ LibStorage::UB_LVM() : `UB_LVM,
LibStorage::UB_MD() : `UB_MD,
LibStorage::UB_DMRAID() : `UB_DMRAID,
+ LibStorage::UB_DMMULTIPATH() : `UB_DMMULTIPATH,
LibStorage::UB_DM() : `UB_DM
]
];
@@ -156,9 +160,8 @@
map DiskMapVersion = $[];
map DiskMap = $[];
map ClassifiedSettings = $[];
-map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_DMRAID : 2,
- `CT_LOOP : 3, `CT_DM : 4, `CT_LVM : 5,
- `CT_EVMS : 6, `CT_NFS : 7 ];
+map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_DMRAID : 2, `CT_DMMULTIPATH : 3,
+ `CT_LOOP : 4, `CT_DM : 5, `CT_LVM : 6, `CT_NFS : 7 ];
list<string> hw_packages = [];
list<string> no_propose_disks = nil;
boolean proposal_evms = false;
@@ -1588,6 +1591,31 @@
c["partitions"] = add( c["partitions"]:[], p );
});
}
+ else if( c["type"]:`CT_UNKNOWN == `CT_DMMULTIPATH )
+ {
+ list<any> pinfos = [];
+ any infos = LibStorage::DmmultipathCoInfo::new("LibStorage::DmmultipathCoInfo");
+ string d = c["device"]:"";
+ ret = LibStorage::StorageInterface::getDmmultipathCoInfo( sint, d, infos );
+ if( ret==0 )
+ {
+ any pinfo = LibStorage::DmmultipathCoInfo::swig_p_get( infos );
+ c = dmPartCoMap( pinfo, c );
+ }
+ else
+ y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret );
+ c["partitions"] = [];
+ ret = LibStorage::StorageInterface::getDmmultipathInfo( sint, d, pinfos );
+ foreach( any info, pinfos,
+ ``{
+ any pinfo = LibStorage::DmmultipathInfo::swig_p_get( info );
+ map p = $[];
+ p = dmPartMap( pinfo, p );
+ p["fstype"] = Partitions::dmmultipath_name;
+ if( p["nr"]:-1 != 0 )
+ c["partitions"] = add( c["partitions"]:[], p );
+ });
+ }
else if( c["type"]:`CT_UNKNOWN == `CT_LVM )
{
list<any> pinfos = [];
@@ -3415,10 +3443,12 @@
return( rbool );
}
-global define boolean IsPartType( symbol t )
- {
- return( t==`CT_DMRAID || t==`CT_DISK );
- }
+
+global boolean IsPartType(symbol t)
+{
+ return t == `CT_DMRAID || t == `CT_DMMULTIPATH || t == `CT_DISK;
+}
+
global define boolean CreateAny( symbol ctype, map d, map& p )
{
@@ -4550,11 +4580,11 @@
*
* @struct entry ~ $[ "type" : ... ? ]
*/
-global define boolean IsPartitionable( map entry )
- {
- return( entry["type"]:`CT_UNKNOWN==`CT_DMRAID ||
- IsRealDisk( entry ) );
- }
+global boolean IsPartitionable( map entry )
+{
+ return entry["type"]:`CT_UNKNOWN==`CT_DMRAID || entry["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH ||
+ IsRealDisk( entry );
+}
global define boolean DeviceRealDisk( string device )
``{
@@ -6184,6 +6214,7 @@
boolean need_md = false;
boolean need_lvm = false;
boolean need_dmraid = false;
+ boolean need_dmmultipath = false;
foreach( string k, map e, tg,
``{
if( size(filter( map p, e["partitions"]:[],
@@ -6195,9 +6226,11 @@
need_lvm = true;
if( e["type"]:`CT_UNKNOWN==`CT_DMRAID )
need_dmraid = true;
+ if( e["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH )
+ need_dmmultipath = true;
});
- y2milestone( "FinishInstall need crypto:%1 md:%2 lvm:%3 dmraid:%4",
- need_crypt, need_md, need_lvm, need_dmraid );
+ y2milestone( "FinishInstall need crypto:%1 md:%2 lvm:%3 dmraid:%4 dmmultipath:%5",
+ need_crypt, need_md, need_lvm, need_dmraid, need_dmmultipath );
string cmd = "";
map bo = $[];
if( need_crypt )
@@ -6205,6 +6238,7 @@
CallInsserv( need_md, "md" );
CallInsserv( need_lvm, "lvm" );
CallInsserv( need_dmraid, "dmraid" );
+ CallInsserv( need_dmmultipath, "multipathd" );
y2milestone( "FinishInstall done" );
}
@@ -6968,7 +7002,7 @@
if( p["type"]:`unknown==`evms )
ret = d["is_container"]:false || p["evms_native"]:false;
else
- ret = d["type"]:`CT_UNKNONW==`CT_DMRAID ||
+ ret = d["type"]:`CT_UNKNONW==`CT_DMRAID || d["type"]:`CT_UNKNONW==`CT_DMMULTIPATH ||
size(d["udev_id"]:[])>0;
}
y2milestone( "IsPersistent device:%1 ret:%2", p["device"]:"", ret );
Modified: trunk/storage/storage/src/modules/StorageFields.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageFields.ycp?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageFields.ycp (original)
+++ trunk/storage/storage/src/modules/StorageFields.ycp Sun Aug 17 19:00:05 2008
@@ -25,8 +25,8 @@
*/
global void IterateTargetMap(map target_map, void(map, map) callback)
{
- const map disk_order = $[ `CT_DMRAID : 0, `CT_DISK : 1, `CT_MD : 2, `CT_LOOP : 3,
- `CT_LVM : 4, `CT_DM : 6, `CT_NFS : 7 ];
+ const map disk_order = $[ `CT_DMRAID : 0, `CT_DMMULTIPATH : 1, `CT_DISK : 2,
+ `CT_MD : 3, `CT_LOOP : 4, `CT_LVM : 5, `CT_DM : 6, `CT_NFS : 8 ];
list<string> keys = maplist(string dev, map disk, target_map, { return dev; });
keys = sort(string a, string b, keys, {
@@ -51,7 +51,9 @@
case `UB_DM:
return "DM " + used_by;
case `UB_DMRAID:
- return "RAID " + used_by;
+ return "DM RAID " + used_by;
+ case `UB_DMMULTIPATH:
+ return "DM Multipath " + used_by;
case `UB_MD:
return "RAID " + used_by;
default:
@@ -312,7 +314,11 @@
}
else if(disk["type"]:`CT_UNKNOWN==`CT_DMRAID)
{
- value = "BIOS RAID " + disk["name"]:"";
+ value = "DM RAID " + disk["name"]:"";
+ }
+ else if(disk["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH)
+ {
+ value = "DM Multipath " + disk["name"]:"";
}
else
{
@@ -694,7 +700,7 @@
if (type == `CT_DISK && !real_disk)
return true;
- if (!contains([ `CT_DISK, `CT_DMRAID, `CT_LVM ], type))
+ if (!contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH, `CT_LVM ], type))
return true;
return false;
@@ -706,7 +712,7 @@
if (partition["fsid"]:0 == Partitions::fsid_mac_hidden)
return true;
- if (disk["used_by_type"]:`UB_NONE == `UB_DMRAID)
+ if (contains([ `UB_DMRAID, `UB_DMMULTIPATH ], disk["used_by_type"]:`UB_NONE))
return true;
return false;
Modified: trunk/storage/yast2-storage.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/yast2-storage.spec.in?rev=50146&r1=50145&r2=50146&view=diff
==============================================================================
--- trunk/storage/yast2-storage.spec.in (original)
+++ trunk/storage/yast2-storage.spec.in Sun Aug 17 19:00:05 2008
@@ -3,7 +3,7 @@
@HEADER@
BuildRequires: blocxx-devel boost-devel gcc-c++ libxcrypt-devel openssl-devel sablot swig docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-testsuite yast2-perl-bindings
-Requires: parted yast2-storage-lib = %version yast2-perl-bindings mdadm lvm2 dmraid kpartx cryptsetup
+Requires: parted yast2-storage-lib = %version yast2-perl-bindings mdadm lvm2 dmraid multipath-tools kpartx cryptsetup
Requires: yast2-core >= 2.17.8
Requires: yast2 >= 2.17.3
Requires: yast2-libyui >= 2.17.5
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org