From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOpgI-0000tD-Q7 for qemu-devel@nongnu.org; Fri, 20 Feb 2015 10:39:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOpgF-000776-FE for qemu-devel@nongnu.org; Fri, 20 Feb 2015 10:39:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOpgF-000771-8A for qemu-devel@nongnu.org; Fri, 20 Feb 2015 10:39:51 -0500 Message-ID: <54E75544.4090108@redhat.com> Date: Fri, 20 Feb 2015 08:39:48 -0700 From: Eric Blake MIME-Version: 1.0 References: <1424346029-5410-1-git-send-email-dgilbert@redhat.com> <1424346029-5410-3-git-send-email-dgilbert@redhat.com> <87r3tl9esl.fsf@blackfin.pond.sub.org> In-Reply-To: <87r3tl9esl.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t6d2f6AS8UIpbrcJSwAQ4QulqQcbjAN2c" Subject: Re: [Qemu-devel] [PATCH v3 2/3] Add migrate_incoming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , "Dr. David Alan Gilbert (git)" Cc: quintela@redhat.com, liang.z.li@intel.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, amit.shah@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t6d2f6AS8UIpbrcJSwAQ4QulqQcbjAN2c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 >> +{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } } >> + >> # @xen-save-devices-state: >> # >> # Save the state of all devices to file. The RAM and the block device= s >=20 > Eric, what's your take on this? >=20 > The general rule in QMP is "no ad hoc encoding of tuples in strings, us= e > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --t6d2f6AS8UIpbrcJSwAQ4QulqQcbjAN2c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU51VEAAoJEKeha0olJ0NqbtMH/RVKNrNfSOVPxQrL4PurbCuf NPH8H52ZRsPG7O5ioCHjy0R1Peeb4txnxwicOsGOIdVEjlDNnucF0hpWRjaLvvfF skhOZi33c6RuIYHDzPA0we5SC59Lc9cimcXcbUl6ivfDBpAy42CYGl8FIE2ihmNb yLKM9xUIGhNjYqfczWhY/RNNozlH6aY4A0YbF4c7lApAI8kNpnRMMaiPmAq0gcY5 /XcTxHS3ZUYGhSsOJeKPlxxy3ouuzqfBAKnQ5DG9+OQ+Y6oM8iAjeE5vtiNBVMY4 Nf8SLIrpqDKAho4/gAt1mZW6Kr0O1lxaB6WqRx2PJhxoQ02TpSF35+v6xtpxN4g= =gqCc -----END PGP SIGNATURE----- --t6d2f6AS8UIpbrcJSwAQ4QulqQcbjAN2c--