mirror of https://gitee.com/openkylin/libvirt.git
qemu: migration_cookie: s/VIR_FREE/g_free/
Previous refactors allow us to plainly replace all VIR_FREE by g_free to finish the modernization of the file. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
49530d5277
commit
c96eba3d03
|
@ -59,9 +59,9 @@ qemuMigrationCookieGraphicsFree(qemuMigrationCookieGraphicsPtr grap)
|
||||||
{
|
{
|
||||||
if (!grap)
|
if (!grap)
|
||||||
return;
|
return;
|
||||||
VIR_FREE(grap->listen);
|
g_free(grap->listen);
|
||||||
VIR_FREE(grap->tlsSubject);
|
g_free(grap->tlsSubject);
|
||||||
VIR_FREE(grap);
|
g_free(grap);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieGraphics,
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieGraphics,
|
||||||
|
@ -78,10 +78,10 @@ qemuMigrationCookieNetworkFree(qemuMigrationCookieNetworkPtr network)
|
||||||
|
|
||||||
if (network->net) {
|
if (network->net) {
|
||||||
for (i = 0; i < network->nnets; i++)
|
for (i = 0; i < network->nnets; i++)
|
||||||
VIR_FREE(network->net[i].portdata);
|
g_free(network->net[i].portdata);
|
||||||
}
|
}
|
||||||
VIR_FREE(network->net);
|
g_free(network->net);
|
||||||
VIR_FREE(network);
|
g_free(network);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieNetwork,
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieNetwork,
|
||||||
|
@ -94,9 +94,9 @@ qemuMigrationCookieNBDFree(qemuMigrationCookieNBDPtr nbd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (nbd->ndisks)
|
while (nbd->ndisks)
|
||||||
VIR_FREE(nbd->disks[--nbd->ndisks].target);
|
g_free(nbd->disks[--nbd->ndisks].target);
|
||||||
VIR_FREE(nbd->disks);
|
g_free(nbd->disks);
|
||||||
VIR_FREE(nbd);
|
g_free(nbd);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieNBD,
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieNBD,
|
||||||
|
@ -110,7 +110,7 @@ qemuMigrationCookieCapsFree(qemuMigrationCookieCapsPtr caps)
|
||||||
|
|
||||||
virBitmapFree(caps->supported);
|
virBitmapFree(caps->supported);
|
||||||
virBitmapFree(caps->automatic);
|
virBitmapFree(caps->automatic);
|
||||||
VIR_FREE(caps);
|
g_free(caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieCaps,
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieCaps,
|
||||||
|
@ -127,15 +127,15 @@ qemuMigrationCookieFree(qemuMigrationCookiePtr mig)
|
||||||
qemuMigrationCookieNetworkFree(mig->network);
|
qemuMigrationCookieNetworkFree(mig->network);
|
||||||
qemuMigrationCookieNBDFree(mig->nbd);
|
qemuMigrationCookieNBDFree(mig->nbd);
|
||||||
|
|
||||||
VIR_FREE(mig->localHostname);
|
g_free(mig->localHostname);
|
||||||
VIR_FREE(mig->remoteHostname);
|
g_free(mig->remoteHostname);
|
||||||
VIR_FREE(mig->name);
|
g_free(mig->name);
|
||||||
VIR_FREE(mig->lockState);
|
g_free(mig->lockState);
|
||||||
VIR_FREE(mig->lockDriver);
|
g_free(mig->lockDriver);
|
||||||
g_clear_pointer(&mig->jobInfo, qemuDomainJobInfoFree);
|
g_clear_pointer(&mig->jobInfo, qemuDomainJobInfoFree);
|
||||||
virCPUDefFree(mig->cpu);
|
virCPUDefFree(mig->cpu);
|
||||||
qemuMigrationCookieCapsFree(mig->caps);
|
qemuMigrationCookieCapsFree(mig->caps);
|
||||||
VIR_FREE(mig);
|
g_free(mig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1406,7 +1406,7 @@ qemuMigrationCookieParse(virQEMUDriverPtr driver,
|
||||||
if (flags & QEMU_MIGRATION_COOKIE_PERSISTENT &&
|
if (flags & QEMU_MIGRATION_COOKIE_PERSISTENT &&
|
||||||
mig->persistent &&
|
mig->persistent &&
|
||||||
STRNEQ(def->name, mig->persistent->name)) {
|
STRNEQ(def->name, mig->persistent->name)) {
|
||||||
VIR_FREE(mig->persistent->name);
|
g_free(mig->persistent->name);
|
||||||
mig->persistent->name = g_strdup(def->name);
|
mig->persistent->name = g_strdup(def->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue