]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Add and use qemuProcessEventFree for freeing qemuProcessEvents
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Fri, 2 Feb 2018 12:13:46 +0000 (13:13 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Feb 2018 09:33:21 +0000 (10:33 +0100)
commit07dcad41a25748e2a33d1890937980e4be1d41b9
treef61037632aa1f576b2dde8fcc32031350ac4f2d8
parent7db455cebd5f4db8a948dcf443fc853744bf9a5d
qemu: Add and use qemuProcessEventFree for freeing qemuProcessEvents

Add and use qemuProcessEventFree for freeing qemuProcessEvents. This
is less error-prone as the compiler can help us make sure that for
every new enumeration value of qemuProcessEventType the
qemuProcessEventFree function has to be adapted.

All process*Event functions are *only* called by
qemuProcessHandleEvent and this function does the freeing by itself
with qemuProcessEventFree. This means that an explicit freeing of
processEvent->data is no longer required in each process*Event
handler.

The effectiveness of this change is also demonstrated by the fact that
it fixes a memory leak of the panic info data in
qemuProcessHandleGuestPanic.

Reported-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_driver.c
src/qemu/qemu_process.c