diff --git a/kata-containers.spec b/kata-containers.spec index c7b3ae10bb417b70118b0ebdb05bd27443dfd2e2..63c9a26b07c37bad306d02752a1042874368248d 100644 --- a/kata-containers.spec +++ b/kata-containers.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} %define VERSION 2.1.0 -%define RELEASE 28 +%define RELEASE 29 Name: kata-containers Version: %{VERSION} @@ -108,6 +108,12 @@ strip %{buildroot}/usr/bin/containerd-shim-kata-v2 %doc %changelog +* Fri Sep 2 2022 chengzeruizhi - 2.1.0-29 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:don't use props for object add + * Tue Aug 23 2022 chengzeruizhi - 2.1.0-28 - Type:bugfix - ID:NA diff --git a/patches/0032-qmp-Don-t-use-deprecated-props-field-for-object-add.patch b/patches/0032-qmp-Don-t-use-deprecated-props-field-for-object-add.patch new file mode 100644 index 0000000000000000000000000000000000000000..db112536a97196777e291581a5e775f6c08f10d5 --- /dev/null +++ b/patches/0032-qmp-Don-t-use-deprecated-props-field-for-object-add.patch @@ -0,0 +1,67 @@ +From e3296a68f7fa270d72605dfd4eb40b1081a79969 Mon Sep 17 00:00:00 2001 +From: chengzrz +Date: Fri, 2 Sep 2022 15:10:26 +0800 +Subject: [PATCH] qmp: Don't use deprecated 'props' field for object-add + +Use of the 'props' argument to 'object-add' has been deprecated since QEMU +5.0 (commit 5f07c4d60d09) in favor of flattening the properties directly +into the 'object-add' arguments. Support for 'props' is removed entirely +in qemu 6.0 (commit 50243407457a). + +reference:https://github.com/kata-containers/kata-containers/commit/d27256f8635d3fa382d6cbd9f3a60f601773c4dc + +Signed-off-by: chengzrz +--- + .../kata-containers/govmm/qemu/qmp.go | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +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 97e9245..91dd732 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 +@@ -1387,17 +1387,16 @@ func (q *QMP) ExecQueryCpusFast(ctx context.Context) ([]CPUInfoFast, error) { + + // ExecMemdevAdd adds size of MiB memory device to the guest + func (q *QMP) ExecMemdevAdd(ctx context.Context, qomtype, id, mempath string, size int, share bool, driver, driverID string) error { +- props := map[string]interface{}{"size": uint64(size) << 20} + args := map[string]interface{}{ + "qom-type": qomtype, + "id": id, +- "props": props, ++ "size": uint64(size) << 20, + } + if mempath != "" { +- props["mem-path"] = mempath ++ args["mem-path"] = mempath + } + if share { +- props["share"] = true ++ args["share"] = true + } + err := q.executeCommand(ctx, "object-add", args, nil) + if err != nil { +@@ -1439,17 +1438,14 @@ func (q *QMP) ExecuteNVDIMMDeviceAdd(ctx context.Context, id, mempath string, si + args := map[string]interface{}{ + "qom-type": "memory-backend-file", + "id": "nvdimmbackmem" + id, +- "props": map[string]interface{}{ +- "mem-path": mempath, +- "size": size, +- "share": true, +- }, ++ "mem-path": mempath, ++ "size": size, ++ "share": true, + } + + if q.version.Major > 4 || (q.version.Major == 4 && q.version.Minor >= 1) { + if pmem != nil { +- props := args["props"].(map[string]interface{}) +- props["pmem"] = *pmem ++ args["pmem"] = *pmem + } + } + +-- +2.25.1 + diff --git a/series.conf b/series.conf index 5ce25b2f731d18699ba3538c689852e93e8b0321..d4e49ed0e479112af2467a6b6aafc77e9cb050c4 100644 --- a/series.conf +++ b/series.conf @@ -29,3 +29,4 @@ 0029-stratovirt-fix-the-problem-that-add-more-than-16-roo.patch 0030-use-host_device-blockdev-adding.patch 0031-add-explicit-on-after-kernel_irqchip.patch +0032-qmp-Don-t-use-deprecated-props-field-for-object-add.patch