From d50c5f4c7df4e17eeb27cf89126200a52bd3397c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 Apr 2011 17:58:51 +0100 Subject: [PATCH] inspector: Include in output. Cherry picked from commit 36d3a4ce53317b104d48b60c9fe1ed679065d1d4 and rebased for stable-1.8 branch. --- inspector/example-debian.xml | 1 + inspector/example-fedora.xml | 1 + inspector/example-ubuntu.xml | 1 + inspector/example-windows.xml | 1 + inspector/virt-inspector.c | 8 ++++++++ inspector/virt-inspector.rng | 1 + 6 files changed, 13 insertions(+) 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 @@ + -- 1.8.3.1