mirror of
https://github.com/mborgerson/xemu.git
synced 2025-12-01 16:10:01 +00:00
util: Introduce qemu_get_host_name()
This function offers operating system agnostic way to fetch host name. It is implemented for both POSIX-like and Windows systems. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
committed by
Michael Roth
parent
844bd70b56
commit
e47f4765af
@ -655,4 +655,14 @@ static inline void qemu_reset_optind(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* qemu_get_host_name:
|
||||
* @errp: Error object
|
||||
*
|
||||
* Operating system agnostic way of querying host name.
|
||||
*
|
||||
* Returns allocated hostname (caller should free), NULL on failure.
|
||||
*/
|
||||
char *qemu_get_host_name(Error **errp);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user