From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjOa3-0006Iw-KI for qemu-devel@nongnu.org; Mon, 03 Jun 2013 02:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjOa2-0006EV-O9 for qemu-devel@nongnu.org; Mon, 03 Jun 2013 02:49:23 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:38502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjOa2-0006ER-IJ for qemu-devel@nongnu.org; Mon, 03 Jun 2013 02:49:22 -0400 Received: by mail-wi0-f175.google.com with SMTP id hn14so2326627wib.14 for ; Sun, 02 Jun 2013 23:49:21 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51AC3C66.3090105@redhat.com> Date: Mon, 03 Jun 2013 08:49:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1370187812-13191-1-git-send-email-pbonzini@redhat.com> <1370187812-13191-3-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/15] memory: add ref/unref List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, Liu Ping Fan Il 02/06/2013 17:58, Peter Maydell ha scritto: >> > + * memory_region_ref: Add 1 to a memory region's reference count >> > + * >> > + * Whenever memory regions are accessed outside the BQL, they need to be >> > + * preserved against hot-unplug. MemoryRegions actually do not have their >> > + * own reference count; they piggyback on a QOM object, their "owner". >> > + * This function adds a reference to the owner. > It doesn't make much sense to describe the function as > "add 1 to a memory region's reference count" and then > say that memory regions don't have reference counts... The fact that the reference count is the owner's is really an implementation detail. The reference count is used entirely as if it were the region's. So the summary says it is the region's, the long description says what happens under the hood. Suggestions on rephrasing the comments are welcome. Paolo