提交 333c574d 编写于 作者: F Fam Zheng 提交者: Kevin Wolf

VMDK: flush multiple extents

Flush all the file that referenced by the image.
Signed-off-by: NFam Zheng <famcool@gmail.com>
Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 e1da9b24
......@@ -1072,7 +1072,17 @@ static void vmdk_close(BlockDriverState *bs)
static int vmdk_flush(BlockDriverState *bs)
{
return bdrv_flush(bs->file);
int i, ret, err;
BDRVVmdkState *s = bs->opaque;
ret = bdrv_flush(bs->file);
for (i = 0; i < s->num_extents; i++) {
err = bdrv_flush(s->extents[i].file);
if (err < 0) {
ret = err;
}
}
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册