All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: fam@euphon.net, kwolf@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com, stefanha@redhat.com,
	andrey.shinkevich@virtuozzo.com, den@openvz.org,
	jsnow@redhat.com
Subject: Re: [PATCH v14 10/13] qapi: block-stream: add "bottom" argument
Date: Fri, 11 Dec 2020 19:50:47 +0300	[thread overview]
Message-ID: <9e131589-84b5-761b-3e26-c4e8eb32ec09@virtuozzo.com> (raw)
In-Reply-To: <79993af7-1993-5af1-d343-04f208b03d73@redhat.com>

11.12.2020 19:05, Max Reitz wrote:
> On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
>> The code already don't freeze base node and we try to make it prepared
>> for the situation when base node is changed during the operation. In
>> other words, block-stream doesn't own base node.
>>
>> Let's introduce a new interface which should replace the current one,
>> which will in better relations with the code. Specifying bottom node
>> instead of base, and requiring it to be non-filter gives us the
>> following benefits:
>>
>>   - drop difference between above_base and base_overlay, which will be
>>     renamed to just bottom, when old interface dropped
>>
>>   - clean way to work with parallel streams/commits on the same backing
>>     chain, which otherwise become a problem when we introduce a filter
>>     for stream job
>>
>>   - cleaner interface. Nobody will surprised the fact that base node may
>>     disappear during block-stream, when there is no word about "base" in
>>     the interface.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   qapi/block-core.json           |  8 +++--
>>   include/block/block_int.h      |  1 +
>>   block/monitor/block-hmp-cmds.c |  3 +-
>>   block/stream.c                 | 50 +++++++++++++++++++---------
>>   blockdev.c                     | 61 ++++++++++++++++++++++++++++------
>>   5 files changed, 94 insertions(+), 29 deletions(-)
>>
>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>> index 04055ef50c..5d6681a35d 100644
>> --- a/qapi/block-core.json
>> +++ b/qapi/block-core.json
>> @@ -2522,6 +2522,10 @@
>>   # @base-node: the node name of the backing file.
>>   #             It cannot be set if @base is also set. (Since 2.8)
>>   #
>> +# @bottom: the last node in the chain that should be streamed into
>> +#          top. It cannot be set any of @base, @base-node or @backing-file
> 
> s/set any/set if any/
> 
> But what’s the problem with backing-file?  The fact that specifying backing-file means that stream will look for that filename in the backing chain when the job is done (so if you use @bottom, we generally don’t want to rely on the presence of any nodes below it)?

I just wanted to deprecate 'backing-file' together with base and base-node as a next step. If user wants to set backing file unrelated to current backing-chain, is it correct at all? It's a direct violation of what's going on, and I doubt that other parts of Qemu working with backing-file are prepared for such situation. User can do it by hand later.. Anyway, we'll have three releases deprecation period for people to come and cry that this is a really needed option, so we can support it later on demand.

> 
> (If so, I would have thought that we actually want the user to specify backing-file so we don’t have to look down below @bottom to look for a filename.  Perhaps a @backing-fmt parameter would help.)

If we decide that 'backing-file' is really needed, than yes we should require backing-fmt to be specified together with backing-file when using new "bottom" interface.

> 
> [...]
> 
>> diff --git a/blockdev.c b/blockdev.c
>> index 70900f4f77..e0e19db88b 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
> 
> [...]
> 
>> @@ -2551,8 +2567,33 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
>>           bdrv_refresh_filename(base_bs);
>>       }
>> -    /* Check for op blockers in the whole chain between bs and base */
>> -    for (iter = bs; iter && iter != base_bs;
>> +    if (has_bottom) {
>> +        bottom_bs = bdrv_lookup_bs(NULL, bottom, errp);
>> +        if (!bottom_bs) {
>> +            goto out;
>> +        }
>> +        if (!bottom_bs->drv) {
>> +            error_setg(errp, "Node '%s' is not open", bottom);
>> +            goto out;
>> +        }
>> +        if (bottom_bs->drv->is_filter) {
>> +            error_setg(errp, "Node '%s' is filter, use non-filter node"
>> +                       "as 'bottom'", bottom);
> 
> Missing a space between “node” and “as”.  (Also, probably two articles, i.e. “Node '%s' is a filter, use a non-filter node...”.)
> 
> The rest looks good to me, but I’m withholding my R-b because I haven’t understood why using @bottom precludes giving @backing-file.
> 
> Max
> 


-- 
Best regards,
Vladimir


  reply	other threads:[~2020-12-11 16:57 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 22:07 [PATCH v14 00/13] Apply COR-filter to the block-stream permanently Vladimir Sementsov-Ogievskiy
2020-12-04 22:07 ` [PATCH v14 01/13] copy-on-read: support preadv/pwritev_part functions Vladimir Sementsov-Ogievskiy
2020-12-04 22:07 ` [PATCH v14 02/13] block: add API function to insert a node Vladimir Sementsov-Ogievskiy
2020-12-10 17:33   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 03/13] copy-on-read: add filter drop function Vladimir Sementsov-Ogievskiy
2020-12-10 17:34   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 04/13] qapi: add filter-node-name to block-stream Vladimir Sementsov-Ogievskiy
2020-12-10 17:37   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 05/13] qapi: create BlockdevOptionsCor structure for COR driver Vladimir Sementsov-Ogievskiy
2020-12-10 17:43   ` Max Reitz
2020-12-10 18:30     ` Vladimir Sementsov-Ogievskiy
2020-12-11  8:54       ` Max Reitz
2020-12-11 12:32         ` Vladimir Sementsov-Ogievskiy
2020-12-04 22:07 ` [PATCH v14 06/13] iotests: add #310 to test bottom node in " Vladimir Sementsov-Ogievskiy
2020-12-11 12:49   ` Max Reitz
2020-12-11 13:10     ` Vladimir Sementsov-Ogievskiy
2020-12-11 13:24       ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 07/13] block: include supported_read_flags into BDS structure Vladimir Sementsov-Ogievskiy
2020-12-11 13:20   ` Max Reitz
2020-12-11 13:31     ` Vladimir Sementsov-Ogievskiy
2020-12-04 22:07 ` [PATCH v14 08/13] copy-on-read: skip non-guest reads if no copy needed Vladimir Sementsov-Ogievskiy
2020-12-11 14:29   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 09/13] stream: skip filters when writing backing file name to QCOW2 header Vladimir Sementsov-Ogievskiy
2020-12-11 15:15   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 10/13] qapi: block-stream: add "bottom" argument Vladimir Sementsov-Ogievskiy
2020-12-11 16:05   ` Max Reitz
2020-12-11 16:50     ` Vladimir Sementsov-Ogievskiy [this message]
2020-12-11 17:24       ` Max Reitz
2020-12-11 17:42         ` Vladimir Sementsov-Ogievskiy
2020-12-11 17:52           ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 11/13] iotests: 30: prepare to COR filter insertion by stream job Vladimir Sementsov-Ogievskiy
2020-12-11 16:09   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 12/13] block/stream: add s->target_bs Vladimir Sementsov-Ogievskiy
2020-12-11 16:33   ` Max Reitz
2020-12-04 22:07 ` [PATCH v14 13/13] block: apply COR-filter to block-stream jobs Vladimir Sementsov-Ogievskiy
2020-12-11 17:21   ` Max Reitz
2020-12-11 17:48     ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e131589-84b5-761b-3e26-c4e8eb32ec09@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.