qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 12/40] char-win: do not override chr_free


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 12/40] char-win: do not override chr_free
Date: Wed, 11 Jan 2017 14:22:04 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

On 01/11/2017 11:29 AM, Marc-André Lureau wrote:
> For some unclear reason to me, char-file does not have chr_free on
> win32. Since we want to switch to instance finalizer instead of class
> chr_free, we should be able to run the base WinChardev class finalizer
> in any case. Use a boolean to skip free to ease the transition to
> instance finalizer.
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  qemu-char.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/qemu-char.c b/qemu-char.c
> index ad8e5e7ebf..1954dec9b8 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2122,6 +2122,8 @@ typedef struct {
>  
>      /* Protected by the Chardev chr_write_lock.  */
>      OVERLAPPED osend;
> +    /* FIXME: file/console do not finalize */
> +    BOOL skip_free;

Do we really need the glib type, or is bool sufficient?

>  } WinChardev;
>  
>  #define TYPE_CHARDEV_WIN "chardev-win"
> @@ -2152,6 +2154,10 @@ static void win_chr_free(Chardev *chr)
>  {
>      WinChardev *s = WIN_CHARDEV(chr);
>  
> +    if (s->skip_free) {
> +        return;
> +    }
> +
>      if (s->hsend) {
>          CloseHandle(s->hsend);
>          s->hsend = NULL;
> @@ -2432,6 +2438,7 @@ static void qemu_chr_open_win_file(Chardev *chr, HANDLE 
> fd_out)
>  {
>      WinChardev *s = WIN_CHARDEV(chr);
>  
> +    s->skip_free = true;

Particularly since you assign it the bool true, rather than the glib TRUE.

With that fixed,
Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]