Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Virtual machine 如何仅使用libvirt和vhost用户配置/启动vm_Virtual Machine_Kvm_Libvirt - Fatal编程技术网

Virtual machine 如何仅使用libvirt和vhost用户配置/启动vm

Virtual machine 如何仅使用libvirt和vhost用户配置/启动vm,virtual-machine,kvm,libvirt,Virtual Machine,Kvm,Libvirt,我试图用2个Virtio界面作为vhost用户界面来启动我的VM 以下是我的域xml的相关部分 <interface type='vhostuser'> <mac address='52:54:00:c7:ac:38'/> <source type='unix' path='/tmp/vhost1.sock' mode='server'/> <model type='virtio'/> <address type='pci'

我试图用2个Virtio界面作为vhost用户界面来启动我的VM

以下是我的域xml的相关部分

<interface type='vhostuser'>
  <mac address='52:54:00:c7:ac:38'/>
  <source type='unix' path='/tmp/vhost1.sock' mode='server'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
<interface type='vhostuser'>
  <mac address='52:54:00:9d:ea:73'/>
  <source type='unix' path='/tmp/vhost2.sock' mode='server'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</interface>"`
我有什么遗漏吗

一些信息

根据库编译:libvirt 1.2.18

使用库:libvirt 1.2.18

使用API:QEMU 1.2.18

运行虚拟机监控程序:QEMU 2.4.1

hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0

HugePages_Total:      10
HugePages_Free:       10
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:    1048576 kB


# ls -lar /tmp/*
srwxrwxrwx. 1 qemu qemu 0 Apr 28 14:02 /tmp/vhost1.sock

这是有关配置的正常行为。当请求mode='server'时,QEMU将启动一个UNIX套接字服务器,并等待连接到此服务器,然后允许来宾开始执行。因此,为了实际使用,您需要让外部进程监视UNIX套接字的创建(例如使用inotify)并及时连接

另一种选择是切换到mode=client,其中QEMU连接到外部网络服务,避免任何延迟

hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0

HugePages_Total:      10
HugePages_Free:       10
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:    1048576 kB


# ls -lar /tmp/*
srwxrwxrwx. 1 qemu qemu 0 Apr 28 14:02 /tmp/vhost1.sock