qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 12/31] qapi/qom: Add ObjectOptions for can-*


From: Eric Blake
Subject: Re: [PATCH v2 12/31] qapi/qom: Add ObjectOptions for can-*
Date: Fri, 26 Feb 2021 13:42:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 2/24/21 7:52 AM, Kevin Wolf wrote:
> This adds a QAPI schema for the properties of the can-* objects.
> 
> can-bus doesn't have any properties, so it only needs to be added to the
> ObjectType enum without adding a new branch to ObjectOptions.

I somewhat prefer

'can-bus': {},

to make it explicit that we thought about it, but since we allow
defaulted union branches, your approach works too.

> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  qapi/qom.json | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/qapi/qom.json b/qapi/qom.json
> index f22b7aa99b..4b1cd4b8dc 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -207,6 +207,21 @@
>    'returns': [ 'ObjectPropertyInfo' ],
>    'allow-preconfig': true }
>  
> +##
> +# @CanHostSocketcanProperties:
> +#
> +# Properties for can-host-socketcan objects.
> +#
> +# @if: interface name of the host system CAN bus to connect to
> +#
> +# @canbus: object ID of the can-bus object to connect to the host interface
> +#
> +# Since: 2.12
> +##
> +{ 'struct': 'CanHostSocketcanProperties',
> +  'data': { 'if': 'str',
> +            'canbus': 'str' } }
> +

Okay, matches net/can/can_socketcan.c:can_host_socketcan_class_init()
(after chasing down the parent class in
net/can/can_host.c:can_host_class_init() to find "canbus").

>  ##
>  # @CryptodevBackendProperties:
>  #
> @@ -439,6 +454,8 @@
>      'authz-listfile',
>      'authz-pam',
>      'authz-simple',
> +    'can-bus',
> +    'can-host-socketcan',
>      'cryptodev-backend',
>      'cryptodev-backend-builtin',
>      'cryptodev-vhost-user',
> @@ -479,6 +496,7 @@
>        'authz-listfile':             'AuthZListFileProperties',
>        'authz-pam':                  'AuthZPAMProperties',
>        'authz-simple':               'AuthZSimpleProperties',
> +      'can-host-socketcan':         'CanHostSocketcanProperties',
>        'cryptodev-backend':          'CryptodevBackendProperties',
>        'cryptodev-backend-builtin':  'CryptodevBackendProperties',
>        'cryptodev-vhost-user':       'CryptodevVhostUserProperties',
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]