diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-05-19 12:21:32 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-05-19 12:21:32 +0100 |
commit | 4c7183285105fd74496133c059a093b78dbe7723 (patch) | |
tree | 88ac336db5543070000c230cfdfba827a2fd6a88 /inspector | |
parent | 1fc41b39dac877ccec1284da8bb14baa4df368b8 (diff) | |
download | libguestfs-4c7183285105fd74496133c059a093b78dbe7723.tar.gz libguestfs-4c7183285105fd74496133c059a093b78dbe7723.tar.xz libguestfs-4c7183285105fd74496133c059a093b78dbe7723.zip |
virt-inspector now lists installed modules.
Diffstat (limited to 'inspector')
-rwxr-xr-x | inspector/virt-inspector.pl | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl index 76c90967..4ee0e08a 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 "<kernel>\n"; print "<version>$_->{version}</version>\n"; - - - - - - + print "<modules>\n"; + my @modules = @{$_->{modules}}; + foreach (@modules) { + print "<module>$_</module>\n"; + } + print "</modules>\n"; print "</kernel>\n"; } print "</kernels>\n"; |