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: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Showing
想要评论请 注册 或 登录