mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00: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
1 changed files with 11 additions and 1 deletions
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 a new issue