From ecf7b06d5a23affa9e8e4f815b4467daeb2e7f00 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Thu, 24 Oct 2013 23:30:54 -0700 Subject: [PATCH] fix bug 3856: rmvm could remove cec --- perl-xCAT/xCAT/FSPvm.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index 09b885a7f..f81030134 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -1720,6 +1720,10 @@ sub remove { my @result = (); while (my ($mtms, $h) = each (%$hash)) { while (my ($name, $d) = each (%$h)) { + if (@$d[4] ne "lpar") { + push @result, [$name, "Node must be LPAR", 1]; + last; + } &clear_service_authority_lpar($request, $name, $d); my $values = &set_lpar_undefined($request, $name, $d); push @result, $values; @@ -1878,6 +1882,10 @@ sub mkspeclpar { my @nodes = keys(%$h); my $ent = $vmtab->getNodesAttribs(\@nodes, ['cpus', 'memory','physlots', 'othersettings']); while (my ($name, $d) = each (%$h)) { + if (@$d[4] ne 'lpar') { + push @result, [$name, "Node must be LPAR", 1]; + last; + } if (!exists($memhash->{run})) { my @td = @$d; @td[0] = 0; @@ -1954,6 +1962,10 @@ sub mkfulllpar { while (my ($mtms, $h) = each (%$hash)) { my $rethash; while (my ($name, $d) = each (%$h)) { + if (@$d[4] ne 'lpar') { + push @result, [$name, "Node must be LPAR", 1]; + last; + } if (!exists($rethash->{run})) { my @td = @$d; @td[0] = 0;