All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 5/7] screendump: replace FILE with QIOChannel and fix close()/qemu_close()
Date: Mon, 2 Dec 2019 11:45:41 +0000	[thread overview]
Message-ID: <20191202114541.GG4184266@redhat.com> (raw)
In-Reply-To: <20191127115202.375107-6-marcandre.lureau@redhat.com>

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 <marcandre.lureau@redhat.com>
> ---
>  ui/console.c | 38 +++++++++++++++++---------------------
>  1 file changed, 17 insertions(+), 21 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: 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	other threads:[~2019-12-02 11:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 11:51 [PATCH 0/7] console: screendump improvements Marc-André Lureau
2019-11-27 11:51 ` [PATCH 1/7] console: add graphic_hw_update_done() Marc-André Lureau
2019-11-28 14:34   ` Daniel P. Berrangé
2019-11-27 11:51 ` [PATCH 2/7] ppm-save: pass opened fd Marc-André Lureau
2019-12-02 11:40   ` Daniel P. Berrangé
2019-11-27 11:51 ` [PATCH 3/7] ui: add pixman image g_autoptr support Marc-André Lureau
2019-12-02 11:41   ` Daniel P. Berrangé
2019-11-27 11:51 ` [PATCH 4/7] object: add " Marc-André Lureau
2019-12-02 11:41   ` Daniel P. Berrangé
2019-11-27 11:52 ` [PATCH 5/7] screendump: replace FILE with QIOChannel and fix close()/qemu_close() Marc-André Lureau
2019-12-02 11:45   ` Daniel P. Berrangé [this message]
2019-11-27 11:52 ` [PATCH 6/7] osdep: add qemu_unlink() Marc-André Lureau
2019-12-02 11:46   ` Daniel P. Berrangé
2019-11-27 11:52 ` [PATCH 7/7] screendump: use qemu_unlink() Marc-André Lureau
2019-12-02 11:49   ` Daniel P. Berrangé
2019-11-27 12:25 ` [PATCH 0/7] console: screendump improvements no-reply
2019-12-20 14:36 ` Marc-André Lureau
2020-01-02  9:52   ` Gerd Hoffmann

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=20191202114541.GG4184266@redhat.com \
    --to=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.