From 933ec093b306785ab3dcaf80074f6c8f38ea2f6a Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 26 Oct 2023 22:50:29 +0900 Subject: [PATCH] qemu: use 9p by default Templates for RHEL-like distros are updated to continue using reverse-sshfs, as 9p is not available on RHEL-like distros. Close issue 971 Signed-off-by: Akihiro Suda --- .github/workflows/test.yml | 7 ------- examples/almalinux-8.yaml | 2 ++ examples/almalinux-9.yaml | 2 ++ examples/centos-stream-8.yaml | 2 ++ examples/centos-stream-9.yaml | 2 ++ examples/default.yaml | 2 +- examples/deprecated/centos-7.yaml | 2 ++ examples/oraclelinux-8.yaml | 2 ++ examples/oraclelinux-9.yaml | 2 ++ hack/test-templates/test-misc.yaml | 2 ++ pkg/limayaml/defaults.go | 7 +++++-- 11 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af3a798d681b..eca0a1d56c32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -171,13 +171,6 @@ jobs: retry_on: error max_attempts: 3 command: ./hack/test-templates.sh templates/default.yaml - - name: "Test experimental/9p.yaml" - uses: nick-invision/retry@v2 - with: - timeout_minutes: 30 - retry_on: error - max_attempts: 3 - command: ./hack/test-templates.sh templates/experimental/9p.yaml - name: "Test test-misc.yaml" uses: nick-invision/retry@v2 with: diff --git a/examples/almalinux-8.yaml b/examples/almalinux-8.yaml index 904bdb90fda8..59b23fa27df3 100644 --- a/examples/almalinux-8.yaml +++ b/examples/almalinux-8.yaml @@ -16,6 +16,8 @@ images: arch: "x86_64" - location: "https://repo.almalinux.org/almalinux/8/cloud/aarch64/images/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2" arch: "aarch64" +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/examples/almalinux-9.yaml b/examples/almalinux-9.yaml index 66e5e903b61b..a37112a60b8e 100644 --- a/examples/almalinux-9.yaml +++ b/examples/almalinux-9.yaml @@ -13,6 +13,8 @@ images: arch: "x86_64" - location: "https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2" arch: "aarch64" +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/examples/centos-stream-8.yaml b/examples/centos-stream-8.yaml index 9e5e670f038d..6925f1e11822 100644 --- a/examples/centos-stream-8.yaml +++ b/examples/centos-stream-8.yaml @@ -17,6 +17,8 @@ images: arch: "x86_64" - location: "https://cloud.centos.org/centos/8-stream/aarch64/images/CentOS-Stream-GenericCloud-8-latest.aarch64.qcow2" arch: "aarch64" +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/examples/centos-stream-9.yaml b/examples/centos-stream-9.yaml index 5a279014fb42..26a950ce3267 100644 --- a/examples/centos-stream-9.yaml +++ b/examples/centos-stream-9.yaml @@ -14,6 +14,8 @@ images: arch: "x86_64" - location: "https://cloud.centos.org/centos/9-stream/aarch64/images/CentOS-Stream-GenericCloud-9-latest.aarch64.qcow2" arch: "aarch64" +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/examples/default.yaml b/examples/default.yaml index 8b909024b971..7e9d09b27e2a 100644 --- a/examples/default.yaml +++ b/examples/default.yaml @@ -100,7 +100,7 @@ mounts: # Mount type for above mounts, such as "reverse-sshfs" (from sshocker), "9p" (EXPERIMENTAL (until Lima v1.0), from QEMU’s virtio-9p-pci, aka virtfs), # or "virtiofs" (EXPERIMENTAL, needs `vmType: vz`) -# 🟢 Builtin default: "reverse-sshfs" (for QEMU), "virtiofs" (for vz) +# 🟢 Builtin default: "9p" (for QEMU, since Lima v1.0), "virtiofs" (for vz) mountType: null # Lima disks to attach to the instance. The disks will be accessible from inside the diff --git a/examples/deprecated/centos-7.yaml b/examples/deprecated/centos-7.yaml index de4a37b87339..b9dc663211b8 100644 --- a/examples/deprecated/centos-7.yaml +++ b/examples/deprecated/centos-7.yaml @@ -12,6 +12,8 @@ images: containerd: system: false user: false +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/examples/oraclelinux-8.yaml b/examples/oraclelinux-8.yaml index 3c22bcfe1225..914a8b76a9c3 100644 --- a/examples/oraclelinux-8.yaml +++ b/examples/oraclelinux-8.yaml @@ -12,6 +12,8 @@ images: - location: "https://yum.oracle.com/templates/OracleLinux/OL8/u8/aarch64/OL8U8_aarch64-kvm-b42.qcow" arch: "aarch64" digest: "sha256:8fe33ebf15780a2d3917a80b3bddabac834f97ac62fc677d35480ebc80cd6db5" +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/examples/oraclelinux-9.yaml b/examples/oraclelinux-9.yaml index 1677f0106c34..49232319d901 100644 --- a/examples/oraclelinux-9.yaml +++ b/examples/oraclelinux-9.yaml @@ -9,6 +9,8 @@ images: - location: "https://yum.oracle.com/templates/OracleLinux/OL9/u2/aarch64/OL9U2_aarch64-kvm-b39.qcow" arch: "aarch64" digest: "sha256:48351bc318b59ab6d54a2f22d11a28891cd54b9ec2fbbcdf83a7c8483b856221" +# 9p is not available +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/hack/test-templates/test-misc.yaml b/hack/test-templates/test-misc.yaml index 8b6d69902234..04ba9d6af55c 100644 --- a/hack/test-templates/test-misc.yaml +++ b/hack/test-templates/test-misc.yaml @@ -1,5 +1,6 @@ # The test template for testing misc configurations: # - disk +# - reverse-sshfs # - (More to come) # # This template requires Lima v0.14.0 or later. @@ -18,6 +19,7 @@ images: - location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img" arch: "aarch64" +mountType: "reverse-sshfs" mounts: - location: "~" - location: "/tmp/lima" diff --git a/pkg/limayaml/defaults.go b/pkg/limayaml/defaults.go index 0cf38bc90e66..5b1608959f01 100644 --- a/pkg/limayaml/defaults.go +++ b/pkg/limayaml/defaults.go @@ -518,9 +518,12 @@ func FillDefault(y, d, o *LimaYAML, filePath string) { y.MountType = o.MountType } if y.MountType == nil || *y.MountType == "" { - if *y.VMType == VZ { + switch *y.VMType { + case VZ: y.MountType = pointer.String(VIRTIOFS) - } else { + case QEMU: + y.MountType = pointer.String(NINEP) + default: y.MountType = pointer.String(REVSSHFS) } }