int ret = -1;
size_t i;
int n;
+ int val;
if (virtType == VIR_DOMAIN_VIRT_KVM)
hostCPUNode = virXPathNode("./hostCPU[@type='kvm']", ctxt);
goto cleanup;
}
+ if (!(str = virXMLPropString(hostCPUNode, "migratability")) ||
+ (val = virTristateBoolTypeFromString(str)) <= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("invalid migratability value for host CPU model"));
+ goto cleanup;
+ }
+ hostCPU->migratability = val == VIR_TRISTATE_BOOL_YES;
+ VIR_FREE(str);
+
ctxt->node = hostCPUNode;
if ((n = virXPathNodeSet("./property", ctxt, &nodes)) > 0) {
for (i = 0; i < n; i++) {
qemuMonitorCPUPropertyPtr prop = hostCPU->props + i;
- int type;
ctxt->node = nodes[i];
}
if (!(str = virXMLPropString(ctxt->node, "type")) ||
- (type = qemuMonitorCPUPropertyTypeFromString(str)) < 0) {
+ (val = qemuMonitorCPUPropertyTypeFromString(str)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing or invalid CPU model property type "
"in QEMU capabilities cache"));
}
VIR_FREE(str);
- prop->type = type;
+ prop->type = val;
switch (prop->type) {
case QEMU_MONITOR_CPU_PROPERTY_BOOLEAN:
if (virXPathBoolean("./@value='true'", ctxt))
case QEMU_MONITOR_CPU_PROPERTY_LAST:
break;
}
+
+ if ((str = virXMLPropString(ctxt->node, "migratable"))) {
+ if ((val = virTristateBoolTypeFromString(str)) <= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown migratable value for '%s' host "
+ "CPU model property"),
+ prop->name);
+ goto cleanup;
+ }
+
+ prop->migratable = val;
+ VIR_FREE(str);
+ }
}
}
if (!model)
return;
- virBufferAsprintf(buf, "<hostCPU type='%s' model='%s'>\n",
- typeStr, model->name);
+ virBufferAsprintf(buf,
+ "<hostCPU type='%s' model='%s' migratability='%s'>\n",
+ typeStr, model->name,
+ model->migratability ? "yes" : "no");
virBufferAdjustIndent(buf, 2);
for (i = 0; i < model->nprops; i++) {
case QEMU_MONITOR_CPU_PROPERTY_LAST:
break;
}
+
+ if (prop->migratable > 0)
+ virBufferAsprintf(buf, " migratable='%s'",
+ virTristateBoolTypeToString(prop->migratable));
+
virBufferAddLit(buf, "/>\n");
}
if (VIR_STRDUP(copy->name, orig->name) < 0)
goto error;
+ copy->migratability = orig->migratability;
copy->nprops = orig->nprops;
for (i = 0; i < orig->nprops; i++) {
if (VIR_STRDUP(copy->props[i].name, orig->props[i].name) < 0)
goto error;
+ copy->props[i].migratable = orig->props[i].migratable;
copy->props[i].type = orig->props[i].type;
switch (orig->props[i].type) {
case QEMU_MONITOR_CPU_PROPERTY_BOOLEAN:
<kvmVersion>0</kvmVersion>
<package> (v2.9.0-rc0-142-g940a8ce)</package>
<arch>x86_64</arch>
- <hostCPU type='kvm' model='base'>
+ <hostCPU type='kvm' model='base' migratability='no'>
<property name='phys-bits' type='number' value='0'/>
<property name='core-id' type='number' value='-1'/>
<property name='xlevel' type='number' value='2147483656'/>
<property name='avx512pf' type='boolean' value='false'/>
<property name='xstore-en' type='boolean' value='false'/>
</hostCPU>
- <hostCPU type='tcg' model='base'>
+ <hostCPU type='tcg' model='base' migratability='no'>
<property name='phys-bits' type='number' value='0'/>
<property name='core-id' type='number' value='-1'/>
<property name='xlevel' type='number' value='2147483658'/>