summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-11-16 12:57:36 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-16 13:27:01 +0000
commitfab75c0337d7897d10ea5e95e47ac05eab81ace9 (patch)
treea1fee811daabdcbc98489dcbb47c4b6265a1d12a /generator
parent35afe0cb33c986bf595585a716ff259cf3415a1f (diff)
downloadlibguestfs-fab75c0337d7897d10ea5e95e47ac05eab81ace9.tar.gz
libguestfs-fab75c0337d7897d10ea5e95e47ac05eab81ace9.tar.xz
libguestfs-fab75c0337d7897d10ea5e95e47ac05eab81ace9.zip
New API: inspect-get-hostname to return the hostname of the guest.
This returns the hostname of the guest. Tested on RHEL, Fedora, Debian 5, Ubuntu 10.10, FreeBSD 8, Windows 7.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml15
1 files changed, 15 insertions, 0 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index 34a82bda..b4099388 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -1276,6 +1276,21 @@ If unavailable this is returned as an empty string C<\"\">.
Please read L<guestfs(3)/INSPECTION> for more details.");
+ ("inspect_get_hostname", (RString "hostname", [Device "root"], []), -1, [],
+ [],
+ "get hostname of the operating system",
+ "\
+This function should only be called with a root device string
+as returned by C<guestfs_inspect_os>.
+
+This function returns the hostname of the operating system
+as found by inspection of the guest's configuration files.
+
+If the hostname could not be determined, then the
+string C<unknown> is returned.
+
+Please read L<guestfs(3)/INSPECTION> for more details.");
+
]
(* daemon_functions are any functions which cause some action