From 1b798c9b391db77aa91b96cfa3d9c9ac329cb354 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 9 Apr 2009 14:10:38 +0000 Subject: [PATCH] -Ensure that kvm has Sys::Virt 0.2.0 module installed, will start using features only in 0.2.0 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3157 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 13ebcb51a..52da6978b 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -784,9 +784,15 @@ sub process_request { }; my $request = shift; my $callback = shift; - my $libvirtsupport = eval { require Sys::Virt; }; + my $libvirtsupport = eval { + require Sys::Virt; + if (Sys::Virt->VERSION < "0.2.0") { + die; + } + 1; + }; unless ($libvirtsupport) { #Still no Sys::Virt module - $callback->({error=>"Sys::Virt perl module missing, unable to fulfill KVM plugin requirements",errorcode=>[42]}); + $callback->({error=>"Sys::Virt perl module missing or older than 0.2.0, unable to fulfill KVM plugin requirements",errorcode=>[42]}); return []; } require Sys::Virt::Domain;