From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYn5x-0001xd-2R for qemu-devel@nongnu.org; Fri, 11 Apr 2014 21:51:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYn5r-0006BS-6U for qemu-devel@nongnu.org; Fri, 11 Apr 2014 21:51:00 -0400 Received: from mail-yh0-x233.google.com ([2607:f8b0:4002:c01::233]:50442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYn5r-0006BO-1X for qemu-devel@nongnu.org; Fri, 11 Apr 2014 21:50:55 -0400 Received: by mail-yh0-f51.google.com with SMTP id f10so6131641yha.10 for ; Fri, 11 Apr 2014 18:50:54 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53489BF0.6090009@redhat.com> Date: Fri, 11 Apr 2014 21:50:40 -0400 From: Paolo Bonzini MIME-Version: 1.0 References: <1397205095-29830-1-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1397205095-29830-1-git-send-email-mjt@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0] kvm_physical_sync_dirty_bitmap: ignore ENOENT from kvm_vm_ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , qemu-devel@nongnu.org Cc: Peter Maydell , Serge Hallyn , Mario Smarduch Il 11/04/2014 04:31, Michael Tokarev ha scritto: > ENOENT means the kernel has an empty dirty bitmap for this > slot. Don't abort in that case. This appears to solve > the bug reported at > > https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1303926 > > which first showed up with commit b533f658a98325d: fix return > check for KVM_GET_DIRTY_LOG ioctl > > Cc: Serge Hallyn > Signed-off-by: Michael Tokarev > --- > kvm-all.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/kvm-all.c b/kvm-all.c > index cd4111d..47fa948 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -441,13 +441,19 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section) > > d.slot = mem->slot; > > - if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) { > + ret = kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d); > + if (ret >= 0) { > + /* regular case, process returned bitmap */ > + kvm_get_dirty_pages_log_range(section, d.dirty_bitmap); > + } else if (ret == -ENOENT) { > + /* kernel does not have dirty bitmap in this slot */ > + ret = 0; > + } else { > DPRINTF("ioctl failed %d\n", errno); > ret = -1; > break; > } > > - kvm_get_dirty_pages_log_range(section, d.dirty_bitmap); > start_addr = mem->start_addr + mem->memory_size; > } > g_free(d.dirty_bitmap); > I'd rather revert b533f658a98325d instead. Paolo