> > > 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