简体   繁体   English

kvm中已编译内核中缺少通道

[英]Channels missing in compiled kernel in kvm

I have a ubuntu in virtual machine using libvirt. 我在使用libvirt的虚拟机中有一个ubuntu。 I configured my guest to create pipe and unix channels for trace-virtio purpose: 我将我的来宾配置为创建管道和unix通道以进行跟踪虚拟化:

<channel type='unix'>
  <source mode='connect' path='path/to/socket'/>
  <target type='virtio' name='unix-name'/>
  <address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<channel type='pipe'>
  <source path='path/to/pipe'/>
  <target type='virtio' name='pipe-name'/>
  <address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>

Everything works fine in my guest and I have my channel in /dev inside my virtual machine and I can send data to host using these channels. 在来宾中一切正常,我的通道在虚拟机内的/ dev中,可以使用这些通道将数据发送到主机。 But when I compile kernel and install it inside my vm and select it from grub, these channels disappear. 但是,当我编译内核并将其安装在vm中并从grub中选择它时,这些通道就会消失。 When I reboot and select the original kernel, it has the channels and works correctly. 当我重新启动并选择原始内核时,它具有通道并且可以正常工作。 How can I tell kvm to create channels in compiled kernel inside my virtual machine? 如何告诉kvm在虚拟机内部的已编译内核中创建通道?

Ensure that the kernel you are building for your guests has the same config options as the one that worked. 确保为来宾构建的内核具有与有效内核相同的配置选项。

You can get these from /proc/kconfig (if you are lucky and the kernel has that compiled in) else from a config distributed with the kernel (normally in the /boot directory. 您可以从/proc/kconfig获得这些文件(如果幸运的话,并且内核已将其编译进去),否则可以从与内核一起分发的config获得(通常在/boot目录中)。

The relevant ones are likely to be the guest kvm options described here . 相关的选项可能是此处描述的来宾kvm选项。 In particular, ensure the VIRTIO options are on. 特别要确保VIRTIO选项已打开。 My guess is you are missing VIRTIO_CONSOLE (which is in fact character devices). 我的猜测是您缺少VIRTIO_CONSOLE (实际上是字符设备)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM