From 61687992f425cf7b4508a2bf614175d8d81b3a98 Mon Sep 17 00:00:00 2001 From: Fupan Li Date: Thu, 13 Jun 2024 10:27:04 +0800 Subject: [PATCH] sandbox: fix the issue of failed to get the vmm master tid For kata container, the container's pid is meaning less to containerd/crio since the container's pid is belonged to VM, and containerd/crio couldn't use it. Thus we just return any tid of kata shim or hypervisor. But since the hypervisor had been stopped before deleting the container, and it wouldn't get the hypervisor's tid for some supported hypervisor, thus we'd better to return the kata shim's pid instead of hypervisor's tid. Fixes: #9777 Signed-off-by: Fupan Li --- .../runtimes/virt_container/src/container_manager/manager.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/manager.rs b/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/manager.rs index 3c8005013f..62d7eae453 100644 --- a/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/manager.rs +++ b/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/manager.rs @@ -139,12 +139,11 @@ impl ContainerManager for VirtContainerManager { // * should be run after the container is deleted but before delete operation returns // * spec details: https://github.com/opencontainers/runtime-spec/blob/c1662686cff159595277b79322d0272f5182941b/config.md#poststop let c_spec = c.spec().await; - let vmm_master_tid = self.hypervisor.get_vmm_master_tid().await?; let state = oci::State { version: c_spec.version.clone(), id: c.container_id.to_string(), status: oci::ContainerState::Stopped, - pid: vmm_master_tid as i32, + pid: self.pid as i32, bundle: c.config().await.bundle, annotations: c_spec.annotations.clone(), };