Author: aschnell
Date: Fri Feb 20 19:27:41 2009
New Revision: 55658
URL: http://svn.opensuse.org/viewcvs/yast?rev=55658&view=rev
Log:
- use new logging functions
Modified:
trunk/storage/libstorage/src/Dasd.cc
trunk/storage/libstorage/src/Disk.cc
trunk/storage/libstorage/src/LvmVg.cc
trunk/storage/libstorage/src/MdCo.cc
trunk/storage/libstorage/src/Storage.cc
trunk/storage/libstorage/src/Volume.cc
Modified: trunk/storage/libstorage/src/Dasd.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dasd.cc?rev=55658&r1=55657&r2=55658&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Dasd.cc (original)
+++ trunk/storage/libstorage/src/Dasd.cc Fri Feb 20 19:27:41 2009
@@ -190,7 +190,7 @@
pl.push_back( p );
}
else
- y2warning( "partition nr %d outside range %lu", pnr, range );
+ y2war("partition nr " << pnr << " outside range " << range);
}
}
}
@@ -510,7 +510,7 @@
int Dasd::commitChanges( CommitStage stage )
{
- y2milestone( "name %s stage %d", name().c_str(), stage );
+ y2mil("name:" << name() << " stage:" << stage);
int ret = 0;
if( stage==DECREASE && init_disk )
{
Modified: trunk/storage/libstorage/src/Disk.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=55658&r1=55657&r2=55658&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Disk.cc (original)
+++ trunk/storage/libstorage/src/Disk.cc Fri Feb 20 19:27:41 2009
@@ -223,7 +223,7 @@
bool Disk::detectGeometry()
{
- y2milestone( "disk:%s", device().c_str() );
+ y2mil("disk:" << device());
bool ret = false;
int fd = open( device().c_str(), O_RDONLY );
if( fd >= 0 )
@@ -262,7 +262,7 @@
ret = true;
}
}
- y2milestone( "After getsize Cylinder:%lu", cyl );
+ y2mil("After getsize Cylinder:" << cyl);
close( fd );
}
byte_cyl = head * sector * 512;
@@ -376,13 +376,13 @@
string cmd_line = PARTEDCMD + quote(device()) + " unit cyl print | sort -n";
string dlabel;
system_stderr.erase();
- y2milestone( "executing cmd:%s", cmd_line.c_str() );
+ y2mil("executing cmd:" << cmd_line);
SystemCmd Cmd( cmd_line );
checkSystemError( cmd_line, Cmd );
if( Cmd.select( "Partition Table:" )>0 )
{
string tmp = *Cmd.getLine(0, true);
- y2milestone( "Label line:%s", tmp.c_str() );
+ y2mil("Label line:" << tmp);
dlabel = extractNthWord( 2, tmp );
}
if( Cmd.select( "BIOS cylinder" )>0 )
@@ -489,7 +489,7 @@
void
Disk::setLabelData( const string& disklabel )
{
- y2milestone( "disklabel:%s", disklabel.c_str() );
+ y2mil("disklabel:" << disklabel);
int i=0;
while( !labels[i].name.empty() && labels[i].name!=disklabel )
{
@@ -497,7 +497,7 @@
}
if( labels[i].name.empty() )
{
- y2error ("unknown disklabel %s", disklabel.c_str());
+ y2err("unknown disklabel " << disklabel);
ext_possible = false;
max_primary = 0;
max_logical = 0;
@@ -537,8 +537,8 @@
string tmp = *cmd.getString(SystemCmd::IDX_STDERR);
if( tmp.length()>0 )
{
- y2error( "cmd:%s", cmd_line.c_str() );
- y2error( "err:%s", tmp.c_str() );
+ y2err("cmd:" << cmd_line);
+ y2err("err:" << tmp);
if( !system_stderr.empty() )
{
system_stderr += "\n";
@@ -548,8 +548,8 @@
tmp = *cmd.getString(SystemCmd::IDX_STDOUT);
if( tmp.length()>0 )
{
- y2milestone( "cmd:%s", cmd_line.c_str() );
- y2milestone( "out:%s", tmp.c_str() );
+ y2mil("cmd:" << cmd_line);
+ y2mil("out:" << tmp);
if( !system_stderr.empty() )
{
system_stderr += "\n";
@@ -571,7 +571,7 @@
ret = 0;
}
else
- y2error( "retcode:%d", cmd.retcode() );
+ y2err("retcode:" << cmd.retcode());
}
return( ret );
}
@@ -658,7 +658,7 @@
if( start+csize > cylinders() )
{
csize = cylinders()-start;
- y2milestone( "new csize:%lu", csize );
+ y2mil("new csize:" << csize);
}
id = Partition::ID_LINUX;
boot = TInfo.find( ",boot," ) != string::npos;
@@ -707,7 +707,7 @@
Data.clear();
Data.str( val );
Data >> std::hex >> tmp_id;
- y2debug( "val=%s id=%d", val.c_str(), tmp_id );
+ y2deb("val=" << val << " id=" << tmp_id);
if( tmp_id>0 )
{
id = tmp_id;
@@ -1271,7 +1271,7 @@
int ret = 0;
list<Region> free;
getUnusedSpace( free );
- y2milestone( "free:" );
+ y2mil("free:");
if( !free.empty() )
{
free.sort( regions_sort_size );
@@ -1313,7 +1313,7 @@
int Disk::createPartition( PartitionType type, string& device )
{
- y2milestone( "type %u", type );
+ y2mil("type " << type);
int ret = 0;
list<Region> free;
getUnusedSpace( free, type==PTYPE_ANY, type==LOGICAL );
@@ -1564,7 +1564,7 @@
int Disk::removePartition( unsigned nr )
{
- y2milestone( "begin nr %u", nr );
+ y2mil("begin nr " << nr);
getStorage()->logCo( this );
int ret = 0;
PartPair p = partPair( notDeleted );
@@ -1672,7 +1672,7 @@
int Disk::destroyPartitionTable( const string& new_label )
{
- y2milestone( "begin" );
+ y2mil("begin");
int ret = 0;
setLabelData( new_label );
if( max_primary==0 )
@@ -1746,7 +1746,7 @@
int Disk::forgetChangePartitionId( unsigned nr )
{
- y2milestone( "begin nr:%u", nr );
+ y2mil("begin nr:" << nr);
int ret = 0;
PartPair p = partPair( notDeleted );
PartIter i = p.begin();
@@ -1791,7 +1791,7 @@
int Disk::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 )
{
@@ -1810,7 +1810,7 @@
int Disk::commitChanges( CommitStage stage )
{
- y2milestone( "name %s stage %d", name().c_str(), stage );
+ y2mil("name:" << name() << " stage:" << stage);
int ret = 0;
if( stage==DECREASE && deleted() )
{
@@ -1939,7 +1939,7 @@
void Disk::redetectGeometry()
{
string cmd_line = PARTEDCMD + quote(device()) + " unit cyl print";
- y2milestone( "executing cmd:%s", cmd_line.c_str() );
+ y2mil("executing cmd:" << cmd_line);
SystemCmd Cmd( cmd_line );
if( Cmd.select( "BIOS cylinder" )>0 )
{
@@ -2076,8 +2076,7 @@
{
if( !ppart.getSize( p->device(), s ) || s==0 )
{
- y2error( "device %s not found in /proc/partitions",
- p->device().c_str() );
+ y2err("device " << p->device() << " not found in /proc/partitions");
ret = false;
}
else
Modified: trunk/storage/libstorage/src/LvmVg.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/LvmVg.cc?rev=55658&r1=55657&r2=55658&view=diff
==============================================================================
--- trunk/storage/libstorage/src/LvmVg.cc (original)
+++ trunk/storage/libstorage/src/LvmVg.cc Fri Feb 20 19:27:41 2009
@@ -41,20 +41,22 @@
PeContainer(s,staticType())
{
nm = Name;
- y2debug( "constructing lvm vg %s lvm1:%d", Name.c_str(), lv1 );
+ y2deb("constructing lvm vg " << Name << " lvm1:" << lv1);
init();
lvm1 = lv1;
if( Name.empty() )
{
- y2error("empty name in constructor");
+ y2err("empty name in constructor");
}
}
-LvmVg::LvmVg( Storage * const s, const string& file, int ) :
- PeContainer(s,staticType())
- {
- y2debug( "constructing lvm vg %s from file %s", dev.c_str(), file.c_str() );
- }
+
+LvmVg::LvmVg(Storage * const s, const string& file, int)
+ : PeContainer(s, staticType())
+{
+ y2deb("constructing lvm vg " << dev << " from file " << file);
+}
+
LvmVg::~LvmVg()
{
@@ -69,7 +71,7 @@
LvmVg::removeVg()
{
int ret = 0;
- y2milestone( "begin" );
+ y2mil("begin");
if( readonly() )
{
ret = LVM_CHANGE_READONLY;
@@ -374,7 +376,7 @@
LvmVg::removeLv( const string& name )
{
int ret = 0;
- y2milestone( "name:%s", name.c_str() );
+ y2mil("name:" << name);
LvmLvIter i;
checkConsistency();
if( readonly() )
@@ -423,7 +425,7 @@
LvmVg::changeStripe( const string& name, unsigned long stripe )
{
int ret = 0;
- y2milestone( "name:%s stripe:%lu", name.c_str(), stripe );
+ y2mil("name:" << name << " stripe:" << stripe);
LvmLvIter i;
checkConsistency();
if( readonly() )
@@ -475,7 +477,7 @@
LvmVg::changeStripeSize( const string& name, unsigned long long stripeSize )
{
int ret = 0;
- y2milestone( "name:%s stripeSize:%llu", name.c_str(), stripeSize );
+ y2mil("name:" << name << " stripeSize:" << stripeSize);
LvmLvIter i;
checkConsistency();
if( readonly() )
@@ -629,7 +631,7 @@
void LvmVg::getVgData( const string& name, bool exists )
{
- y2milestone( "name:%s", name.c_str() );
+ y2mil("name:" << name);
SystemCmd c(VGDISPLAYBIN " --units k -v " + quote(name));
unsigned cnt = c.numLines();
unsigned i = 0;
@@ -652,8 +654,7 @@
{
bool lv1 = extractNthWord( 1, line )=="lvm1";
if( exists && lv1 != lvm1 )
- y2warning( "inconsistent lvm1 my:%d lvm:%d",
- lvm1, lv1 );
+ y2war("inconsistent lvm1 my:" << lvm1 << " lvm:" << lv1);
lvm1 = lv1;
}
else if( line.find( "PE Size" ) == 0 )
@@ -665,8 +666,7 @@
tmp.erase( pos );
tmp >> pes;
if( exists && pes != pe_size )
- y2warning( "inconsistent pe_size my:%llu lvm:%llu",
- pe_size, pes );
+ y2war("inconsistent pe_size my:" << pe_size << " lvm:" << pes);
pe_size = pes;
}
else if( line.find( "Total PE" ) == 0 )
@@ -835,14 +835,14 @@
void LvmVg::addLv(unsigned long& le, string& name, string& origin, string& uuid,
string& status, string& alloc, bool& ro)
{
- y2milestone( "addLv:%s", name.c_str() );
+ y2mil("addLv:" << name);
LvmLvPair p=lvmLvPair(lvNotDeletedCreated);
LvmLvIter i=p.begin();
while( i!=p.end() && i->name()!=name )
{
++i;
}
- y2milestone( "addLv exists %d", i!=p.end() );
+ y2mil("addLv exists " << (i!=p.end()));
if( i!=p.end() )
{
if( !lvResized( *i ))
@@ -868,7 +868,7 @@
{
++i;
}
- y2milestone( "addLv exists deleted %d", i!=p.end() );
+ y2mil("addLv exists deleted " << (i!=p.end()));
if( i==p.end() )
{
num_lv++;
@@ -879,7 +879,7 @@
addToList( n );
else
{
- y2milestone( "inactive Lv %s", name.c_str() );
+ y2mil("inactive Lv " << name);
delete n;
}
}
@@ -929,7 +929,7 @@
int LvmVg::commitChanges( CommitStage stage )
{
- y2milestone( "name %s stage %d", name().c_str(), stage );
+ y2mil("name:" << name() << " stage:" << stage);
int ret = 0;
switch( stage )
{
@@ -1142,7 +1142,7 @@
int
LvmVg::doCreateVg()
{
- y2milestone( "Vg:%s", name().c_str() );
+ y2mil("Vg:" << name());
int ret = 0;
if( created() )
{
@@ -1200,7 +1200,7 @@
int
LvmVg::doRemoveVg()
{
- y2milestone( "Vg:%s", name().c_str() );
+ y2mil("Vg:" << name());
int ret = 0;
if( deleted() )
{
@@ -1230,7 +1230,7 @@
int
LvmVg::doExtendVg()
{
- y2milestone( "Vg:%s", name().c_str() );
+ y2mil("Vg:" << name());
y2mil( "this:" << *this );
int ret = 0;
list<string> devs;
@@ -1282,7 +1282,7 @@
int
LvmVg::doReduceVg()
{
- y2milestone( "Vg:%s", name().c_str() );
+ y2mil("Vg:" << name());
y2mil( "this:" << *this );
int ret = 0;
if( !active )
@@ -1326,7 +1326,7 @@
int
LvmVg::doCreate( Volume* v )
{
- y2milestone( "Vg:%s name:%s", name().c_str(), v->name().c_str() );
+ y2mil("Vg:" << name() << " name:" << v->name());
LvmLv * l = dynamic_cast