Add caution subdirectory containing safety and liveness tests.
[libguestfs.git] / inspector / virt-inspector.c
index 4d2824c..2e3449e 100644 (file)
@@ -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);