Skip to content

Commit

Permalink
Revert "fix return check for KVM_GET_DIRTY_LOG ioctl"
Browse files Browse the repository at this point in the history
This reverts commit b533f65.

The original code was wrong, because effectively it ignored errors
from kernel, because kernel does not return -1 on error case but
returns -errno, and does not return -EPERM for this particular ioctl.
But in some cases kernel actually returned unsuccessful result,
namely, when the dirty bitmap in requested slot does not exist
it returns -ENOENT.  With new code this condition becomes an
error when it shouldn't be.

Revert that patch instead of fixing it properly this late in the
release process.  I disagree with this approach, but let's make
things move _somewhere_, instead of arguing endlessly whch of
the 2 proposed fixes is better.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Message-id: 1397477644-902-1-git-send-email-mjt@msgid.tls.msk.ru
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
Michael Tokarev authored and pm215 committed Apr 14, 2014
1 parent c2b9af1 commit 50212d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kvm-all.c
Expand Up @@ -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) < 0) {
if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
DPRINTF("ioctl failed %d\n", errno);
ret = -1;
break;
Expand Down

0 comments on commit 50212d6

Please sign in to comment.