From: Eric Blake <eblake@redhat.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v3 1/2] qga: flush explicitly when needed
Date: Wed, 25 Nov 2015 08:58:11 -0700 [thread overview]
Message-ID: <5655DA93.6020008@redhat.com> (raw)
In-Reply-To: <1448456352-14143-2-git-send-email-marcandre.lureau@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]
On 11/25/2015 05:59 AM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> According to the specification:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html
>
> "the application shall ensure that output is not directly followed by
> input without an intervening call to fflush() or to a file positioning
> function (fseek(), fsetpos(), or rewind()), and input is not directly
> followed by output without an intervening call to a file positioning
> function, unless the input operation encounters end-of-file."
>
> Without this change, a write() followed by a read() may lose the
> previously written content, as shown in the following test.
>
> Fixes:
> https://bugzilla.redhat.com/show_bug.cgi?id=1210246
> ---
> qga/commands-posix.c | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
With Laszlo's suggested commit message improvements,
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 0ebd473..cf1d7ec 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -216,9 +216,16 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
> }
> }
>
> +typedef enum {
> + RW_STATE_NEW,
Bikeshedding: NEW really only sounds right after open(), and doesn't
quite right after a flush; maybe CLEAN or WAITING would be a better name?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-11-25 15:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 12:59 [Qemu-devel] [PATCH v3 0/2] qga: flush explicitly when needed marcandre.lureau
2015-11-25 12:59 ` [Qemu-devel] [PATCH v3 1/2] " marcandre.lureau
2015-11-25 15:10 ` Laszlo Ersek
2015-11-25 15:58 ` Eric Blake [this message]
2015-11-25 12:59 ` [Qemu-devel] [PATCH v3 2/2] tests: add file-write-read test marcandre.lureau
2015-11-25 16:02 ` Eric Blake
2015-11-25 16:21 ` Michael Roth
2015-11-25 16:41 ` Eric Blake
2015-11-25 16:46 ` Michael Roth
2015-11-25 17:10 ` Eric Blake
2015-11-25 17:14 ` Michael Roth
2015-11-25 17:18 ` Eric Blake
2015-11-25 17:22 ` Michael Roth
2015-11-25 16:46 ` [Qemu-devel] [PATCH v3 0/2] qga: flush explicitly when needed Michael Roth
2015-11-25 16:52 ` Marc-André Lureau
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=5655DA93.6020008@redhat.com \
--to=eblake@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.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.