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 <marcandre.lur...@redhat.com> > --- > 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 <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature