Author: aschnell
Date: Thu Feb 26 19:45:23 2009
New Revision: 55800
URL: http://svn.opensuse.org/viewcvs/yast?rev=55800&view=rev
Log:
- use new logging functions
Modified:
trunk/storage/libstorage/src/Storage.cc
Modified: trunk/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=55800&r1=55799&r2=55800&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.cc (original)
+++ trunk/storage/libstorage/src/Storage.cc Thu Feb 26 19:45:23 2009
@@ -471,7 +471,7 @@
}
else
{
- y2milestone( "inactive VG %s", i->c_str() );
+ y2mil("inactive VG " << *i);
v->unuseDev();
delete( v );
}
@@ -513,7 +513,7 @@
}
else
{
- y2milestone( "inactive DMRAID %s", i->c_str() );
+ y2mil("inactive DMRAID " << *i);
v->unuseDev();
delete( v );
}
@@ -629,8 +629,7 @@
data.dev[pos] = '/';
pos = data.dev.find('!',pos+1);
}
- y2milestone( "name sysfs:%s parted:%s", data.name.c_str(),
- data.dev.c_str() );
+ y2mil("name sysfs:" << data.name << " parted:" << data.dev);
Disk * d = NULL;
switch( data.typ )
{
@@ -861,7 +860,7 @@
string bname( name );
string::size_type pos = bname.rfind( '.' );
bname.erase( pos );
- y2milestone( "name:%s bname:%s", name.c_str(), bname.c_str() );
+ y2mil("name:" << name << " bname:" << bname);
if( access( bname.c_str(), R_OK )==0 )
{
if( !testFilesEqual( bname, name ) )
@@ -985,8 +984,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s type:%d start:%ld size:%ld", disk.c_str(),
- type, start, size );
+ y2mil("disk:" << disk << " type:" << type << " start:" << start << " size:" << size);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -1027,7 +1025,7 @@
{
ret = checkCache();
}
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
+ y2mil("ret:" << ret << " device:" << (ret?"":device));
return( ret );
}
@@ -1039,8 +1037,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s type:%d start:%lld sizeK:%lld", disk.c_str(),
- type, start, sizeK );
+ y2mil("disk:" << disk << " type:" << type << " start:" << start << " sizeK:" << sizeK);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -1091,7 +1088,7 @@
{
ret = STORAGE_DISK_NOT_FOUND;
}
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
+ y2mil("ret:" << ret << " device:" << (ret?"":device));
return( ret );
}
@@ -1102,7 +1099,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s sizeK:%lld", disk.c_str(), sizeK );
+ y2mil("disk:" << disk << " sizeK:" << sizeK);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -1141,7 +1138,7 @@
{
ret = STORAGE_DISK_NOT_FOUND;
}
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
+ y2mil("ret:" << ret << " device:" << (ret?"":device));
return( ret );
}
@@ -1152,7 +1149,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s type:%u", disk.c_str(), type );
+ y2mil("disk:" << disk << " type:" << type);
DiskIterator i = findDisk( disk );
if( i != dEnd() )
{
@@ -1172,7 +1169,7 @@
{
ret = STORAGE_DISK_NOT_FOUND;
}
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
+ y2mil("ret:" << ret << " device:" << (ret?"":device));
return( ret );
}
@@ -1183,7 +1180,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s type:%u", disk.c_str(), type );
+ y2mil("disk:" << disk << " type:" << type);
DiskIterator i = findDisk( disk );
if( readonly )
{
@@ -1221,7 +1218,7 @@
{
ret = STORAGE_DISK_NOT_FOUND;
}
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
+ y2mil("ret:" << ret << " device:" << (ret?"":device));
return( ret );
}
@@ -1231,7 +1228,7 @@
unsigned long long ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s size:%ld", disk.c_str(), size );
+ y2mil("disk:" << disk << " size:" << size);
DiskIterator i = findDisk( disk );
if( i != dEnd() )
{
@@ -1247,7 +1244,7 @@
ret = i->cylinderToKb( size );
}
}
- y2milestone( "ret:%lld", ret );
+ y2mil("ret:" << ret);
return( ret );
}
@@ -1257,7 +1254,7 @@
unsigned long ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s sizeK:%lld", disk.c_str(), sizeK );
+ y2mil("disk:" << disk << " sizeK:" << sizeK);
DiskIterator i = findDisk( disk );
if( i != dEnd() )
{
@@ -1273,7 +1270,7 @@
ret = i->kbToCylinder( sizeK );
}
}
- y2milestone( "ret:%ld", ret );
+ y2mil("ret:" << ret);
return( ret );
}
@@ -1282,7 +1279,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "partition:%s", partition.c_str() );
+ y2mil("partition:" << partition);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1354,8 +1351,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "partition:%s start:%ld size:%ld", partition.c_str(),
- start, size );
+ y2mil("partition:" << partition << " start:" << start << " size:" << size);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1461,7 +1457,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "partition:%s id:%x", partition.c_str(), id );
+ y2mil("partition:" << partition << " id:" << hex << id);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1529,8 +1525,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "partition:%s newCyl:%lu ignoreFs:%d", partition.c_str(),
- sizeCyl, ignoreFs );
+ y2mil("partition:" << partition << " newCyl:" << sizeCyl << " ignoreFs:" << ignoreFs);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1591,7 +1586,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "partition:%s", partition.c_str() );
+ y2mil("partition:" << partition);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1751,7 +1746,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s label:%s", disk.c_str(), label.c_str() );
+ y2mil("disk:" << disk << " label:" << label);
if( readonly )
{
@@ -1793,7 +1788,7 @@
int ret = 0;
bool done = false;
assertInit();
- y2milestone( "disk:%s value:%d", disk.c_str(), value );
+ y2mil("disk:" << disk << " value:" << value);
if( readonly )
{
@@ -1854,8 +1849,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s format:%d type:%s", device.c_str(), format,
- Volume::fsTypeString(fs).c_str() );
+ y2mil("device:" << device << " format:" << format << " type:" << Volume::fsTypeString(fs));
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1883,7 +1877,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s label:%s", device.c_str(), label.c_str() );
+ y2mil("device:" << device << " label:" << label);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1911,7 +1905,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str() );
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1935,7 +1929,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s opts:%s", device.c_str(), opts.c_str() );
+ y2mil("device:" << device << " opts:" << opts);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1963,7 +1957,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s opts:%s", device.c_str(), opts.c_str() );
+ y2mil("device:" << device << " opts:" << opts);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -1991,7 +1985,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s txt:%s", device.c_str(), txt.c_str() );
+ y2mil("device:" << device << " txt:" << txt);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2019,7 +2013,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s mount:%s", device.c_str(), mount.c_str() );
+ y2mil("device:" << device << " mount:" << mount);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2047,7 +2041,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str());
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( findVolume( device, cont, vol ) )
@@ -2067,8 +2061,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s mby:%s", device.c_str(),
- Volume::mbyTypeString(mby).c_str() );
+ y2mil("device:" << device << " mby:" << Volume::mbyTypeString(mby));
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2096,7 +2089,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str());
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( findVolume( device, cont, vol ) )
@@ -2114,7 +2107,7 @@
mby = MOUNTBY_DEVICE;
ret = STORAGE_VOLUME_NOT_FOUND;
}
- y2milestone( "ret:%d mby:%s", ret, Volume::mbyTypeString(mby).c_str());
+ y2mil("ret:" << ret << " mby:" << Volume::mbyTypeString(mby));
return( ret );
}
@@ -2123,7 +2116,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s options:%s", device.c_str(), options.c_str() );
+ y2mil("device:" << device << " options:" << options);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2151,7 +2144,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str());
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( findVolume( device, cont, vol ) )
@@ -2162,7 +2155,7 @@
{
ret = STORAGE_VOLUME_NOT_FOUND;
}
- y2milestone( "ret:%d options:%s", ret, options.c_str() );
+ y2mil("ret:" << ret << " options:" << options);
return( ret );
}
@@ -2171,7 +2164,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s options:%s", device.c_str(), options.c_str() );
+ y2mil("device:" << device << " options:" << options);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2206,7 +2199,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s options:%s", device.c_str(), options.c_str() );
+ y2mil("device:" << device << " options:" << options);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2238,7 +2231,7 @@
int
Storage::setCrypt( const string& device, bool val )
{
- y2milestone( "device:%s val:%d", device.c_str(), val );
+ y2mil("device:" << device << " val:" << val);
return( setCryptType( device, val, ENC_LUKS ));
}
@@ -2247,7 +2240,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s val:%d type:%d", device.c_str(), val, typ );
+ y2mil("device:" << device << " val:" << val << " type:" << typ);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2275,7 +2268,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str());
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( findVolume( device, cont, vol ) )
@@ -2286,7 +2279,7 @@
{
ret = STORAGE_VOLUME_NOT_FOUND;
}
- y2milestone( "ret:%d val:%d", ret, val );
+ y2mil("ret:" << ret << " val:" << val);
return( ret );
}
@@ -2295,9 +2288,9 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s l:%zu", device.c_str(), pwd.length() );
+ y2mil("device:" << device << " l:" << pwd.length());
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
- y2milestone( "password:%s", pwd.c_str() );
+ y2mil("password:" << pwd);
#endif
VolIterator vol;
@@ -2326,7 +2319,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str() );
+ y2mil("device:" << device);
VolIterator vol;
if( readonly )
@@ -2354,7 +2347,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str() );
+ y2mil("device:" << device);
pwd.clear();
VolIterator vol;
@@ -2371,7 +2364,7 @@
ret = checkCache();
}
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
- y2milestone( "password:%s", pwd.c_str() );
+ y2mil("password:" << pwd);
#endif
y2mil("ret:" << ret);
return( ret );
@@ -2382,7 +2375,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s val:%d", device.c_str(), val );
+ y2mil("device:" << device << " val:" << val);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2410,7 +2403,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str());
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( findVolume( device, cont, vol ) )
@@ -2421,7 +2414,7 @@
{
ret = STORAGE_VOLUME_NOT_FOUND;
}
- y2milestone( "ret:%d val:%d", ret, val );
+ y2mil("ret:" << ret << " val:" << val);
return( ret );
}
@@ -2443,8 +2436,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s newSizeMb:%llu ignoreFs:%d", device.c_str(),
- newSizeMb, ignoreFs );
+ y2mil("device:" << device << " newSizeMb:" << newSizeMb << " ignoreFs:" << ignoreFs);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2477,7 +2469,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str() );
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
if( readonly )
@@ -2505,7 +2497,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s", device.c_str() );
+ y2mil("device:" << device);
VolIterator vol;
ContIterator cont;
@@ -2590,7 +2582,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s", name.c_str() );
+ y2mil("name:" << name);
LvmVgIterator i = findLvmVg( name );
if( readonly )
{
@@ -2681,8 +2673,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "vg:%s name:%s sizeM:%llu stripe:%u", vg.c_str(),
- name.c_str(), sizeM, stripe );
+ y2mil("vg:" << vg << " name:" << name << " sizeM:" << sizeM << " stripe:" << stripe);
LvmVgIterator i = findLvmVg( vg );
if( readonly )
{
@@ -2700,7 +2691,7 @@
{
ret = checkCache();
}
- y2milestone( "ret:%d device:%s", ret, ret?"":device.c_str() );
+ y2mil("ret:" << ret << " device:" << (ret?"":device));
return( ret );
}
@@ -2729,7 +2720,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "vg:%s name:%s", vg.c_str(), name.c_str() );
+ y2mil("vg:" << vg << " name:" << name);
LvmVgIterator i = findLvmVg( vg );
if( readonly )
{
@@ -2757,8 +2748,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "vg:%s name:%s stripe:%lu", vg.c_str(), name.c_str(),
- stripe );
+ y2mil("vg:" << vg << " name:" << name << " stripe:" << stripe);
LvmVgIterator i = findLvmVg( vg );
if( readonly )
{
@@ -2786,8 +2776,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "vg:%s name:%s stripeSize:%llu", vg.c_str(), name.c_str(),
- stripeSize );
+ y2mil("vg:" << vg << " name:" << name << " stripeSize:" << stripeSize);
LvmVgIterator i = findLvmVg( vg );
if( readonly )
{
@@ -2900,7 +2889,7 @@
if (haveMd(md))
nr = md->unusedNumber();
device = "/dev/md" + decString(nr);
- y2milestone("ret:%d nr:%d device:%s", ret, nr, device.c_str());
+ y2mil("ret:" << ret << " nr:" << nr << " device:" << device);
return ret;
}
@@ -2996,7 +2985,7 @@
{
ret = checkCache();
}
- y2milestone( "ret:%d device:%s", ret, ret==0?device.c_str():"" );
+ y2mil("ret:" << ret << " device:" << (ret==0?device:""));
return( ret );
}
@@ -3004,7 +2993,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s destroySb:%d", name.c_str(), destroySb );
+ y2mil("name:" << name << " destroySb:" << destroySb);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3034,7 +3023,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s dev:%s", name.c_str(), dev.c_str() );
+ y2mil("name:" << name << " dev:" << dev);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3064,7 +3053,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s dev:%s", name.c_str(), dev.c_str() );
+ y2mil("name:" << name << " dev:" << dev);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3094,7 +3083,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s rtype:%d", name.c_str(), rtype );
+ y2mil("name:" << name << " rtype:" << rtype);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3124,7 +3113,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s dev:%lu", name.c_str(), chunk );
+ y2mil("name:" << name << " chunk:" << chunk);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3154,7 +3143,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s parity:%d", name.c_str(), ptype );
+ y2mil("name:" << name << " parity:" << ptype);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3184,7 +3173,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "name:%s", name.c_str() );
+ y2mil("name:" << name);
unsigned num = 0;
MdCo *md = NULL;
if( Md::mdStringNum( name, num ) && haveMd(md) )
@@ -3200,7 +3189,7 @@
{
int ret = 0;
assertInit();
- y2milestone("name:%s", name.c_str());
+ y2mil("name:" << name);
unsigned num = 0;
if (ret == 0 && !Md::mdStringNum(name, num))
{
@@ -3214,7 +3203,7 @@
else
ret = STORAGE_MD_NOT_FOUND;
}
- y2milestone("ret:%d", ret);
+ y2mil("ret:" << ret);
return ret;
}
@@ -3265,8 +3254,7 @@
break;
}
- y2milestone ("type:%d smallest:%llu sum:%llu size:%llu", md_type,
- smallestK, sumK, sizeK);
+ y2mil("type:" << md_type << " smallest:" << smallestK << " sum:" << sumK << " size:" << sizeK);
return ret;
}
@@ -3383,10 +3371,9 @@
{
int ret = 0;
assertInit();
- y2milestone( "lname:%s reuseExisting:%d sizeK:%llu mp:%s", lname.c_str(),
- reuseExisting, sizeK, mp.c_str() );
+ y2mil("lname:" << lname << " reuseExisting:" << reuseExisting << " sizeK:" << sizeK << " mp:" << mp);
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
- y2milestone( "pwd:%s", pwd.c_str() );
+ y2mil("pwd:" << pwd);
#endif
if( readonly )
{
@@ -3444,7 +3431,7 @@
{
ret = checkCache();
}
- y2milestone( "ret:%d device:%s", ret, ret==0?device.c_str():"" );
+ y2mil("ret:" << ret << " device:" << (ret==0?device:""));
return( ret );
}
@@ -3454,8 +3441,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "device:%s lname:%s reuse:%d sizeK:%lld", device.c_str(),
- lname.c_str(), reuseExisting, sizeK );
+ y2mil("device:" << device << " lname:" << lname << " reuse:" << reuseExisting << " sizeK:" << sizeK);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3481,7 +3467,7 @@
{
int ret = 0;
assertInit();
- y2milestone( "lname:%s removeFile:%d", lname.c_str(), removeFile );
+ y2mil("lname:" << lname << " removeFile:" << removeFile);
if( readonly )
{
ret = STORAGE_CHANGE_READONLY;
@@ -3679,7 +3665,7 @@
y2mil(b.str());
b.str("");
todo.sort( cont_less<commitAction>() );
- y2milestone( "stage %d", stage );
+ y2mil("stage:" << stage);
b << "sorted co <";
for( list