On Tue, 16 Oct 2007, Andrea Righi wrote:

> Frank Corrao wrote:
>>
>> Andrea,
>>
>> I think your patch will work just fine for my needs, though perhaps some
>> folks might like the ability to define logical volume size by extents.
>> Here is a patch against 3.8.2 - let me know what you think.
>>
>> Frank
>>
>
> Frank,
>
> your patch seems fine. I've two comments before cheking it in the
> official trunk on svn:
>
> 1) I would check when the size is defined both in extents and in bytes
> and in this case print at least a warning, for example something like:
>
> if (defined($lv->{size}) && defined($lv->{extent})) {
>    print "WARNING: size defined in bytes and extents for $lv_name: using the 
> size in bytes\n";
>    $lv_size = $lv->{size};
> }
>
> 2) could you post the patch again without the line wrapping? it's quite
> difficult to apply a patch that is not properly formatted (actually it's
> broken for the patch command).
>
> Thanks,
> -Andrea

Andrea,

Here is the updated patch:


--- Server.pm-orig      2007-10-10 08:20:41.000000000 -0400
+++ Server.pm   2007-10-17 08:32:14.000000000 -0400
@@ -1104,10 +1104,21 @@
              }
              # Get logical volume size -AR-
              my $lv_size = $lv->{size};
-            unless (defined($lv_size)) {
-                print "WARNING: undefined logical volume size! skipping volume 
creation.\n";
-                next;
+            my $lv_extent = $lv->{extent};
+            my $lv_vsize;
+            if (!defined($lv_size) && !defined($lv_extent)) {
+              print "WARNING: undefined logical volume size! skipping volume 
creation.\n";
+              next;
              }
+            if (defined($lv->{size}) && defined($lv->{extent})) {
+              print "WARNING: size defined in bytes and extents for $lv_name: 
using the size in bytes\n";
+            }
+            if (defined($lv_size)) {
+              $lv_vsize = "-L${lv_size}";
+            } else {
+              $lv_vsize = "-l${lv_extent}";
+            }
+
              # Get additional options (expressed in lvcreate format) -AR-
              my $lv_options = $lv->{lv_options};
              unless (defined($lv_options)) {
@@ -1115,7 +1126,7 @@
              }

              # Create the logical volume -AR-
-            $cmd = "lvcreate $lv_options -L${lv_size} -n $lv_name $group_name 
|| shellout";
+            $cmd = "lvcreate $lv_options $lv_vsize -n $lv_name $group_name || 
shellout";
              print $out qq(logmsg "$cmd"\n);
              print $out "$cmd\n";

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to