]> xenbits.xensource.com Git - qemu-xen.git/commit
qga: Use qemu_get_host_name() instead of g_get_host_name()
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Jun 2020 18:19:36 +0000 (20:19 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 13 Jul 2020 22:44:58 +0000 (17:44 -0500)
commit0d3a8f32b1e0eca279da1b0cc793efc7250c3daf
treeceda40b154f14358f7a0b76a5168429fc5c29951
parente47f4765afcab2b78dfa5b0115abf64d1d49a5d3
qga: Use qemu_get_host_name() instead of g_get_host_name()

Problem with g_get_host_name() is that on the first call it saves
the hostname into a global variable and from then on, every
subsequent call returns the saved hostname. Even if the hostname
changes. This doesn't play nicely with guest agent, because if
the hostname is acquired before the guest is set up (e.g. on the
first boot, or before DHCP) we will report old, invalid hostname.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1845127
Signed-off-by: Michal Privoznik <mprivozn@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>
qga/commands.c