From 6a2164b6cbc4f418eae6ef95e14dfe5e3b322f39 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 10 Mar 2017 16:15:14 -0500 Subject: [PATCH] Extra checking --- xCAT-server/lib/xcat/plugins/kvm.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 17d1a66b0..6a8433e37 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -1777,6 +1777,7 @@ sub rmvm { if ($disktype eq "cdrom") { next; } my @driver = $disk->parentNode()->findnodes("driver"); + unless ($driver[0]) { next; } my $drivertype = $driver[0]->getAttribute("type"); if (($drivertype eq "raw") || ($disktype eq "block")) { #For raw or block devices, do not remove, even if purge was specified. Log info message. @@ -1784,6 +1785,7 @@ sub rmvm { next; } my $file = $disk->getAttribute("file"); + unless ($file) { next; } # try to check the existence first, if cannot find, do nothing. # we do retry because we found sometimes the delete might fail