[yast-commit] r52589 - in /trunk/storage: ./ libstorage/src/ package/ storage/src/ storage/src/include/ storage/src/modules/
Author: aschnell Date: Mon Oct 27 15:08:31 2008 New Revision: 52589 URL: http://svn.opensuse.org/viewcvs/yast?rev=52589&view=rev Log: - provide simple interface to activate multipath if yast2-multipath is not available (bnc #438055) Added: trunk/storage/storage/src/multipath-simple.ycp Modified: trunk/storage/libstorage/src/Dm.h trunk/storage/libstorage/src/DmmultipathCo.cc trunk/storage/libstorage/src/DmmultipathCo.h trunk/storage/libstorage/src/LvmVg.h trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/Storage.h trunk/storage/libstorage/src/StorageInterface.h trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/Makefile.am trunk/storage/storage/src/include/ep-hd.ycp trunk/storage/storage/src/modules/Storage.ycp trunk/storage/yast2-storage.spec.in Modified: trunk/storage/libstorage/src/Dm.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dm.h?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/Dm.h (original) +++ trunk/storage/libstorage/src/Dm.h Mon Oct 27 15:08:31 2008 @@ -51,6 +51,8 @@ static bool notDeleted( const Dm& l ) { return( !l.deleted() ); } static void activate( bool val=true ); + static bool isActive() { return active; } + static string devToTable( const string& dev ); static string dmName( const string& table ); static int dmNumber( const string& table ); Modified: trunk/storage/libstorage/src/DmmultipathCo.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmmultipathCo.cc?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/DmmultipathCo.cc (original) +++ trunk/storage/libstorage/src/DmmultipathCo.cc Mon Oct 27 15:08:31 2008 @@ -130,10 +130,14 @@ if (active != val) { + bool lvm_active = LvmVg::isActive(); + LvmVg::activate(false); + SystemCmd c; if (val) { Dm::activate(true); + c.execute(MODPROBEBIN " dm-multipath"); c.execute(MULTIPATHBIN); } @@ -141,6 +145,10 @@ { c.execute(MULTIPATHBIN " -F"); } + + if (lvm_active) + LvmVg::activate(true); + active = val; } } @@ -154,8 +162,6 @@ SystemCmd c(MULTIPATHBIN " -d -v 2+ -ll"); if (c.numLines() > 0) { - active = true; - string line; unsigned i=0; @@ -194,6 +200,9 @@ l.push_back(unit); } } + + if (!l.empty()) + active = true; } y2mil("detected multipaths " << l); Modified: trunk/storage/libstorage/src/DmmultipathCo.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmmultipathCo.h?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/DmmultipathCo.h (original) +++ trunk/storage/libstorage/src/DmmultipathCo.h Mon Oct 27 15:08:31 2008 @@ -96,7 +96,8 @@ static string undevName( const string& name ); static void activate( bool val=true ); - static bool getActive() { return active; } + static bool isActive() { return active; } + static void getMultipaths( std::list<string>& l ); static bool multipathNotDeleted( const Dmmultipath&d ) { return( !d.deleted() ); } Modified: trunk/storage/libstorage/src/LvmVg.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/LvmVg.h?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/LvmVg.h (original) +++ trunk/storage/libstorage/src/LvmVg.h Mon Oct 27 15:08:31 2008 @@ -53,10 +53,11 @@ void logDifference( const Container& rhs ) const; static void activate( bool val=true ); + static bool isActive() { return active; } + static void getVgs( std::list<string>& l ); static bool lvNotDeleted( const LvmLv& l ) { return( !l.deleted() ); } - protected: // iterators over LVM LVs // protected typedefs for iterators over LVMLVs Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Mon Oct 27 15:08:31 2008 @@ -5684,15 +5684,6 @@ } -bool -Storage::getMultipathActive() -{ - bool ret = DmmultipathCo::getActive(); - y2mil("ret:" << ret); - return ret; -} - - int Storage::addFstabEntry( const string& device, const string& mount, const string& vfs, const string& options, unsigned freq, unsigned passno ) Modified: trunk/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.h (original) +++ trunk/storage/libstorage/src/Storage.h Mon Oct 27 15:08:31 2008 @@ -463,7 +463,6 @@ void handleHald( bool stop ); void activateHld( bool val=true ); void activateMultipath( bool val=true ); - bool getMultipathActive(); void removeDmTableTo( const Volume& vol ); void removeDmTableTo( const string& device ); bool removeDmTable( const string& table ); Modified: trunk/storage/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageInterface.h (original) +++ trunk/storage/libstorage/src/StorageInterface.h Mon Oct 27 15:08:31 2008 @@ -2084,13 +2084,6 @@ virtual void activateMultipath( bool val ) = 0; /** - * Query whether multipath is active or not. - * - * @return bool multipath active state - */ - virtual bool getMultipathActive() = 0; - - /** * Rescan all disks. * All currently detected objects are forgotten and a new scan * for all type of objects (disks, LVM, MD) is initiated. Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Mon Oct 27 15:08:31 2008 @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Mon Oct 27 11:54:55 CET 2008 - aschnell@suse.de -- allow querying of multipath state (needed for bnc #438055) +- provide simple interface to activate multipath if yast2-multipath + is not available (bnc #438055) - 2.17.45 ------------------------------------------------------------------- Modified: trunk/storage/storage/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/Makefile.am?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/storage/src/Makefile.am (original) +++ trunk/storage/storage/src/Makefile.am Mon Oct 27 15:08:31 2008 @@ -1,21 +1,20 @@ # # Makefile.am for storage/src # -# $Id$ -# SUBDIRS = include modules proposal -client_DATA = \ - inst_custom_part.ycp \ - inst_disk.ycp \ - inst_do_resize.ycp \ - inst_disk_proposal.ycp \ - inst_prepdisk.ycp \ - inst_resize_ui.ycp \ - inst_target_part.ycp \ - inst_target_selection.ycp \ - storage_finish.ycp +client_DATA = \ + inst_custom_part.ycp \ + inst_disk.ycp \ + inst_do_resize.ycp \ + inst_disk_proposal.ycp \ + inst_prepdisk.ycp \ + inst_resize_ui.ycp \ + inst_target_part.ycp \ + inst_target_selection.ycp \ + storage_finish.ycp \ + multipath-simple.ycp EXTRA_DIST = $(client_DATA) Modified: trunk/storage/storage/src/include/ep-hd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd.ycp?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-hd.ycp (original) +++ trunk/storage/storage/src/include/ep-hd.ycp Mon Oct 27 15:08:31 2008 @@ -63,7 +63,7 @@ configs = add(configs, `item(`id(`iscsi), _("Configure &iSCSI..."))); } - if (IsAvailable("multipath")) { + if (true) { // menu entry text configs = add(configs, `item(`id(`multipath), _("Configure &Multipath..."))); } @@ -164,9 +164,14 @@ break; case `multipath: - // popup text - CallConfig(_("Calling Multipath configuration cancels all current changes. + if (WFM::ClientExists("multipath")) + // popup text + CallConfig(_("Calling Multipath configuration cancels all current changes. Really call Multipath configuration?"), ["yast2-multipath"], "multipath"); + else + // popup text + CallConfig(_("Calling Multipath configuration cancels all current changes. +Really call Multipath configuration?"), nil, "multipath-simple"); break; case `dasd: Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Mon Oct 27 15:08:31 2008 @@ -4747,14 +4747,6 @@ } -global boolean GetMultipathActive() -{ - boolean ret = LibStorage::StorageInterface::getMultipathActive(sint); - y2milestone("GetMultipathActive ret:%1", ret); - return ret; -} - - /** * Writes fstab to the disk */ Added: trunk/storage/storage/src/multipath-simple.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/multipath-simple.ycp?rev=52589&view=auto ============================================================================== --- trunk/storage/storage/src/multipath-simple.ycp (added) +++ trunk/storage/storage/src/multipath-simple.ycp Mon Oct 27 15:08:31 2008 @@ -0,0 +1,12 @@ +{ + textdomain "storage"; + + import "Popup"; + import "Storage"; + + boolean activate = Popup::YesNo(_("Activate multipath?")); + + Storage::ActivateMultipath(activate); + + return true; +} Modified: trunk/storage/yast2-storage.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/yast2-storage.spec.in?rev=52589&r1=52588&r2=52589&view=diff ============================================================================== --- trunk/storage/yast2-storage.spec.in (original) +++ trunk/storage/yast2-storage.spec.in Mon Oct 27 15:08:31 2008 @@ -61,6 +61,7 @@ @clientdir@/partitions_proposal.ycp @clientdir@/disk.ycp @clientdir@/disk_worker.ycp +@clientdir@/multipath-simple.ycp @moduledir@/* @fillupdir@/sysconfig.storage -- 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