]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_driver.c: use g_auto* in some functions
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 16 Oct 2019 20:54:29 +0000 (17:54 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Oct 2019 11:56:46 +0000 (13:56 +0200)
commitaf6e383e4b4b907ee58be3c382180669ba30f995
tree68f98c8f935c6b330268714515d961fc42a9683e
parent813510f95c8c4790e33f3f6cd919187268660987
qemu_driver.c: use g_auto* in some functions

This patch changes qemuDomainSnapshotLoad, qemuDomainCheckpointLoad and
qemuStateInitialize to use g_autoptr() and g_autofree, cleaning up
some virObjectUnref() and VIR_FREE() calls on each.

The reason this is being sent separately is because these are not
trivial search/replace cases. In all these functions some strings
declarations are moved inside local loops, where they are in fact
used, allowing us to erase VIR_FREE() calls that were made inside
the loop and in 'cleanup' labels.

Following patches with tackle more trivial cases of g_auto* usage
in all qemu_driver.c file.

Suggested-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c