
On 08/12/2016 09:33 AM, Jiri Denemark wrote:
It really doesn't belong to the generic CPU driver.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 16 ++-------------- src/qemu/qemu_capabilities.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 15 deletions(-)
Hmm... interesting is this something that the online perf add more stats will need to also adjust, see (8/8): http://www.redhat.com/archives/libvir-list/2016-August/msg00209.html It doesn't seem so, but since I recognized the acronyms I figured I'd check... So here we are again at a summary - if I didn't comment on something consider it an implicit ACK. There's a couple of reviews that are simple and ACK'able - I think they're obvious. However, there's also a couple where I'm just looking for information. I have no reason to not ACK, just wanted some clarity. I don't necessarily need to see a whole new series. I think it just the interaction noted in patch 40, 35, and 26 (update and compare callbacks). John
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index e0987c4..237fa40 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2558,22 +2558,10 @@ x86UpdateHostModel(virCPUDefPtr guest, /* Remove non-migratable features by default */ updated->type = VIR_CPU_TYPE_GUEST; updated->mode = VIR_CPU_MODE_CUSTOM; - if (virCPUDefCopyModel(updated, host, true) < 0) + if (virCPUDefCopyModelFilter(updated, host, true, + x86FeatureIsMigratable, map) < 0) goto cleanup;
- i = 0; - while (i < updated->nfeatures) { - if (x86FeatureIsMigratable(updated->features[i].name, map) && - STRNEQ(updated->features[i].name, "cmt") && - STRNEQ(updated->features[i].name, "mbm_total") && - STRNEQ(updated->features[i].name, "mbm_local")) { - i++; - } else { - VIR_FREE(updated->features[i].name); - VIR_DELETE_ELEMENT_INPLACE(updated->features, i, updated->nfeatures); - } - } - if (guest->vendor_id) { VIR_FREE(updated->vendor_id); if (VIR_STRDUP(updated->vendor_id, guest->vendor_id) < 0) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f70a36c..187d4c1 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2859,6 +2859,19 @@ int virQEMUCapsProbeQMP(virQEMUCapsPtr qemuCaps, }
+static bool +virQEMUCapsCPUFilterFeatures(const char *name, + void *opaque ATTRIBUTE_UNUSED) +{ + if (STREQ(name, "cmt") || + STREQ(name, "mbm_total") || + STREQ(name, "mbm_local")) + return false; + + return true; +} + + void virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, virCapsHostPtr host) @@ -2877,7 +2890,8 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, cpu->mode = VIR_CPU_MODE_CUSTOM; cpu->match = VIR_CPU_MATCH_EXACT;
- if (virCPUDefCopyModel(cpu, host->cpu, true) < 0) + if (virCPUDefCopyModelFilter(cpu, host->cpu, true, + virQEMUCapsCPUFilterFeatures, NULL) < 0) goto error; }