From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnLV-0000fG-TT for qemu-devel@nongnu.org; Tue, 18 Feb 2014 11:16:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFnLP-0007Bb-Tb for qemu-devel@nongnu.org; Tue, 18 Feb 2014 11:16:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnLP-0007BR-M2 for qemu-devel@nongnu.org; Tue, 18 Feb 2014 11:16:27 -0500 Message-ID: <53038754.7000304@redhat.com> Date: Tue, 18 Feb 2014 17:16:20 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1392726818-14606-1-git-send-email-vincent.kherbache@inria.fr> In-Reply-To: <1392726818-14606-1-git-send-email-vincent.kherbache@inria.fr> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvm: fix kvm_set_migration_log() behavior List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincent KHERBACHE , qemu-devel@nongnu.org Cc: gleb@redhat.com Il 18/02/2014 13:33, Vincent KHERBACHE ha scritto: > diff --git a/kvm-all.c b/kvm-all.c > index 2ca9143..f104f87 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -355,7 +355,7 @@ static int kvm_set_migration_log(int enable) > { > KVMState *s = kvm_state; > KVMSlot *mem; > - int i, err; > + int i, err = 0; > > s->migration_log = enable; > > @@ -365,15 +365,9 @@ static int kvm_set_migration_log(int enable) > if (!mem->memory_size) { > continue; > } > - if (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) { > - continue; > - } > - err = kvm_set_user_memory_region(s, mem); > - if (err) { > - return err; > - } > + err = kvm_slot_dirty_pages_log_change(mem, (bool)enable); > } > - return 0; > + return err; > } This patch is not correct, because it introduces another one: if dirty logging was enabled on the memory region (kvm_dirty_pages_log_change), it will be disabled after migration. Can you explain better the problem? I cannot see anything wrong in the code, though it is not the clearest. Note that the effects of kvm_set_migration_log and kvm_dirty_pages_log_change should be logically ORed. Paolo