From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx9wl-0006LM-AV for qemu-devel@nongnu.org; Tue, 26 May 2015 04:10:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yx9wi-0004tZ-2o for qemu-devel@nongnu.org; Tue, 26 May 2015 04:10:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx9wh-0004tR-Ih for qemu-devel@nongnu.org; Tue, 26 May 2015 04:10:43 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 519E48EA56 for ; Tue, 26 May 2015 08:10:43 +0000 (UTC) Date: Tue, 26 May 2015 16:10:40 +0800 From: Fam Zheng Message-ID: <20150526081040.GK13749@ad.nay.redhat.com> References: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> <1430152117-100558-11-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-11-git-send-email-pbonzini@redhat.com> Subject: Re: [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: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On Mon, 04/27 18:28, Paolo Bonzini wrote: > 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 Could you explain where this change is needed? Fam > --- > 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 > > >