diff mbox series

[Xen-devel] libs/foreignmemory: Avoid printing an error for ENOTSUPP

Message ID 20180813173325.14697-1-julien.grall@arm.com
State New
Headers show
Series [Xen-devel] libs/foreignmemory: Avoid printing an error for ENOTSUPP | expand

Commit Message

Julien Grall Aug. 13, 2018, 5:33 p.m. UTC
Resource mapping is not supported on Arm and results to an error message
at every guest boot:

xenforeignmemory: error: ioctl failed: Operation not supported

Hide the error message when errnor is ENOTSUPP.

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 tools/libs/foreignmemory/linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Durrant Aug. 14, 2018, 7:53 a.m. UTC | #1
> -----Original Message-----
> From: Julien Grall [mailto:julien.grall@arm.com]
> Sent: 13 August 2018 18:33
> To: xen-devel@lists.xenproject.org
> Cc: Ian Jackson <Ian.Jackson@citrix.com>; Wei Liu <wei.liu2@citrix.com>;
> Paul Durrant <Paul.Durrant@citrix.com>; Julien Grall <julien.grall@arm.com>
> Subject: [PATCH] libs/foreignmemory: Avoid printing an error for ENOTSUPP
> 
> Resource mapping is not supported on Arm and results to an error message
> at every guest boot:
> 
> xenforeignmemory: error: ioctl failed: Operation not supported
> 
> Hide the error message when errnor is ENOTSUPP.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> ---
>  tools/libs/foreignmemory/linux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libs/foreignmemory/linux.c
> b/tools/libs/foreignmemory/linux.c
> index a6b41b0b7f..3686cf41e0 100644
> --- a/tools/libs/foreignmemory/linux.c
> +++ b/tools/libs/foreignmemory/linux.c
> @@ -307,7 +307,7 @@ int osdep_xenforeignmemory_map_resource(
>      {
>          int saved_errno;
> 
> -        if ( errno != ENOTTY )
> +        if ( errno != ENOTTY && errno != EOPNOTSUPP )
>              PERROR("ioctl failed");
>          else
>              errno = EOPNOTSUPP;
> --
> 2.11.0
Wei Liu Aug. 14, 2018, 7:59 a.m. UTC | #2
On Mon, Aug 13, 2018 at 06:33:25PM +0100, Julien Grall wrote:
> Resource mapping is not supported on Arm and results to an error message
> at every guest boot:
> 
> xenforeignmemory: error: ioctl failed: Operation not supported
> 
> Hide the error message when errnor is ENOTSUPP.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
diff mbox series

Patch

diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index a6b41b0b7f..3686cf41e0 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -307,7 +307,7 @@  int osdep_xenforeignmemory_map_resource(
     {
         int saved_errno;
 
-        if ( errno != ENOTTY )
+        if ( errno != ENOTTY && errno != EOPNOTSUPP )
             PERROR("ioctl failed");
         else
             errno = EOPNOTSUPP;