Hello community,
here is the log from the commit of package libstorage for openSUSE:Factory
checked in at Tue Feb 9 23:03:44 CET 2010.
--------
--- libstorage/libstorage.changes 2010-02-05 11:47:20.000000000 +0100
+++ /mounts/work_src_done/STABLE/libstorage/libstorage.changes 2010-02-09 14:48:34.000000000 +0100
@@ -1,0 +2,13 @@
+Tue Feb 9 13:10:58 CET 2010 - fehr@suse.de
+
+- adaptions for new parted 2.1
+ if ioctl BLKRRPART from parted fails, call addpart/delpart to
+ still allow repartitioning of disks where partitions are busy
+- 2.19.8
+
+-------------------------------------------------------------------
+Mon Feb 08 12:55:23 CET 2010 - aschnell@suse.de
+
+- fixes for g++ 4.5
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libstorage-2.19.7.tar.bz2
New:
----
libstorage-2.19.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libstorage.spec ++++++
--- /var/tmp/diff_new_pack.lE7t7Y/_old 2010-02-09 23:03:19.000000000 +0100
+++ /var/tmp/diff_new_pack.lE7t7Y/_new 2010-02-09 23:03:19.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libstorage (Version 2.19.7)
+# spec file for package libstorage (Version 2.19.8)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Name: libstorage
-Version: 2.19.7
+Version: 2.19.8
Release: 1
License: GPL
Group: System/Libraries
@@ -58,7 +58,7 @@
automake --add-missing --copy
autoconf
%{?suse_update_config:%{suse_update_config -f}}
-./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir}
+./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir} --disable-silent-rules
make %{?jobs:-j%jobs}
%ifarch s390 s390x
sed -i -e 's/DEVICE_NAMES=".*"/DEVICE_NAMES="path"/' data/sysconfig.storage-libstorage
@@ -134,4 +134,5 @@
%defattr(-,root,root)
%{python_sitelib}/libstorage.py*
%attr(755,root,root) %{python_sitearch}/_libstorage.so
+
%changelog
++++++ libstorage-2.19.7.tar.bz2 -> libstorage-2.19.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/VERSION new/libstorage-2.19.8/VERSION
--- old/libstorage-2.19.7/VERSION 2010-02-05 11:35:27.000000000 +0100
+++ new/libstorage-2.19.8/VERSION 2010-02-09 13:11:33.000000000 +0100
@@ -1 +1 @@
-2.19.7
+2.19.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/examples/TestDisk.cc new/libstorage-2.19.8/examples/TestDisk.cc
--- old/libstorage-2.19.7/examples/TestDisk.cc 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/examples/TestDisk.cc 2010-02-08 17:02:41.000000000 +0100
@@ -12,7 +12,7 @@
int ret;
initDefaultLogger();
StorageInterface* s = createStorageInterface(Environment(false));
- string disk = "/dev/hdb";
+ string disk = "/dev/sdb";
string dev;
ret = s->destroyPartitionTable( disk, s->defaultDiskLabel() );
if( ret ) cerr << "retcode:" << ret << endl;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/examples/TestDiskLog.cc new/libstorage-2.19.8/examples/TestDiskLog.cc
--- old/libstorage-2.19.7/examples/TestDiskLog.cc 2010-02-01 18:08:07.000000000 +0100
+++ new/libstorage-2.19.8/examples/TestDiskLog.cc 2010-02-08 17:02:41.000000000 +0100
@@ -14,16 +14,16 @@
initDefaultLogger();
StorageInterface* s = createStorageInterface(Environment(false));
string dev;
- ret = s->destroyPartitionTable( "/dev/hdb", s->defaultDiskLabel() );
+ ret = s->destroyPartitionTable( "/dev/sdb", s->defaultDiskLabel() );
if( ret ) cerr << "retcode:" << ret << endl;
- ret = s->createPartitionKb( "/dev/hdb", EXTENDED, 5000*1024, 15000*1024, dev );
+ ret = s->createPartitionKb( "/dev/sdb", EXTENDED, 5000*1024, 15000*1024, dev );
cout << dev << endl;
if( ret ) cerr << "retcode:" << ret << endl;
- unsigned kb = s->cylinderToKb( "/dev/hdb", 40 );
+ unsigned kb = s->cylinderToKb( "/dev/sdb", 40 );
int i=0;
while( i<40 && ret==0 )
{
- ret = s->createPartitionKb( "/dev/hdb", LOGICAL, 5000*1024+i*kb, kb,
+ ret = s->createPartitionKb( "/dev/sdb", LOGICAL, 5000*1024+i*kb, kb,
dev );
if(ret==0) cout << dev << endl;
i++;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/libstorage.spec.in new/libstorage-2.19.8/libstorage.spec.in
--- old/libstorage-2.19.7/libstorage.spec.in 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/libstorage.spec.in 2010-02-08 17:01:25.000000000 +0100
@@ -49,7 +49,7 @@
autoconf
%{?suse_update_config:%{suse_update_config -f}}
-./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir}
+./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir} --disable-silent-rules
make %{?jobs:-j%jobs}
%ifarch s390 s390x
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/AppUtil.cc new/libstorage-2.19.8/storage/AppUtil.cc
--- old/libstorage-2.19.7/storage/AppUtil.cc 2010-02-04 15:21:33.000000000 +0100
+++ new/libstorage-2.19.8/storage/AppUtil.cc 2010-02-09 12:17:03.000000000 +0100
@@ -89,7 +89,7 @@
glob_t globbuf;
if (glob(path.c_str(), flags, 0, &globbuf) == 0)
{
- for (char** p = globbuf.gl_pathv; *p != 0; *p++)
+ for (char** p = globbuf.gl_pathv; *p != 0; p++)
ret.push_back(*p);
}
globfree (&globbuf);
@@ -125,6 +125,26 @@
}
+ bool
+ getMajorMinor(const string& device, unsigned long& major, unsigned long& minor)
+ {
+ bool ret = false;
+ string dev = normalizeDevice(device);
+ struct stat sbuf;
+ if (stat(device.c_str(), &sbuf) == 0)
+ {
+ major = gnu_dev_major(sbuf.st_rdev);
+ minor = gnu_dev_minor(sbuf.st_rdev);
+ ret = true;
+ }
+ else
+ {
+ y2err("stat for " << device << " failed errno:" << errno << " (" << strerror(errno) << ")");
+ }
+ return ret;
+ }
+
+
string extractNthWord(int Num_iv, const string& Line_Cv, bool GetRest_bi)
{
string::size_type pos;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/AppUtil.h new/libstorage-2.19.8/storage/AppUtil.h
--- old/libstorage-2.19.7/storage/AppUtil.h 2010-02-02 17:32:13.000000000 +0100
+++ new/libstorage-2.19.8/storage/AppUtil.h 2010-02-09 12:17:03.000000000 +0100
@@ -52,6 +52,8 @@
bool getStatVfs(const string& path, StatVfs&);
+ bool getMajorMinor(const string& device, unsigned long& major, unsigned long& minor);
+
string extractNthWord(int Num_iv, const string& Line_Cv, bool GetRest_bi = false);
std::list<string> splitString( const string& s, const string& delChars=" \t\n",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Device.cc new/libstorage-2.19.8/storage/Device.cc
--- old/libstorage-2.19.7/storage/Device.cc 2010-02-01 15:49:35.000000000 +0100
+++ new/libstorage-2.19.8/storage/Device.cc 2010-02-09 12:17:03.000000000 +0100
@@ -79,6 +79,13 @@
}
+ bool
+ Device::getMajorMinor()
+ {
+ return storage::getMajorMinor(dev, mjr, mnr);
+ }
+
+
string
Device::udevPath() const
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Device.h new/libstorage-2.19.8/storage/Device.h
--- old/libstorage-2.19.7/storage/Device.h 2010-02-01 18:27:42.000000000 +0100
+++ new/libstorage-2.19.8/storage/Device.h 2010-02-09 12:17:03.000000000 +0100
@@ -52,6 +52,7 @@
unsigned long long sizeK() const { return size_k; }
+ bool getMajorMinor();
unsigned long majorNr() const { return mjr; }
unsigned long minorNr() const { return mnr; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Disk.cc new/libstorage-2.19.8/storage/Disk.cc
--- old/libstorage-2.19.7/storage/Disk.cc 2010-01-29 14:47:30.000000000 +0100
+++ new/libstorage-2.19.8/storage/Disk.cc 2010-02-09 12:22:21.000000000 +0100
@@ -632,10 +632,9 @@
y2mil("out:" << tmp);
}
int ret = cmd.retcode();
- if( ret!=0 && cmd_line.find( device()+" set" )!=string::npos &&
- tmp.find( "kernel was unable to re-read" )!=string::npos )
+ if( ret!=0 && tmp.find( "kernel failed to re-read" )!=string::npos )
{
- y2mil( "resetting retcode set cmd " << ret << " of:" << cmd_line );
+ y2mil( "resetting retcode cmd " << ret << " of:" << cmd_line );
ret = 0;
}
if( ret != 0 )
@@ -652,26 +651,45 @@
}
int
-Disk::execCheckFailed( const string& cmd_line )
+Disk::execCheckFailed( const string& cmd_line, bool stop_hald )
{
static SystemCmd cmd;
- return( execCheckFailed( cmd, cmd_line ) );
+ return( execCheckFailed( cmd, cmd_line, stop_hald ) );
}
-int Disk::execCheckFailed( SystemCmd& cmd, const string& cmd_line )
+int Disk::execCheckFailed( SystemCmd& cmd, const string& cmd_line,
+ bool stop_hald )
{
- getStorage()->handleHald(true);
+ if( stop_hald )
+ getStorage()->handleHald(true);
cmd.execute( cmd_line );
int ret = checkSystemError( cmd_line, cmd );
if( ret!=0 )
setExtError( cmd );
- getStorage()->handleHald(false);
+ if( stop_hald )
+ getStorage()->handleHald(false);
return( ret );
}
bool
+Disk::scanPartedSectors( const string& Line, unsigned& nr,
+ unsigned long long& start,
+ unsigned long long& ssize ) const
+ {
+ std::istringstream Data( Line );
+ classic(Data);
+
+ nr=0;
+ string skip;
+ char c;
+ Data >> nr >> start >> c >> skip >> ssize;
+ y2mil( "nr:" << nr << " st:" << start << " sz:" << ssize << " c:" << c );
+ return( nr>0 );
+ }
+
+bool
Disk::scanPartedLine( const string& Line, unsigned& nr, unsigned long& start,
unsigned long& csize, PartitionType& type, unsigned& id,
bool& boot ) const
@@ -1156,7 +1174,7 @@
disk = dev.substr( 0, pos );
}
y2mil( "dev:" << dev << " disk:" << disk << " nr:" << nr );
- return( make_pair(disk,nr) );
+ return make_pair(disk, nr);
}
@@ -2101,9 +2119,26 @@
return( ret );
}
+int
+Disk::callDelpart( unsigned nr ) const
+ {
+ SystemCmd c( DELPARTBIN " " + device() + ' ' + decString(nr) );
+ return( c.retcode() );
+ }
+
+int
+Disk::callAddpart( unsigned nr, unsigned long long sstart,
+ unsigned long long ssize ) const
+ {
+ SystemCmd c( ADDPARTBIN " " + device() + ' ' + decString(nr) + ' ' +
+ decString(sstart) + ' ' + decString(ssize) );
+ return( c.retcode() );
+ }
+
bool
Disk::getPartedValues( Partition *p ) const
{
+ y2mil( "nr:" << p->nr() );
bool ret = false;
if (getStorage()->testmode())
{
@@ -2112,18 +2147,64 @@
}
else
{
- ProcParts parts;
std::ostringstream cmd_line;
classic(cmd_line);
- cmd_line << PARTEDCMD << quote(device()) << " unit cyl print | grep -w \"^[ \t]*\"" << p->nr();
+ cmd_line << PARTEDCMD << quote(device()) << " unit cyl print unit s print";
+ std::string cmd_str = cmd_line.str();
+ cmd_line << "| grep -w \"^[ \t]*\"" << p->nr();
SystemCmd cmd( cmd_line.str() );
unsigned nr, id;
unsigned long start, csize;
+ unsigned long long sstart, ssize;
PartitionType type;
bool boot;
+ if( cmd.numLines()>1 &&
+ scanPartedSectors( cmd.getLine(1), nr, sstart, ssize ))
+ {
+ unsigned long long sysfs_start = 0;
+ unsigned long long sysfs_size = 0;
+ string tmp = getPartName(p->nr());
+ string start_p = sysfsDir();
+ start_p += tmp.substr(tmp.find_last_of('/'));
+ string size_p = start_p;
+ start_p += "/start";
+ size_p += "/size";
+ y2mil( "p1:" << start_p << " p2:" << size_p );
+ std::ifstream fl;
+ classic(fl);
+ fl.open( start_p );
+ fl >> sysfs_start;
+ fl.close();
+ fl.open( size_p );
+ fl >> sysfs_size;
+ fl.close();
+ if( p->type()==EXTENDED )
+ ssize=2;
+ y2mil( "sectors nr:" << nr << " sysfs start:" << sysfs_start <<
+ " size:" << sysfs_size );
+ y2mil( "sectors nr:" << nr << " parted start:" << sstart <<
+ " size:" << ssize );
+ if( nr == p->nr() && (true || // always only for testing
+ (sysfs_start!=sstart || sysfs_size!=ssize)) )
+ {
+ callDelpart( nr );
+ callAddpart( nr, sstart, ssize );
+ fl.open( start_p );
+ fl >> sysfs_start;
+ fl.close();
+ fl.open( size_p );
+ fl >> sysfs_size;
+ fl.close();
+ if( sysfs_start!=sstart || sysfs_size!=ssize )
+ y2err( "addpart failed sectors parted:" << sstart << ' ' <<
+ ssize << " sysfs:" << sysfs_start << ' ' <<
+ sysfs_size );
+ }
+ }
if( cmd.numLines()>0 &&
scanPartedLine( cmd.getLine(0), nr, start, csize, type, id, boot ))
{
+ ProcParts parts;
y2mil("really created at cyl:" << start << " csize:" << csize);
p->changeRegion( start, csize, cylinderToKb(csize) );
unsigned long long s=0;
@@ -2139,9 +2220,7 @@
p->setSize( s );
}
}
- cmd_line.str("");
- cmd_line << PARTEDCMD << quote(device()) << " unit cyl print";
- cmd.execute( cmd_line.str() );
+ cmd.execute( cmd_str );
}
return( ret );
}
@@ -2267,6 +2346,7 @@
cmd_line << "ext2 ";
}
}
+ getStorage()->handleHald(true);
if( ret==0 )
{
unsigned long start = p->cylStart();
@@ -2312,35 +2392,36 @@
cmd_line << start << " ";
string save = cmd_line.str();
y2mil( "end:" << end << " cylinders:" << cylinders() );
- if( execCheckFailed( save + decString(end) ) &&
+ if( execCheckFailed( save + decString(end), false ) &&
end==cylinders() &&
- execCheckFailed( save + decString(end-1) ) )
+ execCheckFailed( save + decString(end-1), false ) )
{
ret = DISK_CREATE_PARTITION_PARTED_FAILED;
}
}
if( ret==0 )
{
- if( !dmp_slave )
- {
- if( p->type()!=EXTENDED )
- Storage::waitForDevice(p->device());
- else
- Storage::waitForDevice();
- if( p->type()==LOGICAL && getStorage()->instsys() )
- {
- // kludge to make the extended partition visible in
- // /proc/partitions otherwise grub refuses to install if root
- // filesystem is a logical partition
- PartPair lc = partPair(logicalCreated);
- call_blockdev = lc.length()<=1;
- y2mil("logicalCreated:" << lc.length() << " call_blockdev:" << call_blockdev);
- }
- }
p->setCreated( false );
if( !getPartedValues( p ))
ret = DISK_PARTITION_NOT_FOUND;
}
+ getStorage()->handleHald(false);
+ if( ret==0 && !dmp_slave )
+ {
+ if( p->type()!=EXTENDED )
+ Storage::waitForDevice(p->device());
+ else
+ Storage::waitForDevice();
+ if( p->type()==LOGICAL && getStorage()->instsys() )
+ {
+ // kludge to make the extended partition visible in
+ // /proc/partitions otherwise grub refuses to install if root
+ // filesystem is a logical partition
+ PartPair lc = partPair(logicalCreated);
+ call_blockdev = lc.length()<=1;
+ y2mil("logicalCreated:" << lc.length() << " call_blockdev:" << call_blockdev);
+ }
+ }
if( ret==0 && p->type()!=EXTENDED )
{
ret = p->zeroIfNeeded();
@@ -2398,10 +2479,15 @@
std::ostringstream cmd_line;
classic(cmd_line);
cmd_line << PARTEDCMD << quote(device()) << " rm " << p->OrigNr();
- if( execCheckFailed( cmd_line.str() ) )
+ getStorage()->handleHald(true);
+ if( execCheckFailed( cmd_line.str(), false ) )
{
ret = DISK_REMOVE_PARTITION_PARTED_FAILED;
}
+ ProcParts parts;
+ if( parts.findDevice(getPartName(device(), p->OrigNr())) )
+ callDelpart( p->OrigNr() );
+ getStorage()->handleHald(false);
}
if( ret==0 )
{
@@ -2655,17 +2741,19 @@
cmd_line << "YAST_IS_RUNNING=1 " << PARTEDCMD << quote(device())
<< " unit s resize " << p->nr() << " "
<< start_sect << " " << end_sect;
- if( execCheckFailed( cmd_line.str() ) )
+ getStorage()->handleHald(true);
+ if( execCheckFailed( cmd_line.str(), false ) )
{
ret = DISK_RESIZE_PARTITION_PARTED_FAILED;
}
- if( ret==0 && !dmp_slave )
- Storage::waitForDevice(p->device());
if( !getPartedValues( p ))
{
if( ret==0 )
ret = DISK_PARTITION_NOT_FOUND;
}
+ getStorage()->handleHald(false);
+ if( ret==0 && !dmp_slave )
+ Storage::waitForDevice(p->device());
y2mil("after resize size:" << p->sizeK() << " resize:" << (p->needShrink()||p->needExtend()));
}
if( needExtend && !dmp_slave &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Disk.h new/libstorage-2.19.8/storage/Disk.h
--- old/libstorage-2.19.7/storage/Disk.h 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/Disk.h 2010-02-08 17:02:41.000000000 +0100
@@ -207,15 +207,22 @@
virtual bool detectPartitions(const ProcParts& parts);
bool getSysfsInfo( const string& SysFsDir );
int checkSystemError( const string& cmd_line, const SystemCmd& cmd );
- int execCheckFailed( const string& cmd_line );
- int execCheckFailed( SystemCmd& cmd, const string& cmd_line );
+ int execCheckFailed( const string& cmd_line, bool stop_hald=true );
+ int execCheckFailed( SystemCmd& cmd, const string& cmd_line,
+ bool stop_hald=true );
bool checkPartedOutput(const SystemCmd& cmd, const ProcParts& parts);
bool scanPartedLine( const string& Line, unsigned& nr,
unsigned long& start, unsigned long& csize,
storage::PartitionType& type,
unsigned& id, bool& boot ) const;
+ bool scanPartedSectors( const string& Line, unsigned& nr,
+ unsigned long long& start,
+ unsigned long long& ssize ) const;
bool checkPartedValid(const ProcParts& parts, const string& diskname,
std::list& pl, unsigned long& rng ) const;
+ int callDelpart( unsigned nr ) const;
+ int callAddpart( unsigned nr, unsigned long long sstart,
+ unsigned long long ssize ) const;
bool getPartedValues( Partition *p ) const;
bool getPartedSectors( const Partition *p, unsigned long long& start,
unsigned long long& end ) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Dm.cc new/libstorage-2.19.8/storage/Dm.cc
--- old/libstorage-2.19.7/storage/Dm.cc 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/Dm.cc 2010-02-09 12:17:03.000000000 +0100
@@ -289,7 +289,7 @@
void Dm::updateMajorMinor()
{
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
if( majorNr()==Dm::dmMajor() )
{
string d = "/dev/dm-" + decString(minorNr());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/DmPart.cc new/libstorage-2.19.8/storage/DmPart.cc
--- old/libstorage-2.19.7/storage/DmPart.cc 2010-02-04 16:29:41.000000000 +0100
+++ new/libstorage-2.19.8/storage/DmPart.cc 2010-02-09 12:17:03.000000000 +0100
@@ -95,7 +95,7 @@
{
unsigned long mj=mjr;
unsigned long mi=mnr;
- getMajorMinor( dev, mj, mi );
+ getMajorMinor();
if( mi!=mnr || mj!=mjr )
{
mnr = mi;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Loop.cc new/libstorage-2.19.8/storage/Loop.cc
--- old/libstorage-2.19.7/storage/Loop.cc 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/Loop.cc 2010-02-09 12:17:03.000000000 +0100
@@ -63,7 +63,7 @@
if( loopStringNum( loop_dev, num ))
{
setNameDev();
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
}
proc_dev = loop_dev;
}
@@ -110,7 +110,7 @@
if( loopStringNum( dev, num ))
{
setNameDev();
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
}
}
else
@@ -149,7 +149,7 @@
nm = dm_dev.substr( dm_dev.find_last_of( '/' )+1);
if( active )
{
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
replaceAltName( "/dev/dm-", "/dev/dm-"+decString(mnr) );
}
Volume::setDmcryptDev( dm_dev, active );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Md.cc new/libstorage-2.19.8/storage/Md.cc
--- old/libstorage-2.19.7/storage/Md.cc 2010-02-04 12:22:50.000000000 +0100
+++ new/libstorage-2.19.8/storage/Md.cc 2010-02-09 12:17:03.000000000 +0100
@@ -64,7 +64,7 @@
{
nm.clear();
setNameDev();
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
getStorage()->fetchDanglingUsedBy(dev, uby);
}
SystemCmd c(MDADMBIN " --detail " + quote(device()));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/MdPart.cc new/libstorage-2.19.8/storage/MdPart.cc
--- old/libstorage-2.19.7/storage/MdPart.cc 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/MdPart.cc 2010-02-09 12:17:03.000000000 +0100
@@ -96,14 +96,7 @@
void MdPart::updateMinor()
{
- unsigned long mj=mjr;
- unsigned long mi=mnr;
- getMajorMinor( dev, mj, mi );
- if( mi!=mnr || mj!=mjr )
- {
- mnr = mi;
- mjr = mj;
- }
+ getMajorMinor();
}
void MdPart::updateSize()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/MdPartCo.cc new/libstorage-2.19.8/storage/MdPartCo.cc
--- old/libstorage-2.19.7/storage/MdPartCo.cc 2010-02-04 10:48:55.000000000 +0100
+++ new/libstorage-2.19.8/storage/MdPartCo.cc 2010-02-09 12:17:03.000000000 +0100
@@ -1101,12 +1101,12 @@
if( doing )
{
// displayed text during action, %1$s is replaced by a name (e.g. pdc_igeeeadj),
- txt = sformat( _("Removing %1$s"), name().c_str() );
+ txt = sformat( _("Removing software RAID %1$s"), name().c_str() );
}
else
{
// displayed text before action, %1$s is replaced by a name (e.g. pdc_igeeeadj),
- txt = sformat( _("Remove %1$s"), name().c_str() );
+ txt = sformat( _("Remove software RAID %1$s"), name().c_str() );
}
return txt;
}
@@ -1854,30 +1854,6 @@
}
-void MdPartCo::getMajorMinor()
-{
- string path = sysfs_path + nm + "/dev";
-
- if( access( path.c_str(), R_OK )==0 )
- {
- string val;
- unsigned pos;
-
- std::ifstream file( path.c_str() );
- classic(file);
- file >> val;
-
- pos = val.find(":");
- val.substr(0,pos) >> mjr;
- val.substr(pos+1) >> mnr;
-
- file.close();
- file.clear();
- }
-
-}
-
-
bool MdPartCo::isImsmPlatform()
{
bool ret = false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/MdPartCo.h new/libstorage-2.19.8/storage/MdPartCo.h
--- old/libstorage-2.19.7/storage/MdPartCo.h 2010-02-02 17:44:28.000000000 +0100
+++ new/libstorage-2.19.8/storage/MdPartCo.h 2010-02-09 12:17:03.000000000 +0100
@@ -254,8 +254,6 @@
virtual Text removeText( bool doing ) const;
virtual Text setDiskLabelText( bool doing ) const;
- void getMajorMinor();
-
/* Initialize the MD part of object.*/
void initMd();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Partition.cc new/libstorage-2.19.8/storage/Partition.cc
--- old/libstorage-2.19.7/storage/Partition.cc 2010-02-04 16:29:41.000000000 +0100
+++ new/libstorage-2.19.8/storage/Partition.cc 2010-02-09 12:17:03.000000000 +0100
@@ -181,7 +181,7 @@
nm.clear();
setNameDev();
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
getStorage()->changeDeviceName(old, dev);
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/ProcParts.cc new/libstorage-2.19.8/storage/ProcParts.cc
--- old/libstorage-2.19.7/storage/ProcParts.cc 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/ProcParts.cc 2010-02-08 17:02:41.000000000 +0100
@@ -59,13 +59,16 @@
bool
- ProcParts::getSize(const string& device, unsigned long long& sizeK) const
+ ProcParts::findDevice(const string& device) const
{
- if (device != normalizeDevice(device))
- y2err("unnormalize device " << device);
+ return( findEntry(device)!=data.end() );
+ }
+ bool
+ ProcParts::getSize(const string& device, unsigned long long& sizeK) const
+ {
bool ret = false;
- const_iterator i = data.find(normalizeDevice(device));
+ const_iterator i = findEntry(device);
if (i != data.end())
{
sizeK = i->second;
@@ -85,4 +88,12 @@
return ret;
}
+ ProcParts::const_iterator
+ ProcParts::findEntry(const string& device) const
+ {
+ if (device != normalizeDevice(device))
+ y2err("unnormalize device " << device);
+ return( data.find(normalizeDevice(device)) );
+ }
+
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/ProcParts.h new/libstorage-2.19.8/storage/ProcParts.h
--- old/libstorage-2.19.7/storage/ProcParts.h 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/ProcParts.h 2010-02-08 17:02:41.000000000 +0100
@@ -45,6 +45,7 @@
void reload();
bool getSize(const string& device, unsigned long long& sizeK) const;
+ bool findDevice(const string& device) const;
list<string> getEntries() const;
@@ -62,6 +63,8 @@
typedef map::const_iterator const_iterator;
+ const_iterator findEntry(const string& device) const;
+
map data;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/StorageDefines.h new/libstorage-2.19.8/storage/StorageDefines.h
--- old/libstorage-2.19.7/storage/StorageDefines.h 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/StorageDefines.h 2010-02-08 17:02:41.000000000 +0100
@@ -30,6 +30,8 @@
#define PARTEDBIN "/usr/sbin/parted"
#define PARTEDCMD PARTEDBIN " -s " // blank at end !!
+#define ADDPARTBIN "/usr/sbin/addpart"
+#define DELPARTBIN "/usr/sbin/delpart"
#define FDISKBIN "/sbin/fdisk"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Volume.cc new/libstorage-2.19.8/storage/Volume.cc
--- old/libstorage-2.19.7/storage/Volume.cc 2010-02-04 16:29:41.000000000 +0100
+++ new/libstorage-2.19.8/storage/Volume.cc 2010-02-09 12:17:03.000000000 +0100
@@ -218,8 +218,8 @@
if( numeric||!nm.empty() )
{
setNameDev();
- if (!getStorage()->testmode())
- getMajorMinor( dev, mjr, mnr );
+ if (!getStorage()->testmode() && cType()!=NFSC)
+ getMajorMinor();
}
if( !numeric )
num = 0;
@@ -254,26 +254,6 @@
}
- bool
- Volume::getMajorMinor(const string& device, unsigned long& major, unsigned long& minor)
- {
- bool ret = false;
- string dev = normalizeDevice(device);
- struct stat sbuf;
- if (stat(dev.c_str(), &sbuf) == 0)
- {
- minor = gnu_dev_minor(sbuf.st_rdev);
- major = gnu_dev_major(sbuf.st_rdev);
- ret = true;
- }
- else
- {
- y2err("stat for " << dev << " failed errno:" << errno << " (" << strerror(errno) << ")");
- }
- return ret;
- }
-
-
void Volume::getFsInfo( const Volume* source )
{
setFs( source->getFs() );
@@ -1993,13 +1973,13 @@
unsigned long dummy, minor;
if (cType() == LOOP)
{
- getMajorMinor( dev, mjr, mnr );
+ getMajorMinor();
minor = mnr;
replaceAltName( "/dev/dm-", Dm::dmDeviceName(mnr) );
}
else
{
- getMajorMinor( dmcrypt_dev, dummy, minor );
+ storage::getMajorMinor( dmcrypt_dev, dummy, minor );
replaceAltName("/dev/dm-", Dm::dmDeviceName(minor));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.19.7/storage/Volume.h new/libstorage-2.19.8/storage/Volume.h
--- old/libstorage-2.19.7/storage/Volume.h 2010-01-29 12:03:11.000000000 +0100
+++ new/libstorage-2.19.8/storage/Volume.h 2010-02-09 12:17:03.000000000 +0100
@@ -196,8 +196,6 @@
static bool notDeleted( const Volume&d ) { return( !d.deleted() ); }
static bool isDeleted( const Volume&d ) { return( d.deleted() ); }
- static bool getMajorMinor( const string& device,
- unsigned long& Major, unsigned long& Minor );
static bool loopStringNum( const string& name, unsigned& num );
static storage::EncryptType toEncType( const string& val );
static storage::FsType toFsType( const string& val );
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org