qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] pcdimm: add 'type' field to PCDIMMDeviceInf


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/3] pcdimm: add 'type' field to PCDIMMDeviceInfo
Date: Tue, 2 Feb 2016 15:12:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 01/27/2016 11:51 PM, Vladimir Sementsov-Ogievskiy wrote:
> The field is needed to distinguish pc-dimm and nvdimm.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Stefan Hajnoczi <address@hidden>
> CC: Xiao Guangrong <address@hidden>
> CC: "Michael S. Tsirkin" <address@hidden>
> CC: Igor Mammedov <address@hidden>
> CC: Eric Blake <address@hidden>
> CC: Markus Armbruster <address@hidden>
> ---

> +++ b/qapi-schema.json
> @@ -3924,6 +3924,8 @@
>  #
>  # @hotpluggable: true if device if could be added/removed while machine is 
> running
>  #
> +# @type: device type: 'pc-dimm' or 'nvdimm' (since 2.6)
> +#
>  # Since: 2.1
>  ##
>  { 'struct': 'PCDIMMDeviceInfo',
> @@ -3934,7 +3936,8 @@
>              'node': 'int',
>              'memdev': 'str',
>              'hotplugged': 'bool',
> -            'hotpluggable': 'bool'
> +            'hotpluggable': 'bool',
> +            'type': 'str'

No. Since it is a finite set of values (just two possible), you should
be using an enum here rather than open-coded 'str'. Something like:

{ 'enum': 'DIMMType', 'data': [ 'pc-dimm', 'nvdimm' ] }

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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