Author: aschnell
Date: Tue Dec 20 15:15:12 2011
New Revision: 67039
URL: http://svn.opensuse.org/viewcvs/yast?rev=67039&view=rev
Log:
- ask user to activate multipath if setup appears to be multipath (see bnc#727428 and bnc#735038)
Modified:
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.h
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h
branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.cc?rev=67039&r1=67038&r2=67039&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.cc Tue Dec 20 15:15:12 2011
@@ -42,9 +42,13 @@
using namespace std;
- CmdMultipath::CmdMultipath()
+ CmdMultipath::CmdMultipath(bool test)
{
- SystemCmd c(MULTIPATHBIN " -d -v 2+ -ll");
+ string cmd = MULTIPATHBIN " -d -v 2+";
+ if (!test)
+ cmd += " -ll";
+
+ SystemCmd c(cmd);
if (c.retcode() != 0 || c.numLines() == 0)
return;
@@ -57,14 +61,18 @@
{
Entry entry;
- y2mil("mp line:" << *it1);
+ string line = *it1;
+ y2mil("mp line:" << line);
+
+ if (boost::starts_with(line, "create:"))
+ line = extractNthWord(1, line, true);
- string name = extractNthWord(0, *it1);
+ string name = extractNthWord(0, line);
y2mil("mp name:" << name);
- bool has_alias = boost::starts_with(extractNthWord(1, *it1), "(");
+ bool has_alias = boost::starts_with(extractNthWord(1, line), "(");
- list<string> tmp = splitString(extractNthWord(has_alias ? 3 : 2, *it1, true), ",");
+ list<string> tmp = splitString(extractNthWord(has_alias ? 3 : 2, line, true), ",");
if (tmp.size() >= 2)
{
list<string>::const_iterator it2 = tmp.begin();
@@ -125,6 +133,17 @@
}
+ bool
+ CmdMultipath::looksLikeRealMultipath() const
+ {
+ for (const_iterator it = data.begin(); it != data.end(); ++it)
+ if (it->second.devices.size() > 1)
+ return true;
+
+ return false;
+ }
+
+
DmmultipathCo::DmmultipathCo(Storage* s, const string& name, const string& device,
SystemInfo& systeminfo)
: DmPartCo(s, name, device, staticType(), systeminfo)
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.h?rev=67039&r1=67038&r2=67039&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.h (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/DmmultipathCo.h Tue Dec 20 15:15:12 2011
@@ -40,7 +40,7 @@
public:
- CmdMultipath();
+ CmdMultipath(bool test = false);
struct Entry
{
@@ -53,6 +53,8 @@
bool getEntry(const string& name, Entry& entry) const;
+ bool looksLikeRealMultipath() const;
+
private:
typedef map