X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=inspector%2Fvirt-inspector.c;h=2e3449ed1621710ed0569fb156d380a3f282db24;hb=913d5cd3a950a35f19581262250f58a871689d8c;hp=d3e00a9cfc3a192e820be71f04d1d3e859668ed9;hpb=75893a554c374f59318844bca3433e6a2d6c774b;p=libguestfs.git diff --git a/inspector/virt-inspector.c b/inspector/virt-inspector.c index d3e00a9..2e3449e 100644 --- a/inspector/virt-inspector.c +++ b/inspector/virt-inspector.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -407,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);