mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 19:33:39 +08:00
VMDK: flush multiple extents
Flush all the file that referenced by the image. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
e1da9b2433
commit
333c574d05
12
block/vmdk.c
12
block/vmdk.c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user