On Thu, May 07, 2015 at 12:04:56PM +0800, Zhe Qiu wrote: > From: phoeagon <phoea...@gmail.com> > > In reference to > b0ad5a455d7e5352d4c86ba945112011dbeadfb8~078a458e077d6b0db262c4b05fee51d01de2d1d2, > metadata writes to qcow2/cow/qcow/vpc/vmdk are all synced prior to > succeeding writes. > > Only when write is successful that bdrv_flush is called. > > Signed-off-by: Zhe Qiu <phoea...@gmail.com> > --- > block/vdi.c | 3 +++ > 1 file changed, 3 insertions(+)
CCing Stefan Weil and Kevin Wolf (see output from scripts/get_maintainer.pl -f block/vdi.c). > > diff --git a/block/vdi.c b/block/vdi.c > index 7642ef3..dfe8ade 100644 > --- a/block/vdi.c > +++ b/block/vdi.c > @@ -713,6 +713,9 @@ static int vdi_co_write(BlockDriverState *bs, > logout("will write %u block map sectors starting from entry %u\n", > n_sectors, bmap_first); > ret = bdrv_write(bs->file, offset, base, n_sectors); > + if (ret >= 0) { > + ret = bdrv_flush(bs->file); > + } > } > > return ret; > -- > 2.4.0 > >
pgpDXL_Bm0jti.pgp
Description: PGP signature