git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 1.10.11.
[libguestfs.git]
/
inspector
/
virt-inspector.c
diff --git
a/inspector/virt-inspector.c
b/inspector/virt-inspector.c
index
7724be6
..
607e5ae
100644
(file)
--- a/
inspector/virt-inspector.c
+++ b/
inspector/virt-inspector.c
@@
-20,11
+20,13
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <getopt.h>
#include <locale.h>
#include <assert.h>
#include <inttypes.h>
#include <unistd.h>
#include <getopt.h>
#include <locale.h>
#include <assert.h>
+#include <libintl.h>
#include <libxml/xmlIO.h>
#include <libxml/xmlwriter.h>
#include <libxml/xmlIO.h>
#include <libxml/xmlwriter.h>
@@
-426,6
+428,14
@@
output_root (xmlTextWriterPtr xo, char *root)
free (str);
);
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);
+
str = guestfs_inspect_get_format (g, root);
if (!str) exit (EXIT_FAILURE);
if (STRNEQ (str, "unknown"))
str = guestfs_inspect_get_format (g, root);
if (!str) exit (EXIT_FAILURE);
if (STRNEQ (str, "unknown"))