qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Samuel Thibault <samuel.thibault@gnu.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] baum: add destroy hook
Date: Thu, 8 Apr 2010 21:17:48 +0200	[thread overview]
Message-ID: <20100408191748.GF6056@volta.aurel32.net> (raw)
In-Reply-To: <20100328183942.GN7497@const.famille.thibault.fr>

On Sun, Mar 28, 2010 at 08:39:42PM +0200, Samuel Thibault wrote:
> Hello,
> 
> This adds a destroy hook for the baum character device, to properly
> close the BrlAPI connection and free resources.
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Thanks, applied.

> commit 447c41758cfda0022ea6e09aaf81137b2b27b915
> Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
> Date:   Sun Mar 28 20:38:38 2010 +0200
> 
>     baum: add destroy hook
>     
>     Add a destroy hook for the baum character device, to properly close the BrlAPI
>     connection.
> 
> diff --git a/hw/baum.c b/hw/baum.c
> index 18633f4..21326ae 100644
> --- a/hw/baum.c
> +++ b/hw/baum.c
> @@ -564,6 +564,18 @@ static void baum_chr_read(void *opaque)
>      }
>  }
>  
> +static void baum_close(struct CharDriverState *chr)
> +{
> +    BaumDriverState *baum = chr->opaque;
> +
> +    qemu_free_timer(baum->cellCount_timer);
> +    if (baum->brlapi) {
> +        brlapi__closeConnection(baum->brlapi);
> +        qemu_free(baum->brlapi);
> +    }
> +    qemu_free(baum);
> +}
> +
>  CharDriverState *chr_baum_init(QemuOpts *opts)
>  {
>      BaumDriverState *baum;
> @@ -581,6 +593,7 @@ CharDriverState *chr_baum_init(QemuOpts *opts)
>      chr->chr_write = baum_write;
>      chr->chr_send_event = baum_send_event;
>      chr->chr_accept_input = baum_accept_input;
> +    chr->chr_close = baum_close;
>  
>      handle = qemu_mallocz(brlapi_getHandleSize());
>      baum->brlapi = handle;
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      reply	other threads:[~2010-04-08 21:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-28 20:03 [Qemu-devel] [PATCH] Fix curses interaction with keymaps Samuel Thibault
2010-02-28 20:13 ` [Qemu-devel] " Samuel Thibault
2010-03-06 22:20 ` [Qemu-devel] " Aurelien Jarno
2010-03-28 18:39 ` [Qemu-devel] [PATCH] baum: add destroy hook Samuel Thibault
2010-04-08 19:17   ` Aurelien Jarno [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100408191748.GF6056@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).