From 94298dd15c748526948570d45cd9fa723d18dd4e Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 12 Mar 2020 09:25:42 -0700 Subject: [PATCH] clh: Remove dead-code on maxClhVcpus Our CLH driver in kata defines its own constant variable 'maxClhVcpus' which can conflict with the maximum number of vCPUs specified from the kata configuration file 'clh.config.DefaultMaxVCPUs'. As the value from kata configuration file is preferred anyway and the code on 'maxClhVcpus' is not being used. We'd better remove it for better readability and avoiding further confusions. Fixes: #2528 Signed-off-by: Bo Chen --- virtcontainers/clh.go | 6 ------ virtcontainers/clh_test.go | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/virtcontainers/clh.go b/virtcontainers/clh.go index c5616dfb59..af8ec3f75b 100644 --- a/virtcontainers/clh.go +++ b/virtcontainers/clh.go @@ -62,7 +62,6 @@ const ( supportedMinorVersion = 5 defaultClhPath = "/usr/local/bin/cloud-hypervisor" virtioFsCacheAlways = "always" - maxClhVcpus = uint32(64) ) // Interface that hides the implementation of openAPI client @@ -795,11 +794,6 @@ func (clh *cloudHypervisor) LaunchClh() (string, int, error) { return errStr, cmd.Process.Pid, nil } -// MaxClhVCPUs returns the maximum number of vCPUs supported -func MaxClhVCPUs() uint32 { - return maxClhVcpus -} - //########################################################################### // // Cloud-hypervisor CLI builder diff --git a/virtcontainers/clh_test.go b/virtcontainers/clh_test.go index c3f5c6589a..be000bd3ee 100644 --- a/virtcontainers/clh_test.go +++ b/virtcontainers/clh_test.go @@ -47,7 +47,7 @@ func newClhConfig() (HypervisorConfig, error) { BlockDeviceDriver: config.VirtioBlock, MemorySize: defaultMemSzMiB, DefaultBridges: defaultBridges, - DefaultMaxVCPUs: MaxClhVCPUs(), + DefaultMaxVCPUs: uint32(64), SharedFS: config.VirtioFS, VirtioFSCache: virtioFsCacheAlways, VirtioFSDaemon: testVirtiofsdPath,