
On Thu, Dec 11, 2014 at 01:51:45PM -0500, Laine Stump wrote:
On 11/13/2014 04:33 AM, Cédric Bosdonnat wrote:
@@ -4667,6 +4671,58 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, return ret; }
+static virDomainNetIpDefPtr +virDomainNetIpParseXML(xmlNodePtr node) +{ + /* Parse the prefix in every case */ + virDomainNetIpDefPtr ip = NULL; + char *prefixStr = NULL; + unsigned int prefixValue = 0; + char *familyStr = NULL; + int family = AF_UNSPEC; + char *address = NULL; + + if (!(prefixStr = virXMLPropString(node, "prefix")) || + (virStrToLong_ui(prefixStr, NULL, 10, &prefixValue) < 0)) { + // Don't shout, just warn as some old config may not have a prefix + VIR_WARN("Missing or invalid network prefix");
This warning is unnecessary. IPv6 address default to a prefix of 64 if none is specified, and ipv4 addresses to 8, 16, or 24 depending on the range of address you're in (this is specified in an RFC somewhere, basically class A, B, and C networks), and it's quite common for the default prefix to be the correct one. See the function virSocketAddrGetIpPrefix() for details/example.
- <ip address='172.14.5.6'/> + <ip address='172.14.5.6' family='ipv4'/>
Do we really want to automatically add the "ipv4" in there if it's not there? That seems like unnecessary churn and verbosity in the config.
Given that we will now allow use of IPv6 I think we need to be explicit about the address family. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|