From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Jason Wang <jasowang@redhat.com>,
Dmitry Fleytman <dmitry.fleytman@gmail.com>,
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Luigi Rizzo <rizzo@iet.unipi.it>,
Giuseppe Lettieri <g.lettieri@iet.unipi.it>,
Vincenzo Maffione <v.maffione@gmail.com>,
Andrew Melnychenko <andrew@daynix.com>,
Yuri Benditovich <yuri.benditovich@daynix.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Eduardo Habkost <eduardo@habkost.net>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v2 2/3] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()
Date: Fri, 1 Nov 2024 11:44:20 +0000 [thread overview]
Message-ID: <ZyS_FHG1WDncSidt@redhat.com> (raw)
In-Reply-To: <fcff076c-5616-46f3-aaa1-45d3ad1bbb44@daynix.com>
On Thu, Oct 31, 2024 at 04:21:53PM +0900, Akihiko Odaki wrote:
> On 2024/10/29 1:50, Daniel P. Berrangé wrote:
> > On Tue, Oct 22, 2024 at 01:50:39PM +0900, Akihiko Odaki wrote:
> > > DEFINE_PROP_ON_OFF_AUTO_BIT64() corresponds to DEFINE_PROP_ON_OFF_AUTO()
> > > as DEFINE_PROP_BIT64() corresponds to DEFINE_PROP_BOOL(). The difference
> > > is that DEFINE_PROP_ON_OFF_AUTO_BIT64() exposes OnOffAuto instead of
> > > bool.
> >
> > Again, same feedback as last time.
> >
> > With this design, existing users of DEFINE_PROP_BIT64 that
> > get converted to DEFINE_PROP_ON_OFF_AUTO_BIT64, in addition
> > to gaining the desired "auto" value, also gain redundant
> > 'on' and 'off' values as side-effects.
> >
> > In the next patch, the stated problem is that virtio code
> > needs to distinguish between bits that are user set, and
> > bits that are set based on available host backend features.
> >
> > That doesn't seem to require us to accept any new values
> > from the user. It should be sufficient to track user
> > specified features, separately from user specified values.
> > ie when parsing user input for bitfields, we need to parse
> > into a pair of fields
> >
> > uint64_t has_user_features; /* which bits were specified */
> > uint64_t user_features; /* values of specified bits*/
>
> Properties also have getters. We don't know what to return with them without
> the new value.
The virtio changes in the next patch are just accessing the bitsets
directly. A getter could just be made to return false for unset
values, on the assumption that any caller should be checking the
has_user_features bits beforehand.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-11-01 11:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 4:50 [PATCH v2 0/3] virtio: Convert feature properties to OnOffAuto Akihiko Odaki
2024-10-22 4:50 ` [PATCH v2 1/3] qdev-properties: Accept bool for OnOffAuto Akihiko Odaki
2024-10-28 16:49 ` Daniel P. Berrangé
2024-10-31 7:21 ` Akihiko Odaki
2024-11-01 11:41 ` Daniel P. Berrangé
2024-11-06 7:59 ` Akihiko Odaki
2024-10-22 4:50 ` [PATCH v2 2/3] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64() Akihiko Odaki
2024-10-28 16:50 ` Daniel P. Berrangé
2024-10-31 7:21 ` Akihiko Odaki
2024-11-01 11:44 ` Daniel P. Berrangé [this message]
2024-11-09 10:41 ` Akihiko Odaki
2024-10-22 4:50 ` [PATCH v2 3/3] virtio: Convert feature properties to OnOffAuto Akihiko Odaki
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=ZyS_FHG1WDncSidt@redhat.com \
--to=berrange@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=andrew@daynix.com \
--cc=armbru@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=eduardo@habkost.net \
--cc=g.lettieri@iet.unipi.it \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rizzo@iet.unipi.it \
--cc=sriram.yagnaraman@ericsson.com \
--cc=v.maffione@gmail.com \
--cc=yuri.benditovich@daynix.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.