commit: Deal with filters

This includes some permission limiting (for example, we only need to
take the RESIZE permission if the base is smaller than the top).

Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Max Reitz 2019-06-12 17:47:37 +02:00 committed by Kevin Wolf
parent 2b088c60bb
commit 9a71b9de3f
4 changed files with 79 additions and 28 deletions

View file

@ -2703,7 +2703,9 @@ void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,
assert(bdrv_get_aio_context(base_bs) == aio_context);
for (iter = top_bs; iter != backing_bs(base_bs); iter = backing_bs(iter)) {
for (iter = top_bs; iter != bdrv_filter_or_cow_bs(base_bs);
iter = bdrv_filter_or_cow_bs(iter))
{
if (bdrv_op_is_blocked(iter, BLOCK_OP_TYPE_COMMIT_TARGET, errp)) {
goto out;
}