[libvirt] [PATCH-v4 1/2] create virSocketAddrGetIpPrefix utility function

Laine Stump laine at laine.org
Mon Apr 22 15:48:13 UTC 2013


On 04/22/2013 10:20 AM, Laine Stump wrote:
> On 04/20/2013 03:45 PM, Gene Czarcinski wrote:
>> Create the utility function virSocketAddrGetIpPrefix() to
>> determine the prefix for this network.  The code in this
>> function was adapted from virNetworkIpDefPrefix().
>>
>> Update virNetworkIpDefPrefix() in src/conf/network_conf.c
>> to use the new utility function.
>> .
>> Signed-off-by: Gene Czarcinski <gene at czarc.net>
>> ---
> ACK. I'll push it after I've reviewed 2/2.


After going through patch 2/2, I realized that maintaining the "return
-1 when no prefix or netmask or address is specified" rule in this new
function will prevent someone from declaring a default route on a network:

     <route gateway='1.2.3.4'/>

because this will return -1. I checked all the callers of the original
function, and they all are already guaranteed to have a valid address,
so we can safely change the default case of this function to return 0.

I'm going to make that change and push this patch so that you don't have
to resubmit it with the new spin of 2/2 that I'm requesting.




More information about the libvir-list mailing list