From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx9BW-0000HG-CI for qemu-devel@nongnu.org; Tue, 26 May 2015 03:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yx9BT-0004gk-2M for qemu-devel@nongnu.org; Tue, 26 May 2015 03:21:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx8qm-00075I-Rm for qemu-devel@nongnu.org; Tue, 26 May 2015 03:00:33 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4Q70VoK023549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 26 May 2015 03:00:32 -0400 Date: Tue, 26 May 2015 15:00:28 +0800 From: Fam Zheng Message-ID: <20150526070028.GC13749@ad.nay.redhat.com> References: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> <1430152117-100558-2-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430152117-100558-2-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 01/29] memory: the only dirty memory flag for users is DIRTY_MEMORY_VGA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On Mon, 04/27 18:28, Paolo Bonzini wrote: > DIRTY_MEMORY_MIGRATION is triggered by memory_global_dirty_log_start > and memory_global_dirty_log_stop, so it cannot be used with > memory_region_set_log. > > Specify this in the documentation and assert it. > > Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng > --- > include/exec/memory.h | 3 +-- > memory.c | 1 + > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/exec/memory.h b/include/exec/memory.h > index a2ea587..081f7d6 100644 > --- a/include/exec/memory.h > +++ b/include/exec/memory.h > @@ -625,8 +625,7 @@ void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, > * > * @mr: the memory region being updated. > * @log: whether dirty logging is to be enabled or disabled. > - * @client: the user of the logging information; %DIRTY_MEMORY_MIGRATION or > - * %DIRTY_MEMORY_VGA. > + * @client: the user of the logging information; %DIRTY_MEMORY_VGA only. > */ > void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client); > > diff --git a/memory.c b/memory.c > index a11e9bf..e688f5e 100644 > --- a/memory.c > +++ b/memory.c > @@ -1354,6 +1354,7 @@ void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client) > { > uint8_t mask = 1 << client; > > + assert(client == DIRTY_MEMORY_VGA); > memory_region_transaction_begin(); > mr->dirty_log_mask = (mr->dirty_log_mask & ~mask) | (log * mask); > memory_region_update_pending |= mr->enabled; > -- > 1.8.3.1 > >