From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M20oR-0005UF-DU for qemu-devel@nongnu.org; Thu, 07 May 2009 06:26:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M20oM-0005R6-TM for qemu-devel@nongnu.org; Thu, 07 May 2009 06:26:46 -0400 Received: from [199.232.76.173] (port=60751 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M20oM-0005Qn-P7 for qemu-devel@nongnu.org; Thu, 07 May 2009 06:26:42 -0400 Received: from mx2.redhat.com ([66.187.237.31]:55237) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M20oM-0003AL-8K for qemu-devel@nongnu.org; Thu, 07 May 2009 06:26:42 -0400 Date: Thu, 7 May 2009 13:25:38 +0300 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: pci_default_config_write() clean up. Message-ID: <20090507102538.GF32039@redhat.com> References: <20090507084019.GA25512%yamahata@valinux.co.jp> <20090507092908.GC32039@redhat.com> <20090507095540.GC25512%yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090507095540.GC25512%yamahata@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: mtosatti@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Thu, May 07, 2009 at 06:55:40PM +0900, Isaku Yamahata wrote: > On Thu, May 07, 2009 at 12:29:08PM +0300, Michael S. Tsirkin wrote: > > In my opinion, the approach of a mask-filling function is cleaner, > > maintaining the tables manually at you do will be more fragile. For > > example: > > Hmm, to be honest, I don't have strong opinion for > static table v.s. dynamic initialization here. > Okay, you prefer dynamic initialization. > > How about callback? Yes, I think callbacks have the potential to simplify code. Would you like to add them on top of my patch then? Here are some random thoughts on that part of your patch: - To make e.g. clear on write implementable, callback must get the value written - There's some tricky code there to trigger callbacks only once on a multibyte transaction. It would be simpler just to have per-dword callbacks. These could get the mask of the written-to bytes and do if (written_mask & interesting_mask) stuff -- MST