From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN2Xd-0000Fx-9E for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:22:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN2XY-0004MK-CE for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:22:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN2XY-0004MG-3i for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:22:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8KFMdfi009080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 20 Sep 2013 11:22:39 -0400 Message-ID: <523C683E.2030401@redhat.com> Date: Fri, 20 Sep 2013 09:22:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1379678070-14346-1-git-send-email-kwolf@redhat.com> <1379678070-14346-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1379678070-14346-5-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p8W0c49a5JrCcJfXxfj7WDLuRx1PGdHOR" Subject: Re: [Qemu-devel] [PATCH 04/17] blockdev: 'blockdev-add' QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: mreitz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --p8W0c49a5JrCcJfXxfj7WDLuRx1PGdHOR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/20/2013 05:54 AM, Kevin Wolf wrote: > For examples see the changes to qmp-commands.hx. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 57 ++++++++++++ > qapi-schema.json | 270 +++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > qmp-commands.hx | 59 ++++++++++++ > 3 files changed, 386 insertions(+) >=20 > +# Since: 1.7 > +## > +{ 'type': 'BlockdevOptionsBase', > + 'data': { 'driver': 'str', > + '*id': 'str', > + '*discard': 'BlockdevDiscardOptions', > + '*cache': 'BlockdevCacheOptions', > + '*aio': 'BlockdevAIOOptions', Is the double space intentional? Harmless, but inconsistent. > + '*rerror': 'BlockdevOnError', > + '*werror': 'BlockdevOnError', > + '*throttling': 'BlockdevThrottlingOptions', > + '*read-only': 'bool' } } =2E.. > +## > +# @BlockdevOptionsVVFAT > +# > +# Driver specific block device options for the vvfat protocol. > +# > +# @dir: directory to be exported as FAT image > +# @fat-type: #optional FAT type: 12, 16 or 32 > +# @floppy: #optional whether to export a floppy imae (true) or pa= rtitioned > +# hard disk (false; default) > +# @rw: #optional whether to allow write operations (default: = false) Why do we have 'read-only' in base, and 'rw' in vvfat? It feels like the vvfat option is redundant. > +## > +# @BlockdevOptionsGenericCOWFormat > +# > +# Driver specific block device options for image format that have no o= ption > +# besides their data source and an optional backing file. > +# > +# @file: reference to or definition of the data source block de= vice Do you need to document this field... > +# @backing: #optional reference to or definition of the backing fi= le block > +# device (if missing, taken from the image file content)= =2E It is > +# allowed to pass an empty string here in order to disab= le the > +# default backing file. > +# @copy-on-read: #optional whether to enable copy on read for the devi= ce > +# (default: false). Copy on read can only be used if th= e > +# image is not read-only. > +# > +# Since: 1.7 > +## > +{ 'type': 'BlockdevOptionsGenericCOWFormat', > + 'base': 'BlockdevOptionsGenericFormat', > + 'data': { '*backing': 'BlockdevRef', > + '*copy-on-read': 'bool' } } =2E..given that it is only present by inheritence? > +## > +# @BlockdevOptionsQcow2 > +# > +# Driver specific block device options for qcow2. > +# > +# @file: reference to or definition of the data source block de= vice > +# > +# @backing: #optional reference to or definition of the backing fi= le block > +# device (if missing, taken from the image file content)= Same question. If you DO document inherited fields, you missed @copy-on-read; if you DON'T document inherited fields, these two aren't necessary (instead, you could just have some statement about: "In addition to the fields documented in BlockdevOptionsGenericCOWFormat, this struct includes:") > +## > +# @blockdev-add: > +# > +# Creates a new block device. > +# > +# @options: block device options for the new device > +# > +# Since: 1.7 > +## > +{ 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } = } So deceptively simple :) All the real work is in the rest of the (cool!) enhancements to the qapi type generator. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --p8W0c49a5JrCcJfXxfj7WDLuRx1PGdHOR 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.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSPGg+AAoJEKeha0olJ0NqKTIH/2mYc1rLI0TizdCwpH7PSRjo FGVOujmMlfAuLaNa9gIS5Yw2ackYPRPj5I/+o2xkvrrLF8c942WkyAt+fuDyuEDt EyhGhz/upvTp0aU2Gop6wD26ciPHPo90RGzwutpHJw3Nxc8VvoonXcN5DhhivlSr AWCM22QPW9ZqV4mx0Xu021ZcR3eG+nZtEYJvcjeAnIDMNSiPvUW40c4NjNWstkRj Lk/JX1viTERKyhGUpB1StcmxBm9xvXRrXDdPFbhWjKLiO/KGaS9i2ZumCF8C4iHS qUJA0iRcnepYvqBr0VQ2jGyQ0hp5xPTZsa+Ve5acgBA1XAc36r8ZoNgPvGNI32k= =YeDC -----END PGP SIGNATURE----- --p8W0c49a5JrCcJfXxfj7WDLuRx1PGdHOR--