[libvirt PATCH 0/9] qemu: Add support for -cpu host, migratable=on|off

Jiri Denemark (9): conf: Use g_auto* in virCPUDefParseXML qemu: Probe for .migratable property of a CPU qemu: Probe for migrtability support in CPU expansion qemu: Avoid probing unsupported migratable CPU expansion conf: Introduce migratable attribute for the <cpu> element conf: Advertise migratable attribute for CPU in domcaps qemu: Advertise migratable attribute for CPU in domcaps qemu: Fill default value in //cpu/@migratable attribute qemu: Pass migratable=on|off property for -cpu host docs/formatdomain.html.in | 14 +- docs/formatdomaincaps.html.in | 13 +- docs/schemas/domaincaps.rng | 3 + docs/schemas/domaincommon.rng | 5 + src/conf/cpu_conf.c | 157 +++++++++--------- src/conf/cpu_conf.h | 1 + src/conf/domain_capabilities.c | 13 +- src/conf/domain_capabilities.h | 1 + src/qemu/qemu_capabilities.c | 28 +++- src/qemu/qemu_capabilities.h | 4 + src/qemu/qemu_command.c | 15 ++ src/qemu/qemu_domain.c | 14 +- .../domaincapsdata/qemu_1.5.3-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_1.5.3.x86_64.xml | 6 +- .../domaincapsdata/qemu_1.6.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_1.6.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_1.7.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_1.7.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.1.1-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.1.1.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.10.0-q35.x86_64.xml | 6 +- .../qemu_2.10.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.11.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 7 +- .../qemu_2.12.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 6 +- .../qemu_2.6.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.6.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.6.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.6.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.7.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.8.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.8.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.9.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.9.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.9.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_3.0.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 7 +- .../qemu_4.0.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 +- .../qemu_4.2.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 +- .../qemu_5.0.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 +- .../caps_2.10.0.s390x.replies | 22 --- .../caps_2.10.0.x86_64.xml | 1 + .../caps_2.11.0.s390x.replies | 22 --- .../caps_2.11.0.x86_64.xml | 1 + .../caps_2.12.0.s390x.replies | 22 --- .../caps_2.12.0.x86_64.xml | 2 + .../caps_2.8.0.s390x.replies | 22 --- .../caps_2.9.0.s390x.replies | 22 --- .../caps_2.9.0.x86_64.xml | 1 + .../caps_3.0.0.s390x.replies | 22 --- .../caps_3.0.0.x86_64.xml | 2 + .../caps_3.1.0.x86_64.xml | 2 + .../caps_4.0.0.s390x.replies | 48 +----- .../caps_4.0.0.x86_64.xml | 2 + .../caps_4.1.0.x86_64.xml | 2 + .../caps_4.2.0.aarch64.replies | 48 +----- .../caps_4.2.0.s390x.replies | 48 +----- .../caps_4.2.0.x86_64.xml | 2 + .../caps_5.0.0.aarch64.replies | 48 +----- .../caps_5.0.0.x86_64.xml | 2 + .../caps_5.1.0.x86_64.xml | 2 + .../migration-in-params-in.xml | 2 +- .../migration-out-params-in.xml | 2 +- .../cpu-check-default-none.xml | 2 +- .../qemuxml2xmloutdata/cpu-host-kvmclock.xml | 2 +- .../cpu-host-passthrough-features.xml | 2 +- tests/qemuxml2xmloutdata/kvm-features.xml | 2 +- 109 files changed, 578 insertions(+), 481 deletions(-) -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/conf/cpu_conf.c | 130 +++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 80 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 1d02e23175..25648a946c 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -324,29 +324,26 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, virCPUType type, virCPUDefPtr *cpu) { - virCPUDefPtr def = NULL; - xmlNodePtr *nodes = NULL; + g_autoptr(virCPUDef) def = NULL; + g_autofree xmlNodePtr *nodes = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt); int n; size_t i; - char *cpuMode; - char *fallback = NULL; - char *vendor_id = NULL; - char *tscScaling = NULL; + g_autofree char *cpuMode = NULL; + g_autofree char *fallback = NULL; + g_autofree char *vendor_id = NULL; + g_autofree char *tscScaling = NULL; virHostCPUTscInfoPtr tsc = NULL; - int ret = -1; *cpu = NULL; - if (xpath && !(ctxt->node = virXPathNode(xpath, ctxt))) { - ret = 0; - goto cleanup; - } + if (xpath && !(ctxt->node = virXPathNode(xpath, ctxt))) + return 0; if (!virXMLNodeNameEqual(ctxt->node, "cpu")) { virReportError(VIR_ERR_XML_ERROR, "%s", _("XML does not contain expected 'cpu' element")); - goto cleanup; + return -1; } def = virCPUDefNew(); @@ -357,7 +354,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_XML_ERROR, "%s", _("'arch' element cannot be used inside 'cpu'" " element with 'match' attribute'")); - goto cleanup; + return -1; } def->type = VIR_CPU_TYPE_HOST; } else { @@ -369,10 +366,9 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if ((cpuMode = virXMLPropString(ctxt->node, "mode"))) { if (def->type == VIR_CPU_TYPE_HOST) { - VIR_FREE(cpuMode); virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Attribute mode is only allowed for guest CPU")); - goto cleanup; + return -1; } else { def->mode = virCPUModeTypeFromString(cpuMode); @@ -380,10 +376,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Invalid mode attribute '%s'"), cpuMode); - VIR_FREE(cpuMode); - goto cleanup; + return -1; } - VIR_FREE(cpuMode); } } else { if (def->type == VIR_CPU_TYPE_HOST) @@ -393,67 +387,60 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, } if (def->type == VIR_CPU_TYPE_GUEST) { - char *match = virXMLPropString(ctxt->node, "match"); - char *check; + g_autofree char *match = virXMLPropString(ctxt->node, "match"); + g_autofree char *check = NULL; if (match) { def->match = virCPUMatchTypeFromString(match); - VIR_FREE(match); - if (def->match < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid match attribute for CPU " "specification")); - goto cleanup; + return -1; } } if ((check = virXMLPropString(ctxt->node, "check"))) { int value = virCPUCheckTypeFromString(check); - VIR_FREE(check); - if (value < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid check attribute for CPU " "specification")); - goto cleanup; + return -1; } def->check = value; } } if (def->type == VIR_CPU_TYPE_HOST) { - char *arch = virXPathString("string(./arch[1])", ctxt); + g_autofree char *arch = virXPathString("string(./arch[1])", ctxt); if (!arch) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing CPU architecture")); - goto cleanup; + return -1; } if ((def->arch = virArchFromString(arch)) == VIR_ARCH_NONE) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown architecture %s"), arch); - VIR_FREE(arch); - goto cleanup; + return -1; } - VIR_FREE(arch); if (virXPathBoolean("boolean(./microcode[1]/@version)", ctxt) > 0 && virXPathUInt("string(./microcode[1]/@version)", ctxt, &def->microcodeVersion) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("invalid microcode version")); - goto cleanup; + return -1; } if (virXPathBoolean("boolean(./counter[@name='tsc'])", ctxt) > 0) { - if (VIR_ALLOC(tsc) < 0) - goto cleanup; + tsc = g_new0(virHostCPUTscInfo, 1); if (virXPathULongLong("string(./counter[@name='tsc']/@frequency)", ctxt, &tsc->frequency) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid TSC frequency")); - goto cleanup; + return -1; } tscScaling = virXPathString("string(./counter[@name='tsc']/@scaling)", @@ -463,7 +450,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if (scaling < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid TSC scaling attribute")); - goto cleanup; + return -1; } tsc->scaling = scaling; } @@ -476,7 +463,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, def->type == VIR_CPU_TYPE_HOST) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing CPU model name")); - goto cleanup; + return -1; } if (def->type == VIR_CPU_TYPE_GUEST && @@ -486,7 +473,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if ((def->fallback = virCPUFallbackTypeFromString(fallback)) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid fallback attribute")); - goto cleanup; + return -1; } } @@ -496,18 +483,17 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_XML_ERROR, _("vendor_id must be exactly %d characters long"), VIR_CPU_VENDOR_ID_LENGTH); - goto cleanup; + return -1; } /* ensure that the string can be passed to qemu */ if (strchr(vendor_id, ',')) { virReportError(VIR_ERR_XML_ERROR, "%s", _("vendor id is invalid")); - goto cleanup; + return -1; } - def->vendor_id = vendor_id; - vendor_id = NULL; + def->vendor_id = g_steal_pointer(&vendor_id); } } @@ -515,7 +501,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if (def->vendor && !def->model) { virReportError(VIR_ERR_XML_ERROR, "%s", _("CPU vendor specified without CPU model")); - goto cleanup; + return -1; } if (virXPathNode("./topology[1]", ctxt)) { @@ -524,7 +510,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if (virXPathULong("string(./topology[1]/@sockets)", ctxt, &ul) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing 'sockets' attribute in CPU topology")); - goto cleanup; + return -1; } def->sockets = (unsigned int) ul; @@ -532,7 +518,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if (virXPathULong("string(./topology[1]/@dies)", ctxt, &ul) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Malformed 'dies' attribute in CPU topology")); - goto cleanup; + return -1; } def->dies = (unsigned int) ul; } else { @@ -542,71 +528,69 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if (virXPathULong("string(./topology[1]/@cores)", ctxt, &ul) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing 'cores' attribute in CPU topology")); - goto cleanup; + return -1; } def->cores = (unsigned int) ul; if (virXPathULong("string(./topology[1]/@threads)", ctxt, &ul) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing 'threads' attribute in CPU topology")); - goto cleanup; + return -1; } def->threads = (unsigned int) ul; if (!def->sockets || !def->cores || !def->threads || !def->dies) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid CPU topology")); - goto cleanup; + return -1; } } if ((n = virXPathNodeSet("./feature", ctxt, &nodes)) < 0) - goto cleanup; + return -1; if (n > 0) { if (!def->model && def->mode == VIR_CPU_MODE_CUSTOM) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Non-empty feature list specified without " "CPU model")); - goto cleanup; + return -1; } if (VIR_RESIZE_N(def->features, def->nfeatures_max, def->nfeatures, n) < 0) - goto cleanup; + return -1; def->nfeatures = n; } for (i = 0; i < n; i++) { - char *name; + g_autofree char *name = NULL; int policy; /* enum virDomainCPUFeaturePolicy */ size_t j; if (def->type == VIR_CPU_TYPE_GUEST) { - char *strpolicy; + g_autofree char *strpolicy = NULL; strpolicy = virXMLPropString(nodes[i], "policy"); if (strpolicy == NULL) policy = VIR_CPU_FEATURE_REQUIRE; else policy = virCPUFeaturePolicyTypeFromString(strpolicy); - VIR_FREE(strpolicy); if (policy < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid CPU feature policy")); - goto cleanup; + return -1; } } else { policy = -1; } if (!(name = virXMLPropString(nodes[i], "name")) || *name == 0) { - VIR_FREE(name); virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid CPU feature name")); - goto cleanup; + return -1; } for (j = 0; j < i; j++) { @@ -614,24 +598,23 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_XML_ERROR, _("CPU feature '%s' specified more than once"), name); - VIR_FREE(name); - goto cleanup; + return -1; } } - def->features[i].name = name; + def->features[i].name = g_steal_pointer(&name); def->features[i].policy = policy; } if (virXPathInt("count(./cache)", ctxt, &n) < 0) { - goto cleanup; + return -1; } else if (n > 1) { virReportError(VIR_ERR_XML_ERROR, "%s", _("at most one CPU cache element may be specified")); - goto cleanup; + return -1; } else if (n == 1) { int level = -1; - char *strmode; + g_autofree char *strmode = NULL; int mode; if (virXPathBoolean("boolean(./cache[1]/@level)", ctxt) == 1 && @@ -639,36 +622,23 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, level < 1 || level > 3)) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid CPU cache level, must be in range [1,3]")); - goto cleanup; + return -1; } if (!(strmode = virXPathString("string(./cache[1]/@mode)", ctxt)) || (mode = virCPUCacheModeTypeFromString(strmode)) < 0) { - VIR_FREE(strmode); virReportError(VIR_ERR_XML_ERROR, "%s", _("missing or invalid CPU cache mode")); - goto cleanup; + return -1; } - VIR_FREE(strmode); - - if (VIR_ALLOC(def->cache) < 0) - goto cleanup; + def->cache = g_new0(virCPUCacheDef, 1); def->cache->level = level; def->cache->mode = mode; } *cpu = g_steal_pointer(&def); - ret = 0; - - cleanup: - VIR_FREE(fallback); - VIR_FREE(vendor_id); - VIR_FREE(nodes); - VIR_FREE(tscScaling); - VIR_FREE(tsc); - virCPUDefFree(def); - return ret; + return 0; } -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 + 10 files changed, 15 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f12769635a..3f5ddbd34e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -582,6 +582,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "tcg", "virtio-blk-pci.scsi.default.disabled", "pvscsi", + + /* 370 */ + "cpu.migratable", ); @@ -1641,6 +1644,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[] static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMaxCPU[] = { { "unavailable-features", QEMU_CAPS_CPU_UNAVAILABLE_FEATURES }, { "kvm-no-adjvtime", QEMU_CAPS_CPU_KVM_NO_ADJVTIME }, + { "migratable", QEMU_CAPS_CPU_MIGRATABLE }, }; static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 076ecad0f7..c07b3e6f08 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -564,6 +564,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_VIRTIO_BLK_SCSI_DEFAULT_DISABLED, /* virtio-blk-pci.scsi disabled by default */ QEMU_CAPS_SCSI_PVSCSI, /* -device pvscsi */ + /* 370 */ + QEMU_CAPS_CPU_MIGRATABLE, /* -cpu ...,migratable=on|off */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index 319dd6f2c3..1cb0957ed7 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -200,6 +200,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100289</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml index 40cff641a8..10b2661fe3 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -206,6 +206,7 @@ <flag name='storage.werror'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100239</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index 3dbda4b3f3..7ff47aa348 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -209,6 +209,7 @@ <flag name='storage.werror'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>3000092</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml index bf7735caf3..e9fdf9cb1e 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -214,6 +214,7 @@ <flag name='storage.werror'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>4000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml index 8ce0f80e8a..d57cedd0db 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -220,6 +220,7 @@ <flag name='storage.werror'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>4001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml index 50ed35f092..2685c3219f 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -228,6 +228,7 @@ <flag name='virtio.packed'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>4002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml index ba39fef713..0355518cbe 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -234,6 +234,7 @@ <flag name='tcg'/> <flag name='virtio-blk-pci.scsi.default.disabled'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>5000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml index 3f538628b3..906fec41ee 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -234,6 +234,7 @@ <flag name='tcg'/> <flag name='virtio-blk-pci.scsi.default.disabled'/> <flag name='pvscsi'/> + <flag name='cpu.migratable'/> <version>5000050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_capabilities.c | 12 +++++++++++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 + 13 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3f5ddbd34e..dab3665f07 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -585,6 +585,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 370 */ "cpu.migratable", + "query-cpu-model-expansion.migratable", ); @@ -5041,9 +5042,18 @@ virQEMUCapsInitProcessCaps(virQEMUCapsPtr qemuCaps) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM); if (ARCH_IS_X86(qemuCaps->arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_CACHE); + /* Old x86 QEMU supported migratable:false property in + * query-cpu-model-expansion arguments even though it was not properly + * advertised as a CPU property. + */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE) || + qemuCaps->version < 2012000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE); + } + if (ARCH_IS_S390(qemuCaps->arch)) { /* Legacy assurance for QEMU_CAPS_CCW */ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW) && diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c07b3e6f08..f085e67e11 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -566,6 +566,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 370 */ QEMU_CAPS_CPU_MIGRATABLE, /* -cpu ...,migratable=on|off */ + QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE, /* query-cpu-model-expansion supports migratable:false */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml index cb02723ada..8030de8b5f 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -185,6 +185,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2010000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100287</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml index 5245fc77dc..cf927c0bd6 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -191,6 +191,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2011000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100288</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index 1cb0957ed7..d9de98eca4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -201,6 +201,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100289</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml index 122d9509f1..866d1062bf 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -179,6 +179,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2009000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100247</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml index 10b2661fe3..ac8db37399 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -207,6 +207,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100239</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index 7ff47aa348..bc013ecc08 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -210,6 +210,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>3000092</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml index e9fdf9cb1e..d7fb3c2a14 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -215,6 +215,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>4000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml index d57cedd0db..6f904b6ff4 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -221,6 +221,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>4001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml index 2685c3219f..f0bb23d507 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -229,6 +229,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>4002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml index 0355518cbe..e4bf738cb5 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -235,6 +235,7 @@ <flag name='virtio-blk-pci.scsi.default.disabled'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>5000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml index 906fec41ee..cec503308f 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -235,6 +235,7 @@ <flag name='virtio-blk-pci.scsi.default.disabled'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>5000050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_capabilities.c | 1 + .../caps_2.10.0.s390x.replies | 22 --------- .../caps_2.11.0.s390x.replies | 22 --------- .../caps_2.12.0.s390x.replies | 22 --------- .../caps_2.8.0.s390x.replies | 22 --------- .../caps_2.9.0.s390x.replies | 22 --------- .../caps_3.0.0.s390x.replies | 22 --------- .../caps_4.0.0.s390x.replies | 48 +------------------ .../caps_4.2.0.aarch64.replies | 48 +------------------ .../caps_4.2.0.s390x.replies | 48 +------------------ .../caps_5.0.0.aarch64.replies | 48 +------------------ 11 files changed, 9 insertions(+), 316 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dab3665f07..7a976b6bbc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3061,6 +3061,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, /* Try to check migratability of each feature. */ if (modelInfo && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE) && qemuMonitorGetCPUModelExpansion(mon, type, cpu, false, fail_no_props, &nonMigratable) < 0) goto cleanup; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies index 9cae647bdf..4f7d17b4fe 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies @@ -14969,28 +14969,6 @@ "id": "libvirt-35" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-36" -} - -{ - "id": "libvirt-36", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies index 6b06303f7b..3096559c13 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies @@ -15270,28 +15270,6 @@ "id": "libvirt-36" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-37" -} - -{ - "id": "libvirt-37", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies index 93ad14a6b8..66543f62ee 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies @@ -16990,28 +16990,6 @@ "id": "libvirt-38" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-39" -} - -{ - "id": "libvirt-39", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies index 5db900ce80..da9ef050b6 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies @@ -13046,28 +13046,6 @@ "id": "libvirt-35" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-36" -} - -{ - "id": "libvirt-36", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies index 503f896892..3aca949683 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies @@ -14031,28 +14031,6 @@ "id": "libvirt-35" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-36" -} - -{ - "id": "libvirt-36", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.replies b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.replies index 0b35f7e99b..48b5a0ee01 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.replies @@ -17519,28 +17519,6 @@ "id": "libvirt-39" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-40" -} - -{ - "id": "libvirt-40", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.s390x.replies b/tests/qemucapabilitiesdata/caps_4.0.0.s390x.replies index 70fb54b0e7..d81d5c8003 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.s390x.replies @@ -18338,28 +18338,6 @@ "id": "libvirt-39" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-40" -} - -{ - "id": "libvirt-40", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" @@ -21475,31 +21453,9 @@ "id": "libvirt-3" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "max", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-4" -} - -{ - "id": "libvirt-4", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "query-machines", - "id": "libvirt-5" + "id": "libvirt-4" } { @@ -21572,5 +21528,5 @@ "cpu-max": 248 } ], - "id": "libvirt-5" + "id": "libvirt-4" } diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies index 4d28047ebe..a16ba89aeb 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies @@ -21376,28 +21376,6 @@ "id": "libvirt-43" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "full", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-44" -} - -{ - "id": "libvirt-44", - "error": { - "class": "GenericError", - "desc": "Parameter 'migratable' is unexpected" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" @@ -21646,31 +21624,9 @@ "id": "libvirt-3" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "full", - "model": { - "name": "max", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-4" -} - -{ - "id": "libvirt-4", - "error": { - "class": "GenericError", - "desc": "Parameter 'migratable' is unexpected" - } -} - { "execute": "query-machines", - "id": "libvirt-5" + "id": "libvirt-4" } { @@ -22221,5 +22177,5 @@ "deprecated": false } ], - "id": "libvirt-5" + "id": "libvirt-4" } diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies index 82b60bf069..9250132d45 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies @@ -19157,28 +19157,6 @@ "id": "libvirt-39" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-40" -} - -{ - "id": "libvirt-40", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" @@ -22639,31 +22617,9 @@ "id": "libvirt-3" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "static", - "model": { - "name": "max", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-4" -} - -{ - "id": "libvirt-4", - "error": { - "class": "GenericError", - "desc": "Property '.migratable' not found" - } -} - { "execute": "query-machines", - "id": "libvirt-5" + "id": "libvirt-4" } { @@ -22790,5 +22746,5 @@ "deprecated": false } ], - "id": "libvirt-5" + "id": "libvirt-4" } diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies index 44f1bc6fb7..9e683ef979 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies @@ -22725,28 +22725,6 @@ "id": "libvirt-43" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "full", - "model": { - "name": "host", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-44" -} - -{ - "id": "libvirt-44", - "error": { - "class": "GenericError", - "desc": "Parameter 'migratable' is unexpected" - } -} - { "execute": "qmp_capabilities", "id": "libvirt-1" @@ -23000,31 +22978,9 @@ "id": "libvirt-3" } -{ - "execute": "query-cpu-model-expansion", - "arguments": { - "type": "full", - "model": { - "name": "max", - "props": { - "migratable": false - } - } - }, - "id": "libvirt-4" -} - -{ - "id": "libvirt-4", - "error": { - "class": "GenericError", - "desc": "Parameter 'migratable' is unexpected" - } -} - { "execute": "query-machines", - "id": "libvirt-5" + "id": "libvirt-4" } { @@ -23612,5 +23568,5 @@ "deprecated": false } ], - "id": "libvirt-5" + "id": "libvirt-4" } -- 2.27.0

The attribute is only allowed for host-passthrough CPUs and it can be used to request only migratable or all supported features to be enabled in the virtual CPU. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/formatdomain.html.in | 14 ++++++++++++-- docs/schemas/domaincommon.rng | 5 +++++ src/conf/cpu_conf.c | 27 +++++++++++++++++++++++++++ src/conf/cpu_conf.h | 1 + 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 33cec1e6dd..6ebf19ae57 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1490,7 +1490,7 @@ ...</pre> <pre> -<cpu mode='host-passthrough'> +<cpu mode='host-passthrough' migratable='off'> <cache mode='passthrough'/> <feature policy='disable' name='lahf_lm'/> ...</pre> @@ -1639,7 +1639,17 @@ using host-passthrough is dangerous if the source and destination hosts are not identical in both hardware, QEMU version, microcode version and configuration. If such a migration is attempted then the guest may - hang or crash upon resuming execution on the destination host.</dd> + hang or crash upon resuming execution on the destination host. + Depending on hypervisor version the virtual CPU may or may not + contain features which may block migration even to an identical host. + <span class="since">Since 6.5.0</span> optional + <code>migratable</code> attribute may be used to explicitly request + such features to be removed from (<code>on</code>) or kept in + (<code>off</code>) the virtual CPU. This attribute does not make + migration to another host safer: even with + <code>migratable='on'</code> migration will be dangerous unless both + hosts are identical as described above. + </dd> </dl> Both <code>host-model</code> and <code>host-passthrough</code> modes diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 6727cd743b..19242a9a32 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5469,6 +5469,11 @@ <optional> <ref name="cpuCheck"/> </optional> + <optional> + <attribute name="migratable"> + <ref name="virOnOff"/> + </attribute> + </optional> <interleave> <optional> <ref name="cpuModel"/> diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 25648a946c..b40737e407 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -243,6 +243,7 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu) copy->cores = cpu->cores; copy->threads = cpu->threads; copy->arch = cpu->arch; + copy->migratable = cpu->migratable; if (cpu->cache) { if (VIR_ALLOC(copy->cache) < 0) @@ -333,6 +334,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, g_autofree char *fallback = NULL; g_autofree char *vendor_id = NULL; g_autofree char *tscScaling = NULL; + g_autofree char *migratable = NULL; virHostCPUTscInfoPtr tsc = NULL; *cpu = NULL; @@ -386,6 +388,26 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, def->mode = VIR_CPU_MODE_CUSTOM; } + if ((migratable = virXMLPropString(ctxt->node, "migratable"))) { + int val; + + if (def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Attribute migratable is only allowed for " + "host-passthrough CPU")); + return -1; + } + + if ((val = virTristateSwitchTypeFromString(migratable)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Invalid value in migratable attribute: '%s'"), + migratable); + return -1; + } + + def->migratable = val; + } + if (def->type == VIR_CPU_TYPE_GUEST) { g_autofree char *match = virXMLPropString(ctxt->node, "match"); g_autofree char *check = NULL; @@ -698,6 +720,11 @@ virCPUDefFormatBufFull(virBufferPtr buf, virBufferAsprintf(&attributeBuf, " check='%s'", virCPUCheckTypeToString(def->check)); } + + if (def->mode == VIR_CPU_MODE_HOST_PASSTHROUGH && def->migratable) { + virBufferAsprintf(&attributeBuf, " migratable='%s'", + virTristateSwitchTypeToString(def->migratable)); + } } /* Format children */ diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index a95d56d017..24c51e3a63 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -141,6 +141,7 @@ struct _virCPUDef { virCPUFeatureDefPtr features; virCPUCacheDefPtr cache; virHostCPUTscInfoPtr tsc; + virTristateSwitch migratable; /* for host-passthrough mode */ }; virCPUDefPtr virCPUDefNew(void); -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/formatdomaincaps.html.in | 13 +++++++++++-- docs/schemas/domaincaps.rng | 3 +++ src/conf/domain_capabilities.c | 13 ++++++++++++- src/conf/domain_capabilities.h | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 7df9f0bbbf..1506f79818 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -201,7 +201,12 @@ <domainCapabilities> ... <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> <vendor>Intel</vendor> @@ -227,7 +232,11 @@ <dl> <dt><code>host-passthrough</code></dt> - <dd>No mode specific details are provided.</dd> + <dd> + The <code>hostPassthroughMigratable</code> enum shows possible values + of the <code>migratable</code> attribute for the <cpu> element + with <code>mode='host-passthrough'</code> in the domain XML. + </dd> <dt><code>host-model</code></dt> <dd> diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 682cc82177..325581476d 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -99,6 +99,9 @@ <value>host-passthrough</value> </attribute> <ref name='supported'/> + <optional> + <ref name='enum'/> + </optional> </element> </define> diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 921d795630..0fa8aee78e 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -412,10 +412,21 @@ virDomainCapsCPUFormat(virBufferPtr buf, virBufferAddLit(buf, "<cpu>\n"); virBufferAdjustIndent(buf, 2); - virBufferAsprintf(buf, "<mode name='%s' supported='%s'/>\n", + virBufferAsprintf(buf, "<mode name='%s' supported='%s'", virCPUModeTypeToString(VIR_CPU_MODE_HOST_PASSTHROUGH), cpu->hostPassthrough ? "yes" : "no"); + if (cpu->hostPassthrough && cpu->hostPassthroughMigratable.report) { + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); + ENUM_PROCESS(cpu, hostPassthroughMigratable, + virTristateSwitchTypeToString); + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "</mode>\n"); + } else { + virBufferAddLit(buf, "/>\n"); + } + virBufferAsprintf(buf, "<mode name='%s' ", virCPUModeTypeToString(VIR_CPU_MODE_HOST_MODEL)); if (cpu->hostModel) { diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 9f4a23d015..685d5e2a44 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -145,6 +145,7 @@ typedef struct _virDomainCapsCPU virDomainCapsCPU; typedef virDomainCapsCPU *virDomainCapsCPUPtr; struct _virDomainCapsCPU { bool hostPassthrough; + virDomainCapsEnum hostPassthroughMigratable; virCPUDefPtr hostModel; virDomainCapsCPUModelsPtr custom; }; -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_capabilities.c | 11 ++++++++++- tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_1.5.3.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_1.6.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_1.7.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.1.1.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_2.10.0.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_2.10.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_2.10.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_2.10.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.11.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_2.12.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_2.6.0.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_2.6.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_2.6.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.7.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.8.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_2.8.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_2.9.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_2.9.0.x86_64.xml | 6 +++++- tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_3.0.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_4.0.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +++++- tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +++++- tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +++++- tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 ++++++- tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 ++++++- 71 files changed, 376 insertions(+), 71 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 7a976b6bbc..bd3b26d0d9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5857,9 +5857,18 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps, { if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype, VIR_CPU_MODE_HOST_PASSTHROUGH, - domCaps->machine)) + domCaps->machine)) { domCaps->cpu.hostPassthrough = true; + domCaps->cpu.hostPassthroughMigratable.report = true; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE)) { + VIR_DOMAIN_CAPS_ENUM_SET(domCaps->cpu.hostPassthroughMigratable, + VIR_TRISTATE_SWITCH_ON); + } + VIR_DOMAIN_CAPS_ENUM_SET(domCaps->cpu.hostPassthroughMigratable, + VIR_TRISTATE_SWITCH_OFF); + } + if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype, VIR_CPU_MODE_HOST_MODEL, domCaps->machine)) { diff --git a/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml b/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml index b9b9dd0538..3ed96a3ee7 100644 --- a/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_1.5.3.x86_64.xml b/tests/domaincapsdata/qemu_1.5.3.x86_64.xml index c36295b3e5..20cd3a105a 100644 --- a/tests/domaincapsdata/qemu_1.5.3.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.5.3.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml index 56ad885feb..a4b26b46cb 100644 --- a/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_1.6.0.x86_64.xml b/tests/domaincapsdata/qemu_1.6.0.x86_64.xml index 3d4f7f1cee..16417a13d2 100644 --- a/tests/domaincapsdata/qemu_1.6.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.6.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml index 7a8b58bffe..559b49491e 100644 --- a/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_1.7.0.x86_64.xml b/tests/domaincapsdata/qemu_1.7.0.x86_64.xml index c9dfb2e123..472c073de9 100644 --- a/tests/domaincapsdata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.7.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml index 0bf035ce58..a87f5b2a63 100644 --- a/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.1.1.x86_64.xml b/tests/domaincapsdata/qemu_2.1.1.x86_64.xml index 23a8509698..15adfe0ee8 100644 --- a/tests/domaincapsdata/qemu_2.1.1.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.1.1.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml index 7033264719..be2840d9b8 100644 --- a/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Haswell-noTSX</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml index c55ed9bea8..4505d64e3a 100644 --- a/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml @@ -27,7 +27,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_2.10.0.aarch64.xml b/tests/domaincapsdata/qemu_2.10.0.aarch64.xml index 0f710b001d..629833b745 100644 --- a/tests/domaincapsdata/qemu_2.10.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.10.0.aarch64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_2.10.0.ppc64.xml b/tests/domaincapsdata/qemu_2.10.0.ppc64.xml index 08e63d6410..863afbc0df 100644 --- a/tests/domaincapsdata/qemu_2.10.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.10.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.10.0.s390x.xml b/tests/domaincapsdata/qemu_2.10.0.s390x.xml index b41ca5158c..ce5c92edce 100644 --- a/tests/domaincapsdata/qemu_2.10.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.10.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>z14-base</model> <feature policy='require' name='aen'/> diff --git a/tests/domaincapsdata/qemu_2.10.0.x86_64.xml b/tests/domaincapsdata/qemu_2.10.0.x86_64.xml index d67badb4c2..6596016d33 100644 --- a/tests/domaincapsdata/qemu_2.10.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.10.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Haswell-noTSX</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml index ae37e6a462..c2e148e0fc 100644 --- a/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.11.0.s390x.xml b/tests/domaincapsdata/qemu_2.11.0.s390x.xml index ad4e6b0500..c5b48fdad5 100644 --- a/tests/domaincapsdata/qemu_2.11.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.11.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>z14-base</model> <feature policy='require' name='aen'/> diff --git a/tests/domaincapsdata/qemu_2.11.0.x86_64.xml b/tests/domaincapsdata/qemu_2.11.0.x86_64.xml index fa9c6487b0..38b6b20f77 100644 --- a/tests/domaincapsdata/qemu_2.11.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.11.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml index 164427683e..8d38d33369 100644 --- a/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Haswell-noTSX</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml index 6504b74fa6..8ea58bfa25 100644 --- a/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml @@ -27,7 +27,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_2.12.0.aarch64.xml b/tests/domaincapsdata/qemu_2.12.0.aarch64.xml index 2c429fdcca..667516e75e 100644 --- a/tests/domaincapsdata/qemu_2.12.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.12.0.aarch64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_2.12.0.ppc64.xml b/tests/domaincapsdata/qemu_2.12.0.ppc64.xml index fb3f4b7c80..eac3e6a868 100644 --- a/tests/domaincapsdata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.12.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.12.0.s390x.xml b/tests/domaincapsdata/qemu_2.12.0.s390x.xml index 9736d6a42d..01cc3d81ec 100644 --- a/tests/domaincapsdata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.12.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>z14-base</model> <feature policy='require' name='aen'/> diff --git a/tests/domaincapsdata/qemu_2.12.0.x86_64.xml b/tests/domaincapsdata/qemu_2.12.0.x86_64.xml index 2a0dffaf0f..6e006a3ba3 100644 --- a/tests/domaincapsdata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.12.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Haswell-noTSX</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml index 110bfcbdbd..23e103927e 100644 --- a/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.4.0.x86_64.xml b/tests/domaincapsdata/qemu_2.4.0.x86_64.xml index 5a6fa78201..7c6d78e510 100644 --- a/tests/domaincapsdata/qemu_2.4.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.4.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml index 399ac43dc3..bb8bd9c5c5 100644 --- a/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.5.0.x86_64.xml b/tests/domaincapsdata/qemu_2.5.0.x86_64.xml index 23a83311c6..a89990a42e 100644 --- a/tests/domaincapsdata/qemu_2.5.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.5.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml index a0b27929b0..251696a161 100644 --- a/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml index 5a93c0c153..95053e9cbe 100644 --- a/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml @@ -27,7 +27,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_2.6.0.aarch64.xml b/tests/domaincapsdata/qemu_2.6.0.aarch64.xml index fe3c5db30e..223e944c8a 100644 --- a/tests/domaincapsdata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.6.0.aarch64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_2.6.0.ppc64.xml b/tests/domaincapsdata/qemu_2.6.0.ppc64.xml index c69b4dcae6..c97f232028 100644 --- a/tests/domaincapsdata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.6.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.6.0.x86_64.xml b/tests/domaincapsdata/qemu_2.6.0.x86_64.xml index 889b935ac8..f95f8fb46a 100644 --- a/tests/domaincapsdata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.6.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml index fd6762f28c..1e6c47f2d6 100644 --- a/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.7.0.s390x.xml b/tests/domaincapsdata/qemu_2.7.0.s390x.xml index b19a4c9fed..ff3dd4939b 100644 --- a/tests/domaincapsdata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.7.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='no'/> </cpu> diff --git a/tests/domaincapsdata/qemu_2.7.0.x86_64.xml b/tests/domaincapsdata/qemu_2.7.0.x86_64.xml index 0625244885..da1b10c41b 100644 --- a/tests/domaincapsdata/qemu_2.7.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.7.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml index 0bf92eeb39..0a7493d86d 100644 --- a/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.8.0.s390x.xml b/tests/domaincapsdata/qemu_2.8.0.s390x.xml index 30d2f7ff1f..47b1aa46f7 100644 --- a/tests/domaincapsdata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.8.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>zEC12.2-base</model> <feature policy='require' name='aefsi'/> diff --git a/tests/domaincapsdata/qemu_2.8.0.x86_64.xml b/tests/domaincapsdata/qemu_2.8.0.x86_64.xml index 3a9dc24c3d..6fa754c18a 100644 --- a/tests/domaincapsdata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.8.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml index 60a0b76cf1..3df3c3738e 100644 --- a/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml @@ -29,7 +29,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_2.9.0.ppc64.xml b/tests/domaincapsdata/qemu_2.9.0.ppc64.xml index 4b86abbb8f..3776b6ed9c 100644 --- a/tests/domaincapsdata/qemu_2.9.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.9.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_2.9.0.s390x.xml b/tests/domaincapsdata/qemu_2.9.0.s390x.xml index 2476e95181..cf7e7781cc 100644 --- a/tests/domaincapsdata/qemu_2.9.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.9.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>z13.2-base</model> <feature policy='require' name='aefsi'/> diff --git a/tests/domaincapsdata/qemu_2.9.0.x86_64.xml b/tests/domaincapsdata/qemu_2.9.0.x86_64.xml index c98cf1045b..a80ef28488 100644 --- a/tests/domaincapsdata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.9.0.x86_64.xml @@ -28,7 +28,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml index acff9a1310..cd37906bc7 100644 --- a/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_3.0.0.ppc64.xml b/tests/domaincapsdata/qemu_3.0.0.ppc64.xml index 3fdc6e0f1e..1b8ddd4ed0 100644 --- a/tests/domaincapsdata/qemu_3.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_3.0.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_3.0.0.s390x.xml b/tests/domaincapsdata/qemu_3.0.0.s390x.xml index a297bf9ef1..7a4e536fb5 100644 --- a/tests/domaincapsdata/qemu_3.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_3.0.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>z14-base</model> <feature policy='require' name='aen'/> diff --git a/tests/domaincapsdata/qemu_3.0.0.x86_64.xml b/tests/domaincapsdata/qemu_3.0.0.x86_64.xml index a51eb46d15..9fa4224760 100644 --- a/tests/domaincapsdata/qemu_3.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.0.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml index 6d11d0303f..82b1b6a095 100644 --- a/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_3.1.0.ppc64.xml b/tests/domaincapsdata/qemu_3.1.0.ppc64.xml index 3136a00662..6a2bc87947 100644 --- a/tests/domaincapsdata/qemu_3.1.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_3.1.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_3.1.0.x86_64.xml b/tests/domaincapsdata/qemu_3.1.0.x86_64.xml index 9fe7605272..ffc82f17c3 100644 --- a/tests/domaincapsdata/qemu_3.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.1.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml index 8e991f672b..c837de966f 100644 --- a/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml index 0821b8ef9f..f5347aba9f 100644 --- a/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml @@ -27,7 +27,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_4.0.0.aarch64.xml b/tests/domaincapsdata/qemu_4.0.0.aarch64.xml index 5d5af1b87c..b879d7553c 100644 --- a/tests/domaincapsdata/qemu_4.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.0.0.aarch64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_4.0.0.ppc64.xml b/tests/domaincapsdata/qemu_4.0.0.ppc64.xml index b56d5fb6dc..0642753f11 100644 --- a/tests/domaincapsdata/qemu_4.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.0.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_4.0.0.s390x.xml b/tests/domaincapsdata/qemu_4.0.0.s390x.xml index 21ddd27cb9..632c26d689 100644 --- a/tests/domaincapsdata/qemu_4.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.0.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>z14.2-base</model> <feature policy='require' name='aen'/> diff --git a/tests/domaincapsdata/qemu_4.0.0.x86_64.xml b/tests/domaincapsdata/qemu_4.0.0.x86_64.xml index 27d8023d38..3f64bd4b66 100644 --- a/tests/domaincapsdata/qemu_4.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.0.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml index f4ddb66e38..8bf41d6b49 100644 --- a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml index bcc8bbcc7a..5010f879a6 100644 --- a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml index fcb0505da0..6f72b67f68 100644 --- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml index 908406bf11..ef57216562 100644 --- a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml @@ -27,7 +27,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml index c66550cec5..3cf2a6faf1 100644 --- a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>pxa262</model> diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml index 7906482eee..0f2cf6da64 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsdata/qemu_4.2.0.s390x.xml index 6b87e450a2..ecd037438a 100644 --- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>gen15a-base</model> <feature policy='require' name='aen'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml index e22ef8e032..f4a8321637 100644 --- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml index fa945fc002..fc21b2ad62 100644 --- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml index 7153a0b80d..b2b37c0f7b 100644 --- a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml @@ -27,7 +27,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>cortex-a9</model> diff --git a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml index a3e20cc3d8..7377a2c4cf 100644 --- a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='no'/> <mode name='custom' supported='yes'> <model usable='unknown'>cortex-a9</model> diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml index 697c448dfe..9693aeb72e 100644 --- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml @@ -25,7 +25,11 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>POWER8</model> </mode> diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml index fbde7a6ba2..aceca34c43 100644 --- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> diff --git a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml index 996461fb0f..d0917652e1 100644 --- a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml @@ -29,7 +29,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>EPYC-IBPB</model> <vendor>AMD</vendor> diff --git a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml index e95fcec8bc..f33066759d 100644 --- a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml @@ -28,7 +28,12 @@ </loader> </os> <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='forbid'>EPYC-IBPB</model> <vendor>AMD</vendor> -- 2.27.0

Before QEMU introduced migratable CPU property, "-cpu host" included all features that could be enabled on the host, even those which would block migration. In other words, the default was equivalent to migratable=off. When the migratable property was introduced, the default changed to migratable=on. Let's record the default in domain XML. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_domain.c | 14 ++++++++++++-- .../migration-in-params-in.xml | 2 +- .../migration-out-params-in.xml | 2 +- .../qemuxml2xmloutdata/cpu-check-default-none.xml | 2 +- tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml | 2 +- .../cpu-host-passthrough-features.xml | 2 +- tests/qemuxml2xmloutdata/kvm-features.xml | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3239ac1a52..2dad823a86 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4792,7 +4792,8 @@ qemuDomainDefSetDefaultCPU(virDomainDefPtr def, static int -qemuDomainDefCPUPostParse(virDomainDefPtr def) +qemuDomainDefCPUPostParse(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) { virCPUFeatureDefPtr sveFeature = NULL; bool sveVectorLengthsProvided = false; @@ -4888,6 +4889,15 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) } } + if (qemuCaps && + def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH && + !def->cpu->migratable) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE)) + def->cpu->migratable = VIR_TRISTATE_SWITCH_ON; + else if (ARCH_IS_X86(def->os.arch)) + def->cpu->migratable = VIR_TRISTATE_SWITCH_OFF; + } + /* Nothing to be done if only CPU topology is specified. */ if (def->cpu->mode == VIR_CPU_MODE_CUSTOM && !def->cpu->model) @@ -5033,7 +5043,7 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuDomainDefVcpusPostParse(def) < 0) return -1; - if (qemuDomainDefCPUPostParse(def) < 0) + if (qemuDomainDefCPUPostParse(def, qemuCaps) < 0) return -1; if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) diff --git a/tests/qemustatusxml2xmldata/migration-in-params-in.xml b/tests/qemustatusxml2xmldata/migration-in-params-in.xml index fdc2d39173..93450c38d5 100644 --- a/tests/qemustatusxml2xmldata/migration-in-params-in.xml +++ b/tests/qemustatusxml2xmldata/migration-in-params-in.xml @@ -277,7 +277,7 @@ <apic/> <vmport state='off'/> </features> - <cpu mode='host-passthrough' check='none'/> + <cpu mode='host-passthrough' check='none' migratable='on'/> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> diff --git a/tests/qemustatusxml2xmldata/migration-out-params-in.xml b/tests/qemustatusxml2xmldata/migration-out-params-in.xml index 1956eac120..c1daab4dee 100644 --- a/tests/qemustatusxml2xmldata/migration-out-params-in.xml +++ b/tests/qemustatusxml2xmldata/migration-out-params-in.xml @@ -291,7 +291,7 @@ <apic/> <vmport state='off'/> </features> - <cpu mode='host-passthrough' check='none'/> + <cpu mode='host-passthrough' check='none' migratable='on'/> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> diff --git a/tests/qemuxml2xmloutdata/cpu-check-default-none.xml b/tests/qemuxml2xmloutdata/cpu-check-default-none.xml index ddffb2f15b..9f6b043f2c 100644 --- a/tests/qemuxml2xmloutdata/cpu-check-default-none.xml +++ b/tests/qemuxml2xmloutdata/cpu-check-default-none.xml @@ -8,7 +8,7 @@ <type arch='x86_64' machine='pc'>hvm</type> <boot dev='network'/> </os> - <cpu mode='host-passthrough' check='none'/> + <cpu mode='host-passthrough' check='none' migratable='off'/> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> diff --git a/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml b/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml index 6d8fa367c7..9414c41c7a 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml @@ -8,7 +8,7 @@ <type arch='x86_64' machine='pc'>hvm</type> <boot dev='network'/> </os> - <cpu mode='host-passthrough' check='none'/> + <cpu mode='host-passthrough' check='none' migratable='off'/> <clock offset='utc'> <timer name='kvmclock' present='no'/> </clock> diff --git a/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml b/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml index 9a961eb1a1..bd1e50ef6a 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml @@ -13,7 +13,7 @@ <type arch='i686' machine='pc'>hvm</type> <boot dev='hd'/> </os> - <cpu mode='host-passthrough' check='none'> + <cpu mode='host-passthrough' check='none' migratable='off'> <feature policy='require' name='abm'/> <feature policy='force' name='ds'/> <feature policy='disable' name='invtsc'/> diff --git a/tests/qemuxml2xmloutdata/kvm-features.xml b/tests/qemuxml2xmloutdata/kvm-features.xml index 7c554671b3..9c53eb4630 100644 --- a/tests/qemuxml2xmloutdata/kvm-features.xml +++ b/tests/qemuxml2xmloutdata/kvm-features.xml @@ -15,7 +15,7 @@ <hint-dedicated state='on'/> </kvm> </features> - <cpu mode='host-passthrough' check='none'/> + <cpu mode='host-passthrough' check='none' migratable='off'/> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> -- 2.27.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_command.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 419eca5675..d9e99d9d1a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6254,6 +6254,21 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, } virBufferAddLit(buf, ",aarch64=off"); } + + if (cpu->migratable) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE)) { + virBufferAsprintf(buf, ",migratable=%s", + virTristateSwitchTypeToString(cpu->migratable)); + } else if (ARCH_IS_X86(def->os.arch) && + cpu->migratable == VIR_TRISTATE_SWITCH_OFF) { + /* This is the default on x86 */ + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Migratable attribute for host-passthrough " + "CPU is not supported by QEMU binary")); + return -1; + } + } break; case VIR_CPU_MODE_HOST_MODEL: -- 2.27.0

On 6/5/20 8:31 PM, Jiri Denemark wrote:
Jiri Denemark (9): conf: Use g_auto* in virCPUDefParseXML qemu: Probe for .migratable property of a CPU qemu: Probe for migrtability support in CPU expansion qemu: Avoid probing unsupported migratable CPU expansion conf: Introduce migratable attribute for the <cpu> element conf: Advertise migratable attribute for CPU in domcaps qemu: Advertise migratable attribute for CPU in domcaps qemu: Fill default value in //cpu/@migratable attribute qemu: Pass migratable=on|off property for -cpu host
docs/formatdomain.html.in | 14 +- docs/formatdomaincaps.html.in | 13 +- docs/schemas/domaincaps.rng | 3 + docs/schemas/domaincommon.rng | 5 + src/conf/cpu_conf.c | 157 +++++++++--------- src/conf/cpu_conf.h | 1 + src/conf/domain_capabilities.c | 13 +- src/conf/domain_capabilities.h | 1 + src/qemu/qemu_capabilities.c | 28 +++- src/qemu/qemu_capabilities.h | 4 + src/qemu/qemu_command.c | 15 ++ src/qemu/qemu_domain.c | 14 +- .../domaincapsdata/qemu_1.5.3-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_1.5.3.x86_64.xml | 6 +- .../domaincapsdata/qemu_1.6.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_1.6.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_1.7.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_1.7.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.1.1-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.1.1.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.10.0-q35.x86_64.xml | 6 +- .../qemu_2.10.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.10.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.11.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 7 +- .../qemu_2.12.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 6 +- .../qemu_2.6.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.6.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_2.6.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.6.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.7.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.8.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.8.0.x86_64.xml | 6 +- .../domaincapsdata/qemu_2.9.0-q35.x86_64.xml | 6 +- tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_2.9.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_2.9.0.x86_64.xml | 6 +- .Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
../domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 7 +-
tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_3.0.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 7 +- .../qemu_4.0.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 +- .../qemu_4.2.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +- tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 +- .../qemu_5.0.0-virt.aarch64.xml | 6 +- tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +- tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +- tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 +- .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 +- tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 +- .../caps_2.10.0.s390x.replies | 22 --- .../caps_2.10.0.x86_64.xml | 1 + .../caps_2.11.0.s390x.replies | 22 --- .../caps_2.11.0.x86_64.xml | 1 + .../caps_2.12.0.s390x.replies | 22 --- .../caps_2.12.0.x86_64.xml | 2 + .../caps_2.8.0.s390x.replies | 22 --- .../caps_2.9.0.s390x.replies | 22 --- .../caps_2.9.0.x86_64.xml | 1 + .../caps_3.0.0.s390x.replies | 22 --- .../caps_3.0.0.x86_64.xml | 2 + .../caps_3.1.0.x86_64.xml | 2 + .../caps_4.0.0.s390x.replies | 48 +----- .../caps_4.0.0.x86_64.xml | 2 + .../caps_4.1.0.x86_64.xml | 2 + .../caps_4.2.0.aarch64.replies | 48 +----- .../caps_4.2.0.s390x.replies | 48 +----- .../caps_4.2.0.x86_64.xml | 2 + .../caps_5.0.0.aarch64.replies | 48 +----- .../caps_5.0.0.x86_64.xml | 2 + .../caps_5.1.0.x86_64.xml | 2 + .../migration-in-params-in.xml | 2 +- .../migration-out-params-in.xml | 2 +- .../cpu-check-default-none.xml | 2 +- .../qemuxml2xmloutdata/cpu-host-kvmclock.xml | 2 +- .../cpu-host-passthrough-features.xml | 2 +- tests/qemuxml2xmloutdata/kvm-features.xml | 2 +- 109 files changed, 578 insertions(+), 481 deletions(-)
Is there a BZ link that can be put into one of the commit messages? Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal

On Tue, Jun 09, 2020 at 12:35:02 +0200, Michal Privoznik wrote:
On 6/5/20 8:31 PM, Jiri Denemark wrote:
Jiri Denemark (9): conf: Use g_auto* in virCPUDefParseXML qemu: Probe for .migratable property of a CPU qemu: Probe for migrtability support in CPU expansion qemu: Avoid probing unsupported migratable CPU expansion conf: Introduce migratable attribute for the <cpu> element conf: Advertise migratable attribute for CPU in domcaps qemu: Advertise migratable attribute for CPU in domcaps qemu: Fill default value in //cpu/@migratable attribute qemu: Pass migratable=on|off property for -cpu host
...
Is there a BZ link that can be put into one of the commit messages?
No, there's no BZ for this.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Thanks. Jirka
participants (2)
-
Jiri Denemark
-
Michal Privoznik