From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI8V-0003yx-3R for qemu-devel@nongnu.org; Tue, 26 May 2015 12:55:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxI8O-0004VV-9M for qemu-devel@nongnu.org; Tue, 26 May 2015 12:55:26 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:37566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI8O-0004VP-1v for qemu-devel@nongnu.org; Tue, 26 May 2015 12:55:20 -0400 Received: by wifw1 with SMTP id w1so38366772wif.0 for ; Tue, 26 May 2015 09:55:19 -0700 (PDT) Received: from 640k.localdomain (dynamic-adsl-94-39-199-114.clienti.tiscali.it. [94.39.199.114]) by mx.google.com with ESMTPSA id x3sm17749309wiy.20.2015.05.26.09.55.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 09:55:18 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 26 May 2015 18:54:37 +0200 Message-Id: <1432659305-54578-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> References: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v3 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: 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; -- 1.8.3.1