aboutsummaryrefslogtreecommitdiff
path: root/block/raw-win32.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-10-21 16:43:43 +0200
committerKevin Wolf <kwolf@redhat.com>2010-11-04 12:52:16 +0100
commit205ef7961f781496366e0a93a4ec621ad3724bd7 (patch)
tree7c1861837185ba98074140dba8f03e65941c8c8c /block/raw-win32.c
parent5dba48a882c126ccc86db6506cfa6dcca97badab (diff)
block: Allow bdrv_flush to return errors
This changes bdrv_flush to return 0 on success and -errno in case of failure. It's a requirement for implementing proper error handle in users of bdrv_flush. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'block/raw-win32.c')
-rw-r--r--block/raw-win32.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/block/raw-win32.c b/block/raw-win32.c
index 503ed3959a..7f32778612 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -150,7 +150,14 @@ static int raw_write(BlockDriverState *bs, int64_t sector_num,
static void raw_flush(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
- FlushFileBuffers(s->hfile);
+ int ret;
+
+ ret = FlushFileBuffers(s->hfile);
+ if (ret != 0) {
+ return -EIO;
+ }
+
+ return 0;
}
static void raw_close(BlockDriverState *bs)