From 205ef7961f781496366e0a93a4ec621ad3724bd7 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 21 Oct 2010 16:43:43 +0200 Subject: 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 Reviewed-by: Stefan Hajnoczi --- block/raw-win32.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'block/raw-win32.c') 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) -- cgit v1.2.1