提交 72bddd5f 编写于 作者: O Oleg Strikov 提交者: Cole Robinson

qemu: Implement a stub cpuArchDriver.baseline() handler for arm

Openstack Nova calls virConnectBaselineCPU() during initialization
of the instance to get a full list of CPU features.
This patch adds a stub to arm-specific code to handle
this request (no actual work is done).
Signed-off-by: NOleg Strikov <oleg.strikov@canonical.com>
上级 da78406e
......@@ -86,6 +86,29 @@ ArmGuestData(virCPUDefPtr host ATTRIBUTE_UNUSED,
return VIR_CPU_COMPARE_IDENTICAL;
}
static virCPUDefPtr
ArmBaseline(virCPUDefPtr *cpus,
unsigned int ncpus ATTRIBUTE_UNUSED,
const char **models ATTRIBUTE_UNUSED,
unsigned int nmodels ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCPUDefPtr cpu = NULL;
virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, NULL);
if (VIR_ALLOC(cpu) < 0 ||
VIR_STRDUP(cpu->model, cpus[0]->model) < 0) {
virCPUDefFree(cpu);
return NULL;
}
cpu->type = VIR_CPU_TYPE_GUEST;
cpu->match = VIR_CPU_MATCH_EXACT;
return cpu;
}
struct cpuArchDriver cpuDriverArm = {
.name = "arm",
.arch = archs,
......@@ -96,7 +119,7 @@ struct cpuArchDriver cpuDriverArm = {
.free = ArmDataFree,
.nodeData = ArmNodeData,
.guestData = ArmGuestData,
.baseline = NULL,
.baseline = ArmBaseline,
.update = ArmUpdate,
.hasFeature = NULL,
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册