From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsG2k-0006BL-IW for qemu-devel@nongnu.org; Sun, 15 Dec 2013 13:03:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsG2g-0002r7-Ci for qemu-devel@nongnu.org; Sun, 15 Dec 2013 13:03:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsG2g-0002r2-4V for qemu-devel@nongnu.org; Sun, 15 Dec 2013 13:03:50 -0500 Date: Sun, 15 Dec 2013 20:07:31 +0200 From: "Michael S. Tsirkin" Message-ID: <20131215180730.GA12055@redhat.com> References: <10d4ecd00bfd9f76e2668fda2e9b2214865e1ceb.1386053678.git.peter.crosthwaite@xilinx.com> <529DDA66.2030504@suse.de> <52ADED60.2090303@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <52ADED60.2090303@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH arm-devs v3 1/9] qom/object: Make uintXX added properties writable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Peter Maydell , Peter Crosthwaite , Antony Pavlov , Mark Langsdorf , QEMU Developers On Sun, Dec 15, 2013 at 06:56:48PM +0100, Andreas F=E4rber wrote: > Am 15.12.2013 06:59, schrieb Peter Crosthwaite: > > Ping! > >=20 > > I'm trying to figure out what way I want to go here. > >=20 > > On Sat, Dec 7, 2013 at 12:49 AM, Peter Maydell wrote: > >> On 3 December 2013 13:19, Andreas F=E4rber wrote: > >>> Am 03.12.2013 07:59, schrieb Peter Crosthwaite: > >>>> Currently the uintXX property adders make a read only property. Th= is > >>>> is not useful for devices that want to create board (or container) > >>>> configurable dynamic device properties. Fix by trivially adding pr= operty > >>>> setters to object_property_add_uintXX. > >>>> > >>>> Signed-off-by: Peter Crosthwaite > >>>> --- > >>>> changed since v2: > >>>> msg typo: "trivially" > >>> > >>> Not sure if I've asked already, but these functions were added by m= st > >>> (so let's CC him) for accessing read-only constants in ACPI code. Y= our > >>> change seems to make them writable - can anything go wrong when the > >>> setters are used via QMP? > >=20 > > Maybe. But that should be an ACPI problem. >=20 > No, it means that if you change it you need to touch ACPI code as well = - > or to design your change in a way that avoids exactly that, e.g. by > adding a new API reusing the existing getters rather than changing the > semantics of the existing API used by ACPI. >=20 > > It seems that the semantics > > of these qom/object.c APIs has been set by the lead example. Maybe > > just an extra arg for RD/WR flags would do the trick however? >=20 > If you can get the extra arg passed through as opaque then sure, that > would be an option, passing false for all existing users. >=20 > >>> I fear we may need two separate sets of > >>> functions, one read-only, one read-write. > >> > >> We don't want a generically writable property for CBAR either, thoug= h: > >> we want the standard qdev property semantics of "writable until > >> realize, readonly thereafter". > >> > >=20 > > Well, with a bit of replumbing I spose we could make qdev property > > adder framework accessible to post_init to have access to > > setter/getter fns that implement these semantics. >=20 > Sorry, I don't get how that is related to post_init? All that's needed > is a check of DeviceState::realized in your setter and to error_setg() > out if true. >=20 > Regards, > Andreas I think ability to add read only properties is reasonable though. ACPI wants these since we calculate the value ourselves. > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg