Author: mpatelcz Date: Mon Oct 26 14:39:53 2009 New Revision: 59197 URL: http://svn.opensuse.org/viewcvs/yast?rev=59197&view=rev Log: added useMdForIMSM() function to StorageInterface.h Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.cc branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.cc branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.h branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.cc branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.h branches/tmp/mpatelcz/SP1-md/libstorage/src/StorageInterface.h Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.cc?rev=59197&r1=59196&r2=59197&view=diff ============================================================================== --- branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.cc (original) +++ branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPart.cc Mon Oct 26 14:39:53 2009 @@ -63,7 +63,6 @@ y2deb("destructed MdPart " << dev); } -//FIXME void MdPart::init( const string& name ) { p = NULL; Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.cc?rev=59197&r1=59196&r2=59197&view=diff ============================================================================== --- branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.cc (original) +++ branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.cc Mon Oct 26 14:39:53 2009 @@ -70,6 +70,11 @@ y2mil("Initializing Partitions"); init( ppart ); + is_copy = false; + if( sto->instsys() == false ) + { + handlingMd = true; + } devHandled.push_back(name); } @@ -82,7 +87,22 @@ } y2deb("destructed MdPart co " << dev); - //FIXME: Remove. + if( is_copy == false ) + { + for(list<string>::iterator i = devHandled.begin(); + i != devHandled.end(); + i++) + { + if( nm == undevName(*i) ) + { + devHandled.remove((*i)); + } + } + if( devHandled.empty() && !sto->instsys() ) + { + handlingMd = false; + } + } } bool MdPartCo::isMdPart(const string& name) @@ -1269,6 +1289,7 @@ } updatePointers(true); num_part = rhs.num_part; + is_copy = true; } bool MdPartCo::isMdName(const string& name) Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.h?rev=59197&r1=59196&r2=59197&view=diff ============================================================================== --- branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.h (original) +++ branches/tmp/mpatelcz/SP1-md/libstorage/src/MdPartCo.h Mon Oct 26 14:39:53 2009 @@ -168,7 +168,7 @@ /* Return true if on RAID Volume is partition table */ static bool hasPartitionTable(const string& name ); - /* Return true if there is no partition table and no FS */ + /* Return true if there is no Filesystem on device (it can contain partition table). */ static bool hasFileSystem(const string& name); @@ -360,6 +360,7 @@ { return (md_type == RAID5 || md_type == RAID6 || md_type == RAID10); } mutable storage::MdPartCoInfo info; + bool is_copy; static bool active; Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.cc?rev=59197&r1=59196&r2=59197&view=diff ============================================================================== --- branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.cc (original) +++ branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.cc Mon Oct 26 14:39:53 2009 @@ -554,26 +554,16 @@ "Do you want to treat them as Partitionable RAID Volumes?" ), mdDevs.c_str() ); - storage::CallbackYesNoPopup cb = getCallbackYesNoPopup(); - - if( cb ) + if( yesnoPopupCb(txt) ) { - ret = cb(txt); - - if( ret == true ) - { - MdPartCo::setHandlingDev(true); - } - if( ret == false ) - { - MdPartCo::setHandlingDev(false); - //User said 'No' - switch off MD. - MdPartCo::activate( false, "" ); - } + ret = true; + MdPartCo::setHandlingDev(true); } else { - //No callback registered. + MdPartCo::setHandlingDev(false); + //User said 'No' - switch off MD. + MdPartCo::activate( false, "" ); ret = false; } // "Intel disk %1$s is not readable by\n" Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.h?rev=59197&r1=59196&r2=59197&view=diff ============================================================================== --- branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.h (original) +++ branches/tmp/mpatelcz/SP1-md/libstorage/src/Storage.h Mon Oct 26 14:39:53 2009 @@ -445,6 +445,7 @@ int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo, MdPartCoInfo& info); int getMdPartCoStateInfo(const string& name, MdPartCoStateInfo& info); + bool useMdForIMSM(void) { return MdPartCo::isHandlingDev(); } int addNfsDevice( const string& nfsDev, const string& opts, unsigned long long sizeK, const string& mp ); Modified: branches/tmp/mpatelcz/SP1-md/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mpatelcz/SP1-md/libstorage/src/StorageInterface.h?rev=59197&r1=59196&r2=59197&view=diff ============================================================================== --- branches/tmp/mpatelcz/SP1-md/libstorage/src/StorageInterface.h (original) +++ branches/tmp/mpatelcz/SP1-md/libstorage/src/StorageInterface.h Mon Oct 26 14:39:53 2009 @@ -860,6 +860,23 @@ */ virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo, MdPartCoInfo& info) = 0; + + /** + * Checks if Md and MdPart are used for IMSM/ISW SW RAIDs. + * + * In 'normal mode' it will become true after first MdPart class is + * created and it will true until such class exist. + * In 'install mode' it will be true: + * a) if clean or partitioned IMSM RAIDs were detected and no YesOrNo + * callback was registered. + * b) if clean or partitioned IMSM RAIDs were detected and user chose + * 'yes' when asked to use Md classes for IMSM/ISW RAIDs. + * + * @return true if IMSM/ISW SW RAIDa are handled by Md/MdPart classes. + * False otherwise. + */ + virtual bool useMdForIMSM(void) = 0; + /** * Query all volumes found in system * -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org