mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 17:17:56 +03:00
conf: convert VIR_FREE to g_free in other functions that free their arg
Previous patches have converted VIR_FREE to g_free in functions with names ending in Free() and Dispose(), but there are a few similar functions with names that don't fit that pattern, but server the same purpose (and thus can survive the same conversion). in particular *Free*(), and *Unref(). Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e5339e38ca
commit
11c48fe6eb
@ -118,10 +118,10 @@ virCapabilitiesFreeHostNUMACell(virCapsHostNUMACellPtr cell)
|
|||||||
|
|
||||||
virCapabilitiesClearHostNUMACellCPUTopology(cell->cpus, cell->ncpus);
|
virCapabilitiesClearHostNUMACellCPUTopology(cell->cpus, cell->ncpus);
|
||||||
|
|
||||||
VIR_FREE(cell->cpus);
|
g_free(cell->cpus);
|
||||||
VIR_FREE(cell->siblings);
|
g_free(cell->siblings);
|
||||||
VIR_FREE(cell->pageinfo);
|
g_free(cell->pageinfo);
|
||||||
VIR_FREE(cell);
|
g_free(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -129,9 +129,9 @@ virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr machine)
|
|||||||
{
|
{
|
||||||
if (machine == NULL)
|
if (machine == NULL)
|
||||||
return;
|
return;
|
||||||
VIR_FREE(machine->name);
|
g_free(machine->name);
|
||||||
VIR_FREE(machine->canonical);
|
g_free(machine->canonical);
|
||||||
VIR_FREE(machine);
|
g_free(machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -141,13 +141,13 @@ virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom)
|
|||||||
if (dom == NULL)
|
if (dom == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_FREE(dom->info.emulator);
|
g_free(dom->info.emulator);
|
||||||
VIR_FREE(dom->info.loader);
|
g_free(dom->info.loader);
|
||||||
for (i = 0; i < dom->info.nmachines; i++)
|
for (i = 0; i < dom->info.nmachines; i++)
|
||||||
virCapabilitiesFreeGuestMachine(dom->info.machines[i]);
|
virCapabilitiesFreeGuestMachine(dom->info.machines[i]);
|
||||||
VIR_FREE(dom->info.machines);
|
g_free(dom->info.machines);
|
||||||
|
|
||||||
VIR_FREE(dom);
|
g_free(dom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -157,17 +157,17 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest)
|
|||||||
if (guest == NULL)
|
if (guest == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_FREE(guest->arch.defaultInfo.emulator);
|
g_free(guest->arch.defaultInfo.emulator);
|
||||||
VIR_FREE(guest->arch.defaultInfo.loader);
|
g_free(guest->arch.defaultInfo.loader);
|
||||||
for (i = 0; i < guest->arch.defaultInfo.nmachines; i++)
|
for (i = 0; i < guest->arch.defaultInfo.nmachines; i++)
|
||||||
virCapabilitiesFreeGuestMachine(guest->arch.defaultInfo.machines[i]);
|
virCapabilitiesFreeGuestMachine(guest->arch.defaultInfo.machines[i]);
|
||||||
VIR_FREE(guest->arch.defaultInfo.machines);
|
g_free(guest->arch.defaultInfo.machines);
|
||||||
|
|
||||||
for (i = 0; i < guest->arch.ndomains; i++)
|
for (i = 0; i < guest->arch.ndomains; i++)
|
||||||
virCapabilitiesFreeGuestDomain(guest->arch.domains[i]);
|
virCapabilitiesFreeGuestDomain(guest->arch.domains[i]);
|
||||||
VIR_FREE(guest->arch.domains);
|
g_free(guest->arch.domains);
|
||||||
|
|
||||||
VIR_FREE(guest);
|
g_free(guest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr pool)
|
|||||||
if (!pool)
|
if (!pool)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_FREE(pool);
|
g_free(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps)
|
|||||||
if (g_atomic_int_dec_and_test(&caps->refs)) {
|
if (g_atomic_int_dec_and_test(&caps->refs)) {
|
||||||
g_ptr_array_unref(caps->cells);
|
g_ptr_array_unref(caps->cells);
|
||||||
|
|
||||||
VIR_FREE(caps);
|
g_free(caps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
|
|||||||
virCapabilitiesFreeGuestMachine(machines[i]);
|
virCapabilitiesFreeGuestMachine(machines[i]);
|
||||||
machines[i] = NULL;
|
machines[i] = NULL;
|
||||||
}
|
}
|
||||||
VIR_FREE(machines);
|
g_free(machines);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user