Re: [PATCH RFC 06/22] qemu_capabilities: Stop QEMU process before freeing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 11, 2018 at 13:59:14 -0600, Chris Venteicher wrote:
> 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@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 73ec8e5c6e..082874082b 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -4251,6 +4251,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
>      ret = 0;
>  
>   cleanup:
> +    qemuProcessStopQmp(proc);

Doing this here would just crash the daemon if proc == NULL. Also
qemuProcessFree will call the same function again, which will cause a
lot of issues. For example, proc->vm will be unlocked and unreferenced
twice.

That said, you need to squash some code from the following patches to
this one to make sure it doesn't cause any functional change.

>      qemuProcessFree(proc);
>      return ret;

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux