fix ioctl return value
PATCH 1/1 fix ioctl return value
we expect a number less than 0, not exactly -1.
And furthermore, we return errno itself, so no need to use it.
This might break guests when this ioctl fails for some reason.
Signed-off-by Glauber Costa <[email protected]>
--- kvm-all.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
kvm-all.c +3 -3
@@ -319,9 +319,9 @@ int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, d.slot = mem->slot; -if (kvm_vm_ioctl (s,KVM_GET_DIRTY_LOG , &d) ==-1 ) { -dprintf ("ioctl failed %d\n" , errno); - ret =-1 ; + ret =kvm_vm_ioctl (s,KVM_GET_DIRTY_LOG , &d); +if (ret <0 ) { +dprintf ("ioctl failed %d\n" , ret);break ; }
Signature · 1 line
1.6.2.2