From: Richard W.M. Jones Date: Thu, 14 Apr 2011 16:58:51 +0000 (+0100) Subject: inspector: Include in output. X-Git-Tag: 1.8.6~4 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=d50c5f4c7df4e17eeb27cf89126200a52bd3397c;p=libguestfs.git inspector: Include in output. Cherry picked from commit 36d3a4ce53317b104d48b60c9fe1ed679065d1d4 and rebased for stable-1.8 branch. --- diff --git a/inspector/example-debian.xml b/inspector/example-debian.xml index cead573..089df4e 100644 --- a/inspector/example-debian.xml +++ b/inspector/example-debian.xml @@ -10,6 +10,7 @@ 0 deb apt + debian.invalid / /usr diff --git a/inspector/example-fedora.xml b/inspector/example-fedora.xml index 6e03a12..73769f8 100644 --- a/inspector/example-fedora.xml +++ b/inspector/example-fedora.xml @@ -10,6 +10,7 @@ 0 rpm yum + fedora.invalid / /boot diff --git a/inspector/example-ubuntu.xml b/inspector/example-ubuntu.xml index 61338e1..572ffb5 100644 --- a/inspector/example-ubuntu.xml +++ b/inspector/example-ubuntu.xml @@ -10,6 +10,7 @@ 10 deb apt + ubuntu.invalid / /boot diff --git a/inspector/example-windows.xml b/inspector/example-windows.xml index 346b2ed..67d099a 100644 --- a/inspector/example-windows.xml +++ b/inspector/example-windows.xml @@ -9,6 +9,7 @@ 6 1 /Windows + windows.invalid / diff --git a/inspector/virt-inspector.c b/inspector/virt-inspector.c index 4d2824c..2e3449e 100644 --- a/inspector/virt-inspector.c +++ b/inspector/virt-inspector.c @@ -408,6 +408,14 @@ output_root (xmlTextWriterPtr xo, char *root) free (str); ); + str = guestfs_inspect_get_hostname (g, root); + if (!str) exit (EXIT_FAILURE); + if (STRNEQ (str, "unknown")) + XMLERROR (-1, + xmlTextWriterWriteElement (xo, BAD_CAST "hostname", + BAD_CAST str)); + free (str); + output_mountpoints (xo, root); output_filesystems (xo, root); diff --git a/inspector/virt-inspector.rng b/inspector/virt-inspector.rng index 10aa6db..d35e752 100644 --- a/inspector/virt-inspector.rng +++ b/inspector/virt-inspector.rng @@ -39,6 +39,7 @@ +