[Top][All Lists]

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

Re: [PATCH 5/7] screendump: replace FILE with QIOChannel and fix close()

From: Daniel P . Berrangé
Subject: Re: [PATCH 5/7] screendump: replace FILE with QIOChannel and fix close()/qemu_close()
Date: Mon, 2 Dec 2019 11:45:41 +0000
User-agent: Mutt/1.12.1 (2019-06-15)

On Wed, Nov 27, 2019 at 03:52:00PM +0400, Marc-André Lureau wrote:
> The file opened for ppm_save() may be a /dev/fdset, in which case a
> dup fd is added to the fdset. It should be removed by calling
> qemu_close(), instead of the implicit close() on fclose().
> I don't see a convenient way to solve that with stdio streams, so I
> switched the code to QIOChannel which uses qemu_close().

The only way is to duplicate what qemu_close() does in the
ppm_save method by calling  monitor_fdset_dup_fd_remove(fd).
Using QIOChannel is fine too though.

> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  ui/console.c | 38 +++++++++++++++++---------------------
>  1 file changed, 17 insertions(+), 21 deletions(-)

Reviewed-by: Daniel P. Berrangé <address@hidden>

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

reply via email to

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