From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQE1L-0005Ht-VV for qemu-devel@nongnu.org; Wed, 28 Jun 2017 10:32:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQE1K-000424-T1 for qemu-devel@nongnu.org; Wed, 28 Jun 2017 10:32:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48668) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dQE1K-00041Y-Lz for qemu-devel@nongnu.org; Wed, 28 Jun 2017 10:32:42 -0400 Date: Wed, 28 Jun 2017 22:32:38 +0800 From: Fam Zheng Message-ID: <20170628143238.GK14166@lemon.lan> References: <20170628124850.12821-1-famz@redhat.com> <20170628124850.12821-5-famz@redhat.com> <20170628140219.GI14166@lemon.lan> <3553624c-4f6a-7671-41d6-db22a2e37003@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3553624c-4f6a-7671-41d6-db22a2e37003@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/7] qdev: Introduce DEFINE_PROP_LINK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Markus Armbruster , qemu-devel@nongnu.org, "Dr . David Alan Gilbert" , Andreas =?iso-8859-1?Q?F=E4rber?= On Wed, 06/28 16:06, Paolo Bonzini wrote: > > > On 28/06/2017 16:02, Fam Zheng wrote: > >>> It's implemented by creating a wrapper property that basically forwards > >>> operations to a QOM "link-FOO" property, which handles the check > >>> callback and flags. The feature that is missing from QOM is the dynamic > >>> child pointer which is done in the added code with the usual "offset" > >>> approach. > >> Would it be possible to add a ".create" field to PropertyInfo? Then > >> there's no need to introduce the wrapper. > > QOM setter/getter want a LinkProperty opaque pointer, but qdev uses a Property > > pointer. I don't see a way to adapt that with .create(). Can you elaborate? > > The .create() callback would call object_property_add_link directly. > There would be no change in the properties at the QOM level, but the > PropertyInfo lets "info qtree" show the property. Thanks, I see, I'll try it in v2 if Andreas agrees on the general idea. Fam