raw-posix: Fix bdrv_flush error return values
PATCH 1/1 raw-posix: Fix bdrv_flush error return values
bdrv_flush is supposed to use 0/-errno return values
Signed-off-by Kevin Wolf <[email protected]>
--- block/raw-posix.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
block/raw-posix.c +8 -1
@@ -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
Signature · 1 line
1.7.6
Quoted 1 line · Kevin Wolf
bdrv_flushis 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.
Quoted 1 line
Signed-off-by Kevin Wolf <[email protected]>
Works as advertized, therefore:
Reviewed-by Markus Armbruster <[email protected]>