Received: from eggs.gnu.org ([2001:4830:134:3::10]:35758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCEQ-00018U-50 for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:28:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTCEK-0002bk-4X for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:28:38 -0400 From: Michael Tokarev Date: Thu, 27 Mar 2014 19:28:11 +0400 Message-Id: <1395934108-1694-7-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1395934108-1694-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1395934108-1694-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] [PULL 06/23] fix return check for KVM_GET_DIRTY_LOG ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev , Mario Smarduch From: Mario Smarduch Fix return condition check from kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) to handle internal failures or no support for memory slot dirty bitmap. Otherwise the ioctl succeeds and continues with migration. Addresses BUG# 1294227 Signed-off-by: Mario Smarduch Signed-off-by: Michael Tokarev --- kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 82a9119..cd4111d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -441,7 +441,7 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section) d.slot = mem->slot; - if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) { + if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) { DPRINTF("ioctl failed %d\n", errno); ret = -1; break; -- 1.7.10.4