diff options
Diffstat (limited to 'qga/commands.c')
-rw-r--r-- | qga/commands.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qga/commands.c b/qga/commands.c index 4d92946820..57a31bb5ef 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -499,3 +499,14 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp) error_setg(errp, "invalid whence code %"PRId64, whence->u.value); return -1; } + +GuestHostName *qmp_guest_get_host_name(Error **err) +{ + GuestHostName *result = NULL; + gchar const *hostname = g_get_host_name(); + if (hostname != NULL) { + result = g_new0(GuestHostName, 1); + result->host_name = g_strdup(hostname); + } + return result; +} |