All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: arei gonglei <arei.gonglei@huawei.com>,
	qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users
Date: Fri, 25 Mar 2016 08:19:13 -0400 (EDT)	[thread overview]
Message-ID: <2064029908.40944831.1458908353337.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160325121304.GA21300@ad.usersys.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

  reply	other threads:[~2016-03-25 12:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 11:03 [Qemu-devel] [PATCH 0/2] memory: cleanup users of memory_region_get_ram_addr Paolo Bonzini
2016-03-24 11:03 ` [Qemu-devel] [PATCH 1/2] memory: remove unnecessary masking of MemoryRegion ram_addr Paolo Bonzini
2016-03-25  6:20   ` Fam Zheng
2016-04-03 13:48   ` Michael S. Tsirkin
2016-03-24 11:03 ` [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users Paolo Bonzini
2016-03-25  6:20   ` Fam Zheng
2016-03-25 11:58     ` Paolo Bonzini
2016-03-25 12:13       ` Fam Zheng
2016-03-25 12:19         ` Paolo Bonzini [this message]
2016-04-03 13:49   ` Michael S. Tsirkin
2016-04-03 17:14     ` Paolo Bonzini
2016-04-04  8:03     ` Paolo Bonzini
2016-04-04  8:38       ` Michael S. Tsirkin
2016-04-04  9:02         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2064029908.40944831.1458908353337.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=famz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.