From e8fdde8ba7b9a5befdd951e54fe241406cadbc08 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 28 Jul 2008 13:53:41 +0000 Subject: [PATCH] -Move signal handler definition to after Xen plugin gets authoritative control over its process, make the Sys::Virt check more dynamic git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1951 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xen.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 757f3e813..771ae7034 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -158,16 +158,13 @@ sub preprocess_request { my $request = shift; if ($request->{_xcatdest}) { return [$request]; } #exit if preprocessed my $callback=shift; - unless ($libvirtsupport) { + unless ($libvirtsupport) { #Try to see if conditions changed since last check (no xCATd restart for it to take effect) + $libvirtsupport = eval { require Sys::Virt; }; + } + unless ($libvirtsupport) { #Still no Sys::Virt module $callback->({error=>"Sys::Virt perl module missing, unable to fulfill Xen plugin requirements",errorcode=>[42]}); return []; } - $SIG{INT} = $SIG{TERM} = sub { - foreach (keys %vm_comm_pids) { - kill 2, $_; - } - exit 0; - }; my @requests; my $noderange = $request->{node}; #Should be arrayref