[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/7] block: apply COR-filter to block-stream jobs
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH 7/7] block: apply COR-filter to block-stream jobs |
Date: |
Tue, 21 Apr 2020 15:58:27 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
20.04.2020 21:36, Andrey Shinkevich wrote:
The patch completes the series with the COR-filter insertion to any
block-stream operation. It also makes changes to the iotests 030, 141
and 245.
Signed-off-by: Andrey Shinkevich <address@hidden>
---
block/stream.c | 151 +++++++++++++++++++++++++++++++++++++++------
tests/qemu-iotests/030 | 6 +-
tests/qemu-iotests/141.out | 2 +-
tests/qemu-iotests/245 | 5 +-
4 files changed, 141 insertions(+), 23 deletions(-)
diff --git a/block/stream.c b/block/stream.c
index fab7923..af14ba8 100644
--- a/block/stream.c
+++ b/block/stream.c
[..]
+static int stream_exit(Job *job, bool abort)
+{
+ StreamBlockJob *s = container_of(job, StreamBlockJob, common.job);
+ BlockJob *bjob = &s->common;
+ BlockDriverState *target_bs = s->target_bs;
+ int ret = 0;
+
+ if (s->chain_frozen) {
+ bdrv_unfreeze_chain(s->target_bs, s->bottom_cow_node);
+ s->chain_frozen = false;
+ }
+
+ /* Retain the BDS until we complete the graph change. */
+ bdrv_ref(target_bs);
+ /* Hold a guest back from writing while permissions are being reset. */
+ bdrv_drained_begin(target_bs);
+ /* Drop permissions before the graph change. */
+ bdrv_child_try_set_perm(bdrv_filtered_rw_child(s->cor_filter_bs),
+ 0, BLK_PERM_ALL, &error_abort);
Hmm. I don't remember what's wrong with it, but something is. Neither mirror
nor backup do this now,
instead they use some flag, that permissions are not needed anymore and call
bdrv_child_refresh_perms()
Also, strange that you have insert_filter function, but don't use it here.
Also, could we keep add/remove filter api in block/copy-on-read.c, like it is
done for backup-top ?
--
Best regards,
Vladimir
- [PATCH 0/7] Apply COR-filter to the block-stream permanently, Andrey Shinkevich, 2020/04/20
- [PATCH 6/7] iotests: prepare 245 for using filter in block-stream, Andrey Shinkevich, 2020/04/20
- [PATCH 1/7] block: prepare block-stream for using COR-filter, Andrey Shinkevich, 2020/04/20
- [PATCH 3/7] block: protect parallel jobs from overlapping, Andrey Shinkevich, 2020/04/20
- [PATCH 4/7] copy-on-read: Support refreshing filename, Andrey Shinkevich, 2020/04/20
- [PATCH 7/7] block: apply COR-filter to block-stream jobs, Andrey Shinkevich, 2020/04/20
- Re: [PATCH 7/7] block: apply COR-filter to block-stream jobs,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 2/7] stream: exclude a link to filter from freezing, Andrey Shinkevich, 2020/04/20
- [PATCH 5/7] qapi: add filter-node-name to block-stream, Andrey Shinkevich, 2020/04/20
- Re: [PATCH 0/7] Apply COR-filter to the block-stream permanently, Vladimir Sementsov-Ogievskiy, 2020/04/21