From: Anthony Liguori Subject: Re: [Qemu-devel] [RFC v3 31/56] ac97: convert to memory API Date: Sun, 10 Jul 2011 20:42:05 -0500 Message-ID: <4E1A54ED.7040606@codemonkey.ws> References: <1310321709-30770-1-git-send-email-avi@redhat.com> <1310321709-30770-32-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , qemu-devel@nongnu.org, kvm@vger.kernel.org To: malc Return-path: Received: from mail-gx0-f174.google.com ([209.85.161.174]:60958 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754813Ab1GKBmI (ORCPT ); Sun, 10 Jul 2011 21:42:08 -0400 Received: by gxk21 with SMTP id 21so1315016gxk.19 for ; Sun, 10 Jul 2011 18:42:07 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 07/10/2011 03:33 PM, malc wrote: > On Sun, 10 Jul 2011, Avi Kivity wrote: > >> fixes BAR sizing as well. > > I find this patch disgusting, the read and write handlers in particular. Shouldn't it be possible to do something like: typedef struct OldMemoryRegionOps { MemoryRegionOps parent_ops; CPUReadMemoryFunc *readfn[3]; CPUWriteMemoryFunc *writefn[3]; void *opaque; } OldMemoryRegionOps; That should allow old-style implementations to be converted without introducing trampoline functions everywhere. Regards, Anthony Liguori > > [..snip..] >