From f886c0bf3512383d7d4466a0c4e2bda89c174539 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Thu, 18 Jul 2019 21:04:29 -0700 Subject: [PATCH] vc: drop container SetPid API It is not used by anyone. Signed-off-by: Peng Tao --- virtcontainers/container.go | 10 ---------- virtcontainers/documentation/api/1.0/api.md | 1 - virtcontainers/interfaces.go | 1 - virtcontainers/pkg/vcmock/container.go | 6 ------ 4 files changed, 18 deletions(-) diff --git a/virtcontainers/container.go b/virtcontainers/container.go index 4ae6754333..e41db846da 100644 --- a/virtcontainers/container.go +++ b/virtcontainers/container.go @@ -368,16 +368,6 @@ func (c *Container) GetPid() int { return c.process.Pid } -// SetPid sets and stores the given pid as the pid of container's process. -func (c *Container) SetPid(pid int) error { - c.process.Pid = pid - - if !c.sandbox.supportNewStore() { - return c.storeProcess() - } - return nil -} - func (c *Container) setStateFstype(fstype string) error { c.state.Fstype = fstype diff --git a/virtcontainers/documentation/api/1.0/api.md b/virtcontainers/documentation/api/1.0/api.md index c0051e56a9..4753f5c9d1 100644 --- a/virtcontainers/documentation/api/1.0/api.md +++ b/virtcontainers/documentation/api/1.0/api.md @@ -773,7 +773,6 @@ type VCContainer interface { ID() string Sandbox() VCSandbox Process() Process - SetPid(pid int) error } ``` diff --git a/virtcontainers/interfaces.go b/virtcontainers/interfaces.go index d62389d7f0..8ce0e22fa3 100644 --- a/virtcontainers/interfaces.go +++ b/virtcontainers/interfaces.go @@ -110,5 +110,4 @@ type VCContainer interface { ID() string Sandbox() VCSandbox Process() Process - SetPid(pid int) error } diff --git a/virtcontainers/pkg/vcmock/container.go b/virtcontainers/pkg/vcmock/container.go index d93c271811..63fcc8a02b 100644 --- a/virtcontainers/pkg/vcmock/container.go +++ b/virtcontainers/pkg/vcmock/container.go @@ -38,12 +38,6 @@ func (c *Container) GetPid() int { return c.MockPid } -// SetPid implements the VCContainer function of the same name. -func (c *Container) SetPid(pid int) error { - c.MockPid = pid - return nil -} - // GetAnnotations implements the VCContainer function of the same name. func (c *Container) GetAnnotations() map[string]string { return c.MockAnnotations