mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
qemu: capabilities: remove pointless labels
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
parent
eb69535efc
commit
59281d9dc7
@ -2986,7 +2986,6 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
|
|||||||
g_autoptr(virCPUDef) cpu = NULL;
|
g_autoptr(virCPUDef) cpu = NULL;
|
||||||
qemuMonitorCPUModelExpansionType type;
|
qemuMonitorCPUModelExpansionType type;
|
||||||
bool fail_no_props = true;
|
bool fail_no_props = true;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION))
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION))
|
||||||
return 0;
|
return 0;
|
||||||
@ -3017,14 +3016,14 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
|
|||||||
|
|
||||||
if (qemuMonitorGetCPUModelExpansion(mon, type, cpu, true, fail_no_props,
|
if (qemuMonitorGetCPUModelExpansion(mon, type, cpu, true, fail_no_props,
|
||||||
&modelInfo) < 0)
|
&modelInfo) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
/* Try to check migratability of each feature. */
|
/* Try to check migratability of each feature. */
|
||||||
if (modelInfo &&
|
if (modelInfo &&
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE) &&
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE) &&
|
||||||
qemuMonitorGetCPUModelExpansion(mon, type, cpu, false, fail_no_props,
|
qemuMonitorGetCPUModelExpansion(mon, type, cpu, false, fail_no_props,
|
||||||
&nonMigratable) < 0)
|
&nonMigratable) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (nonMigratable) {
|
if (nonMigratable) {
|
||||||
qemuMonitorCPUProperty *prop;
|
qemuMonitorCPUProperty *prop;
|
||||||
@ -3036,7 +3035,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
|
|||||||
for (i = 0; i < modelInfo->nprops; i++) {
|
for (i = 0; i < modelInfo->nprops; i++) {
|
||||||
prop = modelInfo->props + i;
|
prop = modelInfo->props + i;
|
||||||
if (virHashAddEntry(hash, prop->name, prop) < 0)
|
if (virHashAddEntry(hash, prop->name, prop) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nonMigratable->nprops; i++) {
|
for (i = 0; i < nonMigratable->nprops; i++) {
|
||||||
@ -3058,11 +3057,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
accel->hostCPU.info = g_steal_pointer(&modelInfo);
|
accel->hostCPU.info = g_steal_pointer(&modelInfo);
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3495,11 +3490,10 @@ virQEMUCapsGetCPUModelX86Data(virQEMUCaps *qemuCaps,
|
|||||||
unsigned long long sigModel = 0;
|
unsigned long long sigModel = 0;
|
||||||
unsigned long long sigStepping = 0;
|
unsigned long long sigStepping = 0;
|
||||||
g_autoptr(virCPUData) data = NULL;
|
g_autoptr(virCPUData) data = NULL;
|
||||||
virCPUData *ret = NULL;
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!(data = virCPUDataNew(VIR_ARCH_X86_64)))
|
if (!(data = virCPUDataNew(VIR_ARCH_X86_64)))
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
for (i = 0; i < model->nprops; i++) {
|
for (i = 0; i < model->nprops; i++) {
|
||||||
qemuMonitorCPUProperty *prop = model->props + i;
|
qemuMonitorCPUProperty *prop = model->props + i;
|
||||||
@ -3512,14 +3506,14 @@ virQEMUCapsGetCPUModelX86Data(virQEMUCaps *qemuCaps,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (virCPUDataAddFeature(data, name) < 0)
|
if (virCPUDataAddFeature(data, name) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MONITOR_CPU_PROPERTY_STRING:
|
case QEMU_MONITOR_CPU_PROPERTY_STRING:
|
||||||
if (STREQ(name, "vendor") &&
|
if (STREQ(name, "vendor") &&
|
||||||
virCPUx86DataSetVendor(data, prop->value.string) < 0)
|
virCPUx86DataSetVendor(data, prop->value.string) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MONITOR_CPU_PROPERTY_NUMBER:
|
case QEMU_MONITOR_CPU_PROPERTY_NUMBER:
|
||||||
@ -3537,12 +3531,9 @@ virQEMUCapsGetCPUModelX86Data(virQEMUCaps *qemuCaps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virCPUx86DataSetSignature(data, sigFamily, sigModel, sigStepping) < 0)
|
if (virCPUx86DataSetSignature(data, sigFamily, sigModel, sigStepping) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
ret = g_steal_pointer(&data);
|
return g_steal_pointer(&data);
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3560,23 +3551,19 @@ virQEMUCapsInitCPUModelX86(virQEMUCaps *qemuCaps,
|
|||||||
{
|
{
|
||||||
g_autoptr(virDomainCapsCPUModels) cpuModels = NULL;
|
g_autoptr(virDomainCapsCPUModels) cpuModels = NULL;
|
||||||
g_autoptr(virCPUData) data = NULL;
|
g_autoptr(virCPUData) data = NULL;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if (!model)
|
if (!model)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!(data = virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratable)))
|
if (!(data = virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratable)))
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
cpuModels = virQEMUCapsGetCPUModels(qemuCaps, type, NULL, NULL);
|
cpuModels = virQEMUCapsGetCPUModels(qemuCaps, type, NULL, NULL);
|
||||||
|
|
||||||
if (cpuDecode(cpu, data, cpuModels) < 0)
|
if (cpuDecode(cpu, data, cpuModels) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4647,7 +4634,6 @@ virQEMUCapsSaveFile(void *data,
|
|||||||
{
|
{
|
||||||
virQEMUCaps *qemuCaps = data;
|
virQEMUCaps *qemuCaps = data;
|
||||||
g_autofree char *xml = NULL;
|
g_autofree char *xml = NULL;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
xml = virQEMUCapsFormatCache(qemuCaps);
|
xml = virQEMUCapsFormatCache(qemuCaps);
|
||||||
|
|
||||||
@ -4655,7 +4641,7 @@ virQEMUCapsSaveFile(void *data,
|
|||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("Failed to save '%s' for '%s'"),
|
_("Failed to save '%s' for '%s'"),
|
||||||
filename, qemuCaps->binary);
|
filename, qemuCaps->binary);
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Saved caps '%s' for '%s' with (%lld, %lld)",
|
VIR_DEBUG("Saved caps '%s' for '%s' with (%lld, %lld)",
|
||||||
@ -4663,9 +4649,7 @@ virQEMUCapsSaveFile(void *data,
|
|||||||
(long long)qemuCaps->ctime,
|
(long long)qemuCaps->ctime,
|
||||||
(long long)qemuCaps->libvirtCtime);
|
(long long)qemuCaps->libvirtCtime);
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user