From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajQi2-0004qp-R1 for qemu-devel@nongnu.org; Fri, 25 Mar 2016 08:19:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajQhx-0008VI-PP for qemu-devel@nongnu.org; Fri, 25 Mar 2016 08:19:22 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:42760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajQhx-0008VD-H4 for qemu-devel@nongnu.org; Fri, 25 Mar 2016 08:19:17 -0400 Date: Fri, 25 Mar 2016 08:19:13 -0400 (EDT) From: Paolo Bonzini Message-ID: <2064029908.40944831.1458908353337.JavaMail.zimbra@redhat.com> In-Reply-To: <20160325121304.GA21300@ad.usersys.redhat.com> References: <1458817415-29247-1-git-send-email-pbonzini@redhat.com> <1458817415-29247-3-git-send-email-pbonzini@redhat.com> <20160325062038.GA20431@ad.usersys.redhat.com> <1379879614.40943389.1458907082389.JavaMail.zimbra@redhat.com> <20160325121304.GA21300@ad.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: arei gonglei , qemu-devel@nongnu.org, mst@redhat.com > > > If called by address_space_unmap, is this addition still correct? > > > > No, thanks for the careful review! That's another opportunity > > for cleanup actually, splitting the (few) users of qemu_ram_addr_from_host > > that really need a ram_addr_t and those (the majority) that need a > > MemoryRegion and offset. They can use two different functions. I'll > > defer this to 2.7 and post the patches to do so later. > > Good idea. The above "block == NULL" qemu_get_ram_ptr callers could use a > separate function, too - frankly I don't like that function interface too > much. > What do you think? I don't know, at least block == NULL has a clear meaning. It's not entirely satisfying, but the users are readable and the ones that pass NULL stand out. In the case of qemu_ram_addr_from_host, on the other hand, there's a clear opportunity to avoid bugs. Paolo