[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/12] qom: allow for properties to become "fixed"
From: |
Peter Maydell |
Subject: |
Re: [PATCH 08/12] qom: allow for properties to become "fixed" |
Date: |
Mon, 17 Apr 2023 13:04:19 +0100 |
On Mon, 17 Apr 2023 at 12:33, Alex Bennée <alex.bennee@linaro.org> wrote:
> The use-case is this whole series. Basically I want to have a generic
> device (vhost-user-device) which has a bunch of control knobs the user
> can fiddle with (e.g. virtio id, num_vqs and the like). However for the
> specialised versions of this device (e.g. vhost-user-gpio) some of these
> values (e.g. virtio id) need to be fixed.
> Mark suggested maybe just duplicating the properties in a similar way to
> DEFINE_AUDIO_PROPERTIES but that doesn't really address the problem
> wanting to "fix" some of the values for the subclasses and preventing
> the user from changing things.
This shouldn't be something visible to the user of the object,
though, surely? An object which doesn't have a configurable
virtio-id property because the specific subclass has a fixed
value should look exactly like an object which doesn't have
a configurable virtio-id property because that property just
doesn't exist.
If we add a facility for "constant properties" (which is pretty
much what this would be) then we should do it because it's
useful for users of QOM objects (and especially for users of
QOM objects via the QMP interface) to be able to introspect
them and say "ah, this is a property of the object but it's
a constant value".
thanks
-- PMM
- [PATCH 01/12] hw/virtio: fix typo in VIRTIO_CONFIG_IRQ_IDX comments, (continued)
- [PATCH 01/12] hw/virtio: fix typo in VIRTIO_CONFIG_IRQ_IDX comments, Alex Bennée, 2023/04/14
- [PATCH 12/12] docs/system: add a basic enumeration of vhost-user devices, Alex Bennée, 2023/04/14
- [PATCH 11/12] hw/virtio: derive vhost-user-gpio from vhost-user-device (!BROKEN), Alex Bennée, 2023/04/14
- [PATCH 05/12] virtio: add generic vhost-user-device, Alex Bennée, 2023/04/14
- [PATCH 09/12] hw/virtio: derive vhost-user-rng from vhost-user-device, Alex Bennée, 2023/04/14
- [PATCH 04/12] include/hw/virtio: document some more usage of notifiers, Alex Bennée, 2023/04/14
- [PATCH 10/12] hw/virtio: add config support to vhost-user-device, Alex Bennée, 2023/04/14
- [PATCH 08/12] qom: allow for properties to become "fixed", Alex Bennée, 2023/04/14
- [PATCH 07/12] include: attempt to document device_class_set_props, Alex Bennée, 2023/04/14
- Re: [PATCH 00/12] virtio: add vhost-user-generic and reduce copy and paste, Viresh Kumar, 2023/04/17
- Re: [PATCH 00/12] virtio: add vhost-user-generic and reduce copy and paste, Stefan Hajnoczi, 2023/04/17