From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmlvP-0001wo-A3 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 12:30:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmlvO-0002zi-Jh for qemu-devel@nongnu.org; Mon, 27 Apr 2015 12:30:27 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:32783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmlvN-0002zP-Vc for qemu-devel@nongnu.org; Mon, 27 Apr 2015 12:30:26 -0400 Received: by wgin8 with SMTP id n8so121992286wgi.0 for ; Mon, 27 Apr 2015 09:30:25 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 27 Apr 2015 18:28:18 +0200 Message-Id: <1430152117-100558-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> References: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 10/29] kvm: accept non-mapped memory in kvm_dirty_pages_log_change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, stefanha@redhat.com, mst@redhat.com It is okay if memory is not mapped into the guest but has dirty logging enabled. When this happens, KVM will not do anything and only accesses from the host will be logged. Signed-off-by: Paolo Bonzini --- kvm-all.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 989fdd9..616bf04 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -335,12 +335,10 @@ static int kvm_dirty_pages_log_change(hwaddr phys_addr, KVMSlot *mem = kvm_lookup_matching_slot(s, phys_addr, phys_addr + size); if (mem == NULL) { - fprintf(stderr, "BUG: %s: invalid parameters " TARGET_FMT_plx "-" - TARGET_FMT_plx "\n", __func__, phys_addr, - (hwaddr)(phys_addr + size - 1)); - return -EINVAL; + return 0; + } else { + return kvm_slot_dirty_pages_log_change(mem, log_dirty); } - return kvm_slot_dirty_pages_log_change(mem, log_dirty); } static void kvm_log_start(MemoryListener *listener, -- 1.8.3.1