OSDN Git Service

accel/kvm/kvm-all: Fix wrong return code handling in dirty log code
authorThomas Huth <thuth@redhat.com>
Fri, 29 Jan 2021 08:43:54 +0000 (09:43 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Feb 2021 13:43:55 +0000 (14:43 +0100)
commit38e0b7904eca7cd32f8953c33701e1f226ecc3fe
treed5e411627ca6dbaa92e87f2cd7c3d0bcdc84e49f
parentc2651c0eaa1920f6478b4d371ad13c5e1409cccd
accel/kvm/kvm-all: Fix wrong return code handling in dirty log code

The kvm_vm_ioctl() wrapper already returns -errno if the ioctl itself
returned -1, so the callers of kvm_vm_ioctl() should not check for -1
but for a value < 0 instead.

This problem has been fixed once already in commit b533f658a98325d0e4
but that commit missed that the ENOENT error code is not fatal for
this ioctl, so the commit has been reverted in commit 50212d6346f33d6e
since the problem occurred close to a pending release at that point
in time. The plan was to fix it properly after the release, but it
seems like this has been forgotten. So let's do it now finally instead.

Resolves: https://bugs.launchpad.net/qemu/+bug/1294227
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210129084354.42928-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c