[libvirt PATCH 0/2] tests: Don't assume IPv4 connectivity is available

Andrea Bolognani abologna at redhat.com
Tue Jul 14 20:32:58 UTC 2020

I started looking into this after seeing

  FAIL: virnetsockettest

  TEST: virnetsockettest
   1) Socket TCP/IPv4 Accept                       ... libvirt: XML-RPC error : Unable to resolve address '' service '5672': Address family for hostname not supported
   2) Socket TCP/IPv6 Accept                       ... OK
   3) Socket TCP/IPv4+IPv6 Accept                  ... OK
   4) Socket TCP/IPv4+IPv6 Accept                  ... OK
   5) Socket UNIX Accept                           ... OK
   6) Socket UNIX Addrs                            ... OK
   7) Socket External Command /dev/zero            ... OK
   8) Socket External Command /dev/does-not-exist  ... libvirt: XML-RPC error : End of file while reading data: /bin/cat: /dev/does-not-exist: No such file or directory: Input/output error
   9) SSH test 1                                   ... OK
  10) SSH test 2                                   ... OK
  11) SSH test 3                                   ... OK
  12) SSH test 4                                   ... libvirt: XML-RPC error : End of file while reading data: Cannot connect to host nosuchhost: Input/output error
  13) SSH test 5                                   ... libvirt: XML-RPC error : End of file while reading data: : Input/output error
  14) SSH test 6                                   ... OK
  15) SSH test 7                                   ... OK

during a Debian package build.

Full log:


Just a few days ago, this issue was discussed in


and libvirt was mentioned explicitly as a package that could be
affected by it.

Reproducing the issue is quite simple: just remove all IPv4
addresses *except* the one assigned to 'lo', and you'll see it
immediately. The problem seems to be that, in this configuration,
virNetSocketCheckProtocols() reports that both IPv4 and IPv6 are
available, but XML-RPC is apparently not happy with that.

I'm pretty bad at networking, so I'm reporting this in the hope that
someone else will figure it out O:-)

Anyway, there's another scenario that I found while digging: if you
remove *all* IPv4 addresses, *including* the one assigned to 'lo',
you get a different failure. My patch addresses this last one.

Andrea Bolognani (2):
  tests: Don't assume IPv4 connectivity is available
  tests: Minimize variable scope

 tests/virnetsockettest.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)


More information about the libvir-list mailing list