From: Avi Kivity Subject: Re: [Qemu-devel] [PATCH v4 26/39] pcnet: convert to memory API Date: Tue, 09 Aug 2011 15:52:59 +0300 Message-ID: <4E412DAB.90106@redhat.com> References: <1312808972-1718-1-git-send-email-avi@redhat.com> <1312808972-1718-27-git-send-email-avi@redhat.com> <4E40D9F3.5080309@mc.net> <4E40D921.9080700@redhat.com> <20110809124246.GF524@redhat.com> <4E412BB3.9070703@redhat.com> <20110809124856.GI524@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Bob Breuer , Anthony Liguori , qemu-devel@nongnu.org, kvm@vger.kernel.org, Blue Swirl To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34487 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581Ab1HIMxM (ORCPT ); Tue, 9 Aug 2011 08:53:12 -0400 In-Reply-To: <20110809124856.GI524@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/09/2011 03:48 PM, Michael S. Tsirkin wrote: > > > > But in some cases, we can't, and the it's a pain having to wrap > > MemoryRegion in another structure containing an opaque. > > I guess, even though that wrapping structure would > use a proper type, not an opaque. Yes, of course - that's what the first version did. > > Maybe a good compromise is to: > > > > - keep MemoryRegion::opaque > > - pass a MemoryRegion *mr to callbacks instead of opaque > > - use container_of() when possible > > - use mr->opaque otherwise > > Right. This even saves a memory dereference when opaque is > unused. > I'll put this on the TODO (as well as writing the TODO). -- error compiling committee.c: too many arguments to function