qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 28/29] qmp: add query-memdev


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v4 28/29] qmp: add query-memdev
Date: Mon, 09 Jun 2014 11:15:31 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 06/09/2014 07:40 AM, Paolo Bonzini wrote:
> Il 09/06/2014 15:32, Igor Mammedov ha scritto:
>>>>>> > >> > +{ 'command': 'query-memdev', 'returns': ['Memdev'] }
>>>> > > Could we make it union, that returns MemdevRam + MemdevFile
>>>> > >
>>>> > > MemdevFile will have additional file-only specific properties.
>>>> > >
>>> >
>>> > Which are the file-only properties (in the current definition of
>>> Memdev)?
>> in current none, but for file backend exposing 'path' property might
>> be useful
>> alternatively instead of union we could add 'type' and optional 'path'
>> fields
>> to Memdev
>>
> 
> Yes, I agree.  I think the latest additions to QAPI actually let you do
> that with a QAPI union while keeping backwards-compatible output for
> other fields.  Ok to do this later?  It should be acceptable for soft
> freeze.

Correct, use of a discriminated union can add a new 'type' parameter,
which in turn controls what other parameters are also present as a
group, all within the same dictionary passed over the wire, so it is a
back-compat friendly change to convert from a single struct to a QAPI
union, and can be deferred to the point where you need such a change.

-- 
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]