[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 09/12] qapi/qom: Convert rng-backend/random to class
From: |
Markus Armbruster |
Subject: |
Re: [RFC PATCH 09/12] qapi/qom: Convert rng-backend/random to class |
Date: |
Tue, 23 Nov 2021 14:15:33 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Kevin Wolf <kwolf@redhat.com> writes:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> qapi/qom.json | 22 ++++++++++++++++------
> 1 file changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/qapi/qom.json b/qapi/qom.json
> index ccd1167808..a167e91f67 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -721,6 +721,16 @@
> { 'struct': 'RngProperties',
> 'data': { '*opened': { 'type': 'bool', 'features': ['deprecated'] } } }
>
> +##
> +# @rng-backend:
> +#
> +# Base class for random number generator backends
> +#
> +# Since: 1.3
> +##
> +{ 'class': 'rng-backend',
> + 'config': 'RngProperties' }
> +
> ##
> # @RngEgdProperties:
> #
> @@ -736,18 +746,18 @@
> 'data': { 'chardev': 'str' } }
>
> ##
> -# @RngRandomProperties:
> +# @rng-random:
> #
> -# Properties for rng-random objects.
> +# Random number generator backend using a host random number device
> #
> # @filename: the filename of the device on the host to obtain entropy from
> # (default: "/dev/urandom")
> #
> # Since: 1.3
> ##
> -{ 'struct': 'RngRandomProperties',
> - 'base': 'RngProperties',
> - 'data': { '*filename': 'str' } }
> +{ 'class': 'rng-random',
> + 'parent': 'rng-backend',
> + 'config': { '*filename': 'str' } }
>
> ##
> # @SevGuestProperties:
> @@ -889,7 +899,7 @@
> 'qtest': 'QtestProperties',
> 'rng-builtin': 'RngProperties',
> 'rng-egd': 'RngEgdProperties',
> - 'rng-random': { 'type': 'RngRandomProperties',
> + 'rng-random': { 'type': 'qom-config:rng-random',
> 'if': 'CONFIG_POSIX' },
> 'secret': 'SecretProperties',
> 'secret_keyring': { 'type': 'SecretKeyringProperties',
This generates struct q_obj_rng_random_config and struct
qom_config_rng_random. Their names violate coding style.
The former struct appears to be unused. Hmm, the next patch will use
it. Okay.
- [RFC PATCH 01/12] qapi: Add visit_next_struct_member(), (continued)
- [RFC PATCH 01/12] qapi: Add visit_next_struct_member(), Kevin Wolf, 2021/11/03
- [RFC PATCH 03/12] qom: Make object_configure() public, Kevin Wolf, 2021/11/03
- [RFC PATCH 04/12] qom: Add instance_config() to TypeInfo, Kevin Wolf, 2021/11/03
- [RFC PATCH 05/12] rng-random: Implement .instance_config, Kevin Wolf, 2021/11/03
- [RFC PATCH 06/12] rng-backend: Implement .instance_config, Kevin Wolf, 2021/11/03
- [RFC PATCH 07/12] qapi: Allow defining QOM classes, Kevin Wolf, 2021/11/03
- [RFC PATCH 08/12] qapi: Create qom-config:... type for classes, Kevin Wolf, 2021/11/03
- [RFC PATCH 09/12] qapi/qom: Convert rng-backend/random to class, Kevin Wolf, 2021/11/03
- Re: [RFC PATCH 09/12] qapi/qom: Convert rng-backend/random to class,
Markus Armbruster <=
- [RFC PATCH 12/12] qapi/qom: Add class definition for rng-egd, Kevin Wolf, 2021/11/03
- [RFC PATCH 11/12] qapi/qom: Add class definition for rng-builtin, Kevin Wolf, 2021/11/03
- [RFC PATCH 10/12] qapi: Generate QOM config marshalling code, Kevin Wolf, 2021/11/03
- Re: [RFC PATCH 00/12] QOM/QAPI integration part 1, Paolo Bonzini, 2021/11/03