Skip to content

Commit

Permalink
detects lvm pools also when broken (bnc#818780)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fehr committed May 7, 2013
1 parent f373d17 commit eb1145a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libstorage/src/DmCo.cc
Expand Up @@ -228,6 +228,7 @@ void DmCo::getDmData(SystemInfo& systeminfo)

const CmdDmsetup& cmddmsetup = systeminfo.getCmdDmsetup();
list<string> lvm_pools;
list<string> lvm_tmeta;
for (CmdDmsetup::const_iterator it1 = cmddmsetup.begin(); it1 != cmddmsetup.end(); ++it1)
{
if( boost::ends_with(it1->first,"-tpool") )
Expand All @@ -245,6 +246,24 @@ void DmCo::getDmData(SystemInfo& systeminfo)
delete(m);
}
}
if( boost::ends_with(it1->first,"_tmeta") )
{
string name = it1->first.substr( 0, it1->first.size()-6 );
if( find( lvm_tmeta.begin(), lvm_tmeta.end(), name )==lvm_tmeta.end() )
lvm_tmeta.push_back( name );
}
}
y2mil( "lvm_pools:" << lvm_pools );
y2mil( "lvm_tmeta:" << lvm_tmeta );
for (CmdDmsetup::const_iterator it1 = cmddmsetup.begin(); it1 != cmddmsetup.end(); ++it1)
{
if( boost::ends_with(it1->first,"_tdata") )
{
string name = it1->first.substr( 0, it1->first.size()-6 );
if( find( lvm_tmeta.begin(), lvm_tmeta.end(), name )!=lvm_tmeta.end() &&
find( lvm_pools.begin(), lvm_pools.end(), name )==lvm_pools.end() )
lvm_pools.push_back( name );
}
}
y2mil( "lvm_pools:" << lvm_pools );
for (CmdDmsetup::const_iterator it1 = cmddmsetup.begin(); it1 != cmddmsetup.end(); ++it1)
Expand Down

0 comments on commit eb1145a

Please sign in to comment.