print $os->{os}, " " if exists $os->{os};
print $os->{distro}, " " if exists $os->{distro};
+ 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 " ";
print __" Kernels:\n";
my @kernels = @{$os->{kernels}};
foreach (@kernels) {
- print " $_->{version}\n";
+ print " $_->{version} ($_->{arch})\n";
my @modules = @{$_->{modules}};
foreach (@modules) {
print " $_\n";
foreach ( [ "name" => "os" ],
[ "distro" => "distro" ],
+ [ "arch" => "arch" ],
[ "major_version" => "major_version" ],
[ "minor_version" => "minor_version" ],
[ "package_format" => "package_format" ],
}
$xml->endTag("applications");
+ if(defined($os->{boot}) && defined($os->{boot}->{configs})) {
+ my $default = $os->{boot}->{default};
+ my $configs = $os->{boot}->{configs};
+
+ $xml->startTag("boot");
+ for(my $i = 0; $i < scalar(@$configs); $i++) {
+ my $config = $configs->[$i];
+
+ my @attrs = ();
+ push(@attrs, ("default" => 1)) if($default == $i);
+ $xml->startTag("config", @attrs);
+ $xml->dataElement("title", $config->{title});
+ $xml->dataElement("kernel", $config->{kernel}->{version})
+ if(defined($config->{kernel}));
+ $xml->dataElement("cmdline", $config->{cmdline})
+ if(defined($config->{cmdline}));
+ $xml->endTag("config");
+ }
+ $xml->endTag("boot");
+ }
+
$xml->startTag("kernels");
my @kernels = @{$os->{kernels}};
foreach (@kernels) {
- $xml->startTag("kernel", "version" => $_->{version});
+ $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");
output_query_xen_domU_kernel ();
output_query_xen_pv_drivers ();
output_query_virtio_drivers ();
+ output_query_kernel_arch ();
+ output_query_userspace_arch ();
}
=item windows=(yes|no)
print "virtio_drivers=no\n";
}
+=item userspace_arch=(x86_64|...)
+
+Print the architecture of userspace.
+
+NB. For multi-boot VMs this can print several lines.
+
+=cut
+
+sub output_query_userspace_arch
+{
+ my %arches;
+
+ foreach my $os (keys %$oses) {
+ $arches{$oses->{$os}->{arch}} = 1 if exists $oses->{$os}->{arch};
+ }
+
+ foreach (sort keys %arches) {
+ print "userspace_arch=$_\n";
+ }
+}
+
+=item kernel_arch=(x86_64|...)
+
+Print the architecture of the kernel.
+
+NB. For multi-boot VMs this can print several lines.
+
+=cut
+
+sub output_query_kernel_arch
+{
+ my %arches;
+
+ foreach my $os (keys %$oses) {
+ foreach my $kernel (@{$oses->{$os}->{kernels}}) {
+ $arches{$kernel->{arch}} = 1 if exists $kernel->{arch};
+ }
+ }
+
+ foreach (sort keys %arches) {
+ print "kernel_arch=$_\n";
+ }
+}
+
=back
=head1 SEE ALSO