summaryrefslogtreecommitdiffstats
path: root/perl/lib/Sys/Guestfs
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2010-05-07 14:58:32 +0100
committerRichard Jones <rjones@redhat.com>2010-05-14 17:02:20 +0100
commita57f15a0c434797c45b334f9ace5f18a3bef610a (patch)
tree127f84018cb514cef7c6dcb1c8732df3afd86857 /perl/lib/Sys/Guestfs
parent47bd233069261094f198f0fd14c57631ce69b4ec (diff)
downloadlibguestfs-a57f15a0c434797c45b334f9ace5f18a3bef610a.tar.gz
libguestfs-a57f15a0c434797c45b334f9ace5f18a3bef610a.tar.xz
libguestfs-a57f15a0c434797c45b334f9ace5f18a3bef610a.zip
Warn instead of dying if grub refers to non-existent kernel
(cherry picked from commit 4839d5142ca50818965866287932f9ded14729e6)
Diffstat (limited to 'perl/lib/Sys/Guestfs')
-rw-r--r--perl/lib/Sys/Guestfs/Lib.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm
index b6c4a31f..8ec487dc 100644
--- a/perl/lib/Sys/Guestfs/Lib.pm
+++ b/perl/lib/Sys/Guestfs/Lib.pm
@@ -1643,8 +1643,14 @@ sub _check_for_kernels
}
$config{cmdline} = join(' ', @args) if(scalar(@args) > 0);
- my $kernel =
- inspect_linux_kernel($g, $path, $os->{package_format});
+ my $kernel;
+ if ($g->exists($path)) {
+ $kernel =
+ inspect_linux_kernel($g, $path, $os->{package_format});
+ } else {
+ warn __x("grub refers to {path}, which doesn't exist\n",
+ path => $path);
+ }
# Check the kernel was recognised
if(defined($kernel)) {