[libvirt] [PATCH v2 07/33] qemu: Fix CPU model fallback in domain capabilities

Jiri Denemark jdenemar at redhat.com
Wed Feb 15 16:44:41 UTC 2017


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 at redhat.com>
---

Notes:
    Version 2:
    - no change

 src/qemu/qemu_capabilities.c                    | 3 +++
 tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0be2301cb..c511248bd 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3103,6 +3103,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;
 }
 
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
index efe345962..0b8135bc5 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
@@ -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'/>
-- 
2.11.1




More information about the libvir-list mailing list