From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 2/4] qemu-file: Use qemu_file_is_writable() on stdio_fclose()
Date: Wed, 1 Oct 2014 17:34:35 -0300 [thread overview]
Message-ID: <1412195677-24529-3-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1412195677-24529-1-git-send-email-ehabkost@redhat.com>
Use the existing function which checks if writev_buffer() or
put_buffer() are set, instead of duplicating it.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
qemu-file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-file.c b/qemu-file.c
index 6c8a6c9..482bda6 100644
--- a/qemu-file.c
+++ b/qemu-file.c
@@ -152,7 +152,7 @@ static int stdio_fclose(void *opaque)
QEMUFileStdio *s = opaque;
int ret = 0;
- if (s->file->ops->put_buffer || s->file->ops->writev_buffer) {
+ if (qemu_file_is_writable(s->file)) {
int fd = fileno(s->stdio_file);
struct stat st;
--
1.9.3
next prev parent reply other threads:[~2014-10-01 20:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 20:34 [Qemu-devel] [PATCH 0/4] qemu-file: Move QEMUFileOps implementations to separate files Eduardo Habkost
2014-10-01 20:34 ` [Qemu-devel] [PATCH 1/4] qemu-file: Make qemu_file_is_writable() non-static Eduardo Habkost
2014-10-01 20:34 ` Eduardo Habkost [this message]
2014-10-01 20:34 ` [Qemu-devel] [PATCH 3/4] qemu-file: Move unix and socket implementations to qemu-file-unix.c Eduardo Habkost
2014-10-01 20:34 ` [Qemu-devel] [PATCH 4/4] qemu-file: Move stdio implementation to qemu-file-stdio.c Eduardo Habkost
2014-10-02 6:49 ` [Qemu-devel] [PATCH 0/4] qemu-file: Move QEMUFileOps implementations to separate files Markus Armbruster
2014-10-02 12:37 ` Eduardo Habkost
2014-10-14 8:30 ` Juan Quintela
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=1412195677-24529-3-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).