[libvirt] [PATCH] Ensure stream is aborted when exiting console

Eric Blake eblake at redhat.com
Mon Aug 15 17:34:55 UTC 2011


On 08/15/2011 11:12 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"<berrange at redhat.com>
>
> After running 'virsh console' in interactive mode, there was a
> missing call to virStreamAbort, which meant the server kept the
> stream resources open
>
> * tools/console.c: Abort stream when exiting
> ---
>   tools/console.c |    6 ++++--
>   1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/console.c b/tools/console.c
> index 171ebc9..82ef537 100644
> --- a/tools/console.c
> +++ b/tools/console.c
> @@ -90,9 +90,11 @@ static void
>   virConsoleShutdown(virConsolePtr con)
>   {
>       con->quit = true;
> -    virStreamEventRemoveCallback(con->st);
> -    if (con->st)
> +    if (con->st) {
> +        virStreamEventRemoveCallback(con->st);
> +        virStreamAbort(con->st);
>           virStreamFree(con->st);
> +    }

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list