Received: from [140.186.70.92] (port=59024 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmRiP-0004p3-Ny for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:05:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmRiO-0003mG-MN for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:05:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmRiO-0003mB-BR for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:05:16 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 03/16] qdev-properties: add PROP_TYPE_ENUM References: <1296773152-23279-1-git-send-email-alevy@redhat.com> <1296773152-23279-4-git-send-email-alevy@redhat.com> <20110207104348.GA5754@playa.tlv.redhat.com> <4D4FF08D.2040505@codemonkey.ws> Date: Mon, 07 Feb 2011 15:05:13 +0100 In-Reply-To: <4D4FF08D.2040505@codemonkey.ws> (Anthony Liguori's message of "Mon, 07 Feb 2011 07:15:57 -0600") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori writes: > On 02/07/2011 04:43 AM, Alon Levy wrote: >> On Mon, Feb 07, 2011 at 09:53:44AM +0100, Markus Armbruster wrote: [...] >>> Okay, let's examine how your enumeration properties work. >>> >>> An enumeration property describes a uint32_t field of the state object. >>> Differences to ordinary properties defined with DEFINE_PROP_UINT32: >>> >>> * info is qdev_prop_enum instead of qdev_prop_uint32. Differences >>> between the two: >>> >>> - parse, print: symbolic names vs. numbers >>> >>> - name, print_options: only for -device DRIVER,\? (and name's use >>> there isn't particularly helpful) >>> >> Why do you say that? this is being used by libvirt to get the names of the >> supported backends for the ccid-card-emulated device. >> > > This is wrong. > > Libvirt should query this information through QMP. "We should make this information readily available through QMP", you want to say ;) > This is my main > concern with enums. If there isn't a useful introspection interface, > libvirt is going to do dumb things like query help output. Beggars can't be choosers. > This has been a nightmare historically and I'm not inclined to repeat it. No argument, but we can hardly expect poor Alon to finish the QMP job just to get his usb-ccid device in. What would making him drop enum properties from his series accomplish? We'd get the same device with an inferior -device interface, which we then have to maintain compatibly.