]> git.proxmox.com Git - mirror_qemu.git/commitdiff
s390x/vfio-ap: report correct error
authorCornelia Huck <cohuck@redhat.com>
Tue, 16 Oct 2018 11:51:54 +0000 (13:51 +0200)
committerCornelia Huck <cohuck@redhat.com>
Mon, 5 Nov 2018 08:55:01 +0000 (09:55 +0100)
If ioctl(..., VFIO_DEVICE_RESET) fails, we want to report errno
instead of ret (which is always -1 on error).

Fixes Coverity issue CID 1396176.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/vfio/ap.c

index 3962bb74e57895a988ae615969c72cd519dec620..65de952f442ed8c78dc0f3a021847da701e1034e 100644 (file)
@@ -142,7 +142,7 @@ static void vfio_ap_reset(DeviceState *dev)
     ret = ioctl(vapdev->vdev.fd, VFIO_DEVICE_RESET);
     if (ret) {
         error_report("%s: failed to reset %s device: %s", __func__,
-                     vapdev->vdev.name, strerror(ret));
+                     vapdev->vdev.name, strerror(errno));
     }
 }