qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] raw-posix: Fix bdrv_flush error return values
@ 2011-09-14  9:23 Kevin Wolf
  2011-09-14 12:06 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2011-09-14  9:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

bdrv_flush is supposed to use 0/-errno return values

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/raw-posix.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index a624f56..305998d 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -839,7 +839,14 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
 static int raw_flush(BlockDriverState *bs)
 {
     BDRVRawState *s = bs->opaque;
-    return qemu_fdatasync(s->fd);
+    int ret;
+
+    ret = qemu_fdatasync(s->fd);
+    if (ret < 0) {
+        return -errno;
+    }
+
+    return 0;
 }
 
 #ifdef CONFIG_XFS
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] raw-posix: Fix bdrv_flush error return values
  2011-09-14  9:23 [Qemu-devel] [PATCH] raw-posix: Fix bdrv_flush error return values Kevin Wolf
@ 2011-09-14 12:06 ` Markus Armbruster
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2011-09-14 12:06 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

Kevin Wolf <kwolf@redhat.com> writes:

> bdrv_flush is supposed to use 0/-errno return values

Is it?  Can't find a user that cares...

Documenting what the BlockDriver methods are supposed to do wouldn't
hurt.

> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Works as advertized, therefore:

Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-14 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-14  9:23 [Qemu-devel] [PATCH] raw-posix: Fix bdrv_flush error return values Kevin Wolf
2011-09-14 12:06 ` Markus Armbruster

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).