From d85478a0aab2a26ca6b3a023fd98fc4229899c05 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 13 Aug 2010 12:34:32 +0000 Subject: [PATCH] -Preserve and use saved XML in more contexts git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7085 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index e1fd1d3eb..189e4578e 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -772,11 +772,11 @@ sub xhrm_satisfy { sub makedom { my $node=shift; my $cdloc = shift; + my $xml = shift; my $dom; - my $xml; - if ($confdata->{kvmnodedata}->{$node} and $confdata->{kvmnodedata}->{$node}->[0] and $confdata->{kvmnodedata}->{$node}->[0]->{xml}) { + if (not $xml and $confdata->{kvmnodedata}->{$node} and $confdata->{kvmnodedata}->{$node}->[0] and $confdata->{kvmnodedata}->{$node}->[0]->{xml}) { $xml = $confdata->{kvmnodedata}->{$node}->[0]->{xml}; - } else { + } elsif (not $xml) { $xml = build_xmldesc($node,$cdloc); } my $errstr; @@ -1059,21 +1059,27 @@ sub power { } } elsif ($subcommand eq 'off') { if ($dom) { + my $newxml=$dom->get_xml_description(); + $updatetable->{kvm_nodedata}->{$node}={xml=>$newxml}; $dom->destroy(); undef $dom; } else { $retstring .= "$status_noop"; } } elsif ($subcommand eq 'softoff') { if ($dom) { + my $newxml=$dom->get_xml_description(); + $updatetable->{kvm_nodedata}->{$node}={xml=>$newxml}; $dom->shutdown(); } else { $retstring .= "$status_noop"; } } elsif ($subcommand eq 'reset') { if ($dom) { + my $newxml=$dom->get_xml_description(); + $updatetable->{kvm_nodedata}->{$node}={xml=>$newxml}; $dom->destroy(); undef $dom; if ($use_xhrm) { xhrm_satisfy($node,$hyp); } - ($dom,$errstr) = makedom($node,$cdloc); + ($dom,$errstr) = makedom($node,$cdloc,$newxml); if ($errstr) { return (1,$errstr); } $retstring.="reset"; } else { $retstring .= "$status_noop"; }