From 4c7183285105fd74496133c059a093b78dbe7723 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Tue, 19 May 2009 12:21:32 +0100 Subject: [PATCH] virt-inspector now lists installed modules. --- inspector/virt-inspector.pl | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl index 76c9096..4ee0e08 100755 --- a/inspector/virt-inspector.pl +++ b/inspector/virt-inspector.pl @@ -627,13 +627,15 @@ sub check_for_kernels my %kernel; $kernel{version} = $_; + # List modules. + my @modules; + foreach ($g->find ("/lib/modules/$_")) { + if (m,/([^/]+)\.ko,) { + push @modules, $1; + } + } - # XXX List modules. - - - - - + $kernel{modules} = \@modules; push @kernels, \%kernel; } @@ -730,10 +732,11 @@ sub output_text_os print " Kernels:\n"; my @kernels = @{$os->{kernels}}; foreach (@kernels) { - print " $_->{version}\n" - - - + print " $_->{version}\n"; + my @modules = @{$_->{modules}}; + foreach (@modules) { + print " $_\n"; + } } } @@ -793,12 +796,12 @@ sub output_xml_os foreach (@kernels) { print "\n"; print "$_->{version}\n"; - - - - - - + print "\n"; + my @modules = @{$_->{modules}}; + foreach (@modules) { + print "$_\n"; + } + print "\n"; print "\n"; } print "\n"; -- 1.8.3.1