libvirt/src/util
Chris Lalancette 0117b7da68 Fix failing virGetHostname.
We've been running into a lot of situations where
virGetHostname() is returning "localhost", where a plain
gethostname() would have returned the correct thing.  This
is because virGetHostname() is *always* trying to canonicalize
the name returned from gethostname(), even when it doesn't
have to.

This patch changes virGetHostname so that if the value returned
from gethostname() is already FQDN or localhost, it returns
that string directly.  If the value returned from gethostname()
is a shortened hostname, then we try to canonicalize it.  If
that succeeds, we returned the canonicalized hostname.  If
that fails, and/or returns "localhost", then we just return
the original string we got from gethostname() and hope for
the best.

Note that after this patch it is up to clients to check whether
"localhost" is an allowed return value.  The only place
where it's currently not is in qemu migration.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-05-26 08:59:31 -04:00
..
authhelper.c esx: Move username and password helper functions to authhelper.c 2010-03-16 20:15:32 +01:00
authhelper.h esx: Move username and password helper functions to authhelper.c 2010-03-16 20:15:32 +01:00
bitmap.c Add simple bitmap operations to utils 2010-05-21 11:29:03 -06:00
bitmap.h build: fix cppi warnings 2010-05-21 16:02:18 -06:00
bridge.c build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
bridge.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
buf.c virBufferVSprintf: do not omit va_end(argptr) call 2010-02-19 18:32:23 +01:00
buf.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
cgroup.c maint: mark translatable string args of VIR_ERROR 2010-05-20 21:36:25 +02:00
cgroup.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
conf.c maint: add more free-like functions to the list and deal with fallout 2010-05-18 07:53:42 +02:00
conf.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
dnsmasq.c dnsmasqReload: avoid mingw link failure 2010-05-03 14:21:07 -06:00
dnsmasq.h Add dnsmasq module files 2010-04-26 17:20:02 +02:00
ebtables.c ebtablesAddRemoveRule, iptablesAddRemoveRule: don't skip va_end 2010-05-18 19:23:33 +02:00
ebtables.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
event.c Move all shared utility files to src/util/ 2009-09-21 14:41:47 +01:00
event.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
hash.c Fix up a comment in virHashUpdateEntry 2010-02-01 09:39:54 -05:00
hash.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
hooks.c build: use gnulib's sys/wait.h 2010-05-06 14:35:38 -06:00
hooks.h Add hook utilities 2010-03-29 18:21:04 +02:00
hostusb.c build: consistently use C99 varargs macros 2010-03-08 13:32:27 +01:00
hostusb.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
interface.c linux/if.h header is not available on non-Linux platforms 2010-04-26 21:07:11 +02:00
interface.h Consolidate interface related functions in interface.c 2010-04-13 10:57:11 -04:00
iptables.c ebtablesAddRemoveRule, iptablesAddRemoveRule: don't skip va_end 2010-05-18 19:23:33 +02:00
iptables.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
json.c build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
json.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
logging.c maint: don't mark VIR_WARN or VIR_WARN0 diagnostics for translation 2010-05-19 12:00:18 +02:00
logging.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
macvtap.c build: fix compilation without macvtap 2010-05-25 16:51:12 -06:00
macvtap.h vepa: parsing for 802.1Qb{g|h} XML 2010-05-25 17:37:00 -04:00
memory.c Implement variable length structure allocator 2010-04-14 00:46:13 -04:00
memory.h maint: another preprocessor fix 2010-04-15 11:39:10 -06:00
network.c maint: s/initialis/initializ/ 2010-04-07 09:48:07 -06:00
network.h Use libvirt's existing ipv6/ipv4 parser/printer rather than self-written ones 2010-03-30 11:18:04 -04:00
pci.c maint: don't mark VIR_WARN or VIR_WARN0 diagnostics for translation 2010-05-19 12:00:18 +02:00
pci.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
processinfo.c build: update gnulib 2010-05-06 14:35:38 -06:00
processinfo.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
qparams.c qparams.c: do not skip va_end, twice 2010-02-19 11:52:04 +01:00
qparams.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
stats_linux.c build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
stats_linux.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storage_file.c initialize "meta" in virStorageFileGetMetadata, not in each caller 2010-05-19 17:07:08 +02:00
storage_file.h Don't reset user/group/security label on shared filesystems during migrate 2010-05-14 09:21:24 -04:00
threads-pthread.c Add recursive locks 2010-03-26 18:01:15 +00:00
threads-pthread.h Move all shared utility files to src/util/ 2009-09-21 14:41:47 +01:00
threads-win32.c mingw: Fix two undefined symbols 2010-05-04 01:44:35 +02:00
threads-win32.h Move all shared utility files to src/util/ 2009-09-21 14:41:47 +01:00
threads.c build: rely on gnulib's pthread module 2010-05-06 14:35:37 -06:00
threads.h build: rely on gnulib's pthread module 2010-05-06 14:35:37 -06:00
util.c Fix failing virGetHostname. 2010-05-26 08:59:31 -04:00
util.h Fix failing virGetHostname. 2010-05-26 08:59:31 -04:00
uuid.c Expose a host UUID in the capabilities XML 2010-05-25 17:09:18 +01:00
uuid.h Expose a host UUID in the capabilities XML 2010-05-25 17:09:18 +01:00
virterror_internal.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
virterror.c virterror.c: avoid erroneous case "fall-through" 2010-04-06 19:34:20 +02:00
xml.c Introduce XML parsing utility functions 2010-03-23 15:40:04 +01:00
xml.h Introduce XML parsing utility functions 2010-03-23 15:40:04 +01:00