[PATCH v2 0/5] block-job: drop BlockJob.blk

Vladimir Sementsov-Ogievskiy posted 5 patches 2 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211224153552.2086061-1-vsementsov@virtuozzo.com
Maintainers: Hanna Reitz <hreitz@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>, Kevin Wolf <kwolf@redhat.com>, Markus Armbruster <armbru@redhat.com>, John Snow <jsnow@redhat.com>
include/block/blockjob.h       | 10 +++++++---
block/mirror.c                 |  7 -------
block/stream.c                 | 24 +++++++++++++++++------
blockdev.c                     |  6 +++---
blockjob.c                     | 36 ++++++++++++++++------------------
qemu-img.c                     |  2 +-
tests/unit/test-bdrv-drain.c   | 12 ++++++++----
tests/unit/test-blockjob-txn.c | 10 +---------
tests/qemu-iotests/141.out     |  2 +-
tests/qemu-iotests/283         |  3 ++-
tests/qemu-iotests/283.out     |  2 +-
11 files changed, 59 insertions(+), 55 deletions(-)
[PATCH v2 0/5] block-job: drop BlockJob.blk
Posted by Vladimir Sementsov-Ogievskiy 2 years, 4 months ago
Hi all!

v2: rebase on master, fix iostest 283

Block jobs usually operate with several block nodes, and better to
handle them symmetrically, than use one from s->common.blk and one from
s->target (or something like this). Moreover, generic blockjob layer has
no use of BlockJob.blk. And more-moreover, most of block-jobs don't
really use this blk. Actually only block-stream use it.

I've started this thing (unbinding block-job and its main node) long
ago. First step was removing bs->job pointer in b23c580c946644b. Then
block_job_drain was dropped in bb0c94099382b5273.

Now let's finally drop job->blk pointer.

Vladimir Sementsov-Ogievskiy (5):
  blockjob: implement and use block_job_get_aio_context
  test-blockjob-txn: don't abuse job->blk
  block/stream: add own blk
  test-bdrv-drain: don't use BlockJob.blk
  blockjob: drop BlockJob.blk field

 include/block/blockjob.h       | 10 +++++++---
 block/mirror.c                 |  7 -------
 block/stream.c                 | 24 +++++++++++++++++------
 blockdev.c                     |  6 +++---
 blockjob.c                     | 36 ++++++++++++++++------------------
 qemu-img.c                     |  2 +-
 tests/unit/test-bdrv-drain.c   | 12 ++++++++----
 tests/unit/test-blockjob-txn.c | 10 +---------
 tests/qemu-iotests/141.out     |  2 +-
 tests/qemu-iotests/283         |  3 ++-
 tests/qemu-iotests/283.out     |  2 +-
 11 files changed, 59 insertions(+), 55 deletions(-)

-- 
2.31.1


Re: [PATCH v2 0/5] block-job: drop BlockJob.blk
Posted by Nikta Lapshin 2 years, 4 months ago
On 12/24/21 18:35, Vladimir Sementsov-Ogievskiy wrote:

> Hi all!
>
> v2: rebase on master, fix iostest 283
>
> Block jobs usually operate with several block nodes, and better to
> handle them symmetrically, than use one from s->common.blk and one from
> s->target (or something like this). Moreover, generic blockjob layer has
> no use of BlockJob.blk. And more-moreover, most of block-jobs don't
> really use this blk. Actually only block-stream use it.
>
> I've started this thing (unbinding block-job and its main node) long
> ago. First step was removing bs->job pointer in b23c580c946644b. Then
> block_job_drain was dropped in bb0c94099382b5273.
>
> Now let's finally drop job->blk pointer

Reviewed-by: Nikita Lapshin<nikita.lapshin@virtuozzo.com>
Re: [PATCH v2 0/5] block-job: drop BlockJob.blk
Posted by Vladimir Sementsov-Ogievskiy 2 years, 4 months ago
27.12.2021 15:13, Nikta Lapshin wrote:
> 
> On 12/24/21 18:35, Vladimir Sementsov-Ogievskiy wrote:
> 
>> Hi all!
>>
>> v2: rebase on master, fix iostest 283
>>
>> Block jobs usually operate with several block nodes, and better to
>> handle them symmetrically, than use one from s->common.blk and one from
>> s->target (or something like this). Moreover, generic blockjob layer has
>> no use of BlockJob.blk. And more-moreover, most of block-jobs don't
>> really use this blk. Actually only block-stream use it.
>>
>> I've started this thing (unbinding block-job and its main node) long
>> ago. First step was removing bs->job pointer in b23c580c946644b. Then
>> block_job_drain was dropped in bb0c94099382b5273.
>>
>> Now let's finally drop job->blk pointer
> 
> Reviewed-by: Nikita Lapshin<nikita.lapshin@virtuozzo.com>
> 

Thanks for review, applied to my jobs branch.

-- 
Best regards,
Vladimir