mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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:
parent
da78406e64
commit
72bddd5f2f
@ -86,6 +86,29 @@ ArmGuestData(virCPUDefPtr host ATTRIBUTE_UNUSED,
|
|||||||
return VIR_CPU_COMPARE_IDENTICAL;
|
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 = {
|
struct cpuArchDriver cpuDriverArm = {
|
||||||
.name = "arm",
|
.name = "arm",
|
||||||
.arch = archs,
|
.arch = archs,
|
||||||
@ -96,7 +119,7 @@ struct cpuArchDriver cpuDriverArm = {
|
|||||||
.free = ArmDataFree,
|
.free = ArmDataFree,
|
||||||
.nodeData = ArmNodeData,
|
.nodeData = ArmNodeData,
|
||||||
.guestData = ArmGuestData,
|
.guestData = ArmGuestData,
|
||||||
.baseline = NULL,
|
.baseline = ArmBaseline,
|
||||||
.update = ArmUpdate,
|
.update = ArmUpdate,
|
||||||
.hasFeature = NULL,
|
.hasFeature = NULL,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user