Author: aschnell
Date: Fri Jun 20 22:57:23 2008
New Revision: 48469
URL: http://svn.opensuse.org/viewcvs/yast?rev=48469&view=rev
Log:
- get next raid device name from libstorage
Modified:
branches/tmp/aschnell/part-redesign/libstorage/src/Storage.cc
branches/tmp/aschnell/part-redesign/libstorage/src/Storage.h
branches/tmp/aschnell/part-redesign/libstorage/src/StorageInterface.h
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp
Modified: branches/tmp/aschnell/part-redesign/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/libstorage/src/Storage.cc?rev=48469&r1=48468&r2=48469&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/libstorage/src/Storage.cc (original)
+++ branches/tmp/aschnell/part-redesign/libstorage/src/Storage.cc Fri Jun 20 22:57:23 2008
@@ -3277,6 +3277,20 @@
}
int
+Storage::nextFreeMd(int &nr, string &device)
+{
+ int ret = 0;
+ assertInit();
+ MdCo *md = NULL;
+ nr = 0;
+ if (haveMd(md))
+ nr = md->unusedNumber();
+ device = "/dev/md" + decString(nr);
+ y2milestone("ret:%d nr:%d device:%s", ret, nr, device.c_str());
+ return ret;
+}
+
+int
Storage::createMd( const string& name, MdType rtype,
const deque<string>& devs )
{
Modified: branches/tmp/aschnell/part-redesign/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/libstorage/src/Storage.h?rev=48469&r1=48468&r2=48469&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/libstorage/src/Storage.h (original)
+++ branches/tmp/aschnell/part-redesign/libstorage/src/Storage.h Fri Jun 20 22:57:23 2008
@@ -421,6 +421,7 @@
bool getNoEvms() { return( no_evms ); }
static bool getNoEv() { return( no_evms ); }
+ int nextFreeMd(int &nr, string &device);
int createMd( const string& name, storage::MdType rtype,
const deque<string>& devs );
int createMdAny( storage::MdType rtype, const deque<string>& devs,
Modified: branches/tmp/aschnell/part-redesign/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/libstorage/src/StorageInterface.h?rev=48469&r1=48468&r2=48469&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/libstorage/src/StorageInterface.h (original)
+++ branches/tmp/aschnell/part-redesign/libstorage/src/StorageInterface.h Fri Jun 20 22:57:23 2008
@@ -1680,6 +1680,15 @@
virtual int evmsActivate( bool force ) = 0;
/**
+ * Determine the device name of the next created software raid device
+ *
+ * @param nr is set to the number of the next created software raid device
+ * @param device is set to the device name of the next created software raid device
+ * @return zero if all is ok, a negative number to indicate an error
+ */
+ virtual int nextFreeMd(int &nr, string &device) = 0;
+
+ /**
* Create a Software raid device by name
*
* @param name name of software raid device to create (e.g. /dev/md0)
@@ -2170,7 +2179,7 @@
* @example byteToHumanString(4096, 2, false) -> "4.00 kB"
* @example byteToHumanString(1024*1024, 2, true) -> "1 MB"
*/
- virtual string byteToHumanString(unsigned long long size, int precision,
+ virtual string byteToHumanString(unsigned long long size, int precision,
bool omit_zeroes) const = 0;
};
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp?rev=48469&r1=48468&r2=48469&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp Fri Jun 20 22:57:23 2008
@@ -13,7 +13,7 @@
y2milestone("MiniWorkflowStepRaidTypeDevices data:%1", data);
symbol raid_type = `raid0;
-
+
list<string> devices = [];
@@ -139,7 +139,9 @@
{
map