[libvirt] [PATCH 16/22] cpu_x86: Add support for passing guest CPUs to virCPUx86Baseline

Jiri Denemark posted 22 patches 6 years, 12 months ago
[libvirt] [PATCH 16/22] cpu_x86: Add support for passing guest CPUs to virCPUx86Baseline
Posted by Jiri Denemark 6 years, 12 months ago
Modern host CPU models from domain capabilities XMLs are reported as
guest CPU definitions with feature policies. This patch updates
virCPUx86Baseline to properly handle such CPU models.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/cpu/cpu_x86.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 188d1eba75..6bef4089e9 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2482,13 +2482,12 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
     if (!(map = virCPUx86GetMap()))
         goto error;
 
-    if (!(base_model = x86ModelFromCPU(cpus[0], map, VIR_CPU_FEATURE_REQUIRE)))
+    if (!(base_model = x86ModelFromCPU(cpus[0], map, -1)))
         goto error;
 
     if (VIR_ALLOC(cpu) < 0)
         goto error;
 
-    cpu->arch = cpus[0]->arch;
     cpu->type = VIR_CPU_TYPE_GUEST;
     cpu->match = VIR_CPU_MATCH_EXACT;
 
@@ -2513,7 +2512,7 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
             }
         }
 
-        if (!(model = x86ModelFromCPU(cpus[i], map, VIR_CPU_FEATURE_REQUIRE)))
+        if (!(model = x86ModelFromCPU(cpus[i], map, -1)))
             goto error;
 
         if (cpus[i]->vendor && model->vendor &&
@@ -2570,8 +2569,6 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
     if (!outputVendor)
         VIR_FREE(cpu->vendor);
 
-    cpu->arch = VIR_ARCH_NONE;
-
  cleanup:
     x86ModelFree(base_model);
 
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 16/22] cpu_x86: Add support for passing guest CPUs to virCPUx86Baseline
Posted by Ján Tomko 6 years, 11 months ago
On Wed, May 16, 2018 at 10:39:35AM +0200, Jiri Denemark wrote:
>Modern host CPU models from domain capabilities XMLs are reported as
>guest CPU definitions with feature policies. This patch updates
>virCPUx86Baseline to properly handle such CPU models.
>
>Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
>---
> src/cpu/cpu_x86.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list