Hello community,
here is the log from the commit of package libstorage for openSUSE:Factory checked in at 2014-02-26 23:20:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage (Old)
and /work/SRC/openSUSE:Factory/.libstorage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage/libstorage.changes 2014-02-23 07:16:26.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libstorage.new/libstorage.changes 2014-02-26 23:20:29.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Feb 24 14:31:45 CET 2014 - aschnell(a)suse.de
+
+- use parted for ECKD DASDs (fate#313075)
+- 2.25.9
+
+-------------------------------------------------------------------
Old:
----
libstorage-2.25.8.tar.bz2
New:
----
libstorage-2.25.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libstorage.spec ++++++
--- /var/tmp/diff_new_pack.pTW79I/_old 2014-02-26 23:20:30.000000000 +0100
+++ /var/tmp/diff_new_pack.pTW79I/_new 2014-02-26 23:20:30.000000000 +0100
@@ -17,7 +17,7 @@
Name: libstorage
-Version: 2.25.8
+Version: 2.25.9
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: libstorage-%{version}.tar.bz2
++++++ libstorage-2.25.8.tar.bz2 -> libstorage-2.25.9.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/VERSION new/libstorage-2.25.9/VERSION
--- old/libstorage-2.25.8/VERSION 2014-02-21 11:40:44.000000000 +0100
+++ new/libstorage-2.25.9/VERSION 2014-02-24 14:59:33.000000000 +0100
@@ -1 +1 @@
-2.25.8
+2.25.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/bindings/python/libstorage.py new/libstorage-2.25.9/bindings/python/libstorage.py
--- old/libstorage-2.25.8/bindings/python/libstorage.py 2014-02-21 17:35:45.000000000 +0100
+++ new/libstorage-2.25.9/bindings/python/libstorage.py 2014-02-24 15:01:14.000000000 +0100
@@ -1453,7 +1453,6 @@
DM_REMOVE_FAILED = _libstorage.DM_REMOVE_FAILED
DM_NOT_IN_LIST = _libstorage.DM_NOT_IN_LIST
DASD_NOT_POSSIBLE = _libstorage.DASD_NOT_POSSIBLE
-DASD_FDASD_FAILED = _libstorage.DASD_FDASD_FAILED
DASD_DASDFMT_FAILED = _libstorage.DASD_DASDFMT_FAILED
DMPART_CHANGE_READONLY = _libstorage.DMPART_CHANGE_READONLY
DMPART_INTERNAL_ERR = _libstorage.DMPART_INTERNAL_ERR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/AppUtil.cc new/libstorage-2.25.9/storage/AppUtil.cc
--- old/libstorage-2.25.8/storage/AppUtil.cc 2014-02-07 18:08:42.000000000 +0100
+++ new/libstorage-2.25.9/storage/AppUtil.cc 2014-02-24 14:59:33.000000000 +0100
@@ -712,7 +712,7 @@
void
checkBinPaths(const string& arch, bool instsys)
{
- y2mil("Arch:" << arch << " Instsys:" << instsys);
+ y2mil("arch:" << arch << " instsys:" << instsys);
set<string> paths = {
#include "./gen_pathlist.cc"
@@ -723,7 +723,6 @@
if (!boost::starts_with(arch, "s390"))
{
- paths.erase(FDASDBIN);
paths.erase(DASDVIEWBIN);
paths.erase(DASDFMTBIN);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Dasd.cc new/libstorage-2.25.9/storage/Dasd.cc
--- old/libstorage-2.25.8/storage/Dasd.cc 2014-01-22 10:39:57.000000000 +0100
+++ new/libstorage-2.25.9/storage/Dasd.cc 2014-02-24 14:59:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) [2004-2010] Novell, Inc.
+ * Copyright (c) [2004-2014] Novell, Inc.
*
* All Rights Reserved.
*
@@ -64,324 +64,141 @@
bool
- Dasd::detectPartitionsFdasd(SystemInfo& systeminfo)
- {
- bool ret = true;
- checkFdasdOutput(systeminfo);
- y2mil("ret:" << ret << " partitions:" << vols.size());
- return( ret );
- }
-
-
- bool
Dasd::detectPartitions(SystemInfo& systeminfo)
{
- bool ret = true;
-
- detected_label = "dasd";
- setLabelData( "dasd" );
+ bool ret = true;
const Dasdview& dasdview = systeminfo.getDasdview(device());
new_geometry = geometry = dasdview.getGeometry();
fmt = dasdview.getDasdFormat();
ronly = fmt != DASDF_CDL;
- if( size_k==0 )
- {
+ if (size_k == 0)
+ {
size_k = geometry.sizeK();
y2mil("New SizeK:" << size_k);
- }
+ }
+
+ switch (fmt)
+ {
+ case DASDF_NONE:
+ break;
- switch( fmt )
- {
case DASDF_CDL:
- ret = Dasd::detectPartitionsFdasd(systeminfo);
+ ret = Disk::detectPartitions(systeminfo);
break;
- case DASDF_LDL:
- {
+
+ case DASDF_LDL: {
max_primary = 1;
unsigned long long s = cylinderToKb(cylinders());
Partition *p = new Partition(*this, getPartName(1), getPartDevice(1), 1,
systeminfo, s, Region(0, cylinders()), PRIMARY);
const ProcParts& parts = systeminfo.getProcParts();
if (parts.getSize(p->device(), s))
- {
- p->setSize( s );
- }
- addToList( p );
- ret = true;
- }
- break;
- default:
- break;
- }
-
- y2mil("ret:" << ret << " partitions:" << vols.size() << " detected label:" << label);
- y2mil("geometry:" << geometry << " fmt:" << toString(fmt) << " readonly:" << ronly);
- return ret;
- }
-
-
- bool
- Dasd::checkPartitionsValid(SystemInfo& systeminfo, const list<Partition*>& pl) const
- {
- const ProcParts& parts = systeminfo.getProcParts();
- const Fdasd& fdasd = systeminfo.getFdasd(dev);
-
- list<string> ps = partitionsKernelKnowns(parts);
- if (pl.size() != ps.size())
- {
- y2err("number of partitions fdasd and kernel see differs");
- return false;
- }
-
- for (list<Partition*>::const_iterator i = pl.begin(); i != pl.end(); ++i)
- {
- const Partition& p = **i;
-
- Fdasd::Entry entry;
- if (fdasd.getEntry(p.nr(), entry))
- {
- // maybe too strict but should be ok
-
- Region head_fdasd = entry.headRegion;
- Region head_kernel = p.detectSysfsBlkRegion() / (geometry.headSize() / 512);
-
- if (head_fdasd != head_kernel)
{
- y2err("region mismatch dev:" << dev << " nr:" << p.nr() << " head_fdasd:" <<
- head_fdasd << " head_kernel:" << head_kernel);
- return false;
+ p->setSize(s);
}
- }
+ addToList(p);
+ ret = true;
+ } break;
}
- return true;
+ y2mil("ret:" << ret << " partitions:" << vols.size() << " detected label:" << label);
+ y2mil("geometry:" << geometry << " fmt:" << toString(fmt) << " readonly:" << ronly);
+
+ return ret;
}
-bool
- Dasd::checkFdasdOutput(SystemInfo& systeminfo)
+ int
+ Dasd::doResize(Volume* v)
{
- const ProcParts& parts = systeminfo.getProcParts();
- const Fdasd& fdasd = systeminfo.getFdasd(dev);
-
- assert(geometry == fdasd.getGeometry());
-
- list<Partition *> pl;
-
- for (Fdasd::const_iterator it = fdasd.getEntries().begin();
- it != fdasd.getEntries().end(); ++it)
- {
- if( it->num < range )
- {
- unsigned long long s = cylinderToKb(it->cylRegion.len());
- Partition *p = new Partition(*this, getPartName(it->num), getPartDevice(it->num),
- it->num, systeminfo, s, it->cylRegion, PRIMARY);
- if (parts.getSize(p->device(), s))
- {
- p->setSize( s );
- }
- pl.push_back( p );
- }
- else
- y2war("partition nr " << it->num << " outside range " << range);
- }
-
- y2mil("nm:" << nm);
- unsigned long dummy = 0;
- if (!checkPartedValid(systeminfo, pl, dummy))
- {
- Text txt = sformat(
- // popup text %1$s is replaced by disk name e.g. /dev/hda
-_("The partitioning on disk %1$s is not readable by\n"
-"the partitioning tool fdasd, which is used to change the\n"
-"partition table.\n"
-"\n"
-"You can use the partitions on disk %1$s as they are.\n"
-"You can format them and assign mount points to them, but you\n"
-"cannot add, edit, resize, or remove partitions from that\n"
-"disk with this tool."), dev.c_str() );
-
- getStorage()->addInfoPopupText( dev, txt );
- ronly = true;
- }
- for( list<Partition*>::iterator i=pl.begin(); i!=pl.end(); ++i )
- {
- addToList( *i );
- }
- return( true );
+ return DASD_NOT_POSSIBLE;
}
-int Dasd::doResize( Volume* v )
- {
- return DASD_NOT_POSSIBLE;
+ int
+ Dasd::resizePartition(Partition* p, unsigned long newCyl)
+ {
+ return DASD_NOT_POSSIBLE;
}
-int Dasd::resizePartition( Partition* p, unsigned long newCyl )
- {
- return DASD_NOT_POSSIBLE;
- }
-int Dasd::removePartition( unsigned nr )
+ int
+ Dasd::removePartition(unsigned nr)
{
- y2mil("begin nr:" << nr);
- int ret = Disk::removePartition( nr );
- if( ret==0 )
+ y2mil("begin nr:" << nr);
+ int ret = Disk::removePartition(nr);
+ if (ret == 0)
{
- PartPair p = partPair(Partition::notDeleted);
- changeNumbers( p.begin(), p.end(), nr, -1 );
+ PartPair p = partPair(Partition::notDeleted);
+ changeNumbers(p.begin(), p.end(), nr, -1);
}
- y2mil("ret:" << ret);
- return( ret );
+ y2mil("ret:" << ret);
+ return ret;
}
-int Dasd::createPartition( PartitionType type, unsigned long start,
- unsigned long len, string& device,
- bool checkRelaxed )
- {
- y2mil("begin type:" << toString(type) << " start:" << start << " len:" << len << " relaxed:"
- << checkRelaxed);
- int ret = createChecks(type, Region(start, len), checkRelaxed);
- int number = 0;
- if( ret==0 )
- {
- number = availablePartNumber( type );
- if( number==0 )
- {
- ret = DISK_PARTITION_NO_FREE_NUMBER;
- }
- else
- {
- PartPair p = partPair(Partition::notDeleted);
- number = 1;
- PartIter i = p.begin();
- while( i!=p.end() && i->cylStart()<start )
+
+ int
+ Dasd::createPartition(PartitionType type, unsigned long start, unsigned long len,
+ string& device, bool checkRelaxed)
+ {
+ y2mil("begin type:" << toString(type) << " start:" << start << " len:" <<
+ len << " relaxed:" << checkRelaxed);
+ int ret = createChecks(type, Region(start, len), checkRelaxed);
+ int number = 0;
+ if (ret == 0)
+ {
+ number = availablePartNumber(type);
+ if (number == 0)
+ {
+ ret = DISK_PARTITION_NO_FREE_NUMBER;
+ }
+ else
+ {
+ PartPair p = partPair(Partition::notDeleted);
+ number = 1;
+ PartIter i = p.begin();
+ while (i!=p.end() && i->cylStart() < start)
{
- number++;
- ++i;
+ number++;
+ ++i;
}
- y2mil("number:" << number);
- changeNumbers( p.begin(), p.end(), number-1, 1 );
+ y2mil("number:" << number);
+ changeNumbers(p.begin(), p.end(), number - 1, 1);
}
}
- if( ret==0 )
+ if (ret == 0)
{
- Partition * p = new Partition(*this, getPartName(number), getPartDevice(number), number,
- cylinderToKb(len), Region(start, len), type);
- p->setCreated();
- device = p->device();
- PartPair pp = partPair();
- for( PartIter i = pp.begin(); i != pp.end(); ++i)
+ Partition * p = new Partition(*this, getPartName(number), getPartDevice(number), number,
+ cylinderToKb(len), Region(start, len), type);
+ p->setCreated();
+ device = p->device();
+ PartPair pp = partPair();
+ for (PartIter i = pp.begin(); i != pp.end(); ++i)
{
- if (i->deleted() && i->nr()==p->nr() && !i->getCryptPwd().empty())
+ if (i->deleted() && i->nr()==p->nr() && !i->getCryptPwd().empty())
{
- y2mil("harvesting old password");
- p->setCryptPwd(i->getCryptPwd());
+ y2mil("harvesting old password");
+ p->setCryptPwd(i->getCryptPwd());
}
}
- addToList( p );
- }
- y2mil("ret:" << ret);
- return( ret );
- }
-
-Text Dasd::fdasdText() const
- {
- Text txt;
- // displayed text during action, %1$s is replaced by disk name (e.g. /dev/dasda),
- txt = sformat( _("Executing fdasd for disk %1$s"), dev.c_str() );
- return( txt );
- }
-
-int Dasd::doFdasd()
- {
- int ret = 0;
- getStorage()->showInfoCb( fdasdText(), silent );
- PartPair p = partPair();
- PartIter i = p.begin();
- while( ret==0 && i!=p.end() )
- {
- if( i->deleted() )
- {
- getStorage()->removeDmMapsTo( getPartDevice(i->OrigNr()) );
- i->prepareRemove();
- }
- ++i;
- }
- string inpname = getStorage()->tmpDir()+"/fdasd_inp";
- ofstream inpfile( inpname.c_str() );
- classic(inpfile);
- p = partPair(Partition::notDeleted);
- i = p.begin();
- while( i!=p.end() )
- {
- string start = decString(i->cylStart() * new_geometry.heads);
- string end = decString((i->cylEnd() + 1) * new_geometry.heads - 1);
- if( i->cylStart()==0 )
- start = "first";
- if( i->cylEnd()>=cylinders()-1 )
- end = "last";
- inpfile << "[" << start << "," << end << "]" << endl;
- ++i;
- }
- inpfile.close();
- SystemCmd cmd( "cat " + inpname );
- string cmd_line = FDASDBIN " -c " + inpname + " " + quote(device());
- if( execCheckFailed( cmd_line ) )
- {
- ret = DASD_FDASD_FAILED;
- }
- if( ret==0 )
- {
- ProcParts parts;
- p = partPair();
- i = p.begin();
- list<Partition*> rem_list;
- while( i!=p.end() )
- {
- if( i->deleted() )
- {
- rem_list.push_back( &(*i) );
- }
- if( i->created() )
- {
- unsigned long long s;
- Storage::waitForDevice(i->device());
- i->setCreated( false );
- if (parts.getSize(i->device(), s))
- {
- i->setSize( s );
- }
- ret = i->zeroIfNeeded();
- }
- ++i;
- }
- list<Partition*>::const_iterator pr = rem_list.begin();
- while( pr != rem_list.end() )
- {
- if( !removeFromList( *pr ) && ret==0 )
- ret = DISK_REMOVE_PARTITION_LIST_ERASE;
- ++pr;
- }
- del_ptable = false;
+ addToList(p);
}
- unlink( inpname.c_str() );
- y2mil("ret:" << ret);
- return( ret );
+ y2mil("ret:" << ret);
+ return ret;
}
-void
-Dasd::getCommitActions(list<commitAction>& l) const
+ void
+ Dasd::getCommitActions(list<commitAction>& l) const
{
- y2mil("begin:" << name() << " init_disk:" << init_disk);
- Disk::getCommitActions( l );
- if( init_disk )
+ y2mil("begin:" << name() << " init_disk:" << init_disk);
+ Disk::getCommitActions(l);
+ if (init_disk)
{
- l.remove_if(stage_is(DECREASE));
- l.push_front(commitAction(DECREASE, staticType(), dasdfmtText(false), this, true));
+ l.remove_if(stage_is(DECREASE));
+ l.push_front(commitAction(DECREASE, staticType(), dasdfmtText(false), this, true));
}
}
@@ -417,152 +234,125 @@
}
-void
-Dasd::getToCommit(CommitStage stage, list<const Container*>& col, list<const Volume*>& vol) const
-{
- unsigned long oco = col.size();
- unsigned long ovo = vol.size();
- if( stage==DECREASE )
- {
- ConstVolPair p = volPair( stageDecrease );
- if( !p.empty() )
- vol.push_back( &(*(p.begin())) );
- if( deleted() || init_disk )
- col.push_back( this );
- }
- else if( stage==INCREASE )
- {
- ConstVolPair p = volPair(stageIncrease);
- if( !p.empty() )
- {
- ConstVolIterator i = p.begin();
- vol.push_back( &(*i) );
- ++i;
- while( i!=p.end() )
- {
- if( i->needExtend()||i->needCrsetup() )
- vol.push_back( &(*i) );
- ++i;
- }
- }
- }
- else
- Disk::getToCommit( stage, col, vol );
- if( col.size()!=oco || vol.size()!=ovo )
- y2mil("stage:" << stage << " col:" << col.size() << " vol:" << vol.size());
-}
-
-
-int Dasd::commitChanges( CommitStage stage )
+ int
+ Dasd::commitChanges(CommitStage stage)
{
- y2mil("name:" << name() << " stage:" << stage);
- int ret = 0;
- if( stage==DECREASE && init_disk )
+ y2mil("name:" << name() << " stage:" << stage);
+ int ret = 0;
+ if (stage == DECREASE && init_disk)
{
- ret = doDasdfmt();
+ ret = doDasdfmt();
}
- if( ret==0 )
+ if (ret == 0)
{
- ret = Disk::commitChanges( stage );
+ ret = Disk::commitChanges(stage);
}
- y2mil("ret:" << ret);
- return( ret );
+ y2mil("ret:" << ret);
+ return ret;
}
-static bool needDasdfmt( const Disk&d )
- {
- bool ret = d.isDasd() && d.initializeDisk();
- return( ret );
+
+ static bool
+ needDasdfmt(const Disk& d)
+ {
+ return d.isDasd() && d.initializeDisk();
}
-int Dasd::doDasdfmt()
+
+ int
+ Dasd::doDasdfmt()
{
- int ret = 0;
- y2mil("dasd:" << device());
- list<Disk*> dl;
- list<string> devs;
- getStorage()->getDiskList( needDasdfmt, dl );
- if( !dl.empty() )
+ y2mil("dasd:" << device());
+
+ int ret = 0;
+ list<Disk*> dl;
+ list<string> devs;
+ getStorage()->getDiskList(needDasdfmt, dl);
+ if (!dl.empty())
{
- for( list<Disk*>::const_iterator i = dl.begin(); i!=dl.end(); ++i )
+ for (list<Disk*>::const_iterator i = dl.begin(); i != dl.end(); ++i)
{
- devs.push_back( undevDevice((*i)->device()) );
+ devs.push_back(undevDevice((*i)->device()));
}
- y2mil("devs:" << devs);
- getStorage()->showInfoCb( dasdfmtTexts(true, devs), silent );
- for( list<string>::iterator i = devs.begin(); i!=devs.end(); ++i )
+ y2mil("devs:" << devs);
+ getStorage()->showInfoCb(dasdfmtTexts(true, devs), silent);
+ for (list<string>::iterator i = devs.begin(); i != devs.end(); ++i)
{
- *i = "-f " + quote(normalizeDevice(*i));
+ *i = "-f " + quote(normalizeDevice(*i));
}
- string cmd_line = DASDFMTBIN " -Y -P 4 -b 4096 -y -m 1 -d cdl " + boost::join(devs, " ");
- y2mil("cmdline:" << cmd_line);
- CallbackProgressBar cb = getStorage()->getCallbackProgressBarTheOne();
- ProgressBar* progressbar = new DasdfmtProgressBar( cb );
- SystemCmd cmd;
- cmd.setOutputProcessor(progressbar);
- if( execCheckFailed( cmd, cmd_line ) )
+ string cmd_line = DASDFMTBIN " -Y -P 4 -b 4096 -y -m 1 -d cdl " +
+ boost::join(devs, " ");
+ y2mil("cmdline:" << cmd_line);
+ CallbackProgressBar cb = getStorage()->getCallbackProgressBarTheOne();
+ ProgressBar* progressbar = new DasdfmtProgressBar(cb);
+ SystemCmd cmd;
+ cmd.setOutputProcessor(progressbar);
+ if (execCheckFailed(cmd, cmd_line))
{
- ret = DASD_DASDFMT_FAILED;
+ ret = DASD_DASDFMT_FAILED;
}
- if( ret==0 )
+ if (ret == 0)
{
- SystemInfo systeminfo;
- for( list<Disk*>::iterator i = dl.begin(); i!=dl.end(); ++i )
+ SystemInfo systeminfo;
+ for (list<Disk*>::iterator i = dl.begin(); i!=dl.end(); ++i)
{
- Dasd * ds = static_cast<Dasd *>(*i);
- ds->detectPartitions(systeminfo);
- ds->resetInitDisk();
- ds->removeFromMemory();
+ Dasd * ds = static_cast<Dasd *>(*i);
+ ds->detectPartitions(systeminfo);
+ ds->resetInitDisk();
+ ds->removeFromMemory();
}
}
- delete progressbar;
+ delete progressbar;
}
- return( ret );
+
+ return ret;
}
-int Dasd::initializeDisk( bool value )
+
+ int
+ Dasd::initializeDisk(bool value)
{
- y2mil("value:" << value << " old:" << init_disk);
- int ret = 0;
- if( init_disk != value )
- {
- init_disk = value;
- if( init_disk )
- {
- new_geometry.heads = geometry.heads = 15;
- new_geometry.sectors = geometry.sectors = 12;
- y2mil("new geometry:" << geometry);
- size_k = geometry.sizeK();
- y2mil("new SizeK:" << size_k);
- ret = destroyPartitionTable( "dasd" );
- }
- else
- {
- PartPair p = partPair();
- PartIter i = p.begin();
- list<Partition*> rem_list;
- while( i!=p.end() )
+ y2mil("value:" << value << " old:" << init_disk);
+ int ret = 0;
+ if (init_disk != value)
+ {
+ init_disk = value;
+ if (init_disk)
+ {
+ new_geometry.heads = geometry.heads = 15;
+ new_geometry.sectors = geometry.sectors = 12;
+ y2mil("new geometry:" << geometry);
+ size_k = geometry.sizeK();
+ y2mil("new SizeK:" << size_k);
+ ret = destroyPartitionTable("dasd");
+ }
+ else
+ {
+ PartPair p = partPair();
+ PartIter i = p.begin();
+ list<Partition*> rem_list;
+ while (i != p.end())
{
- if( i->deleted() )
+ if (i->deleted())
{
- i->setDeleted(false);
+ i->setDeleted(false);
}
- if( i->created() )
+ if (i->created())
{
- rem_list.push_back( &(*i) );
+ rem_list.push_back(&(*i));
}
- ++i;
+ ++i;
}
- list<Partition*>::const_iterator pr = rem_list.begin();
- while( pr != rem_list.end() )
+ list<Partition*>::const_iterator pr = rem_list.begin();
+ while (pr != rem_list.end())
{
- if( !removeFromList( *pr ) && ret==0 )
- ret = DISK_REMOVE_PARTITION_LIST_ERASE;
- ++pr;
+ if (!removeFromList(*pr) && ret == 0)
+ ret = DISK_REMOVE_PARTITION_LIST_ERASE;
+ ++pr;
}
}
}
- return( ret );
+ return ret;
}
@@ -575,11 +365,11 @@
}
-std::ostream& operator<< (std::ostream& s, const Dasd& d )
+ std::ostream& operator<< (std::ostream& s, const Dasd& d)
{
- s << dynamic_cast<const Disk&>(d);
- s << " fmt:" << toString(d.fmt);
- return s;
+ s << dynamic_cast<const Disk&>(d);
+ s << " fmt:" << toString(d.fmt);
+ return s;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Dasd.h new/libstorage-2.25.9/storage/Dasd.h
--- old/libstorage-2.25.8/storage/Dasd.h 2014-01-22 10:39:57.000000000 +0100
+++ new/libstorage-2.25.9/storage/Dasd.h 2014-02-24 14:59:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) [2004-2010] Novell, Inc.
+ * Copyright (c) [2004-2014] Novell, Inc.
*
* All Rights Reserved.
*
@@ -34,9 +34,9 @@
class ProcParts;
-class Dasd : public Disk
+ class Dasd : public Disk
{
- friend class Storage;
+ friend class Storage;
public:
@@ -48,42 +48,32 @@
Dasd(const Dasd& c);
virtual ~Dasd();
- int createPartition( storage::PartitionType type, long unsigned start,
- long unsigned len, string& device,
- bool checkRelaxed=false );
- int removePartition( unsigned nr );
- int changePartitionId( unsigned nr, unsigned id ) { return 0; }
- int resizePartition( Partition* p, unsigned long newCyl );
- int initializeDisk( bool value );
+ int createPartition(PartitionType type, long unsigned start,
+ long unsigned len, string& device,
+ bool checkRelaxed = false);
+ int removePartition(unsigned nr);
+ int changePartitionId(unsigned nr, unsigned id) { return 0; }
+ int resizePartition(Partition* p, unsigned long newCyl) override;
+ int initializeDisk(bool value);
virtual string defaultLabel() const;
- Text fdasdText() const;
- Text dasdfmtText( bool doing ) const;
+ Text dasdfmtText(bool doing) const;
static Text dasdfmtTexts(bool doing, const list<string>& devs);
void getCommitActions(list<commitAction>& l) const;
- void getToCommit(storage::CommitStage stage, list<const Container*>& col,
- list<const Volume*>& vol) const;
- int commitChanges( storage::CommitStage stage );
+ int commitChanges(CommitStage stage);
protected:
- virtual void print( std::ostream& s ) const { s << *this; }
- virtual Container* getCopy() const { return( new Dasd( *this ) ); }
- bool detectPartitionsFdasd(SystemInfo& systeminfo);
+ virtual void print(std::ostream& s) const { s << *this; }
+ virtual Container* getCopy() const { return new Dasd(*this); }
bool detectPartitions(SystemInfo& systeminfo);
- virtual bool checkPartitionsValid(SystemInfo& systeminfo, const list<Partition*>& pl) const;
- bool checkFdasdOutput(SystemInfo& systeminfo);
- void redetectGeometry() {};
- int doCreate( Volume* v ) { return(doFdasd()); }
- int doRemove( Volume* v ) { return(init_disk?0:doFdasd()); }
- int doFdasd();
- int doResize( Volume* v );
- int doSetType( Volume* v ) { return 0; }
- int doCreateLabel() { return 0; }
+ void redetectGeometry() override {}
+ int doResize(Volume* v) override;
+ int doSetType(Volume* v) override { return 0; }
int doDasdfmt();
DasdFormat fmt;
- friend std::ostream& operator<< (std::ostream&, const Dasd& );
+ friend std::ostream& operator<< (std::ostream&, const Dasd&);
private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Dasdview.cc new/libstorage-2.25.9/storage/Dasdview.cc
--- old/libstorage-2.25.8/storage/Dasdview.cc 2014-02-03 10:49:03.000000000 +0100
+++ new/libstorage-2.25.9/storage/Dasdview.cc 2014-02-24 14:59:33.000000000 +0100
@@ -134,145 +134,4 @@
return s;
}
-
- Fdasd::Fdasd(const string& device)
- {
- SystemCmd cmd(FDASDBIN " --table " + quote(device));
-
- if (cmd.retcode() == 0)
- {
- scanGeometry(cmd);
-
- Regex part("^" + Regex::escape(device) + "[0123456789]+$");
- cmd.select( device );
- int cnt = cmd.numLines();
- for (int i = 0; i < cnt; ++i)
- {
- string line = cmd.getLine(i);
- string tmp = extractNthWord( 0, line );
- if( part.match(tmp) )
- {
- scanEntryLine(line);
- }
- }
- }
- else
- {
- y2err("fdasd failed");
- }
-
- y2mil("device:" << device << " geometry:" << geometry);
-
- for (const_iterator it = entries.begin(); it != entries.end(); ++it)
- y2mil(*it);
- }
-
-
- bool
- Fdasd::getEntry(unsigned num, Entry& entry) const
- {
- for (const_iterator it = entries.begin(); it != entries.end(); ++it)
- {
- if (it->num == num)
- {
- entry = *it;
- return true;
- }
- }
-
- return false;
- }
-
-
- std::ostream& operator<<(std::ostream& s, const Fdasd::Entry& e)
- {
- return s << "num:" << e.num << " cylRegion:" << e.cylRegion << " headRegion:"
- << e.headRegion;
- }
-
-
- void
- Fdasd::scanGeometry(SystemCmd& cmd)
- {
- if (cmd.select("cylinders") > 0)
- {
- string tmp = cmd.getLine(0, true);
- y2mil("Cylinder line:" << tmp);
- tmp = tmp.erase( 0, tmp.find( ':' ) + 1 );
- tmp >> geometry.cylinders;
- }
-
- if (cmd.select("tracks per cylinder") > 0)
- {
- string tmp = cmd.getLine(0, true);
- y2mil("Tracks line:" << tmp);
- tmp = tmp.erase( 0, tmp.find( ':' ) + 1 );
- tmp >> geometry.heads;
- }
-
- if (cmd.select("blocks per track") > 0)
- {
- string tmp = cmd.getLine(0, true);
- y2mil("Blocks line:" << tmp);
- tmp = tmp.erase( 0, tmp.find( ':' ) + 1 );
- tmp >> geometry.sectors;
- }
-
- if (cmd.select("bytes per block") > 0)
- {
- string tmp = cmd.getLine(0, true);
- y2mil("Bytes line:" << tmp);
- tmp = tmp.erase( 0, tmp.find( ':' ) + 1 );
- tmp >> geometry.sector_size;
- }
- }
-
-
- void
- Fdasd::scanEntryLine(const string& line)
- {
- std::istringstream Data(line);
- classic(Data);
-
- Entry entry;
-
- unsigned long StartM = 0;
- unsigned long EndM = 0;
- unsigned long SizeM = 0;
-
- string devname;
- Data >> devname >> StartM >> EndM >> SizeM;
-
- string::size_type pos = devname.find_last_not_of("0123456789");
- string(devname, pos + 1) >> entry.num;
-
- y2mil("Fields Num:" << entry.num << " Start:" << StartM << " End:" << EndM <<
- " Size:" << SizeM);
-
- assert(!Data.fail());
- assert(entry.num != 0);
-
- if (Data.fail() || entry.num == 0)
- {
- y2err("invalid line:" << line);
- return;
- }
-
- unsigned long start = StartM / geometry.heads;
- unsigned long csize = EndM / geometry.heads - start + 1;
- if( start+csize > geometry.cylinders )
- {
- csize = geometry.cylinders - start;
- y2mil("new csize:" << csize);
- }
- entry.cylRegion = Region(start, csize);
-
- entry.headRegion = Region(StartM, SizeM);
-
- y2mil("Fields num:" << entry.num << " cylRegion:" << entry.cylRegion << " headRegion:" <<
- entry.headRegion);
-
- entries.push_back(entry);
- }
-
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Dasdview.h new/libstorage-2.25.9/storage/Dasdview.h
--- old/libstorage-2.25.8/storage/Dasdview.h 2014-02-03 10:49:03.000000000 +0100
+++ new/libstorage-2.25.9/storage/Dasdview.h 2014-02-24 14:59:33.000000000 +0100
@@ -59,45 +59,6 @@
};
-
- class Fdasd
- {
-
- public:
-
- Fdasd(const string& device);
-
- struct Entry
- {
- Entry() : num(0) {}
-
- unsigned num;
- Region cylRegion;
- Region headRegion;
-
- friend std::ostream& operator<<(std::ostream& s, const Entry& e);
- };
-
- const Geometry& getGeometry() const { return geometry; }
-
- typedef vector<Entry>::const_iterator const_iterator;
-
- const vector<Entry>& getEntries() const { return entries; }
-
- bool getEntry(unsigned num, Entry& entry) const;
-
- private:
-
- typedef vector<Entry>::iterator iterator;
-
- Geometry geometry;
- vector<Entry> entries;
-
- void scanGeometry(SystemCmd& cmd);
- void scanEntryLine(const string& line);
-
- };
-
}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Disk.cc new/libstorage-2.25.9/storage/Disk.cc
--- old/libstorage-2.25.8/storage/Disk.cc 2014-02-21 11:40:44.000000000 +0100
+++ new/libstorage-2.25.9/storage/Disk.cc 2014-02-24 14:59:33.000000000 +0100
@@ -597,28 +597,28 @@
}
-bool
-Disk::checkFakePartition(SystemInfo& systeminfo, const list<Partition*>& pl) const
-{
- // For FBA DASDs without an partition table the kernel generates a fake
- // partition spanning almost the whole disk.
-
- if (isDasd() && detected_label.empty() && pl.size() == 1 && pl.front()->nr() == 1)
+ bool
+ Disk::checkFakePartition(SystemInfo& systeminfo, const list<Partition*>& pl) const
{
- Region disk_region = detectSysfsBlkRegion();
- Region part_region = pl.front()->detectSysfsBlkRegion();
-
- y2mil("disk:" << disk_region << " part:" << part_region);
+ // For FBA DASDs without an partition table the kernel generates a fake
+ // partition spanning almost the whole disk.
- if (disk_region.end() == part_region.end() && part_region.start() == 2)
+ if (isDasd() && detected_label.empty() && pl.size() == 1 && pl.front()->nr() == 1)
{
- y2mil("found fake partition on " << device());
- return true;
+ Region disk_region = detectSysfsBlkRegion();
+ Region part_region = pl.front()->detectSysfsBlkRegion();
+
+ y2mil("disk:" << disk_region << " part:" << part_region);
+
+ if (disk_region.end() == part_region.end() && part_region.start() == 2)
+ {
+ y2mil("found fake partition on " << device());
+ return true;
+ }
}
- }
- return false;
-}
+ return false;
+ }
bool
@@ -1605,6 +1605,7 @@
y2mil("stage:" << stage << " col:" << col.size() << " vol:" << vol.size());
}
+
int Disk::commitChanges( CommitStage stage, Volume* vol )
{
y2mil("name:" << name() << " stage:" << stage);
@@ -1624,6 +1625,7 @@
return( ret );
}
+
int Disk::commitChanges( CommitStage stage )
{
y2mil("name:" << name() << " stage:" << stage);
@@ -1988,7 +1990,7 @@
cmd_line << PARTEDCMD;
cmd_line << "--align=" << toString(getStorage()->getPartitionAlignment()) << " ";
cmd_line << quote(device()) << " unit cyl mkpart ";
- if( label != "sun" )
+ if (label != "dasd" && label != "sun")
{
switch( p->type() )
{
@@ -2172,9 +2174,14 @@
else
y2war( "suppressing failed removal del_ptable:" << del_ptable );
}
- ProcParts parts;
- if( parts.findDevice(getPartName(p->OrigNr())) )
- callDelpart( p->OrigNr() );
+ // only check for successful removal (kernel side) of partitions
+ // where no renumbering can happen
+ if (p->type() != LOGICAL && label != "dasd")
+ {
+ ProcParts parts;
+ if (parts.findDevice(getPartName(p->OrigNr())))
+ callDelpart(p->OrigNr());
+ }
}
if( ret==0 )
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Disk.h new/libstorage-2.25.9/storage/Disk.h
--- old/libstorage-2.25.8/storage/Disk.h 2014-02-20 16:09:58.000000000 +0100
+++ new/libstorage-2.25.9/storage/Disk.h 2014-02-24 14:59:33.000000000 +0100
@@ -97,7 +97,7 @@
Region detectSysfsBlkRegion(bool log_error = true) const;
unsigned numPartitions() const;
- bool isDasd() const { return( nm.find("dasd")==0 ); }
+ bool isDasd() const { return boost::starts_with(nm, "dasd"); }
bool isIScsi() const { return transport == ISCSI; }
static bool isIScsi(const Disk& d) { return d.isIScsi(); }
bool isLogical( unsigned nr ) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/Storage.cc new/libstorage-2.25.9/storage/Storage.cc
--- old/libstorage-2.25.8/storage/Storage.cc 2014-02-21 17:34:44.000000000 +0100
+++ new/libstorage-2.25.9/storage/Storage.cc 2014-02-24 14:59:33.000000000 +0100
@@ -812,9 +812,9 @@
list<DiskData> dl;
while( i!=dlist.end() )
{
- if( i->second.range > 1 && (i->second.size > 0 || i->first.find("dasd") == 0))
+ if (i->second.range > 1 && (i->second.size > 0 || boost::starts_with(i->first, "dasd")))
{
- DiskData::DTyp t = (i->first.find("dasd") == 0) ? DiskData::DASD : DiskData::DISK;
+ DiskData::DTyp t = boost::starts_with(i->first, "dasd") ? DiskData::DASD : DiskData::DISK;
if (t == DiskData::DASD)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/StorageDefines.h new/libstorage-2.25.9/storage/StorageDefines.h
--- old/libstorage-2.25.8/storage/StorageDefines.h 2014-01-23 14:42:45.000000000 +0100
+++ new/libstorage-2.25.9/storage/StorageDefines.h 2014-02-24 14:59:33.000000000 +0100
@@ -77,7 +77,6 @@
#define DASDFMTBIN "/sbin/dasdfmt"
#define DASDVIEWBIN "/sbin/dasdview"
-#define FDASDBIN "/sbin/fdasd"
#define UDEVADMBIN "/sbin/udevadm"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/StorageInterface.h new/libstorage-2.25.9/storage/StorageInterface.h
--- old/libstorage-2.25.8/storage/StorageInterface.h 2014-02-21 17:34:44.000000000 +0100
+++ new/libstorage-2.25.9/storage/StorageInterface.h 2014-02-24 14:59:33.000000000 +0100
@@ -882,7 +882,6 @@
DM_NOT_IN_LIST = -10006,
DASD_NOT_POSSIBLE = -11000,
- DASD_FDASD_FAILED = -11001,
DASD_DASDFMT_FAILED = -11002,
DMPART_CHANGE_READONLY = -12001,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/SystemInfo.h new/libstorage-2.25.9/storage/SystemInfo.h
--- old/libstorage-2.25.8/storage/SystemInfo.h 2014-02-14 09:32:43.000000000 +0100
+++ new/libstorage-2.25.9/storage/SystemInfo.h 2014-02-24 14:59:33.000000000 +0100
@@ -65,7 +65,6 @@
const Lsscsi& getLsscsi() { return *lsscsi; }
const Parted& getParted(const string& device) { return parteds.get(device); }
const Dasdview& getDasdview(const string& device) { return dasdviews.get(device); }
- const Fdasd& getFdasd(const string& device) { return fdasds.get(device); }
const CmdDmsetup& getCmdDmsetup() { return *cmddmsetup; }
const CmdCryptsetup& getCmdCryptsetup(const string& name) { return cmdcryptsetups.get(name); }
const CmdDmraid& getCmdDmraid() { return *cmddmraid; }
@@ -123,7 +122,6 @@
LazyObject<Blkid> blkid;
LazyObject<Lsscsi> lsscsi;
LazyObjects<Parted> parteds;
- LazyObjects<Fdasd> fdasds;
LazyObjects<Dasdview> dasdviews;
LazyObject<CmdDmsetup> cmddmsetup;
LazyObjects<CmdCryptsetup> cmdcryptsetups;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.8/storage/gen_md5sum.cc new/libstorage-2.25.9/storage/gen_md5sum.cc
--- old/libstorage-2.25.8/storage/gen_md5sum.cc 2014-02-21 17:35:40.000000000 +0100
+++ new/libstorage-2.25.9/storage/gen_md5sum.cc 2014-02-24 15:01:05.000000000 +0100
@@ -1,5 +1,5 @@
-#define SOURCES_MD5SUM "e038440b03be7c7a80ceb180dc3ed294"
-#define SOURCES_MD5_DATE " Fri 21 Feb 17:35:40 CET 2014 "
+#define SOURCES_MD5SUM "6b670645cb598698baf7428432785926"
+#define SOURCES_MD5_DATE " Mon 24 Feb 15:01:05 CET 2014 "
namespace storage
{
const char* GetSourceMd5() { return SOURCES_MD5SUM; }
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org