qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: John Snow <jsnow@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	Peter Krempa <pkrempa@redhat.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	Denis Lunev <den@virtuozzo.com>,
	"libvir-list@redhat.com" <libvir-list@redhat.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"mreitz@redhat.com" <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] qapi: deprecate implicit filters
Date: Thu, 29 Aug 2019 15:16:19 +0000	[thread overview]
Message-ID: <315c4015-aa3b-ee18-e83c-83496aab62e3@virtuozzo.com> (raw)
In-Reply-To: <28206440-3929-7bb5-f4ea-ee14a9018eab@virtuozzo.com>

29.08.2019 18:00, Vladimir Sementsov-Ogievskiy wrote:
> 28.08.2019 20:48, John Snow wrote:
>> (Peter: search for "pkrempa" down below.)
>>
>> On 8/28/19 5:20 AM, Vladimir Sementsov-Ogievskiy wrote:
>>> 27.08.2019 23:12, John Snow wrote:
>>>>
>>>>
>>>> On 8/23/19 5:22 AM, Vladimir Sementsov-Ogievskiy wrote:
>>>>> 14.08.2019 13:07, Vladimir Sementsov-Ogievskiy wrote:
>>>>>> To get rid of implicit filters related workarounds in future let's
>>>>>> deprecate them now.
>>>>>
>>>>> Interesting, could we deprecate implicit filter without deprecation of unnecessity of
>>>>> parameter? As actually, it's good when this parameter is not necessary, in most cases
>>>>> user is not interested in node-name.
>>>>>
>>>>
>>>> https://en.wiktionary.org/wiki/unnecessity -- I am surprised to learn
>>>> that this a real word in the language I speak. :)
>>>>
>>>> I assume you're referring to making the optional argument mandatory.
>>>
>>> exactly, it's my a bit "google-translate-driven" English)
>>>
>>
>> It teaches me some fun words!
>>
>>>>
>>>>> Obviously we can do the following:
>>>>>
>>>>> 1. In 4.2 we deprecate unnecessity, which implies deprecation of implicit filters
>>>>> 2. After some releases in 4.x we can drop deprecated functionality, so we drop it together with
>>>>> implicit filters. And, in same release 4.x we return it back (as it's compatible change :)
>>>>> but without implicit filters (so, if filter-node-name not specified, we just create
>>>>> explicit filter with autogenerated node-name)
>>>>>
>>>>> So, effectively we just drop "deprecation mark" together with implicit filters, which is nice
>>>>> but actually confusing.
>>>>>
>>>>> Instead, we may do
>>>>> 1. In 4.2 deprecate
>>>>> 2. In 4.x drop optionality together with implicit filters
>>>>> 3. In 4.y (y > x of course) return optionality back
>>>>>
>>>>
>>>> Ah, I see what you're digging at here now...
>>>>
>>>>> It's a bit safer, but for users who miss releases [4.x, 4.y) it's no difference..
>>>>>
>>>>> Or we just write in spec, that implicit filters are deprecated? But we have nothing about implicit
>>>>> filters in spec. More over, we directly write that we have filter, and if parameter is omitted
>>>>> it's node-name is autogenerated. So actually, the fact the filter is hidden when filter-node-name is
>>>>> unspecified is _undocumented_.
>>>>>
>>>>> So, finally, it looks like nothing to deprecated in specification, we can just drop implicit filters :)
>>>>>
>>>>> What do you think?
>>>>>
>>>>
>>>> What exactly _IS_ an implicit filter? How does it differ today from an
>>>> explicit filter? I assumed the only difference was if it was named or
>>>> not; but I think I must be mistaken now if you're proposing leaving the
>>>> interface alone entirely.
>>>>
>>>> Are they instantiated differently?
>>>>
>>>
>>> As I understand, the only difference is their BlockDriverState.impicit field, and several places in code
>>> where we skip implicit filter when trying to find something in a chain starting from a device.
>>>
>>
>> Oh, oh, yes. I see.
>>
>>> Hmm, OK, let's see:
>>>
>>> 1. the only implicit filters are commit_top and mirror_top if user don't specify filter-node-name.
>>>
>>> Where it make sense, i.e., where implicit field used?
>>>
>>
>> `git grep -E '(->|\.)implicit'` is what I used to find usages.
>>
>>> 2. bdrv_query_info, bdrv_query_bds_stats, bdrv_block_device_info(only when called from bdrv_query_info), they'll
>>> report filter as top node if we don't mark it implicit.
>>>
>>
>> So that's a bit of a change, but only visually. The "reality" is still
>> the same, we just report it more "accurately." libvirt MIGHT need a
>> heads up here. I'm looping pkrempa back in for comment.
>>
>> <pkrempa>
>> Would libvirt be negatively impacted by the revelation of formerly
>> internal ("implicit") nodes created by mirror and commit via query block
>> commands? At the moment, QEMU hides them from you if you do not name them.
>> </pkrempa>
>>
>>> 3. bdrv_refresh_filename, bdrv_reopen_parse_backing, bdrv_drop_intermediate:
>>>     I think it's not a problem, just drop special case for implicit fitlers
>>>
>>
>> I'm much less certain about what the impact of this would be and would
>> need to audit it (and don't have the time to, personally.)
>>
>> Do you have a POC or RFC patch that demonstrates dropping these special
>> cases? It might be nice to see as proof that it's safe to deprecate.

I faced a problem with some iotest (it's not a surprise of course), but I think, I'll
come back with and RFC of course.

>>
>>> So, seems the only real change is query-block and query-blockstats output when mirror or commit is started
>>> without specifying filter-node-name (filter would be on top)
>>>
>>> So, how should we deprecate this, or can we just change it?
>>>
>>
>> I'm not sure if it's worth it yet, what does dropping the implicit field
>> buy us? Conceptually I understand that it's simpler without the notion
>> of implicit fields, but I imagine there's some cleanup in particular
>> that motivated this.
> 
> Reviewing Max's "block: Deal with filters" series motivated me.


Currently, we just mostly don't care about implicit filters.

your command on master:
# git grep -E '(->|\.)implicit'
block.c:    while (backing_bs(overlay_bs) && backing_bs(overlay_bs)->implicit) {
block.c:        assert(!old_backing_bs || !old_backing_bs->implicit);
block.c:    while (explicit_top && explicit_top->implicit) {
block.c:    if (bs->implicit) {
block/commit.c:        commit_top_bs->implicit = true;
block/mirror.c:        mirror_top_bs->implicit = true;
block/qapi.c:        while (blk && bs0->drv && bs0->implicit) {
block/qapi.c:    while (bs && bs->drv && bs->implicit) {
block/qapi.c:    while (blk_level && bs->drv && bs->implicit) {


on Max's series:

# git grep -E '(->|\.)implicit'
block.c:           bdrv_filtered_bs(overlay_bs)->implicit)
block.c:        assert(!old_backing_bs || !old_backing_bs->implicit);
block.c:    if (bs->implicit) {
block.c:    while (!(stop_on_explicit_filter && !bs->implicit)) {
block/commit.c:        commit_top_bs->implicit = true;
block/mirror.c:        mirror_top_bs->implicit = true;

seems better, but actually, we get new function bdrv_skip_implicit_filters:
# git grep bdrv_skip_implicit_filters
block.c:    explicit_top = bdrv_skip_implicit_filters(explicit_top);
block.c:BlockDriverState *bdrv_skip_implicit_filters(BlockDriverState *bs)
block/block-backend.c:            non_filter = bdrv_skip_implicit_filters(blk->root->bs);
block/qapi.c:            bs0 = bdrv_skip_implicit_filters(bs0);
block/qapi.c:        bs = bdrv_skip_implicit_filters(bs);
block/qapi.c:        bs = bdrv_skip_implicit_filters(bs);
blockdev.c:        bs = bdrv_skip_implicit_filters(blk_bs(blk));
blockdev.c:                bdrv_skip_implicit_filters(source);
blockdev.c:    unfiltered_bs = bdrv_skip_implicit_filters(bs);
blockdev.c:        BlockDriverState *explicit_backing = bdrv_skip_implicit_filters(source);
blockdev.c:    unfiltered_bs = bdrv_skip_implicit_filters(bs);
include/block/block_int.h:BlockDriverState *bdrv_skip_implicit_filters(BlockDriverState *bs);


So, if we are going to really support implicit filters, we have to support them everywhere.
I'm not sure that Max's series covered all cases. We don't have strong definition of implicit
filters, or about have implicit and explicit filters should be interleaved on appending.

That's why I think it's better to drop them earlier, as it seems that we are going to increase
filter usage in block-layer.

> 
>>
>> I'd say to just change the behavior, we should:
>>
>> - Give a standard three-release warning that the behavior will change in
>> an incompatible way
>> - Demonstrate with an RFC patch that special cases around ->implicit in
>> block.c can be removed and do not make the code more complex,
>> - Get blessings from Peter Krempa.
>>
>> As always: Libvirt is not the end-all be-all of QEMU management, but if
>> libvirt is capable of working around design changes then I believe any
>> project out there today also could, so it's a good litmus test.
>>
>> --js
>>
> 
> 


-- 
Best regards,
Vladimir

  reply	other threads:[~2019-08-29 15:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 10:07 [Qemu-devel] [PATCH 0/2] Deprecate implicit filters Vladimir Sementsov-Ogievskiy
2019-08-14 10:07 ` [Qemu-devel] [PATCH 1/2] qapi: deprecate drive-mirror and drive-backup Vladimir Sementsov-Ogievskiy
2019-08-14 19:22   ` John Snow
2019-08-15  7:44     ` [Qemu-devel] [libvirt] " Peter Krempa
2019-08-15 21:24       ` John Snow
2019-08-14 10:07 ` [Qemu-devel] [PATCH 2/2] qapi: deprecate implicit filters Vladimir Sementsov-Ogievskiy
2019-08-14 19:27   ` John Snow
2019-08-14 20:34     ` [Qemu-devel] [Qemu-block] " Maxim Levitsky
2019-08-15 10:49     ` [Qemu-devel] " Kevin Wolf
2019-08-15 11:45       ` [Qemu-devel] [libvirt] " Peter Krempa
2019-08-15 14:04         ` Markus Armbruster
2019-08-29 16:45           ` Christophe de Dinechin
2019-08-29 17:57             ` John Snow
2019-08-30 10:07               ` Christophe de Dinechin
2019-08-30 18:11                 ` John Snow
2019-09-02 12:04                   ` Kevin Wolf
2019-11-22  8:41             ` Markus Armbruster
2019-11-22 11:32               ` Christophe de Dinechin
2019-08-15 16:07       ` [Qemu-devel] " John Snow
2019-08-15 16:48         ` Kevin Wolf
2019-08-15 17:33           ` John Snow
2019-08-15 19:24           ` Markus Armbruster
2019-08-16  8:20             ` Kevin Wolf
2019-08-16 12:33               ` Markus Armbruster
2019-08-16 12:58                 ` Vladimir Sementsov-Ogievskiy
2019-08-15 14:16     ` [Qemu-devel] Exposing feature deprecation to machine clients (was: [PATCH 2/2] qapi: deprecate implicit filters) Markus Armbruster
2019-08-15 17:40       ` John Snow
2019-11-07 18:52         ` [Qemu-devel] Exposing feature deprecation to machine clients Philippe Mathieu-Daudé
2019-11-07 19:13           ` Vladimir Sementsov-Ogievskiy
2019-11-08  6:41             ` Deprecating stuff for 4.2 (was: [Qemu-devel] Exposing feature deprecation to machine clients) Markus Armbruster
2019-11-08  9:36               ` Deprecating stuff for 4.2 Vladimir Sementsov-Ogievskiy
2019-11-08  8:35             ` [Qemu-devel] Exposing feature deprecation to machine clients Max Reitz
2019-08-29 15:59     ` [Qemu-devel] [PATCH 2/2] qapi: deprecate implicit filters Christophe de Dinechin
2019-08-29 17:18       ` [Qemu-devel] [Qemu-block] " John Snow
2019-08-23  9:22   ` [Qemu-devel] " Vladimir Sementsov-Ogievskiy
2019-08-27 20:12     ` John Snow
2019-08-28  9:20       ` Vladimir Sementsov-Ogievskiy
2019-08-28 17:48         ` John Snow
2019-08-29 14:44           ` Peter Krempa
2019-08-29 15:17             ` Vladimir Sementsov-Ogievskiy
2019-08-29 17:50               ` John Snow
2019-08-29 15:00           ` Vladimir Sementsov-Ogievskiy
2019-08-29 15:16             ` Vladimir Sementsov-Ogievskiy [this message]
2019-09-02 12:14     ` Kevin Wolf

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=315c4015-aa3b-ee18-e83c-83496aab62e3@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).