1dd34bb xenconfig: support vif bandwidth in sexpr parser and formatter

Authored and Committed by Jim Fehlig 8 years ago
    xenconfig: support vif bandwidth in sexpr parser and formatter
    
    The xen sexpr config format has long supported specifying vif rate
    limiting, e.g.
    
      (device
        (vif
          (mac '00:16:3e:1b:b1:47')
          (rate '10240KB/s')
          ...
        )
      )
    
    Add support for mapping rate to and from <bandwidth> in the xenconfig
    sexpr 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 unit tests to check the conversion logic.
    
    This patch benefits both the old xen driver and the libxl driver.
    Both drivers gain support for vif bandwidth when converting to/from
    domXML and xen-sxpr. In addition, the old xen driver will now be
    able to handle vif 'rate' setting when communicating with xend.
    
        
file modified
+1 -0
file modified
+74 -0
file modified
+2 -0
file modified
+2 -0
file modified
+1 -0