[libvirt] [PATCH V2] Fix parsing of bond interface XML

Eric Blake eblake at redhat.com
Thu Mar 21 23:25:11 UTC 2013


On 03/21/2013 05:13 PM, Jim Fehlig wrote:
> Noticed that parsing bond interface XML containing the miimon element
> fails
> 
>   <interface type="bond" name="bond0">
>     ...
>     <bond mode="active-backup">
>       <miimon freq="100" carrier="netif"/>
>       ...
>     </bond>
>   </interface>
> 
> This configuration does not contain the optional updelay and downdelay
> attributes, but parsing will fail due to returning the result of
> virXPathULong (a -1 when the attribute doesn't exist) from
> virInterfaceDefParseBond after examining the updelay attribute.
> 
> While fixing this bug, cleanup the function to use virXPathInt instead
> of virXPathULong, and store the result directly instead of using a tmp
> variable.  Using virXPathInt actually fixes a potential silent
> truncation bug noted by Eric Blake.
> 
> Also, there is no cleaup in the error label.  Remove the label,

s/cleaup/cleanup/

> returning failure where failure occurs and success if the end of the
> function is reached.
> ---
> 

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130321/8f1b3750/attachment-0001.sig>


More information about the libvir-list mailing list