错误:virHostCPUGetKVMMaxVCPUs:此平台不支持 KVM:功能未实现

错误:virHostCPUGetKVMMaxVCPUs:此平台不支持 KVM:功能未实现

我在我的 ARM Chromebook 上运行 Debian bookworm,型号为“xe303c12”,并且我已经重新编译了内核(5.4)以启用 KVM,所以现在我的系统听起来像这样:

$ lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

$ uname -a
Linux chromarietto 5.4.244-stb-cbe
#8 SMP PREEMPT Sat Aug 19 22:19:32 UTC 2023 armv7l GNU/Linux

$ uname -r
5.4.244-stb-cbe

$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

$ qemu-system-arm --version
QEMU emulator version 5.1.0 (v5.1.0-dirty)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers

$ python3 --version
Python 3.11.2

我已经从源代码安装了 libvirt 9.7.0、qemu 5.1 和 virt-manager,最终目标是能够将 qemu、kvm 和 libvirt 连接在一起,为 Arm 32 位虚拟化 FreeBSD 13.2。有关我的平台的一些有用信息:

root@chromarietto:/home/marietto/Desktop# virt-host-validate


QEMU: Checking if device /dev/kvm exists                                  : PASS
QEMU: Checking if device /dev/kvm is accessible                           : PASS
QEMU: Checking if device /dev/vhost-net exists                            : PASS
QEMU: Checking if device /dev/net/tun exists                              : PASS
QEMU: Checking for cgroup 'cpu' controller support                        : PASS
QEMU: Checking for cgroup 'cpuacct' controller support                    : PASS
QEMU: Checking for cgroup 'cpuset' controller support                     : PASS
QEMU: Checking for cgroup 'memory' controller support                     : PASS
QEMU: Checking for cgroup 'devices' controller support                    : PASS
QEMU: Checking for cgroup 'blkio' controller support                      : PASS

QEMU: Checking for device assignment IOMMU support                        : WARN 
(No ACPI IORT table found, IOMMU not supported by this hardware platform)

QEMU: Checking for secure guest support                                   : WARN 
(Unknown if this platform has Secure Guest support)

LXC: Checking for Linux >= 2.6.26                                         : PASS
LXC: Checking for namespace ipc                                           : PASS
LXC: Checking for namespace mnt                                           : PASS
LXC: Checking for namespace pid                                           : PASS
LXC: Checking for namespace uts                                           : PASS
LXC: Checking for namespace net                                           : PASS
LXC: Checking for namespace user                                          : PASS
LXC: Checking for cgroup 'cpu' controller support                         : PASS
LXC: Checking for cgroup 'cpuacct' controller support                     : PASS
LXC: Checking for cgroup 'cpuset' controller support                      : PASS
LXC: Checking for cgroup 'memory' controller support                      : PASS
LXC: Checking for cgroup 'devices' controller support                     : PASS

LXC: Checking for cgroup 'freezer' controller support                     : FAIL
(Enable 'freezer' in kernel Kconfig file or mount/enable cgroup controller in your system)

LXC: Checking for cgroup 'blkio' controller support                       : PASS
LXC: Checking if device /sys/fs/fuse/connections exists                   : PASS


# lsmod | grep kvm
no errors (I have embedded the options needed to enable KVM inside the kernel)


# virsh --connect qemu:///system capabilities | grep baselabel

<baselabel type='kvm'>+1002:+1002</baselabel>
<baselabel type='qemu'>+1002:+1002</baselabel>

我无法修复的错误如下:

root@chromarietto:~#  virsh domcapabilities --machine virt --emulatorbin /usr/local/bin/qemu-system-arm

2023-08-29 10:17:59.110+0000: 1763: error : virHostCPUGetKVMMaxVCPUs:1228 : 
KVM is not supported on this platform: Function not implemented ; 
error: failed to get emulator capabilities
error: KVM is not supported on this platform: Function not implemented

这是我在启用调试选项的情况下运行 libvirtd 时得到的日志

root@chromarietto:~# libvirtd --debug

[Tue, 29 Aug 2023 10:10:11 virt-manager 2141] DEBUG (createvm:494) UEFI found, setting it as default.
[Tue, 29 Aug 2023 10:10:11 virt-manager 2141] DEBUG (createvm:728) Guest type set to os_type=hvm, arch=armv7l, dom_type=kvm
[Tue, 29 Aug 2023 10:10:11 virt-manager 2141] DEBUG (guest:546) Prefer EFI => True
2023-08-29 10:10:12.972+0000: 1765: error : virHostCPUGetKVMMaxVCPUs:1228 : KVM is not supported on this platform: Function not implemented
[Tue, 29 Aug 2023 10:10:12 virt-manager 2141] DEBUG (domcapabilities:250) Error fetching domcapabilities XML
Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virtinst/domcapabilities.py", line 245, in build_from_params
    xml = conn.getDomainCapabilities(emulator, arch,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4612, in getDomainCapabilities
    raise libvirtError('virConnectGetDomainCapabilities() failed')
libvirt.libvirtError: KVM is not supported on this platform: Function not implemented


2023-08-29 10:10:14.157+0000: 1762: error : virHostCPUGetKVMMaxVCPUs:1228 : KVM is not supported on this platform: Function not implemented

[Tue, 29 Aug 2023 10:10:14 virt-manager 2141] DEBUG (domcapabilities:250) Error fetching domcapabilities XML
Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virtinst/domcapabilities.py", line 245, in build_from_params
    xml = conn.getDomainCapabilities(emulator, arch,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4612, in getDomainCapabilities
    raise libvirtError('virConnectGetDomainCapabilities() failed')
libvirt.libvirtError: KVM is not supported on this platform: Function not implemented
[Tue, 29 Aug 2023 10:10:14 virt-manager 2141] DEBUG (createvm:497) Error checking for UEFI default
Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virtManager/createvm.py", line 491, in _set_caps_state
    guest.enable_uefi()
  File "/usr/local/share/virt-manager/virtinst/guest.py", line 589, in enable_uefi
    path = self._lookup_default_uefi_path()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/share/virt-manager/virtinst/guest.py", line 848, in _lookup_default_uefi_path
    raise RuntimeError(_("Libvirt version does not support UEFI."))
RuntimeError: Libvirt version does not support UEFI

有人可以给我一些建议来修复该错误吗?谢谢。

答案1

KVM 上对 32 位 ARM 的支持在 5.2(以及 5.7 内核以后)中被删除。看https://qemu.readthedocs.io/en/master/about/removed-features.html#kvm-guest-support-on-32-bit-arm-hosts-removed-in-5-2

相关内容