Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
clh: Remove dead-code on maxClhVcpus
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
likebreath committed Mar 13, 2020
1 parent ee01fa8 commit 94298dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/clh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 94298dd

Please sign in to comment.