Received: from eggs.gnu.org ([2001:4830:134:3::10]:59784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN2iv-00056u-Kr for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:34:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN2in-0007ZE-PX for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:34:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN2in-0007Yu-IS for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:34:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8KFYGTH018267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 20 Sep 2013 11:34:17 -0400 Date: Fri, 20 Sep 2013 17:34:22 +0200 From: Kevin Wolf Message-ID: <20130920153421.GL2800@dhcp-200-207.str.redhat.com> References: <1379678070-14346-1-git-send-email-kwolf@redhat.com> <1379678070-14346-5-git-send-email-kwolf@redhat.com> <523C683E.2030401@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <523C683E.2030401@redhat.com> 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: Eric Blake Cc: mreitz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com Am 20.09.2013 um 17:22 hat Eric Blake geschrieben: > On 09/20/2013 05:54 AM, Kevin Wolf wrote: > > For examples see the changes to qmp-commands.hx. > > > > Signed-off-by: Kevin Wolf > > --- > > blockdev.c | 57 ++++++++++++ > > qapi-schema.json | 270 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > qmp-commands.hx | 59 ++++++++++++ > > 3 files changed, 386 insertions(+) > > > > > > +# Since: 1.7 > > +## > > +{ 'type': 'BlockdevOptionsBase', > > + 'data': { 'driver': 'str', > > + '*id': 'str', > > + '*discard': 'BlockdevDiscardOptions', > > + '*cache': 'BlockdevCacheOptions', > > + '*aio': 'BlockdevAIOOptions', > > Is the double space intentional? Harmless, but inconsistent. No, I'll fix it. > > + '*rerror': 'BlockdevOnError', > > + '*werror': 'BlockdevOnError', > > + '*throttling': 'BlockdevThrottlingOptions', > > + '*read-only': 'bool' } } > ... > > > +## > > +# @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 partitioned > > +# 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. I guess it is kind of redundant. The reason for it is that it's always been there, encoded in the filename as "fat:rw:..." - and the reason for that is that read-write vvfat is even more unreliable than read-only vvfat. So we have a read-only=false default in base, and a read-only=true default in vvfat. I'm not sure if changing this without breaking the command line is possible; but if it is, it involves vvfat-specific magic in drive_init(), which this simply isn't worth. > > +## > > +# @BlockdevOptionsGenericCOWFormat > > +# > > +# Driver specific block device options for image format that have no option > > +# besides their data source and an optional backing file. > > +# > > +# @file: reference to or definition of the data source block device > > Do you need to document this field... > > > +# @backing: #optional reference to or definition of the backing file block > > +# device (if missing, taken from the image file content). It is > > +# allowed to pass an empty string here in order to disable the > > +# default backing file. > > +# @copy-on-read: #optional whether to enable copy on read for the device > > +# (default: false). Copy on read can only be used if the > > +# image is not read-only. > > +# > > +# Since: 1.7 > > +## > > +{ 'type': 'BlockdevOptionsGenericCOWFormat', > > + 'base': 'BlockdevOptionsGenericFormat', > > + 'data': { '*backing': 'BlockdevRef', > > + '*copy-on-read': 'bool' } } > > ...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 device > > +# > > +# @backing: #optional reference to or definition of the backing file 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:") Nope, I don't think they are necessary. I just wasn't careful enough when I added the inheritance. I'll drop them. Kevin