Change in vdsm[master]: XMLRPCServer: make XMLRPCServer able to listen on IPv6 addre...

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Wed May 22 06:08:12 UTC 2013


Zhou Zheng Sheng has posted comments on this change.

Change subject: XMLRPCServer: make XMLRPCServer able to listen on IPv6 addresses
......................................................................


Patch Set 4: I would prefer that you didn't submit this

I test your patch, it works with some problems.

How to test:
Build and install vdsm, edit /etc/vdsm/vdsm.conf , under [addresses] section, set

 management_ip = ::

Start vdsmd and use vdsClient to test.

 vdsClient -s '[::]:54321' getVdsCaps

and

 netstat -t -a -n -p | grep 54321

shows

 tcp6       0      0 :::54321                :::*                    LISTEN      21545/python
 
 

There are some problems as well.

1. Default management IP is empty. We need this IP when initiating BindingXMLRPC to determine the address family, so you should edit config.py, set the default management IP to "0.0.0.0". Unless you fix this, a normal IPv4 setup will fail.

2. JSON RPC binding does not support IPv6. When start VDSM using "::" as management IP, JSON RPC binding fails to run. Well this is as expected... You may fix it in future patches.

3. In caps.py, _getIfaceByIP does not support IPv6. If you "vdsClient -s '[::]:54321' getVdsCaps" twice, you will see the following exception in log.

Traceback (most recent call last):
  File "/usr/share/vdsm/BindingXMLRPC.py", line 931, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/BindingXMLRPC.py", line 302, in getCapabilities
    ret['info'].update(self.getServerInfo())
  File "/usr/share/vdsm/BindingXMLRPC.py", line 91, in getServerInfo
    'lastClientIface': caps._getIfaceByIP(last)}
  File "/usr/share/vdsm/caps.py", line 310, in _getIfaceByIP
    remote = struct.unpack('I', socket.inet_aton(addr))[0]
error: illegal IP address string passed to inet_aton

inet_aton is IPv4 specific. We should use inet_pton. Another problem is _getIfaceByIP reads /proc/net/route, this is IPv4 specific. For IPv6 we can use /proc/net/ipv6_route . So I suggest we firstly use getaddrinfo with the AI_NUMERICHOST flag to get the address family, and write a _getIfaceByIP6, then dispatch the invokation according to the address family. Unless we fix this, IPv6 for XMLRPC binding does not work. 

4. vdsm.vdscli does not support IPv6 very nicely. It thinks all the address string containing ":" has a port information, this is true for IPv4, but wrong for IPv6.

We can fix problem NO. 2 and 4 in future patches. I -1 for 1, 3.

--
To view, visit http://gerrit.ovirt.org/11520
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I50ab0ba59ac696da2d992afe453c6d3ceb111e94
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Hunt Xu <mhuntxu at gmail.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Hunt Xu <mhuntxu at gmail.com>
Gerrit-Reviewer: Petr Sebek <psebek at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list