[yast-commit] r65541 - in /branches/SuSE-Code-11-SP2-Branch/storage: libstorage/src/Btrfs.cc libstorage/src/Btrfs.h libstorage/src/BtrfsCo.cc libstorage/src/BtrfsCo.h package/yast2-storage.changes
Author: aschnell Date: Mon Sep 5 14:46:18 2011 New Revision: 65541 URL: http://svn.opensuse.org/viewcvs/yast?rev=65541&view=rev Log: - handle device name change in btrfs (bnc#715652) Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc?rev=65541&r1=65540&r2=65541&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc Mon Sep 5 14:46:18 2011 @@ -485,6 +485,25 @@ return( ret ); } + + void + Btrfs::changeDeviceName( const string& old, const string& nw ) + { + if (dev == old) + { + Volume const* v; + if (getStorage()->findVolume(old, v)) + setNameDevice(v->name(), nw); + else + y2err("device " << old << " not fount"); + } + + list<string>::iterator i = find(dev_add.begin(), dev_add.end(), old); + if (i != dev_add.end()) + *i = nw; + } + + Text Btrfs::removeText(bool doing) const { Text txt; Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h?rev=65541&r1=65540&r2=65541&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h Mon Sep 5 14:46:18 2011 @@ -84,6 +84,7 @@ void unuseDev() const; int clearSignature(); + void changeDeviceName( const string& old, const string& nw ); static bool notDeleted( const Btrfs& l ) { return( !l.deleted() ); } static bool needCreateSubvol( const Btrfs& v ); Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc?rev=65541&r1=65540&r2=65541&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc Mon Sep 5 14:46:18 2011 @@ -473,6 +473,18 @@ return( ret ); } + + void + BtrfsCo::changeDeviceName( const string& old, const string& nw ) + { + BtrfsPair p = btrfsPair(); + for (BtrfsIter i = p.begin(); i != p.end(); ++i) + { + i->changeDeviceName( old, nw ); + } + } + + void BtrfsCo::logData(const string& Dir) const { Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h?rev=65541&r1=65540&r2=65541&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h Mon Sep 5 14:46:18 2011 @@ -57,6 +57,8 @@ int doRemove( Volume* v ); + void changeDeviceName( const string& old, const string& nw ); + static storage::CType staticType() { return storage::BTRFSC; } friend std::ostream& operator<< (std::ostream&, const BtrfsCo& ); Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=65541&r1=65540&r2=65541&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Mon Sep 5 14:46:18 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon Sep 05 14:17:29 CEST 2011 - aschnell@suse.de + +- handle device name change in btrfs (bnc#715652) + +------------------------------------------------------------------- Mon Sep 5 11:56:32 CEST 2011 - fehr@suse.de - fixed potential confusing text about disk init (bnc#715801) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org