From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXj4g-00007W-6Y for qemu-devel@nongnu.org; Tue, 08 Apr 2014 23:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXj4a-0003BA-GW for qemu-devel@nongnu.org; Tue, 08 Apr 2014 23:21:18 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXj4a-0003B4-AK for qemu-devel@nongnu.org; Tue, 08 Apr 2014 23:21:12 -0400 Date: Tue, 8 Apr 2014 22:21:06 -0500 From: Serge Hallyn Message-ID: <20140409032106.GA5163@sergelap> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH 1/1] kvm_physical_sync_dirty_bitmap: ignore ENOENT from kvm_vm_ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Tokarev , 1303926@bugs.launchpad.net, Mario Smarduch ENOENT (iiuc) 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 Signed-off-by: Serge Hallyn --- kvm-all.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 82a9119..7b7ea8d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -441,10 +441,13 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section) d.slot = mem->slot; - if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) { + ret = kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d); + if (ret < 0 && ret != -ENOENT) { DPRINTF("ioctl failed %d\n", errno); ret = -1; break; + } else if (ret < 0) { + ret = 0; } kvm_get_dirty_pages_log_range(section, d.dirty_bitmap); -- 1.9.1