qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error
@ 2018-10-16 11:58 Cornelia Huck
  2018-10-16 12:56 ` Christian Borntraeger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Cornelia Huck @ 2018-10-16 11:58 UTC (permalink / raw)
  To: Tony Krowiak, Christian Borntraeger, Halil Pasic, Pierre Morel
  Cc: Alex Williamson, Peter Maydell, qemu-s390x, qemu-devel,
	Cornelia Huck

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>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/vfio/ap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 3962bb74e5..65de952f44 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -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));
     }
 }
 
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error
  2018-10-16 11:58 [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error Cornelia Huck
@ 2018-10-16 12:56 ` Christian Borntraeger
  2018-10-16 13:29 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2018-10-16 12:56 UTC (permalink / raw)
  To: Cornelia Huck, Tony Krowiak, Halil Pasic, Pierre Morel
  Cc: Alex Williamson, Peter Maydell, qemu-s390x, qemu-devel



On 10/16/2018 01:58 PM, Cornelia Huck wrote:
> 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>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>

makes sense

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>

> ---
>  hw/vfio/ap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index 3962bb74e5..65de952f44 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -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));
>      }
>  }
>  
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH] s390x/vfio-ap: report correct error
  2018-10-16 11:58 [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error Cornelia Huck
  2018-10-16 12:56 ` Christian Borntraeger
@ 2018-10-16 13:29 ` Thomas Huth
  2018-10-16 14:56 ` [Qemu-devel] " Tony Krowiak
  2018-10-16 16:44 ` Cornelia Huck
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2018-10-16 13:29 UTC (permalink / raw)
  To: Cornelia Huck, Tony Krowiak, Christian Borntraeger, Halil Pasic,
	Pierre Morel
  Cc: Peter Maydell, Alex Williamson, qemu-s390x, qemu-devel

On 2018-10-16 13:58, Cornelia Huck wrote:
> 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>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  hw/vfio/ap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index 3962bb74e5..65de952f44 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -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));
>      }
>  }
>  
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error
  2018-10-16 11:58 [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error Cornelia Huck
  2018-10-16 12:56 ` Christian Borntraeger
  2018-10-16 13:29 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
@ 2018-10-16 14:56 ` Tony Krowiak
  2018-10-16 16:44 ` Cornelia Huck
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Krowiak @ 2018-10-16 14:56 UTC (permalink / raw)
  To: Cornelia Huck, Christian Borntraeger, Halil Pasic, Pierre Morel
  Cc: Alex Williamson, Peter Maydell, qemu-s390x, qemu-devel

On 10/16/2018 07:58 AM, Cornelia Huck wrote:
> 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>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   hw/vfio/ap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index 3962bb74e5..65de952f44 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -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));
>       }
>   }

Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>

>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error
  2018-10-16 11:58 [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error Cornelia Huck
                   ` (2 preceding siblings ...)
  2018-10-16 14:56 ` [Qemu-devel] " Tony Krowiak
@ 2018-10-16 16:44 ` Cornelia Huck
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2018-10-16 16:44 UTC (permalink / raw)
  To: Tony Krowiak, Christian Borntraeger, Halil Pasic, Pierre Morel
  Cc: Alex Williamson, Peter Maydell, qemu-s390x, qemu-devel

On Tue, 16 Oct 2018 13:58:17 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> 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>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  hw/vfio/ap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Queued to s390-next.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-16 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 11:58 [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error Cornelia Huck
2018-10-16 12:56 ` Christian Borntraeger
2018-10-16 13:29 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-10-16 14:56 ` [Qemu-devel] " Tony Krowiak
2018-10-16 16:44 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).