跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

qemu_linux_arm64.go

35 行 · 1.1 KB历史下载
1// SPDX-FileCopyrightText: Copyright The Lima Authors
2// SPDX-License-Identifier: Apache-2.0
3
4package qemu
5
6import (
7 "fmt"
8 "strings"
9
10 "github.com/coreos/go-semver/semver"
11 "github.com/sirupsen/logrus"
12
13 "github.com/lima-vm/lima/v2/pkg/limatype"
14)
15
16// nestedVirtualizationEnabled reports whether the host can provide nested virtualization
17// for the given guest configuration.
18//
19// On aarch64 Linux, KVM_CAP_ARM_EL2 requires QEMU 10.1.0 or later and a host kernel
20// (6.16 or later) booted with `kvm-arm.mode=nested`.
21func nestedVirtualizationEnabled(arch, accel, _ string, qemuVer *semver.Version) (bool, error) {
22 if arch != limatype.AARCH64 {
23 logrus.Warnf("field `nestedVirtualization` is not supported for architecture %#q, ignoring", arch)
24 return false, nil
25 }
26 if accel != "kvm" {
27 logrus.Warnf("nested virtualization is not supported with accelerator %s on this platform, ignoring", strings.ToUpper(accel))
28 return false, nil
29 }
30 minVer := semver.New("10.1.0")
31 if qemuVer != nil && qemuVer.LessThan(*minVer) {
32 return false, fmt.Errorf("QEMU %v is too old, %v or later is required for nested virtualization with KVM", qemuVer, minVer)
33 }
34 return true, nil
35}