From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPLAx-00078Z-Vh for qemu-devel@nongnu.org; Tue, 01 May 2012 18:04:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPLAs-0003rs-LK for qemu-devel@nongnu.org; Tue, 01 May 2012 18:04:03 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:41109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPLAs-0003mO-EU for qemu-devel@nongnu.org; Tue, 01 May 2012 18:03:58 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 May 2012 16:03:53 -0600 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 41BAFC9006C for ; Tue, 1 May 2012 18:02:59 -0400 (EDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q41M2vmR065010 for ; Tue, 1 May 2012 18:02:59 -0400 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q41M1oxh016703 for ; Tue, 1 May 2012 16:01:52 -0600 Message-ID: <4FA05D1D.7080905@us.ibm.com> Date: Tue, 01 May 2012 17:01:01 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1335896294-9530-1-git-send-email-aliguori@us.ibm.com> <1335896294-9530-4-git-send-email-aliguori@us.ibm.com> <4FA033EC.1050800@suse.de> <4FA0497D.3060103@us.ibm.com> <4FA04B0E.5040500@suse.de> <4FA04C23.4070403@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/14] qdev: add qdev_add_properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Wanpeng Li , Paolo Bonzini , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , qemu-devel@nongnu.org On 05/01/2012 03:57 PM, Peter Maydell wrote: > On 1 May 2012 21:48, Anthony Liguori wrote: >> Legacy properties != static properties. >> >> qdev_add_properties adds both legacy and static properties. I'm happy to >> put static properties into object but not legacy properties. > > So, er, how are you defining legacy and static properties? > I would have thought 'legacy property' was 'anything we happen > to already have'... No, per the naming convention Paolo introduced, it's roughly: 1) legacy properties can be get/set as strings using the qdev parsing methods. Via qdev, they're exposed as -device ,=. In QOM, they're exposed as: /path/to/device/legacy- = 2) static properties are well-behaved QOM properties that just happen to be defined by the DEFINE_PROP_XXX macros. They use the get/set methods of the property types. New code can (and probably should) make use of static properties. There's magic in the qdev layer now to decide whether a Property in the array of properties becomes a legacy or static property (it's only ever exposed as one type). When we move static properties to Object, I'd like to keep legacy strictly as a qdev concept so we don't accidentally introduce more legacy properties. >> Base classes are free to call object_property_add_static directly and avoid >> qdev_add_properties entirely but we need the later for backwards compat. > > If qdev_add_properties is purely for back-compat it should be > clearly labelled so we don't use it in new code. Yes, I expect it would be once we have Paolo's property series in. For now, it's the only real interface we have for adding bulk properties. Regards, Anthony Liguori > > -- PMM >