From: Jiri Denemark Date: Wed, 29 Mar 2017 09:00:32 +0000 (+0200) Subject: qemu: Check non-migratable host CPU features X-Git-Tag: v3.2.0-rc2^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=385c1cc96c54c88fad3e371ab6966f5c5a098441;p=thirdparty%2Flibvirt.git qemu: Check non-migratable host CPU features CPU features which change their value from disabled to enabled between two calls to query-cpu-model-expansion (the first with no extra properties set and the second with 'migratable' property set to false) can be marked as enabled and non-migratable in qemuMonitorCPUModelInfo. Since the code consuming qemuMonitorCPUModelInfo currently ignores the migratable flag, this change is effectively changing the CPU model advertised in domain capabilities to contain all features (even those which block migration). And this matches what we do for QEMU older than 2.9.0, when we detect all CPUID bits ourselves without asking QEMU. As a result of this change will work with all QEMU versions. Such CPU definition would be forbidden with QEMU >= 2.9.0 without this patch. Signed-off-by: Jiri Denemark --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9726bce748..b1245ad5dd 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2864,8 +2864,12 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, prop->type != nmProp->type) continue; - if (prop->value.boolean) + if (prop->value.boolean) { prop->migratable = VIR_TRISTATE_BOOL_YES; + } else if (nmProp->value.boolean) { + prop->value.boolean = true; + prop->migratable = VIR_TRISTATE_BOOL_NO; + } } (*modelInfo)->migratability = true; diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml index a4ab74dcaf..e8fe01d85e 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml @@ -30,6 +30,7 @@ + qemu64 diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml index 6efa8a668b..6386c4ed0d 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -314,7 +314,7 @@ - +