From 54f12461db8e8e76d1da20d3cdca1e629aa7f9e2 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 26 May 2020 00:36:06 -0700 Subject: [PATCH] clh: memory: remove pmem size argument Pmem size now is calculated by the hypervisor. This is not required anymore. Remove it to simplify the code. Signed-off-by: Jose Carlos Venegas Munoz Signed-off-by: Peng Tao --- src/runtime/virtcontainers/clh.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index 73ac7bfbc6..405ea9e092 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -271,14 +271,8 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ return errors.New("image path is empty") } - st, err := os.Stat(imagePath) - if err != nil { - return fmt.Errorf("Failed to get information for image file '%v': %v", imagePath, err) - } - pmem := chclient.PmemConfig{ File: imagePath, - Size: st.Size(), DiscardWrites: true, } clh.vmconfig.Pmem = append(clh.vmconfig.Pmem, pmem)