From: Richard Jones Date: Tue, 19 May 2009 11:21:32 +0000 (+0100) Subject: virt-inspector now lists installed modules. X-Git-Tag: 1.0.27~3 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=4c7183285105fd74496133c059a093b78dbe7723;p=libguestfs.git virt-inspector now lists installed modules. --- 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";