From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsFw5-00027b-0L for qemu-devel@nongnu.org; Sun, 15 Dec 2013 12:57:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsFvy-0000wR-NY for qemu-devel@nongnu.org; Sun, 15 Dec 2013 12:57:00 -0500 Received: from cantor2.suse.de ([195.135.220.15]:52064 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsFvy-0000vp-Hk for qemu-devel@nongnu.org; Sun, 15 Dec 2013 12:56:54 -0500 Message-ID: <52ADED60.2090303@suse.de> Date: Sun, 15 Dec 2013 18:56:48 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <10d4ecd00bfd9f76e2668fda2e9b2214865e1ceb.1386053678.git.peter.crosthwaite@xilinx.com> <529DDA66.2030504@suse.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 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: Peter Crosthwaite Cc: Peter Maydell , "Michael S. Tsirkin" , Antony Pavlov , Mark Langsdorf , QEMU Developers 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. This >>>> is not useful for devices that want to create board (or container) >>>> configurable dynamic device properties. Fix by trivially adding prop= erty >>>> 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 mst >>> (so let's CC him) for accessing read-only constants in ACPI code. You= r >>> 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. 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. > 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? If you can get the extra arg passed through as opaque then sure, that would be an option, passing false for all existing users. >>> 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, though: >> 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. 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. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg