All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: quintela@redhat.com, liang.z.li@intel.com, mjt@tls.msk.ru,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>,
	amit.shah@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 2/3] Add migrate_incoming
Date: Fri, 20 Feb 2015 18:57:16 +0100	[thread overview]
Message-ID: <871tlkzcsj.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <54E75544.4090108@redhat.com> (Eric Blake's message of "Fri, 20 Feb 2015 08:39:48 -0700")

Eric Blake <eblake@redhat.com> writes:

> On 02/20/2015 01:18 AM, Markus Armbruster wrote:
>> I'd like Eric's opinion on on encoding configuration tuples as URIs
>> rather than JSON in QMP.
>> 
>
>>> +{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
>>> +
>>>  # @xen-save-devices-state:
>>>  #
>>>  # Save the state of all devices to file. The RAM and the block devices
>> 
>> Eric, what's your take on this?
>> 
>> The general rule in QMP is "no ad hoc encoding of tuples in strings, use
>> JSON objects instead".
>
> Yes, it would be nice to be type-safe, and have a QAPI union with a
> discriminator of different URI types along with appropriate accompanying
> data.  But it is also new code (both in qemu to parse it, and in libvirt
> to generate it), and we already have existing code that knows how to
> generate the string-encoded tuple for the -incoming command line
> argument that can be reused as-is with the new QMP command as proposed.
>  So even though it is less safe, I'm okay with this particular command
> using an overloaded string argument.
>
> Down the road, if we WANT to add type-safety, we can make this command
> take an anonymous union, where a 'str' value is the compact old style,
> and where a dictionary value is the new discriminated union style.  So
> we aren't completely locked into non-type-safe string forever, but we
> probably won't add a type-safe variant until (if) we ever add a new
> migration format that just looks too ugly as a URI based on the
> parameters it requires.

I can accept this, but I want the rationale in a comment, so this
exception to the QMP rule serves less well as bad example.

  reply	other threads:[~2015-02-20 17:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 11:40 [Qemu-devel] [PATCH v3 0/3] -incoming defer Dr. David Alan Gilbert (git)
2015-02-19 11:40 ` [Qemu-devel] [PATCH v3 1/3] Add " Dr. David Alan Gilbert (git)
2015-02-20  7:56   ` Markus Armbruster
2015-02-20  9:09     ` Dr. David Alan Gilbert
2015-02-20  9:52       ` Markus Armbruster
2015-02-19 11:40 ` [Qemu-devel] [PATCH v3 2/3] Add migrate_incoming Dr. David Alan Gilbert (git)
2015-02-20  8:18   ` Markus Armbruster
2015-02-20  9:11     ` Dr. David Alan Gilbert
2015-02-20 13:05       ` Juan Quintela
2015-02-20 15:39     ` Eric Blake
2015-02-20 17:57       ` Markus Armbruster [this message]
2015-02-26 15:09     ` Dr. David Alan Gilbert
2015-02-19 11:40 ` [Qemu-devel] [PATCH v3 3/3] Document -incoming options Dr. David Alan Gilbert (git)
2015-02-20  9:15   ` Markus Armbruster
2015-02-26 20:34     ` Dr. David Alan Gilbert
2015-02-22  9:13 ` [Qemu-devel] [PATCH v3 0/3] -incoming defer Michael S. Tsirkin
2015-02-23 16:01   ` Dr. David Alan Gilbert
2015-02-23 10:38 ` Stefan Hajnoczi
2015-02-23 10:55   ` Dr. David Alan Gilbert
2015-02-24 11:01     ` Stefan Hajnoczi

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=871tlkzcsj.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=liang.z.li@intel.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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.