[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/libxl: replace non-POSIX error codes used by PSR code



commit 21a85ed569e59c5968b770a913a83a6b45213be7
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Wed Jul 22 16:45:35 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 22 16:45:35 2015 +0200

    x86/libxl: replace non-POSIX error codes used by PSR code

    PSR was using EBADSLT and EUSERS which are not POSIX error codes, replace
    them with ENOTSOCK and EOVERFLOW respectively.

    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_psr.c    |    6 +++---
 xen/arch/x86/psr.c         |    8 ++++----
 xen/include/public/errno.h |    1 +
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 2a07777..3378239 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -31,7 +31,7 @@ static void libxl__psr_log_err_msg(libxl__gc *gc, int err)
     case ESRCH:
         msg = "invalid domain ID";
         break;
-    case EBADSLT:
+    case ENOTSOCK:
         msg = "socket is not supported";
         break;
     case EFAULT:
@@ -59,7 +59,7 @@ static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err)
     case ENOENT:
         msg = "CMT is not attached to this domain";
         break;
-    case EUSERS:
+    case EOVERFLOW:
         msg = "no free RMID available";
         break;
     default:
@@ -81,7 +81,7 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err)
     case ENOENT:
         msg = "CAT is not enabled on the socket";
         break;
-    case EUSERS:
+    case EOVERFLOW:
         msg = "no free COS available";
         break;
     case EEXIST:
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index ed59803..c0daa2e 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -178,7 +178,7 @@ int psr_alloc_rmid(struct domain *d)
     if ( rmid > psr_cmt->rmid_max )
     {
         d->arch.psr_rmid = 0;
-        return -EUSERS;
+        return -EOVERFLOW;
     }

     d->arch.psr_rmid = rmid;
@@ -253,7 +253,7 @@ static struct psr_cat_socket_info 
*get_cat_socket_info(unsigned int socket)
         return ERR_PTR(-ENODEV);

     if ( socket >= nr_sockets )
-        return ERR_PTR(-EBADSLT);
+        return ERR_PTR(-ENOTSOCK);

     if ( !test_bit(socket, cat_socket_enable) )
         return ERR_PTR(-ENOENT);
@@ -334,7 +334,7 @@ static int write_l3_cbm(unsigned int socket, unsigned int 
cos, uint64_t cbm)
         unsigned int cpu = get_socket_cpu(socket);

         if ( cpu >= nr_cpu_ids )
-            return -EBADSLT;
+            return -ENOTSOCK;
         on_selected_cpus(cpumask_of(cpu), do_write_l3_cbm, &info, 1);
     }

@@ -383,7 +383,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, 
uint64_t cbm)
     if ( !found )
     {
         spin_unlock(&info->cbm_lock);
-        return -EUSERS;
+        return -EOVERFLOW;
     }

     cos = found - map;
diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
index 9a7e411..50adcb9 100644
--- a/xen/include/public/errno.h
+++ b/xen/include/public/errno.h
@@ -65,6 +65,7 @@ XEN_ERRNO(EILSEQ,     84)     /* Illegal byte sequence */
 XEN_ERRNO(ERESTART,    85)     /* Interrupted system call should be restarted 
*/
 #endif
 XEN_ERRNO(EUSERS,      87)     /* Too many users */
+XEN_ERRNO(ENOTSOCK,    88)     /* Socket operation on non-socket */
 XEN_ERRNO(EOPNOTSUPP,  95)     /* Operation not supported on transport 
endpoint */
 XEN_ERRNO(EADDRINUSE,  98)     /* Address already in use */
 XEN_ERRNO(EADDRNOTAVAIL, 99)   /* Cannot assign requested address */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.