mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
inspector: show the per-OS osinfo guess (RHBZ#1544842)
Output also the osinfo guess for each OS in the generated XML output; adapt the RNG schema, and the test data to it.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<major_version>899</major_version>
|
||||
<minor_version>13</minor_version>
|
||||
<hostname>coreos.invalid</hostname>
|
||||
<osinfo>coreos899.13</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/sda5">/</mountpoint>
|
||||
<mountpoint dev="/dev/sda3">/usr</mountpoint>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<package_format>deb</package_format>
|
||||
<package_management>apt</package_management>
|
||||
<hostname>debian.invalid</hostname>
|
||||
<osinfo>debian5</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/debian/root">/</mountpoint>
|
||||
<mountpoint dev="/dev/debian/usr">/usr</mountpoint>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<package_format>rpm</package_format>
|
||||
<package_management>yum</package_management>
|
||||
<hostname>fedora.invalid</hostname>
|
||||
<osinfo>fedora14</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/VG/Root">/</mountpoint>
|
||||
<mountpoint dev="/dev/sda1">/boot</mountpoint>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<package_format>deb</package_format>
|
||||
<package_management>apt</package_management>
|
||||
<hostname>ubuntu.invalid</hostname>
|
||||
<osinfo>ubuntu10.10</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/sda2">/</mountpoint>
|
||||
<mountpoint dev="/dev/sda1">/boot</mountpoint>
|
||||
|
||||
@@ -443,6 +443,13 @@ output_root (xmlTextWriterPtr xo, char *root)
|
||||
BAD_CAST str));
|
||||
free (str);
|
||||
|
||||
str = guestfs_inspect_get_osinfo (g, root);
|
||||
if (!str) exit (EXIT_FAILURE);
|
||||
if (STRNEQ (str, "unknown"))
|
||||
XMLERROR (-1,
|
||||
xmlTextWriterWriteElement (xo, BAD_CAST "osinfo", BAD_CAST str));
|
||||
free (str);
|
||||
|
||||
output_mountpoints (xo, root);
|
||||
|
||||
output_filesystems (xo, root);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<optional><ref name="ospackageformat"/></optional>
|
||||
<optional><ref name="ospackagemanagement"/></optional>
|
||||
<optional><element name="hostname"><text/></element></optional>
|
||||
<optional><element name="osinfo"><text/></element></optional>
|
||||
|
||||
<ref name="mountpoints"/>
|
||||
<ref name="filesystems"/>
|
||||
|
||||
Reference in New Issue
Block a user