aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-06-12 17:47:37 +0200
committerKevin Wolf <kwolf@redhat.com>2020-09-07 12:31:31 +0200
commit9a71b9de3f08941577a9760021f52771aaba4fa4 (patch)
tree2af597e3b47d920f60c609b9c0ae45da2baf005e /blockdev.c
parent2b088c60bbe59e4f48fede97263bb293bd38e43e (diff)
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>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c
index d53e39c303..f308adc9aa 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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;
}