qga: move qga_get_host_name()

The function is specific to qemu-ga, no need to share it in QEMU.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Message-Id: <20220420132624.2439741-32-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-04-20 17:26:14 +04:00
parent 756a98dd70
commit 548fb0da73
7 changed files with 60 additions and 59 deletions

View file

@ -573,19 +573,6 @@ bool qemu_write_pidfile(const char *filename, Error **errp)
return true;
}
char *qemu_get_host_name(Error **errp)
{
wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = G_N_ELEMENTS(tmp);
if (GetComputerNameW(tmp, &size) == 0) {
error_setg_win32(errp, GetLastError(), "failed close handle");
return NULL;
}
return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
}
size_t qemu_get_host_physmem(void)
{
MEMORYSTATUSEX statex;