mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu_capabilities: Decrease scope of @hash in virQEMUCapsProbeQMPHostCPU()
The @hash variable inside of virQEMUCapsProbeQMPHostCPU() is used only within a block, but declared at the beginning of the function. Bring the variable declaration into the said block. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
5ea0315f60
commit
9193bac260
@ -3038,7 +3038,6 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
|
|||||||
const char *model = virQEMUCapsTypeIsAccelerated(virtType) ? "host" : "max";
|
const char *model = virQEMUCapsTypeIsAccelerated(virtType) ? "host" : "max";
|
||||||
g_autoptr(qemuMonitorCPUModelInfo) modelInfo = NULL;
|
g_autoptr(qemuMonitorCPUModelInfo) modelInfo = NULL;
|
||||||
g_autoptr(qemuMonitorCPUModelInfo) nonMigratable = NULL;
|
g_autoptr(qemuMonitorCPUModelInfo) nonMigratable = NULL;
|
||||||
g_autoptr(GHashTable) hash = NULL;
|
|
||||||
g_autoptr(virCPUDef) cpu = NULL;
|
g_autoptr(virCPUDef) cpu = NULL;
|
||||||
qemuMonitorCPUModelExpansionType type;
|
qemuMonitorCPUModelExpansionType type;
|
||||||
bool fail_no_props = true;
|
bool fail_no_props = true;
|
||||||
@ -3082,12 +3081,11 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (nonMigratable) {
|
if (nonMigratable) {
|
||||||
|
g_autoptr(GHashTable) hash = virHashNew(NULL);
|
||||||
qemuMonitorCPUProperty *prop;
|
qemuMonitorCPUProperty *prop;
|
||||||
qemuMonitorCPUProperty *nmProp;
|
qemuMonitorCPUProperty *nmProp;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
hash = virHashNew(NULL);
|
|
||||||
|
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user