[libvirt] [PATCH 2/2] conf: Remove callback from stream when freeing entries in console hash
Osier Yang
jyang at redhat.com
Mon Jul 30 13:12:41 UTC 2012
On 2012年07月27日 21:44, Peter Krempa wrote:
> When a domain has a active console connection and is destroyed the
> callback is called on private data that no longer exist causing a
> segfault.
> ---
> src/conf/virconsole.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/src/conf/virconsole.c b/src/conf/virconsole.c
> index 3d12011..912aff6 100644
> --- a/src/conf/virconsole.c
> +++ b/src/conf/virconsole.c
> @@ -219,6 +219,9 @@ static void virConsoleHashEntryFree(void *data,
> const char *pty = name;
> virStreamPtr st = data;
>
> + /* remove callback from stream */
> + virFDStreamSetInternalCloseCb(st, NULL, NULL, NULL);
> +
> /* free stream reference */
> virStreamFree(st);
>
ACK
More information about the libvir-list
mailing list