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>
This commit is contained in:
Kevin Wolf 2010-10-21 16:43:43 +02:00
parent 5dba48a882
commit 205ef7961f
13 changed files with 45 additions and 25 deletions

View file

@ -734,10 +734,10 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
return result;
}
static void raw_flush(BlockDriverState *bs)
static int raw_flush(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
qemu_fdatasync(s->fd);
return qemu_fdatasync(s->fd);
}