diff --git a/kata-containers.spec b/kata-containers.spec index b7a2fcd29a9fe268d7d8c20ad147659e0b352bd8..396ca744bf149fa721d37f95d016bae2b553345c 100644 --- a/kata-containers.spec +++ b/kata-containers.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} %define VERSION 2.1.0 -%define RELEASE 26 +%define RELEASE 27 Name: kata-containers Version: %{VERSION} @@ -108,6 +108,12 @@ strip %{buildroot}/usr/bin/containerd-shim-kata-v2 %doc %changelog +* Mon Aug 22 2022 chengzeruizhi - 2.1.0-27 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:use host device when adding block dev + * Fri Mar 18 2022 Xinle.Guo - 2.1.0-26 - Type:bugfix - ID:NA diff --git a/patches/0030-use-host_device-blockdev-adding.patch b/patches/0030-use-host_device-blockdev-adding.patch new file mode 100644 index 0000000000000000000000000000000000000000..deaad571b0675cb1f1609c3f503992e54952bfef --- /dev/null +++ b/patches/0030-use-host_device-blockdev-adding.patch @@ -0,0 +1,38 @@ +From 2da8be5657f219de41e11917cb916895934749b8 Mon Sep 17 00:00:00 2001 +From: chengzrz +Date: Mon, 22 Aug 2022 19:19:52 +0800 +Subject: [PATCH] use host_device blockdev adding + +ExecuteBlockdevAdd() and ExecuteBlockdevAddWithCache() both appear to be +intended to create block devices in the guest which backend onto a block +device in the host. That seems to be the way that Kata always uses it. +However blockdevAddBaseArgs(), used by both those functions always uses the +"file" driver, which is only intended for use with regular file backends. + +Use of the "file" driver for host block devices was deprecated in qemu-3.0, +and has been removed entirely in qemu-6.0 (commit 8d17adf34f5). We should +be using the "host_device" driver instead. + +reference: https://github.com/kata-containers/kata-containers/commit/1b021929864fa45b643d9603d6615cc4b86235d7 + +Signed-off-by: chengzrz +--- + src/runtime/vendor/github.com/kata-containers/govmm/qemu/qmp.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/runtime/vendor/github.com/kata-containers/govmm/qemu/qmp.go b/src/runtime/vendor/github.com/kata-containers/govmm/qemu/qmp.go +index 97e924559..0e0337dbf 100644 +--- a/src/runtime/vendor/github.com/kata-containers/govmm/qemu/qmp.go ++++ b/src/runtime/vendor/github.com/kata-containers/govmm/qemu/qmp.go +@@ -775,7 +775,7 @@ func (q *QMP) blockdevAddBaseArgs(device, blockdevID string, ro bool) (map[strin + "driver": "raw", + "read-only": ro, + "file": map[string]interface{}{ +- "driver": "file", ++ "driver": "host_device", + "filename": device, + }, + } +-- +2.25.1 + diff --git a/series.conf b/series.conf index 521120322681a1235cf2bb70d3873246152470f7..82b4a6a0c3e54cabf68a9fe31d684a80fbc03ef9 100644 --- a/series.conf +++ b/series.conf @@ -27,3 +27,4 @@ 0027-stratovirt-fix-the-problem-that-fails-to-plug-net-de.patch 0028-stratovirt-provide-a-way-to-dynomically-obtain-firmw.patch 0029-stratovirt-fix-the-problem-that-add-more-than-16-roo.patch +0030-use-host_device-blockdev-adding.patch