<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:rgb(11,83,148)">Let me clarify my question, I am using unmodified stock qemu (1.4.0) and only the location of vhost file descriptor is different from default (I don't remove the default /dev/vhost-net directory)</div>
<div class="gmail_default" style="font-family:georgia,serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(11,83,148)">The VHOST file descriptor is present in "/dev/vhost-0" directory instead of the default "/dev/vhost-net". When I try to give vhostfd in the XML I get a different error:</div>
<div class="gmail_default" style="font-family:georgia,serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style><div class="gmail_default" style="color:rgb(11,83,148);font-family:georgia,serif">2014-07-24 10:42:22.507+0000: 3181: error : qemuMonitorOpenUnix:293 : failed to connect to monitor socket: No such process</div>
<div class="gmail_default" style="color:rgb(11,83,148);font-family:georgia,serif">2014-07-24 10:42:22.507+0000: 3181: error : qemuProcessWaitForMonitor:1806 : internal error process exited while connecting to monitor: qemu-system-x86_64: -netdev type=tap,id=net1,script=no,downscript=no,ifname=port4,vhost=on,vhostfd=/dev/vhost-0: Device 'tap' could not be initialized</div>
<div style="color:rgb(11,83,148);font-family:georgia,serif"><br></div><div style="color:rgb(11,83,148);font-family:georgia,serif"><br></div><div style="color:rgb(11,83,148);font-family:georgia,serif">Whereas if I don't give the vhostfd option in the XML, it uses the default /dev/vhost-net directory and throws the following error:</div>
<div style><div style><br></div><div style><font color="#0b5394" face="georgia, serif">2014-07-24 10:41:35.970+0000: 3183: error : qemuMonitorOpenUnix:293 : failed to connect to monitor socket: No such process</font></div>
<div style><font color="#0b5394" face="georgia, serif">2014-07-24 10:41:35.970+0000: 3183: error : qemuProcessWaitForMonitor:1806 : internal error process exited while connecting to monitor: qemu-system-x86_64: -netdev type=tap,id=net1,script=no,downscript=no,ifname=port4,vhost=on: vhost-net requested but could not be initialized</font></div>
<div style><font color="#0b5394" face="georgia, serif">qemu-system-x86_64: -netdev type=tap,id=net1,script=no,downscript=no,ifname=port4,vhost=on: Device 'tap' could not be initialized</font></div></div></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 24 July 2014 13:47, Asadullah Hussain <span dir="ltr"><<a href="mailto:asadxflow@gmail.com" target="_blank">asadxflow@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:rgb(11,83,148)"><div class=""><div class="gmail_default" style="font-size:13px">​The qemu that I am using isn't modified at all. It's the VHOST drivers that are mounted elsewhere i.e., not on default /dev/vhost-net.</div>

<div class="gmail_default" style="font-size:13px"><br></div><div class="gmail_default" style="font-size:13px">Here is the command that I use to launch my qemu VM:</div><div class="gmail_default" style="font-size:13px"><span style="font-size:15px;font-family:'Courier New';color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:rgb(183,183,183)">qemu-system-x86_64 -cpu host -boot order=c -hda /root/Disks/ubuntu1.qcow2 -m 1024M -smp 2 --enable-kvm -name 'client 1' -nographic -vnc :2 -net none -no-reboot -mem-path /dev/hugepages -mem-prealloc -netdev type=tap,id=net1,script=no,downscript=no,ifname=port3,vhost=on -device virtio-net-pci,netdev=net1,mac=00:00:00:00:00:01,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off -netdev type=tap,id=net2,script=no,downscript=no,ifname=port4,vhost=on -device virtio-net-pci,netdev=net2,mac=00:00:00:00:00:02,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off</span><br>

</div><div class="gmail_default" style="font-size:13px">​</div><div class="gmail_default" style="font-size:13px">As you can see I have created tap interfaces port3 & port4 and I just want to connect the VM to these VMs.</div>

</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div></div></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On 24 July 2014 13:31, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span> wrote:<br>

</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, Jul 24, 2014 at 08:42:47AM +0500, Asadullah Hussain wrote:<br>
> Thanks Wangkai but libvirt infact pre-configures network tap devices and<br>
> pre-opens /dev/vhost-net file and passes these to qemu as open, ready to<br>
> use file descriptors.<br>
><br>
> My issue is that my qemu requires that /dev/vhost-net directory is removed<br>
> and it's kernel module be unloaded. Then it creates a vhost -net device<br>
> using its own configuration.<br>
<br>
</div>Libvirt is only written to work against official upstream QEMU. If you<br>
have modified your QEMU to work in a different way wrt net devices then<br>
you'll have to modify your libvirt to cope or workaround the problems.<br>
<br>
Regards,<br>
Daniel<br>
<span><font color="#888888">--<br>
|: <a href="http://berrange.com" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/~danberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: <a href="http://entangle-photo.org" target="_blank">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc</a> :|<br>
</font></span></blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Cheers, </div><div><br></div>Asadullah Hussain</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Cheers, </div><div><br></div>Asadullah Hussain</div>
</div>