From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsYmk-0003vM-GR for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:18:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsYme-0006CL-UB for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:18:13 -0400 References: <1475854682-20667-1-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: Date: Fri, 7 Oct 2016 12:18:01 -0500 MIME-Version: 1.0 In-Reply-To: <1475854682-20667-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NbpQlgMQWvLG3GLUX6pBIK4ts9bc9g6BR" Subject: Re: [Qemu-devel] [PATCH] block: Remove "options" indirection from blockdev-add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NbpQlgMQWvLG3GLUX6pBIK4ts9bc9g6BR From: Eric Blake To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org Message-ID: Subject: Re: [PATCH] block: Remove "options" indirection from blockdev-add References: <1475854682-20667-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1475854682-20667-1-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/07/2016 10:38 AM, Kevin Wolf wrote: > Now that QAPI supports boxed types, we can have unions at the top level= > of a command, so let's put our real options directly there for > blockdev-add instead of having a single "options" dict that contains th= e > real arguments. >=20 > blockdev-add is still experimental and we already made substantial > changes to the API recently, so we're free to make changes like this > one, too. I like it, and it needs to make 2.8. Max was correct that there are some doc changes missing, so looking forward to v2. >=20 > Signed-off-by: Kevin Wolf > --- >=20 > Yes, that's right. Ignoring the test cases, this is a one-liner in > the schema without any C code changes. :-) Yay! My qapi refactoring work is paying dividends. The lack of C code changes is because we convert everything to QDict and then manually parse it using QemuOpts, rather than sticking to the nicer qapi structs. Someday, it would be nice to use the actual qapi structs all the way, but that doesn't have to be today. > +++ b/qapi/block-core.json > @@ -2321,7 +2321,7 @@ > # > # Since: 1.7 > ## > -{ 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } = } > +{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true = } Eventually, when we rename x-blockdev-del, we'll want some sort of doc note here that even though this command has existed since 1.7, it is fundamentally different in 2.8 and should not be used in anger unless blockdev-del is also defined. > +++ b/tests/qemu-iotests/041 > @@ -194,10 +194,9 @@ class TestSingleBlockdev(TestSingleDrive): > def setUp(self): > TestSingleDrive.setUp(self) > qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=3D= %s' % backing_img, target_img) > - args =3D {'options': > - {'driver': iotests.imgfmt, > - 'node-name': self.qmp_target, > - 'file': { 'filename': target_img, 'driver': 'file= ' } } } > + args =3D {'driver': iotests.imgfmt, > + 'node-name': self.qmp_target, > + 'file': { 'filename': target_img, 'driver': 'file' } }= Less nesting is indeed a bit easier to read :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NbpQlgMQWvLG3GLUX6pBIK4ts9bc9g6BR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJX99jJAAoJEKeha0olJ0NqsNQH/3Q50ql0n16+peskHJH4sg0e +rqAKm0Igm0OsMbRug1cLkeN2Xp1CleEfgT2adOuopo93VEidPohUT3Ohx/oAs1J KuvyeI+ZldZSrpc4GLdVK+5qYKsadVCdtD0PqZo+eiN9hw+Rc16zluP8XQ/laUx5 wuJLjYbpwJ4Ot/JmfZw7xzRbSDVschH+Gqo8WsuEZdN48zdQv3t9vX1JaVTG6tW/ PFDaahKudiecJzeTuJDLvvfLrsFGC/mLHhU4MBN/OBA33gZsBkCGwN4OobXZuQsO bgurteKx78ZWqpkx8yf7C9QpFMgQeL+kKgKYk3plY/0eb/G7mhiwEOy479rTzGQ= =SmmP -----END PGP SIGNATURE----- --NbpQlgMQWvLG3GLUX6pBIK4ts9bc9g6BR--