Author: aschnell
Date: Tue Sep 20 16:21:09 2011
New Revision: 65854
URL: http://svn.opensuse.org/viewcvs/yast?rev=65854&view=rev
Log:
- fixed used-by detection for DM devices used by LVM (bnc#718033)
Modified:
branches/SuSE-SLE-10-SP4-Branch/storage/VERSION
branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Dm.cc
branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Storage.h
branches/SuSE-SLE-10-SP4-Branch/storage/package/yast2-storage.changes
Modified: branches/SuSE-SLE-10-SP4-Branch/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/storage/VERSION?rev=65854&r1=65853&r2=65854&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP4-Branch/storage/VERSION (original)
+++ branches/SuSE-SLE-10-SP4-Branch/storage/VERSION Tue Sep 20 16:21:09 2011
@@ -1 +1 @@
-2.13.109
+2.13.110
Modified: branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Dm.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Dm.cc?rev=65854&r1=65853&r2=65854&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Dm.cc (original)
+++ branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Dm.cc Tue Sep 20 16:21:09 2011
@@ -35,6 +35,13 @@
nm = tn;
init();
getTableInfo();
+
+ liststorage::usedBy tmp_uby;
+ getContainer()->getStorage()->fetchDanglingUsedBy(dev, tmp_uby);
+ for (list<string>::const_iterator it = alt_names.begin(); it != alt_names.end(); ++it)
+ getContainer()->getStorage()->fetchDanglingUsedBy(*it, tmp_uby);
+ if (!tmp_uby.empty())
+ setUsedBy(tmp_uby.front().type(), tmp_uby.front().name());
}
Dm::~Dm()
Modified: branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Storage.cc?rev=65854&r1=65853&r2=65854&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Storage.cc (original)
+++ branches/SuSE-SLE-10-SP4-Branch/storage/libstorage/src/Storage.cc Tue Sep 20 16:21:09 2011
@@ -220,6 +220,8 @@
void Storage::detectObjects()
{
+ danglingUsedBy.clear();
+
ProcPart ppart;
if( EvmsCo::canDoEvms() )
{
@@ -241,6 +243,9 @@
detectEvms();
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 )
@@ -4823,6 +4828,9 @@
ret = false;
y2error( "could not set used by %d:%s for %s", typ, name.c_str(),
dev.c_str() );
+ danglingUsedBy[dev].push_back(storage::usedBy(typ, name));
+ y2mil("setting type:" << typ << " name:" << name <<
+ " for dev:" << dev << " to dangling usedby");
}
}
else
@@ -4854,6 +4862,24 @@
return( ret );
}
+
+ void
+ Storage::fetchDanglingUsedBy(const string& dev, liststorage::usedBy& uby)
+ {
+ map