Virt-inspector can produce output in several formats, including a
readable text report, and XML for feeding into other programs.
Virt-inspector can produce output in several formats, including a
readable text report, and XML for feeding into other programs.
In the normal usage, use C<virt-inspector domname> where C<domname> is
the libvirt domain (see: C<virsh list --all>).
In the normal usage, use C<virt-inspector domname> where C<domname> is
the libvirt domain (see: C<virsh list --all>).
print $os->{arch}, " " if exists $os->{arch};
print $os->{major_version} if exists $os->{major_version};
print ".", $os->{minor_version} if exists $os->{minor_version};
print $os->{arch}, " " if exists $os->{arch};
print $os->{major_version} if exists $os->{major_version};
print ".", $os->{minor_version} if exists $os->{minor_version};
- print __" Kernels:\n";
- my @kernels = @{$os->{kernels}};
- foreach (@kernels) {
- print " $_->{version} ($_->{arch})\n";
- my @modules = @{$_->{modules}};
- foreach (@modules) {
- print " $_\n";
+ if ($os->{kernels}) {
+ print __" Kernels:\n";
+ my @kernels = @{$os->{kernels}};
+ foreach (@kernels) {
+ print " $_->{version} ($_->{arch})\n";
+ my @modules = @{$_->{modules}};
+ foreach (@modules) {
+ print " $_\n";
+ }
foreach ( [ "name" => "os" ],
[ "distro" => "distro" ],
foreach ( [ "name" => "os" ],
[ "distro" => "distro" ],
[ "arch" => "arch" ],
[ "major_version" => "major_version" ],
[ "minor_version" => "minor_version" ],
[ "arch" => "arch" ],
[ "major_version" => "major_version" ],
[ "minor_version" => "minor_version" ],
foreach (@apps) {
$xml->startTag("application");
$xml->dataElement("name", $_->{name});
foreach (@apps) {
$xml->startTag("application");
$xml->dataElement("name", $_->{name});
- $xml->startTag("kernels");
- my @kernels = @{$os->{kernels}};
- foreach (@kernels) {
- $xml->startTag("kernel",
- "version" => $_->{version},
- "arch" => $_->{arch});
- $xml->startTag("modules");
- my @modules = @{$_->{modules}};
- foreach (@modules) {
- $xml->dataElement("module", $_);
- }
- $xml->endTag("modules");
- $xml->dataElement("path", $_->{path}) if(defined($_->{path}));
- $xml->dataElement("package", $_->{package}) if(defined($_->{package}));
- $xml->endTag("kernel");
- }
- $xml->endTag("kernels");
+ $xml->startTag("kernels");
+ my @kernels = @{$os->{kernels}};
+ foreach (@kernels) {
+ $xml->startTag("kernel",
+ "version" => $_->{version},
+ "arch" => $_->{arch});
+ $xml->startTag("modules");
+ my @modules = @{$_->{modules}};
+ foreach (@modules) {
+ $xml->dataElement("module", $_);
+ }
+ $xml->endTag("modules");
+ $xml->dataElement("path", $_->{path}) if(defined($_->{path}));
+ $xml->dataElement("package", $_->{package}) if(defined($_->{package}));
+ $xml->endTag("kernel");
+ }
+ $xml->endTag("kernels");