Author: aschnell Date: Tue Jan 24 14:33:04 2012 New Revision: 67260 URL: http://svn.opensuse.org/viewcvs/yast?rev=67260&view=rev Log: - do not query user to autostart multipath in AutoYaST (bnc#742913) Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.h branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.cc?rev=67260&r1=67259&r2=67260&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.cc Tue Jan 24 14:33:04 2012 @@ -128,6 +128,14 @@ lengthof(imsm_driver_names)); + static const string multipath_autostart_names[] = { + "UNDECIDED", "ON", "OFF" + }; + + const vector<string> EnumInfo<MultipathAutostart>::names(multipath_autostart_names, multipath_autostart_names + + lengthof(multipath_autostart_names)); + + // strings must match "parted --align" option static const string part_align_names[] = { "optimal", "cylinder" Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.h?rev=67260&r1=67259&r2=67260&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Enum.h Tue Jan 24 14:33:04 2012 @@ -52,6 +52,7 @@ template <> struct EnumInfo<CType> { static const vector<string> names; }; template <> struct EnumInfo<Transport> { static const vector<string> names; }; template <> struct EnumInfo<ImsmDriver> { static const vector<string> names; }; + template <> struct EnumInfo<MultipathAutostart> { static const vector<string> names; }; template <> struct EnumInfo<PartAlign> { static const vector<string> names; }; Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc?rev=67260&r1=67259&r2=67260&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc Tue Jan 24 14:33:04 2012 @@ -109,7 +109,7 @@ partAlignment(ALIGN_OPTIMAL), defaultMountBy(MOUNTBY_ID), defaultFs(EXT3), defaultSubvolName(""), detectMounted(true), root_mounted(!instsys()), rootprefix(), fstab(NULL), mdadm(NULL), - imsm_driver(IMSM_UNDECIDED) + imsm_driver(IMSM_UNDECIDED), multipath_autostart(MPAS_UNDECIDED) { y2mil("constructed Storage with " << env); y2mil("libstorage version " VERSION); @@ -139,6 +139,14 @@ } y2mil("imsm_driver:" << toString(imsm_driver)); + tenv = getenv("LIBSTORAGE_MULTIPATH_AUTOSTART"); + if (tenv) + { + if (!toValue(tenv, multipath_autostart, false)) + y2war("unknown multipath autostart '" << tenv << "' in environment"); + } + y2mil("multipath_autostart:" << toString(multipath_autostart)); + logSystemInfo(); } @@ -223,7 +231,9 @@ if (instsys()) { - if (decideMultipath()) + decideMultipath(); + + if (multipath_autostart == MPAS_ON) DmmultipathCo::activate(true); } @@ -488,28 +498,28 @@ } - bool + void Storage::decideMultipath() { y2mil("decideMultipath"); if (getenv("LIBSTORAGE_NO_DMMULTIPATH") != NULL) - return false; + return; - SystemCmd c(MODPROBEBIN " dm-multipath"); - - CmdMultipath cmdmultipath(true); - if (cmdmultipath.looksLikeRealMultipath()) + if (multipath_autostart == MPAS_UNDECIDED) { - // popup text - Text txt = _("The system seems to have multipath hardware.\n" - "Do you want to activate multipath?"); + SystemCmd c(MODPROBEBIN " dm-multipath"); - if (yesnoPopupCb(txt)) - return true; - } + CmdMultipath cmdmultipath(true); + if (cmdmultipath.looksLikeRealMultipath()) + { + // popup text + Text txt = _("The system seems to have multipath hardware.\n" + "Do you want to activate multipath?"); - return false; + multipath_autostart = yesnoPopupCb(txt) ? MPAS_ON : MPAS_OFF; + } + } } Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h?rev=67260&r1=67259&r2=67260&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h Tue Jan 24 14:33:04 2012 @@ -522,6 +522,8 @@ list<int> getMdAllowedParity(MdType md_type, unsigned devices ); void setImsmDriver(ImsmDriver val) { imsm_driver = val; } ImsmDriver getImsmDriver() const { return imsm_driver; } + void setMultipathAutostart(MultipathAutostart val) { multipath_autostart = val; } + MultipathAutostart getMultipathAutostart() const { return multipath_autostart; } int getMdPartCoInfo( const string& name, MdPartCoInfo& info); int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo, @@ -2028,7 +2030,7 @@ void detectMds(SystemInfo& systeminfo); void detectBtrfs(SystemInfo& systeminfo); void detectMdParts(SystemInfo& systeminfo); - bool decideMultipath(); + void decideMultipath(); bool discoverMdPVols(); void detectLoops(SystemInfo& systeminfo); void detectNfs(const EtcFstab& fstab, SystemInfo& systeminfo); @@ -2123,6 +2125,7 @@ EtcMdadm* mdadm; ImsmDriver imsm_driver; + MultipathAutostart multipath_autostart; CallbackProgressBar progress_bar_cb; CallbackShowInstallInfo install_info_cb; Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h?rev=67260&r1=67259&r2=67260&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h Tue Jan 24 14:33:04 2012 @@ -162,6 +162,8 @@ enum ImsmDriver { IMSM_UNDECIDED, IMSM_DMRAID, IMSM_MDADM }; + enum MultipathAutostart { MPAS_UNDECIDED, MPAS_ON, MPAS_OFF }; + enum PartAlign { ALIGN_OPTIMAL, ALIGN_CYLINDER }; @@ -1041,6 +1043,20 @@ virtual ImsmDriver getImsmDriver() const = 0; /** + * Set whether multipath should be started automatically if detected. + * + * @param multipath_autostart value for automatically start of multipath. + */ + virtual void setMultipathAutostart(MultipathAutostart multipath_autostart) = 0; + + /** + * Query whether multipath should be started automatically if detected. + * + * @return value for automatically start of multipath. + */ + virtual MultipathAutostart getMultipathAutostart() const = 0; + + /** * Query all volumes found in system * * @param infos list of records that get filled with volume info 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=67260&r1=67259&r2=67260&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 Tue Jan 24 14:33:04 2012 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Tue Jan 24 14:15:29 CET 2012 - aschnell@suse.de + +- do not query user to autostart multipath in AutoYaST (bnc#742913) + +------------------------------------------------------------------- Tue Jan 24 13:28:45 CET 2012 - fehr@suse.de - ensure default mountby uuid for btrfs in all cases Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp?rev=67260&r1=67259&r2=67260&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp Tue Jan 24 14:33:04 2012 @@ -371,6 +371,11 @@ { LibStorage::StorageInterface::setDetectMountedVolumes(sint, false); LibStorage::StorageInterface::setRootPrefix(sint, Installation::destdir); + + if (Mode::autoinst() || Mode::autoupgrade()) + { + LibStorage::StorageInterface::setMultipathAutostart(sint, LibStorage::MPAS_OFF()); + } } conts = getContainers(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org