All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	libvir-list@redhat.com, jsnow@redhat.com, eblake@redhat.com,
	xiechanglong.d@gmail.com, wencongyang2@huawei.com,
	nshirokovskiy@virtuozzo.com, pkrempa@redhat.com, den@openvz.org,
	yur@virtuozzo.com, dim@virtuozzo.com, berrange@redhat.com,
	kchamart@redhat.com
Subject: Re: [PATCH v2 3/3] qapi: deprecate drive-backup
Date: Mon, 5 Jul 2021 22:12:43 +0300	[thread overview]
Message-ID: <734bccbc-3cff-5e22-e487-451e73db1d65@virtuozzo.com> (raw)
In-Reply-To: <874ke7s46i.fsf@dusky.pond.sub.org>

09.06.2021 13:49, Markus Armbruster wrote:
> Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:
> 
>> 08.06.2021 14:12, Markus Armbruster wrote:
>>> Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:
>>>
>>> [...]
>>>
>>>> TODO: We also need to deprecate drive-backup transaction action..
>>>> But union members in QAPI doesn't support 'deprecated' feature. I tried
>>>> to dig a bit, but failed :/ Markus, could you please help with it? At
>>>> least by advice?
>>>
>>> There are two closely related things in play here: the union branch and
>>> the corresponding enum value.
>>>
>>> So far, the QAPI schema language doesn't support tacking feature flags
>>> to either.
>>>
>>> If an enum value is deprecated, any union branches corresponding to it
>>> must also be deprecated (because their use requires using the deprecated
>>> enum value).
>>>
>>> The converse is not true, but I can't see a use for deprecating a union
>>> branch without also deprecating the enum member.
>>>
>>> I think we can implement feature flags just for enum members, then
>>> document that 'deprecated' enum value implies corresponding union
>>> branches are also deprecated.
>>>
>>> I have unfinished patches implementing feature flags for enum members.
>>>
>>> Since TransactionAction is a simple union, the corresponding enum is
>>> implicit.  We can make it explicit by converting to a flat union.
>>> Simple unions need to die anyway.
>>
>>
>> Does BlockStatsSpecific from qapi/block-core.json a correct example of flat union you mean? I can make patch to convert TransactionAction to be similar if that helps (discriminator field should be called "type", yes?).
> 
>  From docs/devel/qapi-code-gen.txt:
> 
>      A simple union can always be re-written as a flat union where the base
>      class has a single member named 'type', and where each branch of the
>      union has a struct with a single member named 'data'.  That is,
> 
>       { 'union': 'Simple', 'data': { 'one': 'str', 'two': 'int' } }
> 
>      is identical on the wire to:
> 
>       { 'enum': 'Enum', 'data': ['one', 'two'] }
>       { 'struct': 'Branch1', 'data': { 'data': 'str' } }
>       { 'struct': 'Branch2', 'data': { 'data': 'int' } }
>       { 'union': 'Flat', 'base': { 'type': 'Enum' }, 'discriminator': 'type',
>         'data': { 'one': 'Branch1', 'two': 'Branch2' } }
> 
> The generated C isn't identical, but adjusting the code using it should
> be straightforward.
> 
>>> Does this make sense?
>>>
>>
>> Yes if it helps)
>>
>> Did you also look at John's https://gitlab.com/jsnow/qemu/-/commits/hack-deprecate-union-branches/ ?
> 
> Not yet.
> 
>> I hope you and John will send patches that you have, I'll help with reviewing (keep me in CC), and finally we'll get the feature.
> 
> Sounds like a plan.  I need to get my post-vacation e-mail pileup under
> control first.
> 

Hi!

Kindly remind in the case you forget :) Or may be I miss some patches?

-- 
Best regards,
Vladimir


  reply	other threads:[~2021-07-05 19:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 13:58 [PATCH v2 0/3] qapi & doc: deprecate drive-backup Vladimir Sementsov-Ogievskiy
2021-05-05 13:58 ` [PATCH v2 1/3] docs/block-replication: use blockdev-backup Vladimir Sementsov-Ogievskiy
2021-05-14 20:23   ` John Snow
2021-05-05 13:58 ` [PATCH v2 2/3] docs/interop/bitmaps: " Vladimir Sementsov-Ogievskiy
2021-05-06  9:34   ` Kashyap Chamarthy
2021-05-14 20:27   ` John Snow
2021-05-05 13:58 ` [PATCH v2 3/3] qapi: deprecate drive-backup Vladimir Sementsov-Ogievskiy
2021-05-06  9:57   ` Kashyap Chamarthy
2021-05-14 22:38     ` John Snow
2021-05-24 14:06       ` Vladimir Sementsov-Ogievskiy
2021-05-24 18:37         ` John Snow
2021-09-01 13:29           ` Vladimir Sementsov-Ogievskiy
2021-09-01 14:33             ` Markus Armbruster
2021-06-08 11:12   ` Markus Armbruster
2021-06-08 11:46     ` Vladimir Sementsov-Ogievskiy
2021-06-09 10:49       ` Markus Armbruster
2021-07-05 19:12         ` Vladimir Sementsov-Ogievskiy [this message]
2021-09-15 19:25         ` Markus Armbruster

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=734bccbc-3cff-5e22-e487-451e73db1d65@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=den@openvz.org \
    --cc=dim@virtuozzo.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kchamart@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=nshirokovskiy@virtuozzo.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wencongyang2@huawei.com \
    --cc=xiechanglong.d@gmail.com \
    --cc=yur@virtuozzo.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.