]> xenbits.xensource.com Git - libvirt.git/commit
xenconfig: support vif bandwidth in xm and xl parser and formatter
authorJim Fehlig <jfehlig@suse.com>
Mon, 28 Dec 2015 22:26:17 +0000 (15:26 -0700)
committerJim Fehlig <jfehlig@suse.com>
Sat, 9 Jan 2016 01:56:00 +0000 (18:56 -0700)
commitec63000a62819bf29b930e8c43fa8ff9203ada4a
treec750a406af6959899de21bf088cbd1b5d9b2b94c
parent1dd34bbb4b70e163f1b303f43b7c3507d2db086b
xenconfig: support vif bandwidth in xm and xl parser and formatter

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@suse.com>
src/xenconfig/xen_common.c
tests/xlconfigdata/test-vif-rate.cfg [new file with mode: 0644]
tests/xlconfigdata/test-vif-rate.xml [new file with mode: 0644]
tests/xlconfigtest.c