[libvirt] [PATCH 1/2] conf: Increase virNetDevBandwidthParse intelligence

John Ferlan jferlan at redhat.com
Tue Jan 13 15:26:24 UTC 2015



On 01/07/2015 12:31 PM, Michal Privoznik wrote:
> There's this function virNetDevBandwidthParse which parses the
> bandwidth XML snippet. But it's not clever much. For the
> following XML it allocates the virNetDevBandwidth structure even
> though it's completely empty:
> 
>     <bandwidth>
>     </bandwidth>
> 
> Later in the code there are some places where we check if
> bandwidth was set or not. And since we obtained pointer from the
> parsing function we think that it is when in fact it isn't.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/conf/domain_conf.c           | 10 ++++++----
>  src/conf/netdev_bandwidth_conf.c | 38 +++++++++++++++++++++++---------------
>  src/conf/netdev_bandwidth_conf.h |  7 ++++---
>  src/conf/network_conf.c          |  7 +++----
>  tests/virnetdevbandwidthtest.c   | 12 ++++++------
>  5 files changed, 42 insertions(+), 32 deletions(-)
> 

ACK

John




More information about the libvir-list mailing list