
On 02/22/2018 05:41 PM, Riccardo Ravaioli wrote:
Hi,
I'm having trouble starting a VM with vhostuser interfaces.
I have a simple configuration where a VM running Debian has 1 vhostuser interface plugged into an OVS switch where a DPDK interface is already plugged in. $ ovs-vsctl show: Bridge "switch1" Port "switch1" Interface "switch1" type: internal Port "1.switch1" Interface "1.switch1" type: dpdk options: {dpdk-devargs="0000:0b:00.0"} Port "0.switch1" Interface "0.vm" type: dpdkvhostuserclient options: {vhost-server-path="/opt/oa/vhost/0.vm.sock"}
The relevant excerpt from the XML of my VM is:
<?xml version="1.0" ?> <domain type="kvm" xmlns:ns0="http://libvirt.org/schemas/domain/qemu/1.0"> <!-- [...] --> <devices> <emulator>/opt/oa/bin/qemu-system-x86_64</emulator> <!-- [...] --> <interface type="vhostuser"> <script path="/opt/oa/etc/qemu-ifup"/> <source mode="server" path="/opt/oa/vhost/0.vm.sock" type="unix"/> <mac address="52:54:00:41:37:08"/> <model type="virtio"/> <driver queues="1"> <host csum="off"/> </driver> </interface> <!-- [...] --> </devices> <ns0:commandline> <ns0:arg value="-object"/> <ns0:arg value="memory-backend-file,id=mem,size=2G,mem-path=/dev/hugepages,share=on"/> <ns0:arg value="-numa"/> <ns0:arg value="node,memdev=mem"/> <ns0:arg value="-mem-prealloc"/> </ns0:commandline>
Unrelated, to avoid command line passthrough you can do: <domain> <memoryBacking> <hugepages/> </memoryBacking> .. <cpu> <numa> <cell id='0' cpus='$CPUS' memory='$MEM' memAccess='shared'/> </numa> </cpu> .. </domain> Michal