]> xenbits.xensource.com Git - libvirt.git/commit
util: introduce virSocketAddrParseAny
authorJim Fehlig <jfehlig@suse.com>
Mon, 26 Mar 2018 18:53:05 +0000 (12:53 -0600)
committerJim Fehlig <jfehlig@suse.com>
Thu, 5 Apr 2018 20:50:15 +0000 (14:50 -0600)
commit412afdb8f4f3f097d6baad3acaeb9e26dfd15836
treee2aad0fb04f35cbcbee290bc9bd1ef0da16696ec
parent09877303014e0297d2c2707be5167d932cc3f425
util: introduce virSocketAddrParseAny

When preparing for migration, the libxl driver creates a new TCP listen
socket for the incoming migration by calling virNetSocketNewListenTCP,
passing the destination host name. virNetSocketNewListenTCP calls
virSocketAddrParse to check if the host name is a wildcard address, in
which case it avoids adding the AI_ADDRCONFIG flag to the hints passed to
getaddrinfo. If the host name is not an IP address, virSocketAddrParse
reports an error

error : virSocketAddrParseInternal:121 : Cannot parse socket address
'myhost.example.com': Name or service not known

But virNetSocketNewListenTCP succeeds regardless and the overall migration
operation succeeds.

Introduce virSocketAddrParseAny and use it when simply testing if a host
name/addr is parsable.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/libvirt_private.syms
src/rpc/virnetsocket.c
src/util/virsocketaddr.c
src/util/virsocketaddr.h