This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Leverage the new support for ppc64le
Fixes #302 Signed-off-by: Nitesh Konkar [email protected]
- Loading branch information
Showing
4 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2018 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# Power ppc64le settings | ||
|
||
MACHINETYPE := pseries | ||
KERNELPARAMS := | ||
MACHINEACCELERATORS := | ||
KERNELTYPE := uncompressed #This architecture must use an uncompressed kernel. | ||
QEMUCMD := qemu-system-ppc64le |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) 2018 IBM | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// archRequiredCPUFlags maps a CPU flag value to search for and a | ||
// human-readable description of that value. | ||
var archRequiredCPUFlags = map[string]string{} | ||
|
||
// archRequiredCPUAttribs maps a CPU (non-CPU flag) attribute value to search for | ||
// and a human-readable description of that value. | ||
var archRequiredCPUAttribs = map[string]string{} | ||
|
||
// archRequiredKernelModules maps a required module name to a human-readable | ||
// description of the modules functionality and an optional list of | ||
// required module parameters. | ||
var archRequiredKernelModules = map[string]kernelModule{ | ||
"kvm": { | ||
desc: "Kernel-based Virtual Machine", | ||
}, | ||
"kvm_hv": { | ||
desc: "Kernel-based Virtual Machine hardware virtualization", | ||
}, | ||
} | ||
|
||
func archHostCanCreateVMContainer() error { | ||
return kvmIsUsable() | ||
} | ||
|
||
// hostIsVMContainerCapable checks to see if the host is theoretically capable | ||
// of creating a VM container. | ||
func hostIsVMContainerCapable(details vmContainerCapableDetails) error { | ||
_, err := getCPUInfo(details.cpuInfoFile) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
count, err := checkKernelModules(details.requiredKernelModules, archKernelParamHandler) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if count == 0 { | ||
return nil | ||
} | ||
|
||
return fmt.Errorf("ERROR: %s", failMessage) | ||
} | ||
|
||
// kvmIsUsable determines if it will be possible to create a full virtual machine | ||
// by creating a minimal VM and then deleting it. | ||
func kvmIsUsable() error { | ||
return genericKvmIsUsable() | ||
} | ||
|
||
func archKernelParamHandler(onVMM bool, fields logrus.Fields, msg string) bool { | ||
return genericArchKernelParamHandler(onVMM, fields, msg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters