]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Implement a stub cpuArchDriver.baseline() handler for arm
authorOleg Strikov <oleg.strikov@canonical.com>
Mon, 3 Mar 2014 13:41:03 +0000 (17:41 +0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 3 Mar 2014 16:06:25 +0000 (11:06 -0500)
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>
src/cpu/cpu_arm.c

index 5baff4264f016b744fcd21e45f72e4baae5f9af0..ec80b35473468eaafe322e46ec109a8d09f7eb1c 100644 (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,
 };