Updated Polish translation
[libguestfs.git] / inspector / virt-inspector
index 86b1795..13673af 100755 (executable)
@@ -247,10 +247,9 @@ Windows), the distribution and version.
 The diagram above shows what we return for each OS.
 
 With the I<--xml> option the output is mapped into an XML document.
-Unfortunately there is no clear schema for this document
-(contributions welcome) but you can get an idea of the format by
-looking at other documents and as a last resort the source for this
-program.
+There is a RELAX-NG schema for this XML in the file
+I<virt-inspector.rng> which normally ships with virt-inspector, or can
+be found in the source.
 
 With the I<--fish> or I<--ro-fish> option the mount points are mapped to
 L<guestfish(1)> command line parameters, so that you can go in
@@ -550,23 +549,25 @@ sub output_xml_os
         $xml->endTag("boot");
     }
 
-    $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");
+    if ($os->{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");
     }
-    $xml->endTag("kernels");
 
     if (exists $os->{root}->{registry}) {
         $xml->startTag("windowsregistryentries");