From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2FsH-0008Vf-NZ for qemu-devel@nongnu.org; Wed, 02 Jul 2014 04:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2FsA-0001eb-7s for qemu-devel@nongnu.org; Wed, 02 Jul 2014 04:26:41 -0400 Message-ID: <53B3C21D.5040203@redhat.com> Date: Wed, 02 Jul 2014 10:26:05 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404251378-5242-1-git-send-email-agraf@suse.de> <1404251378-5242-4-git-send-email-agraf@suse.de> <53B3C1A8.7020408@suse.de> In-Reply-To: <53B3C1A8.7020408@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/6] sysbus: Add user map hints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Peter Crosthwaite Cc: Peter Maydell , Eric Auger , "qemu-devel@nongnu.org Developers" , qemu-ppc Mailing List , "Stalley, Sean" , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Il 02/07/2014 10:24, Alexander Graf ha scritto: >>> >> So this suggests your reasoning for side effected _ptr write is just >> for validity checking. So another approach could be to add a "check" >> function to the _ptr variants (rather than an open coded) setter. This >> has the advantage of being consistent with what we already do for >> object_property_add_link. > > Heh, yes. Unfortunately "realized" is a field in DeviceStruct which we > don't have access to from object.c. > > In fact, this is exactly what I wanted to do before this approach. I > introduced an enum that was either > > * read-only > * read-write > * read-write-before-realize > > and wanted to do all the checking in object.c. > > But then I realized that object.c really shouldn't be aware of > DeviceState and threw away the idea. I think your solution is pretty. However, it's probably time to split qom/object.c and/or include/qom/object.h. Paolo