Skip to content

Commit

Permalink
virtcontainers: Tag unused functions and routines for ARM64
Browse files Browse the repository at this point in the history
ARM64 does not need all QEMU generic routines.

Fixes: kata-containers#1217

Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
Samuel Ortiz committed Feb 9, 2019
1 parent 9a04ccb commit 4763324
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/kata-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const (
kernelPropertyCorrect = "Kernel property value correct"

// these refer to fields in the procCPUINFO file
genericCPUFlagsTag = "flags"
genericCPUVendorField = "vendor_id"
genericCPUModelField = "model name"
genericCPUFlagsTag = "flags" // nolint: varcheck,unused
genericCPUVendorField = "vendor_id" // nolint: varcheck,unused
genericCPUModelField = "model name" // nolint: varcheck,unused
)

// variables rather than consts to allow tests to modify them
Expand Down
1 change: 1 addition & 0 deletions cli/kata-check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func makeCPUInfoFile(path, vendorID, flags string) error {
return ioutil.WriteFile(path, contents.Bytes(), testFileMode)
}

// nolint: unused
func genericTestGetCPUDetails(t *testing.T, validVendor string, validModel string, validContents string, data []TestData) {
tmpdir, err := ioutil.TempDir("", "")
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions cli/kata-env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func getExpectedAgentDetails(config oci.RuntimeConfig) (AgentInfo, error) {
}, nil
}

// nolint: unused
func genericGetExpectedHostDetails(tmpdir string, expectedVendor string, expectedModel string) (HostInfo, error) {
type filesToCreate struct {
file string
Expand Down
3 changes: 3 additions & 0 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@ func (q *qemu) resizeMemory(reqMemMB uint32, memoryBlockSizeMB uint32) (uint32,
}

// genericAppendBridges appends to devices the given bridges
// nolint: unused
func genericAppendBridges(devices []govmmQemu.Device, bridges []types.PCIBridge, machineType string) []govmmQemu.Device {
bus := defaultPCBridgeBus
switch machineType {
Expand Down Expand Up @@ -1437,6 +1438,7 @@ func genericAppendBridges(devices []govmmQemu.Device, bridges []types.PCIBridge,
return devices
}

// nolint: unused
func genericBridges(number uint32, machineType string) []types.PCIBridge {
var bridges []types.PCIBridge
var bt types.PCIType
Expand Down Expand Up @@ -1469,6 +1471,7 @@ func genericBridges(number uint32, machineType string) []types.PCIBridge {
return bridges
}

// nolint: unused
func genericMemoryTopology(memoryMb, hostMemoryMb uint64, slots uint8, memoryOffset uint32) govmmQemu.Memory {
// image NVDIMM device needs memory space 1024MB
// See https://github.com/clearcontainers/runtime/issues/380
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/qemu_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const defaultQemuMachineType = QemuVirt
var defaultQemuMachineOptions = "usb=off,accel=kvm,gic-version=" + getGuestGICVersion()

// Not used
const defaultPCBridgeBus = ""
const defaultPCBridgeBus = "" // nolint: unused

var qemuPaths = map[string]string{
QemuVirt: defaultQemuPath,
Expand Down

0 comments on commit 4763324

Please sign in to comment.