From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tM3-0001lu-DH for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tM1-0007NM-PO for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tM1-0007Mu-KH for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:17 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 58C00C79C7 for ; Fri, 5 Jun 2015 15:16:17 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t55FG4kI012808 for ; Fri, 5 Jun 2015 11:16:16 -0400 From: Paolo Bonzini Date: Fri, 5 Jun 2015 17:15:07 +0200 Message-Id: <1433517363-32335-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> References: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 06/62] 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: qemu-devel@nongnu.org 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. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- 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 b61c84f..7b0929d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -647,8 +647,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 03c536b..a8f8599 100644 --- a/memory.c +++ b/memory.c @@ -1425,6 +1425,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; -- 2.4.1