]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpuBaseline: Don't mess with the CPU returned by arch driver
authorJiri Denemark <jdenemar@redhat.com>
Fri, 2 Jul 2010 15:51:20 +0000 (17:51 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 7 Jul 2010 15:24:53 +0000 (17:24 +0200)
All features in the baseline CPU definition were always created with
policy='require' even though an arch driver returned them with different
policy settings.

src/cpu/cpu.c
src/cpu/cpu_x86.c

index 580b767b9afbca99dd133358aea3719b1f2d7b79..8d6c22b54964eea572a3a0f01c7e3ceac23e3f72 100644 (file)
@@ -354,7 +354,6 @@ cpuBaseline(virCPUDefPtr *cpus,
             unsigned int nmodels)
 {
     struct cpuArchDriver *driver;
-    virCPUDefPtr cpu;
     unsigned int i;
 
     VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
@@ -394,16 +393,7 @@ cpuBaseline(virCPUDefPtr *cpus,
         return NULL;
     }
 
-    if ((cpu = driver->baseline(cpus, ncpus, models, nmodels))) {
-        cpu->type = VIR_CPU_TYPE_GUEST;
-        cpu->match = VIR_CPU_MATCH_EXACT;
-        VIR_FREE(cpu->arch);
-
-        for (i = 0; i < cpu->nfeatures; i++)
-            cpu->features[i].policy = VIR_CPU_FEATURE_REQUIRE;
-    }
-
-    return cpu;
+    return driver->baseline(cpus, ncpus, models, nmodels);
 }
 
 
index f7473bffb4aca519e7b43d2c94833e5d5d20f2e4..30a2db68fdc9b88534da638446d96ec92ba08f35 100644 (file)
@@ -1366,6 +1366,8 @@ x86Baseline(virCPUDefPtr *cpus,
     if (x86Decode(cpu, data, models, nmodels, NULL) < 0)
         goto error;
 
+    VIR_FREE(cpu->arch);
+
 cleanup:
     x86DataFree(data);
     x86ModelFree(base_model);