aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-02-05 19:37:13 +0300
committerEric Blake <eblake@redhat.com>2021-02-12 09:45:18 -0600
commit3fc1ec3725a92268cb896e7fd82b4b4b4718203b (patch)
tree5ace063280ccebd7cd76d92543eaaa2bc207e22b /block
parentc4f7f24e1f6e81804a7f15356614d9249280ab02 (diff)
block/raw-format: implement .bdrv_cancel_in_flight handler
We are going to cancel in-flight requests on mirror nbd target on job cancel. Still nbd is often used not directly but as raw-format child. So, add pass-through handler here. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210205163720.887197-4-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/raw-format.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/raw-format.c b/block/raw-format.c
index 42ec50802b..7717578ed6 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -575,6 +575,11 @@ static const char *const raw_strong_runtime_opts[] = {
NULL
};
+static void raw_cancel_in_flight(BlockDriverState *bs)
+{
+ bdrv_cancel_in_flight(bs->file->bs);
+}
+
BlockDriver bdrv_raw = {
.format_name = "raw",
.instance_size = sizeof(BDRVRawState),
@@ -608,6 +613,7 @@ BlockDriver bdrv_raw = {
.bdrv_has_zero_init = &raw_has_zero_init,
.strong_runtime_opts = raw_strong_runtime_opts,
.mutable_opts = mutable_opts,
+ .bdrv_cancel_in_flight = raw_cancel_in_flight,
};
static void bdrv_raw_init(void)