block: Flush all children in generic code
commit883833e29cb800b4d92b5d4736252f4004885191
authorMax Reitz <mreitz@redhat.com>
Wed, 12 Jun 2019 16:18:05 +0000 (12 18:18 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 7 Sep 2020 10:31:31 +0000 (7 12:31 +0200)
tree515b6cce8e2981648e0a7a6b87dc8ff1798a220b
parent1d42f48c3a468fbf53660970d7372d0f0f9d0529
block: Flush all children in generic code

If the driver does not support .bdrv_co_flush() so bdrv_co_flush()
itself has to flush the children of the given node, it should not flush
just bs->file->bs, but in fact all children that might have been written
to (judging from the permissions taken on them).

This is a bug fix for qcow2 images with an external data file, as they
so far did not flush that data_file node.

In any case, the BLKDBG_EVENT() should be emitted on the primary child,
because that is where a blkdebug node would be if there is any.

Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
block/io.c