mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
qemu: Introduce virQEMUCapsFormatCPUModels
This patch moves the CPU models formatting code from virQEMUCapsFormatCache into a separate function. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
1bdcd7a4ee
commit
7c95619cb1
@ -3294,6 +3294,21 @@ virQEMUCapsLoadCache(virCapsPtr caps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps,
|
||||||
|
virBufferPtr buf)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if (qemuCaps->cpuDefinitions) {
|
||||||
|
for (i = 0; i < qemuCaps->cpuDefinitions->nmodels; i++) {
|
||||||
|
virDomainCapsCPUModelPtr cpu = qemuCaps->cpuDefinitions->models + i;
|
||||||
|
virBufferEscapeString(buf, "<cpu name='%s'/>\n", cpu->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps,
|
||||||
time_t selfCTime,
|
time_t selfCTime,
|
||||||
@ -3336,12 +3351,7 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps,
|
|||||||
virBufferAsprintf(&buf, "<arch>%s</arch>\n",
|
virBufferAsprintf(&buf, "<arch>%s</arch>\n",
|
||||||
virArchToString(qemuCaps->arch));
|
virArchToString(qemuCaps->arch));
|
||||||
|
|
||||||
if (qemuCaps->cpuDefinitions) {
|
virQEMUCapsFormatCPUModels(qemuCaps, &buf);
|
||||||
for (i = 0; i < qemuCaps->cpuDefinitions->nmodels; i++) {
|
|
||||||
virDomainCapsCPUModelPtr cpu = qemuCaps->cpuDefinitions->models + i;
|
|
||||||
virBufferEscapeString(&buf, "<cpu name='%s'/>\n", cpu->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < qemuCaps->nmachineTypes; i++) {
|
for (i = 0; i < qemuCaps->nmachineTypes; i++) {
|
||||||
virBufferEscapeString(&buf, "<machine name='%s'",
|
virBufferEscapeString(&buf, "<machine name='%s'",
|
||||||
|
Loading…
Reference in New Issue
Block a user