summaryrefslogtreecommitdiff
path: root/0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch
diff options
context:
space:
mode:
Diffstat (limited to '0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch')
-rw-r--r--0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch b/0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch
new file mode 100644
index 0000000..13df472
--- /dev/null
+++ b/0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch
@@ -0,0 +1,60 @@
+From 1d51e3e9f14199854cc2d586651c5809345aee18 Mon Sep 17 00:00:00 2001
+From: zhongtao <zhongtao17@huawei.com>
+Date: Wed, 8 May 2024 14:48:47 +0800
+Subject: [PATCH 82/85] fix shim controller set incorrect sandbox status state
+
+Signed-off-by: jikai <jikai11@huawei.com>
+---
+ src/daemon/sandbox/controller/controller.h | 3 +++
+ src/daemon/sandbox/controller/shim/shim_controller.cc | 6 ++++--
+ src/daemon/sandbox/sandbox.cc | 3 ---
+ 3 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/daemon/sandbox/controller/controller.h b/src/daemon/sandbox/controller/controller.h
+index f479a0ac..9ad45855 100644
+--- a/src/daemon/sandbox/controller/controller.h
++++ b/src/daemon/sandbox/controller/controller.h
+@@ -27,6 +27,9 @@
+
+ namespace sandbox {
+
++#define SANDBOX_READY_STATE_STR "SANDBOX_READY"
++#define SANDBOX_NOTREADY_STATE_STR "SANDBOX_NOTREADY"
++
+ struct ControllerMountInfo {
+ std::string source;
+ std::string destination;
+diff --git a/src/daemon/sandbox/controller/shim/shim_controller.cc b/src/daemon/sandbox/controller/shim/shim_controller.cc
+index 4da637c7..ce09c076 100644
+--- a/src/daemon/sandbox/controller/shim/shim_controller.cc
++++ b/src/daemon/sandbox/controller/shim/shim_controller.cc
+@@ -446,8 +446,10 @@ void ShimController::InspectResponseToSandboxStatus(container_inspect *inspect,
+ sandboxStatus.id = inspect->id;
+ if (inspect->state != nullptr) {
+ sandboxStatus.pid = inspect->state->pid;
+- if (inspect->state->status != nullptr) {
+- sandboxStatus.state = std::string(inspect->state->status);
++ if (inspect->state->running) {
++ sandboxStatus.state = std::string(SANDBOX_READY_STATE_STR);
++ } else {
++ sandboxStatus.state = std::string(SANDBOX_NOTREADY_STATE_STR);
+ }
+ }
+
+diff --git a/src/daemon/sandbox/sandbox.cc b/src/daemon/sandbox/sandbox.cc
+index 279bf628..d44abb99 100644
+--- a/src/daemon/sandbox/sandbox.cc
++++ b/src/daemon/sandbox/sandbox.cc
+@@ -39,9 +39,6 @@
+ #include "utils_timestamp.h"
+ #include "mailbox.h"
+
+-#define SANDBOX_READY_STATE_STR "SANDBOX_READY"
+-#define SANDBOX_NOTREADY_STATE_STR "SANDBOX_NOTREADY"
+-
+ namespace sandbox {
+
+ const std::string SHM_MOUNT_POINT = "/dev/shm";
+--
+2.34.1
+