[yast-commit] r56525 - in /trunk/storage: ./ libstorage/src/ package/
Author: aschnell Date: Wed Apr 1 12:22:44 2009 New Revision: 56525 URL: http://svn.opensuse.org/viewcvs/yast?rev=56525&view=rev Log: - improved used-by handling during detection (fixes bnc #472803) Modified: trunk/storage/VERSION trunk/storage/libstorage/src/Container.cc trunk/storage/libstorage/src/Dm.cc trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/Storage.h trunk/storage/libstorage/src/StorageTypes.cc trunk/storage/libstorage/src/StorageTypes.h trunk/storage/libstorage/src/Volume.cc trunk/storage/package/yast2-storage.changes Modified: trunk/storage/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/VERSION?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/VERSION (original) +++ trunk/storage/VERSION Wed Apr 1 12:22:44 2009 @@ -1 +1 @@ -2.18.9 +2.18.10 Modified: trunk/storage/libstorage/src/Container.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Container.cc?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/Container.cc (original) +++ trunk/storage/libstorage/src/Container.cc Wed Apr 1 12:22:44 2009 @@ -356,7 +356,7 @@ { std::ostringstream b; classic(b); - b << uby << "-->" << string(c.uby); + b << uby << "-->" << c.uby; ret += b.str(); } return( ret ); Modified: trunk/storage/libstorage/src/Dm.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dm.cc?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/Dm.cc (original) +++ trunk/storage/libstorage/src/Dm.cc Wed Apr 1 12:22:44 2009 @@ -39,6 +39,10 @@ nm = tn; init(); getTableInfo(); + + getContainer()->getStorage()->fetchDanglingUsedBy(dev, uby); + for (list<string>::const_iterator it = alt_names.begin(); it != alt_names.end(); ++it) + getContainer()->getStorage()->fetchDanglingUsedBy(*it, uby); } Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Wed Apr 1 12:22:44 2009 @@ -198,8 +198,11 @@ y2mil("DETECTED OBJECTS END"); } + void Storage::detectObjects() { + danglingUsedBy.clear(); + ProcPart ppart; detectDisks(ppart); if( instsys() ) @@ -215,6 +218,9 @@ detectLvmVgs(); detectDm(ppart); + if (!danglingUsedBy.empty()) + y2err("dangling used-by left after detection: " << danglingUsedBy); + LvmVgPair p = lvgPair(); y2mil( "p length:" << p.length() ); for( LvmVgIterator i=p.begin(); i!=p.end(); ++i ) @@ -4813,8 +4819,9 @@ else { ret = false; - y2err("could not set ub_type:" << ub_type << " ub_name:" << ub_name << - " for dev: " << dev); + danglingUsedBy[dev] = storage::usedBy(ub_type, ub_name); + y2mil("adding ub_type:" << ub_type << " ub_name:" << ub_name << + " for dev: " << dev << " to dangling usedby"); } } else @@ -4826,6 +4833,23 @@ } +void +Storage::fetchDanglingUsedBy(const string& dev, storage::usedBy& uby) +{ + map<string, storage::usedBy>::iterator pos = danglingUsedBy.find(dev); + if (pos != danglingUsedBy.end()) + { + uby = pos->second; + danglingUsedBy.erase(pos); + y2mil("dev:" << dev << " usedby:" << uby); + } + else + { + y2mil("dev:" << dev << " not found"); + } +} + + bool Storage::usedBy( const string& dev, storage::usedBy& ub ) { ub.clear(); Modified: trunk/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.h (original) +++ trunk/storage/libstorage/src/Storage.h Wed Apr 1 12:22:44 2009 @@ -235,6 +235,7 @@ bool clearUsedBy(const string& dev); bool setUsedBy(const string& dev, storage::UsedByType ub_type, const string& ub_name); + void fetchDanglingUsedBy(const string& dev, storage::usedBy& uby); bool canUseDevice( const string& dev, bool disks_allowed=false ); bool knownDevice( const string& dev, bool disks_allowed=false ); bool setDmcryptData( const string& dev, const string& dm, @@ -1742,6 +1743,8 @@ static storage::CallbackYesNoPopup yesno_popup_cb_ycp; friend std::ostream& operator<< (std::ostream& s, Storage &v ); + map<string, storage::usedBy> danglingUsedBy; + unsigned max_log_num; string lastAction; string extendedError; Modified: trunk/storage/libstorage/src/StorageTypes.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.cc?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageTypes.cc (original) +++ trunk/storage/libstorage/src/StorageTypes.cc Wed Apr 1 12:22:44 2009 @@ -98,7 +98,7 @@ st = "UNKNOWN"; break; } - st += "[" + name() + "]"; + st += "[" + device() + "]"; } return st; } @@ -107,9 +107,7 @@ std::ostream& operator<<(std::ostream& s, const usedBy& d) { if (d.type() != storage::UB_NONE) - { - s << " UsedBy:" << string(d); - } + s << string(d); return s; } Modified: trunk/storage/libstorage/src/StorageTypes.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.h?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageTypes.h (original) +++ trunk/storage/libstorage/src/StorageTypes.h Wed Apr 1 12:22:44 2009 @@ -142,8 +142,6 @@ bool operator!=(const usedBy& rhs) const { return !(*this == rhs); } - operator string() const; - storage::UsedByType type() const { return ub_type; } const string& name() const { return ub_name; } const string device() const; @@ -151,6 +149,7 @@ friend std::ostream& operator<<(std::ostream&, const usedBy&); private: + operator string() const; storage::UsedByType ub_type; string ub_name; }; Modified: trunk/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/libstorage/src/Volume.cc (original) +++ trunk/storage/libstorage/src/Volume.cc Wed Apr 1 12:22:44 2009 @@ -2949,7 +2949,7 @@ { std::ostringstream b; classic(b); - b << uby << "-->" << string(rhs.uby); + b << uby << "-->" << rhs.uby; ret += b.str(); } if( fs!=rhs.fs ) Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=56525&r1=56524&r2=56525&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Wed Apr 1 12:22:44 2009 @@ -1,8 +1,14 @@ ------------------------------------------------------------------- +Wed Apr 01 12:11:44 CEST 2009 - aschnell@suse.de + +- improved used-by handling during detection (fixes bnc #472803) +- 2.18.10 + +------------------------------------------------------------------- Fri Mar 27 17:55:41 CET 2009 - kmachalkova@suse.cz - Avoid throwing 'no widget with ID foo' exceptions in format/mount - dialog (bnc#483789) + dialog (bnc#483789) ------------------------------------------------------------------- Wed Mar 25 16:58:10 CET 2009 - aschnell@suse.de @@ -25,7 +31,7 @@ ------------------------------------------------------------------- Fri Mar 13 15:49:50 CET 2009 - kmachalkova@suse.cz -- Added graphical representation of partitions on disk +- Added graphical representation of partitions on disk ------------------------------------------------------------------- Wed Mar 11 12:13:56 CET 2009 - aschnell@suse.de -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org