]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_capabilities: Stop QEMU process before freeing
authorChris Venteicher <cventeic@redhat.com>
Sun, 13 Jan 2019 00:50:05 +0000 (18:50 -0600)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 19 Feb 2019 17:41:23 +0000 (18:41 +0100)
commitbfff747313d550b696bfb31654264d003220a3e5
treee5a5d1eb10cbaa2fb3b194ec4154e0681f77beb2
parent468841eabd436fa7e5de7dd09bfc3ca0ceb8221b
qemu_capabilities: Stop QEMU process before freeing

virQEMUCapsInitQMP now stops QEMU process in all execution paths,
before freeing the process structure.

The qemuProcessQMPStop function can be called multiple times without
problems... Won't attempt to stop processes and free resources multiple
times.

Follow the convention established in qemu_process of
1) alloc process structure
2) start process
3) use process
4) stop process
5) free process data structure

The process data structure persists after the process activation fails
or the process dies or is killed so stderr strings can be retrieved
until the process data structure is freed.

Signed-off-by: Chris Venteicher <cventeic@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_process.c