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: Oleg Strikov <oleg.strikov@canonical.com>
This commit is contained in:
Oleg Strikov 2014-03-03 17:41:03 +04:00 committed by Cole Robinson
parent da78406e64
commit 72bddd5f2f

View File

@ -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,
};