kata-containers/runtime/patches/0085-kata-runtime-fix-kata-netmon-does-not-exit-when-cont.patch

71 lines
2.6 KiB
Diff
Raw Normal View History

kata:sync bugfix patches, runtime 0079-0096 agent 0021-0024 runtime: 0079-kata-runtime-fix-qemu-SCSIBus-info-not-saved-into-pe.patch 0080-kata-runtime-fix-the-block-device-not-removed-in-dev.patch 0081-kata-runtime-cut-too-long-message-in-grpc-log.patch 0082-kata-runtime-change-sandbox-state-to-unhealthy-when-.patch 0083-kata-runtime-add-removeMountBlockDevices-for-contain.patch 0084-kata-runtime-fix-validInterface-func-cause-crash-pro.patch 0085-kata-runtime-fix-kata-netmon-does-not-exit-when-cont.patch 0086-kata-runtime-add-checkCPUSet-before-create-container.patch 0087-kata-runtime-force-delete-the-sandbox-and-container.patch 0088-kata-runtime-check-sandbox-healthy-state-before-call.patch 0089-kata-add-support-for-update-iface.patch 0090-kata-set-sandbox-or-container-status-to-unhealthy.patch 0091-kata-runtime-add-sandbox-file-lock-while-call-GetSan.patch 0092-qemu-add-arm64-to-support-list-of-dimm.patch 0093-kata-runtime-add-timeout-for-grpcWaitProcessRequest.patch 0094-kata-runtime-fix-update-iface-clean-NIC-cause-route-.patch 0095-kata-runtime-fix-qemu-process-resource-resi.patch 0096-kata-containers-Move-from-query-cpus-to-query-cpus-f.patch agent: 0021-kata-agent-fix-sync-clock-not-work-problem.patch 0022-kata-agent-delete-container-id-from-sandbox-struct.patch 0023-kata-agent-modify-log-level.patch 0024-kata-agent-fix-agent.debug_console-not-work-when-bui.patch Signed-off-by: Vanient <xiadanni1@huawei.com> (cherry picked from commit f2d936028666741658157472b8de9d02187c6d55)
2022-09-09 17:04:39 +08:00
From a1f1c9de04dd3cd2003f06c26b415c4e30fa3a53 Mon Sep 17 00:00:00 2001
From: yangfeiyu <yangfeiyu2@huawei.com>
Date: Wed, 16 Dec 2020 10:36:39 +0800
Subject: [PATCH] kata-runtime: fix kata-netmon does not exit when container is
stopped
reason: start a container and stop it, the netmon process will not exit,
we should store the netmon info to disk and read it when fetching the sandbox,
then the remove netmon operation will be executed.
Change-Id: I2d8fd02747eaf208445444bc0c43a7d221ba1715
Conflict:NA
Reference:https://gitee.com/holyfei/kata-runtime
Signed-off-by: yangfeiyu <yangfeiyu2@huawei.com>
---
virtcontainers/persist.go | 11 ++++++++++-
virtcontainers/persist/api/config.go | 7 +++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/virtcontainers/persist.go b/virtcontainers/persist.go
index efa4506..57b5336 100644
--- a/virtcontainers/persist.go
+++ b/virtcontainers/persist.go
@@ -192,8 +192,12 @@ func (s *Sandbox) dumpConfig(ss *persistapi.SandboxState) {
DisableNewNetNs: sconfig.NetworkConfig.DisableNewNetNs,
EnableCompatOldCNI: sconfig.NetworkConfig.EnableCompatOldCNI,
InterworkingModel: int(sconfig.NetworkConfig.InterworkingModel),
+ NetmonConfig: persistapi.NetmonConfig{
+ Path: sconfig.NetworkConfig.NetmonConfig.Path,
+ Debug: sconfig.NetworkConfig.NetmonConfig.Debug,
+ Enable: sconfig.NetworkConfig.NetmonConfig.Enable,
+ },
},
-
ShmSize: sconfig.ShmSize,
SharePidNs: sconfig.SharePidNs,
Stateful: sconfig.Stateful,
@@ -484,6 +488,11 @@ func loadSandboxConfig(id string) (*SandboxConfig, error) {
DisableNewNetNs: savedConf.NetworkConfig.DisableNewNetNs,
EnableCompatOldCNI: savedConf.NetworkConfig.EnableCompatOldCNI,
InterworkingModel: NetInterworkingModel(savedConf.NetworkConfig.InterworkingModel),
+ NetmonConfig: NetmonConfig{
+ Path: savedConf.NetworkConfig.NetmonConfig.Path,
+ Debug: savedConf.NetworkConfig.NetmonConfig.Debug,
+ Enable: savedConf.NetworkConfig.NetmonConfig.Enable,
+ },
},
ShmSize: savedConf.ShmSize,
diff --git a/virtcontainers/persist/api/config.go b/virtcontainers/persist/api/config.go
index 28204fc..26f6cf4 100644
--- a/virtcontainers/persist/api/config.go
+++ b/virtcontainers/persist/api/config.go
@@ -215,6 +215,13 @@ type NetworkConfig struct {
DisableNewNetNs bool
EnableCompatOldCNI bool
InterworkingModel int
+ NetmonConfig NetmonConfig
+}
+
+type NetmonConfig struct {
+ Path string
+ Debug bool
+ Enable bool
}
type ContainerConfig struct {
--
2.23.0