From 8ae3edbc1860ab2e8266b9b7021a531ee1ab0b0d Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 30 Aug 2021 16:09:02 +0800 Subject: [PATCH 1/3] runtime: fix default hypervisor path Should not be qemu-lite. Signed-off-by: Peng Tao --- src/runtime/pkg/katautils/config-settings.go.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/pkg/katautils/config-settings.go.in b/src/runtime/pkg/katautils/config-settings.go.in index 6231ddd393..d03f5406ac 100644 --- a/src/runtime/pkg/katautils/config-settings.go.in +++ b/src/runtime/pkg/katautils/config-settings.go.in @@ -8,7 +8,7 @@ package katautils -var defaultHypervisorPath = "/usr/bin/qemu-lite-system-x86_64" +var defaultHypervisorPath = "/usr/bin/qemu-system-x86_64" var defaultHypervisorCtlPath = "/usr/bin/acrnctl" var defaultJailerPath = "/usr/bin/jailer" var defaultImagePath = "/usr/share/kata-containers/kata-containers.img" From a9de761d71415c5d003563b8d2c1997f67d934d6 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 30 Aug 2021 16:13:28 +0800 Subject: [PATCH 2/3] runtime: drop qemu-lite support As the project is not maintained and we have not been testing against it for a long time. Fixes: #2529 Signed-off-by: Peng Tao --- src/runtime/cli/main_test.go | 2 +- src/runtime/containerd-shim-v2/utils_test.go | 2 +- src/runtime/pkg/katautils/create_test.go | 2 +- src/runtime/virtcontainers/qemu_amd64.go | 5 ----- src/runtime/virtcontainers/qemu_arch_base.go | 3 --- src/runtime/virtcontainers/qemu_arch_base_test.go | 2 +- 6 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/runtime/cli/main_test.go b/src/runtime/cli/main_test.go index 5baa3c87af..b6a6f634b4 100644 --- a/src/runtime/cli/main_test.go +++ b/src/runtime/cli/main_test.go @@ -210,7 +210,7 @@ func newTestHypervisorConfig(dir string, create bool) (vc.HypervisorConfig, erro KernelPath: kernelPath, ImagePath: imagePath, HypervisorPath: hypervisorPath, - HypervisorMachineType: "pc-lite", + HypervisorMachineType: "q35", }, nil } diff --git a/src/runtime/containerd-shim-v2/utils_test.go b/src/runtime/containerd-shim-v2/utils_test.go index 96faeaf719..05c8bdc9ee 100644 --- a/src/runtime/containerd-shim-v2/utils_test.go +++ b/src/runtime/containerd-shim-v2/utils_test.go @@ -192,7 +192,7 @@ func newTestHypervisorConfig(dir string, create bool) (vc.HypervisorConfig, erro KernelPath: kernelPath, ImagePath: imagePath, HypervisorPath: hypervisorPath, - HypervisorMachineType: "pc-lite", + HypervisorMachineType: "q35", }, nil } diff --git a/src/runtime/pkg/katautils/create_test.go b/src/runtime/pkg/katautils/create_test.go index 7f033082f6..fa6b434d09 100644 --- a/src/runtime/pkg/katautils/create_test.go +++ b/src/runtime/pkg/katautils/create_test.go @@ -138,7 +138,7 @@ func newTestHypervisorConfig(dir string, create bool) (vc.HypervisorConfig, erro KernelPath: kernelPath, ImagePath: imagePath, HypervisorPath: hypervisorPath, - HypervisorMachineType: "pc-lite", + HypervisorMachineType: "q35", }, nil } diff --git a/src/runtime/virtcontainers/qemu_amd64.go b/src/runtime/virtcontainers/qemu_amd64.go index 1129d4d340..eab95ff571 100644 --- a/src/runtime/virtcontainers/qemu_amd64.go +++ b/src/runtime/virtcontainers/qemu_amd64.go @@ -43,7 +43,6 @@ const ( ) var qemuPaths = map[string]string{ - QemuPCLite: "/usr/bin/qemu-lite-system-x86_64", QemuQ35: defaultQemuPath, QemuMicrovm: defaultQemuPath, } @@ -66,10 +65,6 @@ var kernelParams = []Param{ } var supportedQemuMachines = []govmmQemu.Machine{ - { - Type: QemuPCLite, - Options: defaultQemuMachineOptions, - }, { Type: QemuQ35, Options: defaultQemuMachineOptions, diff --git a/src/runtime/virtcontainers/qemu_arch_base.go b/src/runtime/virtcontainers/qemu_arch_base.go index 50a82bf5a3..98fdfb7661 100644 --- a/src/runtime/virtcontainers/qemu_arch_base.go +++ b/src/runtime/virtcontainers/qemu_arch_base.go @@ -209,9 +209,6 @@ const ( const bridgePCIStartAddr = 2 const ( - // QemuPCLite is the QEMU pc-lite machine type for amd64 - QemuPCLite = "pc-lite" - // QemuQ35 is the QEMU Q35 machine type for amd64 QemuQ35 = "q35" diff --git a/src/runtime/virtcontainers/qemu_arch_base_test.go b/src/runtime/virtcontainers/qemu_arch_base_test.go index c1ea7d0b8d..1cd904864b 100644 --- a/src/runtime/virtcontainers/qemu_arch_base_test.go +++ b/src/runtime/virtcontainers/qemu_arch_base_test.go @@ -158,7 +158,7 @@ func TestQemuAddDeviceToBridge(t *testing.T) { // addDeviceToBridge fails cause q.Bridges == 0 q = newQemuArchBase() - q.qemuMachine.Type = QemuPCLite + q.qemuMachine.Type = QemuQ35 q.bridges(0) _, _, err = q.addDeviceToBridge(context.Background(), "qemu-bridge", types.PCI) if assert.Error(err) { From 2250360b5623710c9b50cf894f4335ca1df685c7 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 30 Aug 2021 16:55:09 +0800 Subject: [PATCH 3/3] docs: remove mentioning of qemu-lite vm-templating should just work with upstream qemu v4.1.0 or above. Signed-off-by: Peng Tao --- docs/how-to/what-is-vm-templating-and-how-do-I-use-it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/how-to/what-is-vm-templating-and-how-do-I-use-it.md b/docs/how-to/what-is-vm-templating-and-how-do-I-use-it.md index b031d09e8c..ba5d8ed333 100644 --- a/docs/how-to/what-is-vm-templating-and-how-do-I-use-it.md +++ b/docs/how-to/what-is-vm-templating-and-how-do-I-use-it.md @@ -47,7 +47,7 @@ and can be classified as potentially misunderstood behaviors rather than vulnera VM templating can be enabled by changing your Kata Containers config file (`/usr/share/defaults/kata-containers/configuration.toml`, overridden by `/etc/kata-containers/configuration.toml` if provided) such that: - - `qemu-lite` is specified in `hypervisor.qemu`->`path` section + - `qemu` version `v4.1.0` or above is specified in `hypervisor.qemu`->`path` section - `enable_template = true` - `initrd =` is set - `image =` option is commented out or removed