On 01/07/2016 07:48 AM, Michal Privoznik wrote:
On 29.12.2015 02:09, Jim Fehlig wrote:
> Both xm and xl config have long supported specifying vif rate
> limiting, e.g.
>
> vif = [ 'mac=00:16:3E:74:3d:76,bridge=br0,rate=10MB/s' ]
>
> Add support for mapping rate to and from <bandwidth> in the xenconfig
> parser and formatter. rate is mapped to the required 'average' attribute
> of the <outbound> element, e.g.
>
> <interface type='bridge'>
> ...
> <bandwidth>
> <outbound average='10240'/>
> </bandwidth>
> </interface>
>
> Also add a unit test to check the conversion logic.
>
> Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
> ---
>
> I used a bit of code from libxlu_vif.c to implement xenParseVifRate()
> instead of using the libxlutil lib directly, since in theory rate limiting
> applies to the old xen driver (no libxl) as well.
>
> src/xenconfig/xen_common.c | 77 ++++++++++++++++++++++++++++++++++++
> tests/xlconfigdata/test-vif-rate.cfg | 26 ++++++++++++
> tests/xlconfigdata/test-vif-rate.xml | 57 ++++++++++++++++++++++++++
> tests/xlconfigtest.c | 1 +
> 4 files changed, 161 insertions(+)
ACK
Hi Michal,
Thanks a lot for taking a look at this series! Note that I posted a V2 earlier
this week which includes support for parsing/formatting vif bandwidth in sexpr
config too
https://www.redhat.com/archives/libvir-list/2016-January/msg00045.html
Unfortunately it results in some changes to this patch, so I think it would be
best to peek at the V2 series before pushing it.
Regards,
Jim