]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
ts-xen-build-prep: break out gb2pe
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 17 Sep 2013 10:19:53 +0000 (11:19 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 17 Sep 2013 10:26:00 +0000 (11:26 +0100)
ts-xen-build-prep

index 3174b752aa94ac6916c8f6dca75633e7190029a0..4811205c4654a1c2617e41a2f91dfef1216a9d35 100755 (executable)
@@ -32,6 +32,11 @@ our ($vg);
 
 our $pe_size;
 
+sub gb2pe ($) {
+    my ($gb) = @_;
+    return $gb *1024.0*1024.0 / $pe_size;
+}
+
 sub lvextend_stage1 () {
     $vg=
         $ho->{Suite} =~ m/lenny/
@@ -71,7 +76,7 @@ sub lvextend1 ($$$) {
 
     my $do_limit_pe = sub { };
     if (defined $max_more_gb) {
-       my $max_more_pe = floor($max_more_gb *1024.0*1024.0 / $pe_size);
+       my $max_more_pe = floor(gb2pe($max_more_gb));
        $do_limit_pe = sub {
            my ($pevar, $twhat) = @_;
            logm("$what: $twhat: limit ${max_more_gb}G,".