[yast-commit] r67039 - in /branches/SuSE-Code-11-SP2-Branch/storage: libstorage/src/DmmultipathCo.cc libstorage/src/DmmultipathCo.h libstorage/src/Storage.cc libstorage/src/Storage.h package/yast2-storage.changes
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<string, Entry>::const_iterator const_iterator; Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc?rev=67039&r1=67038&r2=67039&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc Tue Dec 20 15:15:12 2011 @@ -221,6 +221,12 @@ y2mil(archinfo); } + if (instsys()) + { + if (decideMultipath()) + DmmultipathCo::activate(true); + } + detectObjects(); for (list<std::pair<string, Text>>::const_iterator i = infoPopupTxts.begin(); @@ -482,6 +488,31 @@ } + bool + Storage::decideMultipath() + { + y2mil("decideMultipath"); + + if (getenv("LIBSTORAGE_NO_DMMULTIPATH") != NULL) + return false; + + SystemCmd c(MODPROBEBIN " dm-multipath"); + + CmdMultipath cmdmultipath(true); + if (cmdmultipath.looksLikeRealMultipath()) + { + // popup text + Text txt = _("The system seems to have multipath hardware.\n" + "Do you want to activate multipath?"); + + if (yesnoPopupCb(txt)) + return true; + } + + return false; + } + + void Storage::detectDisks(SystemInfo& systeminfo) { Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h?rev=67039&r1=67038&r2=67039&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h Tue Dec 20 15:15:12 2011 @@ -2026,6 +2026,7 @@ void detectMds(SystemInfo& systeminfo); void detectBtrfs(SystemInfo& systeminfo); void detectMdParts(SystemInfo& systeminfo); + bool decideMultipath(); bool discoverMdPVols(); void detectLoops(SystemInfo& systeminfo); void detectNfs(const EtcFstab& fstab, SystemInfo& systeminfo); Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=67039&r1=67038&r2=67039&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Tue Dec 20 15:15:12 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Dec 20 15:05:13 CET 2011 - aschnell@suse.de + +- ask user to activate multipath if setup appears to be multipath + (see bnc#727428 and bnc#735038) + +------------------------------------------------------------------- Tue Dec 06 14:08:41 CET 2011 - aschnell@suse.de - add nofail for volumes using iSCSI disks (bnc#734786) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org