virCPUExpandFeatures(cpus[0]->arch, cpu) < 0)
goto cleanup;
- cpustr = virCPUDefFormat(cpu, NULL, false);
+ cpustr = virCPUDefFormat(cpu, NULL);
cleanup:
virCPUDefListFree(cpus);
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</features>\n");
}
- virCPUDefFormatBuf(&buf, caps->host.cpu, false);
+ virCPUDefFormatBuf(&buf, caps->host.cpu);
for (i = 0; i < caps->host.nPagesSize; i++) {
virBufferAsprintf(&buf, "<pages unit='KiB' size='%u'/>\n",
char *
virCPUDefFormat(virCPUDefPtr def,
- virDomainNumaPtr numa,
- bool updateCPU)
+ virDomainNumaPtr numa)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
- if (virCPUDefFormatBufFull(&buf, def, numa, updateCPU) < 0)
+ if (virCPUDefFormatBufFull(&buf, def, numa) < 0)
goto cleanup;
if (virBufferCheckError(&buf) < 0)
int
virCPUDefFormatBufFull(virBufferPtr buf,
virCPUDefPtr def,
- virDomainNumaPtr numa,
- bool updateCPU)
+ virDomainNumaPtr numa)
{
int ret = -1;
virBuffer attributeBuf = VIR_BUFFER_INITIALIZER;
virBufferAsprintf(&attributeBuf, " mode='%s'", tmp);
}
- if (def->model &&
- (def->mode == VIR_CPU_MODE_CUSTOM ||
- updateCPU)) {
+ if (def->model && def->mode == VIR_CPU_MODE_CUSTOM) {
if (!(tmp = virCPUMatchTypeToString(def->match))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected CPU match policy %d"),
if (def->type == VIR_CPU_TYPE_HOST && def->arch)
virBufferAsprintf(&childrenBuf, "<arch>%s</arch>\n",
virArchToString(def->arch));
- if (virCPUDefFormatBuf(&childrenBuf, def, updateCPU) < 0)
+ if (virCPUDefFormatBuf(&childrenBuf, def) < 0)
goto cleanup;
if (virDomainNumaDefCPUFormat(&childrenBuf, numa) < 0)
int
virCPUDefFormatBuf(virBufferPtr buf,
- virCPUDefPtr def,
- bool updateCPU)
+ virCPUDefPtr def)
{
size_t i;
bool formatModel;
return 0;
formatModel = (def->mode == VIR_CPU_MODE_CUSTOM ||
- def->mode == VIR_CPU_MODE_HOST_MODEL ||
- updateCPU);
+ def->mode == VIR_CPU_MODE_HOST_MODEL);
formatFallback = (def->type == VIR_CPU_TYPE_GUEST &&
(def->mode == VIR_CPU_MODE_HOST_MODEL ||
(def->mode == VIR_CPU_MODE_CUSTOM && def->model)));
char *
virCPUDefFormat(virCPUDefPtr def,
- virDomainNumaPtr numa,
- bool updateCPU);
+ virDomainNumaPtr numa);
int
virCPUDefFormatBuf(virBufferPtr buf,
- virCPUDefPtr def,
- bool updateCPU);
+ virCPUDefPtr def);
int
virCPUDefFormatBufFull(virBufferPtr buf,
virCPUDefPtr def,
- virDomainNumaPtr numa,
- bool updateCPU);
+ virDomainNumaPtr numa);
int
virCPUDefAddFeature(virCPUDefPtr cpu,
virBufferAddLit(buf, "supported='yes'>\n");
virBufferAdjustIndent(buf, 2);
- virCPUDefFormatBuf(buf, cpu->hostModel, false);
+ virCPUDefFormatBuf(buf, cpu->hostModel);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</mode>\n");
virBufferAddLit(buf, "</features>\n");
}
- if (virCPUDefFormatBufFull(buf, def->cpu, def->numa,
- !!(flags & VIR_DOMAIN_DEF_FORMAT_UPDATE_CPU)) < 0)
+ if (virCPUDefFormatBufFull(buf, def->cpu, def->numa) < 0)
goto error;
virBufferAsprintf(buf, "<clock offset='%s'",
virCPUExpandFeatures(cpus[0]->arch, cpu) < 0)
goto cleanup;
- cpustr = virCPUDefFormat(cpu, NULL, false);
+ cpustr = virCPUDefFormat(cpu, NULL);
cleanup:
virCPUDefListFree(cpus);
virBufferEscapeString(buf, "<channelTargetDir path='%s'/>\n",
priv->channelTargetDir);
- virCPUDefFormatBufFull(buf, priv->origCPU, NULL, false);
+ virCPUDefFormatBufFull(buf, priv->origCPU, NULL);
if (priv->chardevStdioLogd)
virBufferAddLit(buf, "<chardevStdioLogd/>\n");
qemuDomainSaveCookiePtr cookie = (qemuDomainSaveCookiePtr) obj;
if (cookie->cpu &&
- virCPUDefFormatBufFull(buf, cookie->cpu, NULL, false) < 0)
+ virCPUDefFormatBufFull(buf, cookie->cpu, NULL) < 0)
return -1;
return 0;
virCPUExpandFeatures(cpus[0]->arch, cpu) < 0)
goto cleanup;
- cpustr = virCPUDefFormat(cpu, NULL, false);
+ cpustr = virCPUDefFormat(cpu, NULL);
cleanup:
virCPUDefListFree(cpus);
qemuMigrationCookieStatisticsXMLFormat(buf, mig->jobInfo);
if (mig->flags & QEMU_MIGRATION_COOKIE_CPU && mig->cpu)
- virCPUDefFormatBufFull(buf, mig->cpu, NULL, false);
+ virCPUDefFormatBufFull(buf, mig->cpu, NULL);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</qemu-migration>\n");
virCPUExpandFeatures(cpus[0]->arch, cpu) < 0)
goto cleanup;
- cpustr = virCPUDefFormat(cpu, NULL, false);
+ cpustr = virCPUDefFormat(cpu, NULL);
cleanup:
virCPUDefListFree(cpus);
virCPUExpandFeatures(cpus[0]->arch, cpu) < 0)
goto cleanup;
- cpustr = virCPUDefFormat(cpu, NULL, false);
+ cpustr = virCPUDefFormat(cpu, NULL);
cleanup:
virCPUDefListFree(cpus);
static int
cpuTestCompareXML(virArch arch,
virCPUDef *cpu,
- const char *name,
- bool updateCPU)
+ const char *name)
{
char *xml = NULL;
char *actual = NULL;
abs_srcdir, virArchToString(arch), name) < 0)
goto cleanup;
- if (!(actual = virCPUDefFormat(cpu, NULL, updateCPU)))
+ if (!(actual = virCPUDefFormat(cpu, NULL)))
goto cleanup;
if (virTestCompareToFile(actual, xml) < 0)
}
result = virBufferContentAndReset(&buf);
- if (cpuTestCompareXML(data->arch, cpu, result, false) < 0)
+ if (cpuTestCompareXML(data->arch, cpu, result) < 0)
goto cleanup;
ret = 0;
if (virAsprintf(&result, "%s-%s", data->name, suffix) < 0)
goto cleanup;
- if (cpuTestCompareXML(data->arch, baseline, result, false) < 0)
+ if (cpuTestCompareXML(data->arch, baseline, result) < 0)
goto cleanup;
for (i = 0; i < ncpus; i++) {
if (virAsprintf(&result, "%s+%s", data->host, data->name) < 0)
goto cleanup;
- ret = cpuTestCompareXML(data->arch, cpu, result, true);
+ ret = cpuTestCompareXML(data->arch, cpu, result);
cleanup:
virCPUDefFree(host);
guest ? "guest" : "host") < 0)
goto cleanup;
- ret = cpuTestCompareXML(data->arch, cpu, result, false);
+ ret = cpuTestCompareXML(data->arch, cpu, result);
cleanup:
VIR_FREE(hostFile);
if (virQEMUCapsInitCPUModel(qemuCaps, VIR_DOMAIN_VIRT_KVM, cpu, false) != 0)
goto cleanup;
- ret = cpuTestCompareXML(data->arch, cpu, result, false);
+ ret = cpuTestCompareXML(data->arch, cpu, result);
cleanup:
qemuMonitorCPUModelInfoFree(model);
-<cpu mode='host-model' match='exact'>
+<cpu mode='host-model'>
<model fallback='allow'>power8</model>
</cpu>
-<cpu mode='host-model' match='exact'>
+<cpu mode='host-model'>
<model fallback='allow'>power7+</model>
</cpu>
-<cpu mode='host-model' match='exact'>
+<cpu mode='host-model'>
<model fallback='allow'>power6</model>
</cpu>