From 074abad3264bf2bb7cfd279b7457416b318716ca Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 14 Sep 2011 11:22:26 +0200 Subject: [PATCH] raw-posix: Fix bdrv_flush error return values bdrv_flush is supposed to use 0/-errno return values Signed-off-by: Kevin Wolf --- block/raw-posix.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index a624f56f86..305998ddb3 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 -- 2.11.4.GIT