[yast-commit] r53244 - /trunk/storage/libstorage/src/Volume.cc
Author: aschnell Date: Wed Nov 12 19:50:39 2008 New Revision: 53244 URL: http://svn.opensuse.org/viewcvs/yast?rev=53244&view=rev Log: - work on mount-by for multipath Modified: trunk/storage/libstorage/src/Volume.cc Modified: trunk/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc?rev=53244&r1=53243&r2=53244&view=diff ============================================================================== --- trunk/storage/libstorage/src/Volume.cc (original) +++ trunk/storage/libstorage/src/Volume.cc Wed Nov 12 19:50:39 2008 @@ -110,7 +110,7 @@ { MountByType mb = cont->getStorage()->getDefaultMountBy(); y2mil( "mby:" << mb_names[mb] << " type:" << cType() ); - if( cType()!=DISK && (mb==MOUNTBY_ID || mb==MOUNTBY_PATH) ) + if ((cType() != DISK && cType() != DMRAID && cType() != DMMULTIPATH) && (mb == MOUNTBY_ID || mb == MOUNTBY_PATH)) mb = MOUNTBY_DEVICE; if (cType() == NFSC && mb != MOUNTBY_DEVICE) mb = MOUNTBY_DEVICE; @@ -128,12 +128,14 @@ } +// TODO: allowedMountBy is never used bool Volume::allowedMountBy(storage::MountByType mby, const string& mp) { bool ret = true; - if( (cType()!=DISK && (mby==MOUNTBY_ID || mby==MOUNTBY_PATH)) || - (mp=="swap" && mby==MOUNTBY_UUID ) ) + if ((cType() != DISK && cType() != DMRAID && cType() != DMMULTIPATH) && (mby == MOUNTBY_ID || mby == MOUNTBY_PATH)) + ret = false; + if (mp == "swap" && mby == MOUNTBY_UUID) ret = false; if (cType() == NFSC && mby != MOUNTBY_DEVICE) ret = false; @@ -533,10 +535,12 @@ return( ret ); } -int Volume::changeMount( const string& m ) - { + +int +Volume::changeMount(const string& m) +{ int ret = 0; - y2milestone( "device:%s mount:%s", dev.c_str(), m.c_str() ); + y2mil("device:" << dev << " mount:" << m); if( (!m.empty() && m[0]!='/' && m!="swap") || m.find_first_of( " \t\n" ) != string::npos ) { @@ -559,14 +563,16 @@ mount_by = defaultMountBy(m); */ } - y2milestone( "ret:%d", ret ); - return( ret ); - } + y2mil("ret:" << ret); + return ret; +} -int Volume::changeMountBy( MountByType mby ) - { + +int +Volume::changeMountBy(MountByType mby) +{ int ret = 0; - y2milestone( "device:%s mby:%s", dev.c_str(), mbyTypeString(mby).c_str() ); + y2mil("device:" << dev << " mby:" << mbyTypeString(mby)); y2mil( "vorher:" << *this ); if( uby.type() != UB_NONE ) { @@ -588,7 +594,8 @@ } else if( mby == MOUNTBY_ID || mby == MOUNTBY_PATH ) { - if (cType() != DISK) + // TODO: why not use allowedMountBy()? + if (cType() != DISK && cType() != DMRAID && cType() != DMMULTIPATH) ret = VOLUME_MOUNTBY_UNSUPPORTED_BY_VOLUME; } if( ret==0 ) @@ -596,9 +603,10 @@ } y2mil( "nachher:" << *this ); y2mil( "needFstabUdpate:" << needFstabUpdate() ); - y2milestone( "ret:%d", ret ); - return( ret ); - } + y2mil("ret:" << ret); + return ret; +} + void Volume::updateFstabOptions() { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org