<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I work mostly in OpenStack on enabling ovs with dpdk.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When deploying vms on host running ovs with dpdk vms are booted utilizing
<o:p></o:p></p>
<p class="MsoNormal">Vhost-user interfaces.<o:p></o:p></p>
<p class="MsoNormal">Qemu support creating vms with vhost-user network interfaces as of v2.1.<o:p></o:p></p>
<p class="MsoNormal">Libvirt currently has support for requesting the use of vhost-user interfaces by added the following xml fragment<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    <interface type='vhostuser'><o:p></o:p></p>
<p class="MsoNormal">      <mac address='fa:16:3e:ea:2a:08'/><o:p></o:p></p>
<p class="MsoNormal">      <source type='unix' path='/var/run/openvswitch/vhuf1204e0c-98' mode='client'/><o:p></o:p></p>
<p class="MsoNormal">      <model type='virtio'/><o:p></o:p></p>
<p class="MsoNormal">      <alias name='net0'/><o:p></o:p></p>
<p class="MsoNormal">      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/><o:p></o:p></p>
<p class="MsoNormal">    </interface><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Send traffic via a vhost-user interface, the vhost-user frontend (provided by qemu) must share
<o:p></o:p></p>
<p class="MsoNormal">the virtios ring to the vhost-backed via passing a file descript to the memory backing object<o:p></o:p></p>
<p class="MsoNormal">of the qemu instance as part of the port creation.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Today the only native  way to request Libvirt to create a vm who’s memory is backed by a  memdev which can be<o:p></o:p></p>
<p class="MsoNormal">Accessed via a file descriptor is to request hugepage backed memory. This requires the operator to<o:p></o:p></p>
<p class="MsoNormal">Manage and configure hugepage on each of their compute hosts and take special care to ensure that vms are<o:p></o:p></p>
<p class="MsoNormal">Not placed on host were vhost-user interface are used if they do not request hugepages.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Today it is possible to use Libvirt to spawn a vm without hugepage memory and a file descriptor backed memdev<o:p></o:p></p>
<p class="MsoNormal">Via the use of the qemu:commandline element.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">  <qemu:commandline><o:p></o:p></p>
<p class="MsoNormal">    <qemu:arg value='-object'/><o:p></o:p></p>
<p class="MsoNormal">    <qemu:arg value='memory-backend-file,id=mem,size=1024M,mem-path=/var/lib/libvirt/qemu,share=on'/><o:p></o:p></p>
<p class="MsoNormal">    <qemu:arg value='-numa'/><o:p></o:p></p>
<p class="MsoNormal">    <qemu:arg value='node,memdev=mem'/><o:p></o:p></p>
<p class="MsoNormal">    <qemu:arg value='-mem-prealloc'/><o:p></o:p></p>
<p class="MsoNormal">  </qemu:commandline><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I created a proof of concept patch to nova to demonstrate that this works however to support this usecase in<o:p></o:p></p>
<p class="MsoNormal">Nova a new xml element is required.<o:p></o:p></p>
<p class="MsoNormal"><a href="https://review.openstack.org/#/c/309565/1">https://review.openstack.org/#/c/309565/1</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I would like to propose the introduction of  a new subelemnt to the memorybacking element to request file discrptro backed memory<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><memoryBacking><o:p></o:p></p>
<p class="MsoNormal"><filedescriptor size_mb=”1024” path=”/var/lib/libvirt/qemu” prealloc=”true” shared=”on” />
<o:p></o:p></p>
<p class="MsoNormal"> </memoryBacking><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The above  filedescriptor xml fragment above would then be parsed to generate the same qemu argument as the qemu:commandline fragment<o:p></o:p></p>
<p class="MsoNormal">Therefor allowing the creation of a vm with vhost-user interface without hugepage memory backing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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
<o:p></o:p></p>
<p class="MsoNormal">To approach enabling this feature.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards<o:p></o:p></p>
<p class="MsoNormal">Sean.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>