From c3fc66defe5675e9819793d0dad6b46156467f63 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 17 May 2011 20:57:40 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9624 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 894596441..896c9aa14 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -4163,6 +4163,16 @@ sub listTree { $found = 1; last; } + + # Handle second level zVM + foreach my $vm(sort keys %{$tree{$cec}{$lpar}}) { + if ($vm eq $parent) { + # Add VM branch + $tree{$cec}{$lpar}{$parent}{$node} = {}; + $found = 1; + last; + } + } } # Exit loop if LPAR branch added @@ -4191,6 +4201,16 @@ sub listTree { $found = 1; last; } + + # Handle second level zVM + foreach my $vm(sort keys %{$tree{$cec}{$lpar}{$zvm}}) { + if ($vm eq $parent) { + # Add VM branch + $tree{$cec}{$lpar}{$zvm}{$parent}{$node} = $_->{'userid'}; + $found = 1; + last; + } + } } # Exit loop if zVM branch added @@ -4221,7 +4241,15 @@ sub listTree { # Loop through VMs foreach my $vm(sort keys %{$tree{$cec}{$lpar}{$zvm}}) { - xCAT::zvmUtils->printLn( $callback, " |__VM: $vm ($tree{$cec}{$lpar}{$zvm}{$vm})" ); + # Handle second level zVM + if (ref($tree{$cec}{$lpar}{$zvm}{$vm}) eq 'HASH') { + xCAT::zvmUtils->printLn( $callback, " |__zVM: $vm" ); + foreach my $vm2(sort keys %{$tree{$cec}{$lpar}{$zvm}{$vm}}) { + xCAT::zvmUtils->printLn( $callback, " |__VM: $vm2 ($tree{$cec}{$lpar}{$zvm}{$vm}{$vm2})" ); + } + } else { + xCAT::zvmUtils->printLn( $callback, " |__VM: $vm ($tree{$cec}{$lpar}{$zvm}{$vm})" ); + } } } }