diff --git a/kata-containers.spec b/kata-containers.spec index 6a39bf74dad3aee10f6ff8302d1734bcf5e0b9a8..961e99842bd40a1a4a556c7da5152eaae82265b9 100644 --- a/kata-containers.spec +++ b/kata-containers.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} %define VERSION 2.1.0 -%define RELEASE 17 +%define RELEASE 18 Name: kata-containers Version: %{VERSION} @@ -108,6 +108,12 @@ strip %{buildroot}/usr/bin/containerd-shim-kata-v2 %doc %changelog +* Tue Dec 7 2021 jikui - 2.1.0-18 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix the block device not removed in devManager + * Thu Dec 2 2021 jikui - 2.1.0-17 - Type:bugfix - ID:NA diff --git a/patches/0009-kata-containers-fix-kata-runtime-hungs-when-qemu-proces.patch b/patches/0009-kata-containers-fix-kata-runtime-hungs-when-qemu-proces.patch index d8464f917f6807d7f72e8b6e8f12726c91991a22..4c780e69af28fb887b54b6551438a79b66734912 100644 --- a/patches/0009-kata-containers-fix-kata-runtime-hungs-when-qemu-proces.patch +++ b/patches/0009-kata-containers-fix-kata-runtime-hungs-when-qemu-proces.patch @@ -1,8 +1,8 @@ From c563b455e3bb0cebfbe2a77c8d5ebac36aac3c76 Mon Sep 17 00:00:00 2001 From: jikui Date: Thu, 4 Nov 2021 19:58:33 +0800 -Subject: [PATCH 1/8] kata-runtime: fix kata-runtime hungs when qemu process is - D/T state +Subject: [PATCH] kata-runtime: fix kata-runtime hungs when qemu process is D/T + state Signed-off-by: jikui --- diff --git a/patches/0010-kata-containers-fix-kata-runtime-skip-read-lines-in-pro.patch b/patches/0010-kata-containers-fix-kata-runtime-skip-read-lines-in-pro.patch index db28a4a6dbcffc4eceec391f476a264b4113e440..ed0504506ad61cf6b2efc1ec25a73b6e6d4656a4 100644 --- a/patches/0010-kata-containers-fix-kata-runtime-skip-read-lines-in-pro.patch +++ b/patches/0010-kata-containers-fix-kata-runtime-skip-read-lines-in-pro.patch @@ -1,7 +1,7 @@ From c355523761598154653466033a1d88643d3fd3df Mon Sep 17 00:00:00 2001 From: jikui Date: Thu, 4 Nov 2021 20:27:22 +0800 -Subject: [PATCH 2/8] kata-runtime: fix kata-runtime skip read lines in +Subject: [PATCH] kata-runtime: fix kata-runtime skip read lines in /proc/mounts file problem Signed-off-by: jikui diff --git a/patches/0011-kata-containers-keep-the-process-name-of-qemu-same-as-c.patch b/patches/0011-kata-containers-keep-the-process-name-of-qemu-same-as-c.patch index 159b7848e420bae843dc3635cd8bce93052b7a70..b67ab04926499856bddfcb72fc31c0e44d1cda91 100644 --- a/patches/0011-kata-containers-keep-the-process-name-of-qemu-same-as-c.patch +++ b/patches/0011-kata-containers-keep-the-process-name-of-qemu-same-as-c.patch @@ -1,7 +1,7 @@ From 0797bf1fec9c40b67f2770bc8778e8eaee1657c8 Mon Sep 17 00:00:00 2001 From: jikui Date: Fri, 5 Nov 2021 11:35:25 +0800 -Subject: [PATCH 3/8] kata-runtime: keep the process name of qemu same as +Subject: [PATCH] kata-runtime: keep the process name of qemu same as configured path Signed-off-by: jikui diff --git a/patches/0013-kata-containers-increase-delete-cgroup-retry-times.patch b/patches/0013-kata-containers-increase-delete-cgroup-retry-times.patch index fdd167788a8ce2769b6afe43c2c48e21348a4820..b84917897a33f651213edf219c95c9789862dd9a 100644 --- a/patches/0013-kata-containers-increase-delete-cgroup-retry-times.patch +++ b/patches/0013-kata-containers-increase-delete-cgroup-retry-times.patch @@ -1,7 +1,7 @@ From 13aec526360797b3bce776f35b7e5f5976961b47 Mon Sep 17 00:00:00 2001 From: jikui Date: Fri, 5 Nov 2021 11:46:17 +0800 -Subject: [PATCH 4/8] kata-runtime: increase delete cgroup retry times +Subject: [PATCH] kata-runtime: increase delete cgroup retry times Signed-off-by: jikui --- diff --git a/patches/0014-kata-containers-fix-umount-container-rootfs-dir-return-.patch b/patches/0014-kata-containers-fix-umount-container-rootfs-dir-return-.patch index e97a894f86ecf04b50127b7906506ba189c401a2..0868201660177763629393483663dc618ac4e781 100644 --- a/patches/0014-kata-containers-fix-umount-container-rootfs-dir-return-.patch +++ b/patches/0014-kata-containers-fix-umount-container-rootfs-dir-return-.patch @@ -1,8 +1,8 @@ From b654687f88281d1dfbbb6c8ede65aa53ec105122 Mon Sep 17 00:00:00 2001 From: jikui Date: Fri, 5 Nov 2021 11:55:24 +0800 -Subject: [PATCH 5/8] kata-runtime: fix umount container rootfs dir return - invalid argument error +Subject: [PATCH] kata-runtime: fix umount container rootfs dir return invalid + argument error Signed-off-by: jikui --- diff --git a/patches/0015-kata-containers-truncate-the-log.json-file-before-kata-.patch b/patches/0015-kata-containers-truncate-the-log.json-file-before-kata-.patch index 3edf5eddb6cf87417edd4fd74c8b3763193b95b5..adcba1a54be4ad7fc81c09554c52bd0dd92a2d36 100644 --- a/patches/0015-kata-containers-truncate-the-log.json-file-before-kata-.patch +++ b/patches/0015-kata-containers-truncate-the-log.json-file-before-kata-.patch @@ -1,8 +1,8 @@ From fe490b4d63871f91c17ad72afef38a3227c8b4d3 Mon Sep 17 00:00:00 2001 From: jikui Date: Fri, 5 Nov 2021 12:06:11 +0800 -Subject: [PATCH 6/8] kata-runtime: truncate the log.json file before - kata-runtime subcommand executed +Subject: [PATCH] kata-runtime: truncate the log.json file before kata-runtime + subcommand executed Signed-off-by: jikui --- diff --git a/patches/0016-kata-containers-validate-sandbox-cpu-and-memory-size.patch b/patches/0016-kata-containers-validate-sandbox-cpu-and-memory-size.patch index d12a394a6642170be591e49fc4c4f777dc9db66f..66ef95e62b8b1cecd39846d396c733dcf4e04517 100644 --- a/patches/0016-kata-containers-validate-sandbox-cpu-and-memory-size.patch +++ b/patches/0016-kata-containers-validate-sandbox-cpu-and-memory-size.patch @@ -1,7 +1,7 @@ From 420cb51b47e19556c35423354102fdc3a4d041f0 Mon Sep 17 00:00:00 2001 From: jikui Date: Fri, 5 Nov 2021 16:29:40 +0800 -Subject: [PATCH 7/8] kata-runtime: validate sandbox cpu and memory size +Subject: [PATCH] kata-runtime: validate sandbox cpu and memory size Signed-off-by: jikui --- diff --git a/patches/0017-kata-containers-fix-delete-sandbox-failed-problem.patch b/patches/0017-kata-containers-fix-delete-sandbox-failed-problem.patch index 9a0ce122ff6dc8d80d37635fdc11db55c179184b..d42e9f853feadd9158b5e774844f18b13892776e 100644 --- a/patches/0017-kata-containers-fix-delete-sandbox-failed-problem.patch +++ b/patches/0017-kata-containers-fix-delete-sandbox-failed-problem.patch @@ -1,7 +1,7 @@ From 514a0a19e5f37458d1a7e44c8b2fb4bff3b12d5b Mon Sep 17 00:00:00 2001 From: jikui Date: Fri, 5 Nov 2021 16:40:05 +0800 -Subject: [PATCH 8/8] kata-runtime: fix delete sandbox failed problem +Subject: [PATCH] kata-runtime: fix delete sandbox failed problem Signed-off-by: jikui --- diff --git a/patches/0019-kata-containers-do-not-delete-the-exist-tap-device-in-t.patch b/patches/0019-kata-containers-do-not-delete-the-exist-tap-device-in-t.patch index 4a1a2f4f3a51ae875eca225b104f97addfaee5fb..f2824a23c15767524c3e76321fc4c21c8b98f8c6 100644 --- a/patches/0019-kata-containers-do-not-delete-the-exist-tap-device-in-t.patch +++ b/patches/0019-kata-containers-do-not-delete-the-exist-tap-device-in-t.patch @@ -1,8 +1,7 @@ From 51e17297b61fdb9ec560bae2f6c36003c8ebdfc0 Mon Sep 17 00:00:00 2001 From: jikui Date: Tue, 30 Nov 2021 11:29:50 +0800 -Subject: [PATCH 1/4] kata-runtime: do not delete the exist tap device in the - host +Subject: [PATCH] kata-runtime: do not delete the exist tap device in the host Signed-off-by: jikui --- diff --git a/patches/0020-kata-containers-do-not-ignore-updateInterface-return-er.patch b/patches/0020-kata-containers-do-not-ignore-updateInterface-return-er.patch index 95370f47d58b9ef4d83b1124c1228056638d6177..26e407ef0f852ca9276e0816fb652aa3dce1f1ff 100644 --- a/patches/0020-kata-containers-do-not-ignore-updateInterface-return-er.patch +++ b/patches/0020-kata-containers-do-not-ignore-updateInterface-return-er.patch @@ -1,7 +1,7 @@ From 39ac2f6929aea7e404c4597683e43fba7949964c Mon Sep 17 00:00:00 2001 From: jikui Date: Tue, 30 Nov 2021 11:47:36 +0800 -Subject: [PATCH 2/4] kata-runtime: do not ignore updateInterface return error +Subject: [PATCH] kata-runtime: do not ignore updateInterface return error Signed-off-by: jikui --- diff --git a/patches/0021-kata-containers-fix-the-block-device-not-remove-in-devM.patch b/patches/0021-kata-containers-fix-the-block-device-not-remove-in-devM.patch new file mode 100644 index 0000000000000000000000000000000000000000..151dd6f600fb1297e4f934e38a0a28203a80e5d8 --- /dev/null +++ b/patches/0021-kata-containers-fix-the-block-device-not-remove-in-devM.patch @@ -0,0 +1,45 @@ +From 1bb584ac783d057b64058b02cc96c1c67dd7bf30 Mon Sep 17 00:00:00 2001 +From: jikui +Date: Tue, 30 Nov 2021 12:02:42 +0800 +Subject: [PATCH] kata-runtime: fix the block device not remove in devManager + +Signed-off-by: jikui +--- + src/runtime/virtcontainers/container.go | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/runtime/virtcontainers/container.go b/src/runtime/virtcontainers/container.go +index 224f096..dd4317e 100644 +--- a/src/runtime/virtcontainers/container.go ++++ b/src/runtime/virtcontainers/container.go +@@ -1302,6 +1302,7 @@ func (c *Container) plugDevice(ctx context.Context, devicePath string) error { + } + + if c.checkBlockDeviceSupport(ctx) && stat.Mode&unix.S_IFBLK == unix.S_IFBLK { ++ var err error + b, err := c.sandbox.devManager.NewDevice(config.DeviceInfo{ + HostPath: devicePath, + ContainerPath: filepath.Join(kataGuestSharedDir(), c.id), +@@ -1313,10 +1314,18 @@ func (c *Container) plugDevice(ctx context.Context, devicePath string) error { + return fmt.Errorf("device manager failed to create rootfs device for %q: %v", devicePath, err) + } + ++ defer func() { ++ if err != nil { ++ if newErr := c.sandbox.devManager.RemoveDevice(b.DeviceID()); newErr != nil { ++ c.Logger().WithError(newErr).Error("fail rollback to remove block device") ++ } ++ } ++ }() ++ + c.state.BlockDeviceID = b.DeviceID() + + // attach rootfs device +- if err := c.sandbox.devManager.AttachDevice(ctx, b.DeviceID(), c.sandbox); err != nil { ++ if err = c.sandbox.devManager.AttachDevice(ctx, b.DeviceID(), c.sandbox); err != nil { + return err + } + } +-- +2.25.1 + diff --git a/series.conf b/series.conf index cbc50dba648c9d0abb48b1c1e04c8e5055f4dcd8..83a316ba704b3a74f204bf70659125eb24bb4be1 100644 --- a/series.conf +++ b/series.conf @@ -18,3 +18,4 @@ 0018-kata-containers-check-VFIO-when-create-device.patch 0019-kata-containers-do-not-delete-the-exist-tap-device-in-t.patch 0020-kata-containers-do-not-ignore-updateInterface-return-er.patch +0021-kata-containers-fix-the-block-device-not-remove-in-devM.patch