From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXjEw-0007GP-Ki for qemu-devel@nongnu.org; Tue, 08 Apr 2014 23:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXjEr-0006Im-Vm for qemu-devel@nongnu.org; Tue, 08 Apr 2014 23:31:54 -0400 Received: from static.92.5.9.176.clients.your-server.de ([176.9.5.92]:35142 helo=hallynmail2) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXjEr-0006IU-P1 for qemu-devel@nongnu.org; Tue, 08 Apr 2014 23:31:49 -0400 Date: Wed, 9 Apr 2014 05:31:48 +0200 From: "Serge E. Hallyn" Message-ID: <20140409033148.GA15339@mail.hallyn.com> References: <20140409032106.GA5163@sergelap> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140409032106.GA5163@sergelap> Subject: Re: [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: Serge Hallyn Cc: Michael Tokarev , qemu-devel@nongnu.org, 1303926@bugs.launchpad.net, Mario Smarduch D'oh, sorry. I generated that patch against my qemu tree at the bad_commit^. That won't apply to the tree... this should. >>From 0d818e334f6db88b2770e9a1076ae1e68c41e460 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Tue, 8 Apr 2014 22:14:20 -0500 Subject: [PATCH 1/1] kvm_physical_sync_dirty_bitmap: ignore ENOENT from kvm_vm_ioctl 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 Signed-off-by: Serge Hallyn --- kvm-all.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Index: qemu-2.0.0~rc1+dfsg/kvm-all.c =================================================================== --- qemu-2.0.0~rc1+dfsg.orig/kvm-all.c 2014-04-08 22:28:38.000722081 -0500 +++ qemu-2.0.0~rc1+dfsg/kvm-all.c 2014-04-08 22:29:14.644722904 -0500 @@ -441,10 +441,13 @@ static int kvm_physical_sync_dirty_bitma 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 && 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);