[libvirt] adding a new libvirt xml element for File Descriptor backed memory for use with vhost-user

Mooney, Sean K sean.k.mooney at intel.com
Tue May 10 21:01:20 UTC 2016


I work mostly in OpenStack on enabling ovs with dpdk.

When deploying vms on host running ovs with dpdk vms are booted utilizing
Vhost-user interfaces.
Qemu support creating vms with vhost-user network interfaces as of v2.1.
Libvirt currently has support for requesting the use of vhost-user interfaces by added the following xml fragment

    <interface type='vhostuser'>
      <mac address='fa:16:3e:ea:2a:08'/>
      <source type='unix' path='/var/run/openvswitch/vhuf1204e0c-98' mode='client'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>

Send traffic via a vhost-user interface, the vhost-user frontend (provided by qemu) must share
the virtios ring to the vhost-backed via passing a file descript to the memory backing object
of the qemu instance as part of the port creation.

Today the only native  way to request Libvirt to create a vm who's memory is backed by a  memdev which can be
Accessed via a file descriptor is to request hugepage backed memory. This requires the operator to
Manage and configure hugepage on each of their compute hosts and take special care to ensure that vms are
Not placed on host were vhost-user interface are used if they do not request hugepages.

Today it is possible to use Libvirt to spawn a vm without hugepage memory and a file descriptor backed memdev
Via the use of the qemu:commandline element.

    <qemu:arg value='-object'/>
    <qemu:arg value='memory-backend-file,id=mem,size=1024M,mem-path=/var/lib/libvirt/qemu,share=on'/>
    <qemu:arg value='-numa'/>
    <qemu:arg value='node,memdev=mem'/>
    <qemu:arg value='-mem-prealloc'/>

I created a proof of concept patch to nova to demonstrate that this works however to support this usecase in
Nova a new xml element is required.

I would like to propose the introduction of  a new subelemnt to the memorybacking element to request file discrptro backed memory

<filedescriptor size_mb="1024" path="/var/lib/libvirt/qemu" prealloc="true" shared="on" />

The above  filedescriptor xml fragment above would then be parsed to generate the same qemu argument as the qemu:commandline fragment
Therefor allowing the creation of a vm with vhost-user interface without hugepage memory backing.

Before I start looking at the Libvirt code base I wanted to ask if the Libvirt community would be open to this change and what would be the best way
To approach enabling this feature.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160510/0dbca45e/attachment-0001.htm>

More information about the libvir-list mailing list