Message ID | 20211103173002.209906-10-kwolf@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | QOM/QAPI integration part 1 | expand |
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.
Am 23.11.2021 um 14:15 hat Markus Armbruster geschrieben: > 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. They are just for internal use of QAPI generated code. QMP command marshallers are precedence for this. Kevin
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',
Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- qapi/qom.json | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)