[yast-commit] r55628 - in /trunk/storage/libstorage/src: Dm.cc DmPartCo.cc DmraidCo.cc MdCo.cc PeContainer.cc
Author: aschnell
Date: Thu Feb 19 19:05:12 2009
New Revision: 55628
URL: http://svn.opensuse.org/viewcvs/yast?rev=55628&view=rev
Log:
- use new logging functions
Modified:
trunk/storage/libstorage/src/Dm.cc
trunk/storage/libstorage/src/DmPartCo.cc
trunk/storage/libstorage/src/DmraidCo.cc
trunk/storage/libstorage/src/MdCo.cc
trunk/storage/libstorage/src/PeContainer.cc
Modified: trunk/storage/libstorage/src/Dm.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dm.cc?rev=55628&r1=55627&r2=55628&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Dm.cc (original)
+++ trunk/storage/libstorage/src/Dm.cc Thu Feb 19 19:05:12 2009
@@ -28,7 +28,7 @@
Dm::Dm( const PeContainer& d, const string& tn, unsigned mnum ) :
Volume( d ), tname(tn)
{
- y2milestone( "constructed dm dev table \"%s\" %u", tn.c_str(), mnum );
+ y2mil("constructed dm dev table \"" << tn << "\" " << mnum);
num_le = 0;
stripe = 1;
stripe_size = 0;
@@ -59,8 +59,8 @@
getDmMajor();
SystemCmd c(DMSETUPBIN " table " + quote(tname));
inactiv = c.retcode()!=0;
- y2milestone( "table %s retcode:%d numLines:%u inactive:%d",
- tname.c_str(), c.retcode(), c.numLines(), inactiv );
+ y2mil("table:" << tname << " retcode:" << c.retcode() << " numLines:" << c.numLines() <<
+ " inactive:" << inactiv);
if( c.numLines()>0 )
{
string line = *c.getLine(0);
@@ -94,8 +94,7 @@
mit->second += le;
}
else
- y2warning( "could not find major/minor pair %s",
- majmin.c_str());
+ y2war("could not find major/minor pair " << majmin);
}
else if (target == "snapshot-origin")
{
@@ -116,7 +115,7 @@
stripe_size /= 2;
extractNthWord( 3, line ) >> str;
if( str<2 )
- y2warning( "invalid stripe count %u", str );
+ y2war("invalid stripe count " << str);
else
{
le = (le+str-1)/str;
@@ -132,8 +131,7 @@
mit->second += le;
}
else
- y2warning( "could not find major/minor pair %s",
- majmin.c_str());
+ y2war("could not find major/minor pair " << majmin);
}
}
}
@@ -141,7 +139,7 @@
{
if( find( known_types.begin(), known_types.end(), target ) ==
known_types.end() )
- y2warning( "unknown target type \"%s\"", target.c_str() );
+ y2war("unknown target type \"" << target << "\"");
extractNthWord( 1, line ) >> le;
y2mil( "le:" << le );
le /= 2;
@@ -170,8 +168,7 @@
mit->second += le;
}
else
- y2warning( "could not find major/minor pair %s",
- majmin.c_str());
+ y2war("could not find major/minor pair " << majmin);
}
}
}
@@ -266,8 +263,8 @@
ret = mit != pe_map.end();
if( ret )
{
- y2mil( "map:" << pe_map );
- y2milestone( "table:%s dev:%s ret:%d", tname.c_str(), dev.c_str(), ret );
+ y2mil("map:" << pe_map);
+ y2mil("table:" << tname << " dev:" << dev << " ret:" << ret);
}
return( ret );
}
@@ -281,7 +278,7 @@
mit!=pe_map.end(); ++mit )
sum += mit->second;
if( sum != num_le )
- y2warning( "lv:%s sum:%lu num:%llu", dev.c_str(), sum, num_le );
+ y2war("lv:" << dev << " sum:" << sum << " num:" << num_le);
else
ret = true;
return( ret );
@@ -435,7 +432,7 @@
void Dm::activate( bool val )
{
- y2milestone( "old active:%d val:%d", active, val );
+ y2mil("old active:" << active << " val:" << val);
if( active!=val )
{
SystemCmd c;
@@ -472,7 +469,7 @@
++it;
}
if( dev!=ret )
- y2milestone( "dev:%s --> %s", dev.c_str(), ret.c_str() );
+ y2mil("dev:" << dev << " ret:" << ret);
return( ret );
}
@@ -531,7 +528,7 @@
void Dm::getDmMajor()
{
dm_major = getMajorDevices( "device-mapper" );
- y2milestone( "dm_major:%u", dm_major );
+ y2mil("dm_major:" << dm_major);
}
void Dm::getInfo( DmInfo& tinfo ) const
Modified: trunk/storage/libstorage/src/DmPartCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmPartCo.cc?rev=55628&r1=55627&r2=55628&view=diff
==============================================================================
--- trunk/storage/libstorage/src/DmPartCo.cc (original)
+++ trunk/storage/libstorage/src/DmPartCo.cc Thu Feb 19 19:05:12 2009
@@ -325,7 +325,7 @@
void DmPartCo::handleWholeDevice()
{
Disk::PartPair pp = disk->partPair( Partition::notDeleted );
- y2milestone( "empty:%d", pp.empty() );
+ y2mil("empty:" << pp.empty());
if( pp.empty() )
{
DmPart * p = NULL;
@@ -423,7 +423,7 @@
int DmPartCo::destroyPartitionTable( const string& new_label )
{
- y2milestone( "begin" );
+ y2mil("begin");
int ret = disk->destroyPartitionTable( new_label );
if( ret==0 )
{
@@ -521,7 +521,7 @@
void DmPartCo::activate_part( bool val )
{
- y2milestone( "old active:%d val:%d", active, val );
+ y2mil("old active:" << active << " val:" << val);
if( active != val )
{
SystemCmd c;
@@ -558,7 +558,7 @@
int DmPartCo::doCreateLabel()
{
- y2milestone( "label:%s", labelName().c_str() );
+ y2mil("label:" << labelName());
int ret = 0;
if( !silent )
{
@@ -582,7 +582,7 @@
DmPartCo::removeDmPart()
{
int ret = 0;
- y2milestone( "begin" );
+ y2mil("begin");
if( readonly() )
{
ret = DMPART_CHANGE_READONLY;
@@ -680,7 +680,7 @@
int DmPartCo::commitChanges( CommitStage stage, Volume* vol )
{
- y2milestone( "name %s stage %d", name().c_str(), stage );
+ y2mil("name:" << name() << " stage:" << stage);
int ret = Container::commitChanges( stage, vol );
if( ret==0 && stage==INCREASE )
{
@@ -700,7 +700,7 @@
int DmPartCo::commitChanges( CommitStage stage )
{
- y2milestone( "name %s stage %d", name().c_str(), stage );
+ y2mil("name:" << name() << " stage:" << stage);
int ret = 0;
if( stage==DECREASE && deleted() )
{
Modified: trunk/storage/libstorage/src/DmraidCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmraidCo.cc?rev=55628&r1=55627&r2=55628&view=diff
==============================================================================
--- trunk/storage/libstorage/src/DmraidCo.cc (original)
+++ trunk/storage/libstorage/src/DmraidCo.cc Thu Feb 19 19:05:12 2009
@@ -33,7 +33,7 @@
void DmraidCo::getRaidData( const string& name )
{
- y2milestone( "name:%s", name.c_str() );
+ y2mil("name:" << name);
SystemCmd c(DMRAIDBIN " -s -c -c -c " + quote(name));
list<string>::const_iterator ci;
list<string> sl;
@@ -109,7 +109,7 @@
void DmraidCo::activate( bool val )
{
- y2milestone( "old active:%d val:%d", active, val );
+ y2mil("old active:" << active << " val:" << val);
if( active != val )
{
SystemCmd c;
@@ -189,7 +189,7 @@
int
DmraidCo::doRemove()
{
- y2milestone( "Raid:%s", name().c_str() );
+ y2mil("Raid:" << name());
int ret = 0;
if( deleted() )
{
Modified: trunk/storage/libstorage/src/MdCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/MdCo.cc?rev=55628&r1=55627&r2=55628&view=diff
==============================================================================
--- trunk/storage/libstorage/src/MdCo.cc (original)
+++ trunk/storage/libstorage/src/MdCo.cc Thu Feb 19 19:05:12 2009
@@ -84,7 +84,7 @@
void
MdCo::getMdData()
{
- y2milestone( "begin" );
+ y2mil("begin");
string line;
std::ifstream file( "/proc/mdstat" );
classic(file);
@@ -156,7 +156,7 @@
void
MdCo::getMdData( unsigned num )
{
- y2milestone( "num:%u", num );
+ y2mil("num:" << num);
string line;
std::ifstream file( "/proc/mdstat" );
classic(file);
@@ -318,7 +318,7 @@
{
ret = MD_DEVICE_USED;
}
- y2milestone( "dev:%s ret:%d", dev.c_str(), ret );
+ y2mil("dev:" << dev << " ret:" << ret);
return( ret );
}
@@ -326,7 +326,7 @@
MdCo::checkMd( unsigned num )
{
int ret = 0;
- y2milestone( "num:%u", num );
+ y2mil("num:" << num);
MdIter i;
if( !findMd( num, i ) )
ret = MD_DEVICE_UNKNOWN;
@@ -340,7 +340,7 @@
MdCo::extendMd( unsigned num, const string& dev )
{
int ret = 0;
- y2milestone( "num:%u dev:%s", num, dev.c_str() );
+ y2mil("num:" << num << " dev:" << dev);
MdIter i;
if( readonly() )
{
@@ -380,7 +380,7 @@
MdCo::shrinkMd( unsigned num, const string& dev )
{
int ret = 0;
- y2milestone( "num:%u dev:%s", num, dev.c_str() );
+ y2mil("num:" << num << " dev:" << dev);
MdIter i;
if( readonly() )
{
@@ -412,7 +412,7 @@
MdCo::changeMdType( unsigned num, MdType ptype )
{
int ret = 0;
- y2milestone( "num:%u md_type:%d", num, ptype );
+ y2mil("num:" << num << " md_type:" << ptype);
MdIter i;
if( readonly() )
{
@@ -439,7 +439,7 @@
MdCo::changeMdChunk( unsigned num, unsigned long chunk )
{
int ret = 0;
- y2milestone( "num:%u chunk:%lu", num, chunk );
+ y2mil("num:" << num << " chunk:" << chunk);
MdIter i;
if( readonly() )
{
@@ -466,7 +466,7 @@
MdCo::changeMdParity( unsigned num, MdParity ptype )
{
int ret = 0;
- y2milestone( "num:%u parity:%d", num, ptype );
+ y2mil("num:" << num << " parity:" << ptype);
MdIter i;
if( readonly() )
{
@@ -507,7 +507,7 @@
{
i->getState(info);
}
- y2milestone("ret:%d", ret);
+ y2mil("ret:" << ret);
return ret;
}
@@ -515,7 +515,7 @@
MdCo::removeMd( unsigned num, bool destroySb )
{
int ret = 0;
- y2milestone( "num:%u", num );
+ y2mil("num:" << num);
MdIter i;
if( readonly() )
{
@@ -554,7 +554,7 @@
int MdCo::removeVolume( Volume* v )
{
int ret = 0;
- y2milestone( "name:%s", v->name().c_str() );
+ y2mil("name:" << v->name());
Md * m = dynamic_cast
participants (1)
-
aschnell@svn.opensuse.org