]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix CPU model fallback in domain capabilities
authorJiri Denemark <jdenemar@redhat.com>
Tue, 10 Jan 2017 20:07:23 +0000 (21:07 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 24 Feb 2017 13:10:57 +0000 (14:10 +0100)
Our documentation of the domain capabilities XML says that the fallback
attribute of a CPU model is used to indicate whether the CPU model was
detected by libvirt itself (fallback="allow") or by asking the
hypervisor (fallback="forbid"). We need to properly set
fallback="forbid" when CPU model comes from QEMU to match the
documentation.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c
tests/domaincapsschemadata/qemu_2.8.0.s390x.xml

index 0f5acb76a9eb1446a683d2f33f1f3be8a96f7cce..29ca3d4f907af77cf1f13ff78dc8ff914fd84a7e 100644 (file)
@@ -3105,6 +3105,9 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps,
     if (ARCH_IS_S390(qemuCaps->arch))
         ret = virQEMUCapsInitCPUModelS390(qemuCaps, cpu);
 
+    if (ret == 0)
+        cpu->fallback = VIR_CPU_FALLBACK_FORBID;
+
     return ret;
 }
 
index efe345962a4d7039f76ef97a2dd8bcc04197791c..0b8135bc5c656cf1a362850333cfb2b6f77d6cb9 100644 (file)
@@ -21,7 +21,7 @@
   <cpu>
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'>
-      <model fallback='allow'>zEC12.2-base</model>
+      <model fallback='forbid'>zEC12.2-base</model>
       <feature policy='require' name='aefsi'/>
       <feature policy='require' name='msa5'/>
       <feature policy='require' name='msa4'/>