From f280d931ed57ce79ab9420e310b9203fc1101e85 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 22 Aug 2014 03:25:37 -0700 Subject: [PATCH] Fix bug 4257: chvm hugepage doesn't work with dfm on Powerlinux --- perl-xCAT/xCAT/FSPvm.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index 6271f4aa6..45e5bfc4f 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -801,6 +801,19 @@ sub do_op_extra_cmds { if ($op eq "lparname") { $action = "set_lpar_name"; } elsif ($op eq "huge_page") { + my @td = @$d; + @td[0] = 0; + my $tmphash = &query_cec_info_actions($request, $name, \@td, 1, ["get_huge_page"]); + if ($tmphash->{huge_page_avail}) { + if ($param > $tmphash->{huge_page_avail}) { + push @values, [$name, "No enough huge pages, only $tmphash->{huge_page_avail} pages available", 0]; + $param = $tmphash->{huge_page_avail}; + } + $param = "1/$param/$param"; + } else { + push @values, [$name, "No huge page available to configure", 0]; + next; + } $action = "set_huge_page"; } elsif ($op eq "vmcpus") { $action = "part_set_lpar_pending_proc";