All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <mlureau@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>
Cc: marcandre lureau <marcandre.lureau@redhat.com>,
	Claudio Fontana <claudio.fontana@huawei.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] ivshmem property size should be a size, not a string
Date: Fri, 20 Nov 2015 09:46:32 -0700	[thread overview]
Message-ID: <564F4E68.8090903@redhat.com> (raw)
In-Reply-To: <2083526024.12459505.1448036588653.JavaMail.zimbra@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1975 bytes --]

On 11/20/2015 09:23 AM, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
>> Everybody's favourite device model has "size" property.  It's declared
>> as *string*
>>
>>     DEFINE_PROP_STRING("size", IVShmemState, sizearg),
>>
>>
>> * In QMP, the size must be given as JSON string instead of JSON number,
>>   and size suffixes are accepted.  Example: "size": "512k" instead of
>>   "size": 524288.
>>
>>   Right now, this violation of QMP rules is tolerable (barely), because
>>   device_add breaks some of these rules already.  However, one goal of
>>   the current work on QAPI is to support a QMP command to plug devices
>>   that doesn't break QMP rules, and then this violation will stand out.
>>
>>   Therefore, I want it fixed now, before ivshmem gets used in anger.

Was ivshmem even usable in 2.4?  I'd argue that if we are going to
change it, changing it for 2.5 is the ideal time.

>>
>>   A straight fix of size isn't fully backwards compatible: suffixes no
>>   longer work in QMP, and you need to use an 'M' suffix to get Mebibytes
>>   on command line and HMP.
> 
> I don't know the rules to break properties in qemu, but I would prefer to avoid it if possible.

It's possible to use an alternate to accept both a string and an
integer.  But in general, QMP _wants_ to use byte-count integers without
suffix (the convenience of '512k' is only for the command line and HMP),
so letting QMP expose a string of "512k" instead of an integer 524288
feels wrong.

> 
>>   If that's unacceptable, we'll have to provide a new, fixed property,
>>   and deprecate size.
> 
> Sounds a better alternative to me.

I'd rather fix the interface rather than catering to ugliness,
particularly since 2.5 already fixes so much else that was ugly about
ivshmem.

Markus, did you have a patch to propose?

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-11-20 16:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 16:07 [Qemu-devel] ivshmem property size should be a size, not a string Markus Armbruster
2015-11-20 16:23 ` Marc-André Lureau
2015-11-20 16:46   ` Eric Blake [this message]
2015-11-20 18:06     ` Markus Armbruster
2015-11-20 18:20       ` Marc-André Lureau
2015-11-20 19:39         ` Markus Armbruster
2015-11-20 20:18           ` Marc-André Lureau
2015-11-23 10:19             ` Markus Armbruster
2015-11-23 12:15               ` Marc-André Lureau
2015-11-23 13:25                 ` Markus Armbruster
2015-11-23 13:48                   ` Marc-André Lureau
2015-11-23 14:08                     ` Markus Armbruster
2015-11-23 14:16                       ` Marc-André Lureau
2015-11-23 14:46                         ` Markus Armbruster
2015-11-23 14:53                           ` Marc-André Lureau
2015-11-23 15:17                             ` Markus Armbruster
2015-11-23 19:52                           ` Eric Blake
2015-11-23 20:19                             ` Marc-André Lureau
2015-11-24  9:56                               ` Markus Armbruster
2015-11-24 12:23                                 ` Marc-André Lureau
2015-11-24 13:50                                   ` Markus Armbruster
2015-11-24 14:23                                     ` Marc-André Lureau
2015-11-24 15:12                                       ` Markus Armbruster
2015-11-23 18:22               ` Markus Armbruster
2015-11-23 23:29             ` Andrew James
2015-11-24  9:52               ` Markus Armbruster
2015-11-23 20:57 ` Bruce Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564F4E68.8090903@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=claudio.fontana@huawei.com \
    --cc=lcapitulino@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mlureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.