qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qga/commands-posix: Fix bug in guest-fstrim


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] qga/commands-posix: Fix bug in guest-fstrim
Date: Wed, 01 Apr 2015 06:33:06 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 04/01/2015 01:54 AM, Paolo Bonzini wrote:
> 
> 
> On 31/03/2015 19:03, Eric Blake wrote:
>>>>
>>>> Apart from this, looks good.
>> Changing a "return":{} to "return":0 is not backwards-compatible.
> 
> Why not?

It's only a minor incompatibility, but a client that hard-codes itself
to parsing "returns":0 (that is, expecting a json-number) will fail when
talking to an older qemu that provided a json-object instead; while a
client that expects a json-object always and can search for a "key":0
integer pair within that object that may or may not be present (we
already document that clients MUST be prepared for dictionary members to
be optional, but do NOT advise that clients must be prepared for a
change between fundamental JSON types).  Yes, the
backwards-incompatibility is a weak argument, but as my pending series
will be requiring all new commands to whitelist a non-dict return, we
might as well avoid making this another case for that whitelist.

My stronger argument in my other email is that returning a single
integer is not much information.  Since we have FULL statistics (how
much did each file system trim), why not return it all, for the end user
to take advantage of if desired?

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