Author: aschnell
Date: Wed Jan 27 15:12:50 2010
New Revision: 60555
URL: http://svn.opensuse.org/viewcvs/yast?rev=60555&view=rev
Log:
- allow to set driver for IMSM without callback (bnc #574270)
Modified:
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h
branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes
branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.cc?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.cc Wed Jan 27 15:12:50 2010
@@ -2319,8 +2319,6 @@
bool MdPartCo::active = false;
-bool MdPartCo::handlingMd = false;
-
void MdPartCo::logData( const string& Dir ) {}
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.h?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/MdPartCo.h Wed Jan 27 15:12:50 2010
@@ -58,7 +58,6 @@
virtual ~MdPartCo();
-
unsigned long long sizeK() const { return size_k; }
const string& labelName() const { return disk->labelName(); }
const string& udevPath() const { return udev_path; }
@@ -171,10 +170,6 @@
/* Return true if there is no Filesystem on device (it can contain partition table). */
static bool hasFileSystem(const string& name);
-
- static void setHandlingDev(bool val) { handlingMd = val; }
- static bool isHandlingDev() { return handlingMd; }
-
static bool isImsmPlatform();
static bool matchRegex( const string& dev );
@@ -390,7 +385,7 @@
mutable storage::MdPartCoInfo info;
static bool active;
- static bool handlingMd;
+
};
}
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc Wed Jan 27 15:12:50 2010
@@ -135,6 +135,8 @@
fstab = NULL;
raidtab = NULL;
+ imsm_driver = IMSM_UNDECIDED;
+
logSystemInfo();
}
@@ -244,7 +246,7 @@
DmraidCo::activate( true );
waitForDevice();
//If user said No then this is the way it was before.
- if( MdPartCo::isHandlingDev() == false )
+ if (getImsmDriver() != IMSM_MDADM)
{
MdPartCo::activate(true, tmpDir() );
waitForDevice();
@@ -529,11 +531,12 @@
if( yesnoPopupCb(txt) )
{
ret = true;
- MdPartCo::setHandlingDev(true);
+ setImsmDriver(IMSM_MDADM);
}
else
{
ret = false;
+ setImsmDriver(IMSM_DMRAID);
}
}
else
@@ -6547,7 +6550,7 @@
y2mil("val:" << val);
if (val)
{
- if( MdPartCo::isHandlingDev() == true)
+ if (getImsmDriver() == IMSM_MDADM)
{
MdPartCo::activate(val, tmpDir());
Dm::activate(val);
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h Wed Jan 27 15:12:50 2010
@@ -476,11 +476,13 @@
int computeMdSize(MdType md_type, list<string> devices,
unsigned long long& sizeK);
+ void setImsmDriver(ImsmDriver val) { imsm_driver = val; }
+ ImsmDriver getImsmDriver() const { return imsm_driver; }
+
int getMdPartCoInfo( const string& name, MdPartCoInfo& info);
int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
MdPartCoInfo& info);
int getMdPartCoStateInfo(const string& name, MdPartCoStateInfo& info);
- bool useMdForImsm() { return MdPartCo::isHandlingDev(); }
int removeMdPartCo(const string& devName, bool destroySb);
int addNfsDevice( const string& nfsDev, const string& opts,
@@ -1929,6 +1931,8 @@
EtcFstab *fstab;
EtcRaidtab *raidtab;
+ ImsmDriver imsm_driver;
+
CallbackProgressBar progress_bar_cb;
CallbackShowInstallInfo install_info_cb;
CallbackInfoPopup info_popup_cb;
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h Wed Jan 27 15:12:50 2010
@@ -143,6 +143,9 @@
enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH,
MDPART, COTYPE_LAST_ENTRY };
+ enum ImsmDriver { IMSM_UNDECIDED, IMSM_DMRAID, IMSM_MDADM };
+
+
/**
* typedef for a pointer to a function that is called on progress bar events
*/
@@ -884,21 +887,19 @@
virtual int getContMdPartCoInfo( const string& name, ContainerInfo& cinfo,
MdPartCoInfo& info) = 0;
+ /**
+ * Set which driver should be used for IMSM Software RAIDs.
+ *
+ * @param driver driver to use for IMSM Software RAIDs.
+ */
+ virtual void setImsmDriver(ImsmDriver driver) = 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.
+ * Query which driver is used for IMSM Software RAIDs.
*
- * @return true if IMSM/ISW SW RAIDa are handled by Md/MdPart classes.
- * False otherwise.
+ * @return driver used for IMSM Software RAIDs.
*/
- virtual bool useMdForImsm() = 0;
+ virtual ImsmDriver getImsmDriver() const = 0;
/**
* Query all volumes found in system
Modified: branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes Wed Jan 27 15:12:50 2010
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Jan 27 15:09:27 CET 2010 - aschnell@suse.de
+
+- allow to set driver for IMSM without callback (bnc #574270)
+
+-------------------------------------------------------------------
Mon Jan 25 17:30:26 CET 2010 - aschnell@suse.de
- fixed default mount-by for multipath (bnc #572209)
Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp?rev=60555&r1=60554&r2=60555&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp Wed Jan 27 15:12:50 2010
@@ -164,6 +164,11 @@
"right_asymmetric" : LibStorage::RIGHT_ASYMMETRIC(),
"right_symmetric" : LibStorage::RIGHT_SYMMETRIC() ];
+map