[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH for-4.6 2/3] libxl/psr: use Xen error codes when checking hypercall return values
We cannot use the systems errno values when checking return values from Xen, because some OSes don't have the same set of errno definitions. Instead use the definitions present in Xen public errno.h header. Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> Cc: Wei Liu <wei.liu2@xxxxxxxxxx> --- I have not checked if there are other places in libxl that need similar treatment, I just came around this because FreeBSD doesn't have EBADSLT defined. --- tools/libxl/libxl_internal.h | 1 + tools/libxl/libxl_psr.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 2b6b2a0..cf5db8a 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -55,6 +55,7 @@ #include "xentoollog.h" #include <xen/io/xenbus.h> +#include <xen/errno.h> #ifdef LIBXL_H # error libxl.h should be included via libxl_internal.h, not separately diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c index 2a07777..5711c38 100644 --- a/tools/libxl/libxl_psr.c +++ b/tools/libxl/libxl_psr.c @@ -24,17 +24,17 @@ static void libxl__psr_log_err_msg(libxl__gc *gc, int err) char *msg; switch (err) { - case ENOSYS: - case EOPNOTSUPP: + case XEN_ENOSYS: + case XEN_EOPNOTSUPP: msg = "unsupported operation"; break; - case ESRCH: + case XEN_ESRCH: msg = "invalid domain ID"; break; - case EBADSLT: + case XEN_EBADSLT: msg = "socket is not supported"; break; - case EFAULT: + case XEN_EFAULT: msg = "failed to exchange data with Xen"; break; default: @@ -50,16 +50,16 @@ static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err) char *msg; switch (err) { - case ENODEV: + case XEN_ENODEV: msg = "CMT is not supported in this system"; break; - case EEXIST: + case XEN_EEXIST: msg = "CMT is already attached to this domain"; break; - case ENOENT: + case XEN_ENOENT: msg = "CMT is not attached to this domain"; break; - case EUSERS: + case XEN_EUSERS: msg = "no free RMID available"; break; default: @@ -75,16 +75,16 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err) char *msg; switch (err) { - case ENODEV: + case XEN_ENODEV: msg = "CAT is not supported in this system"; break; - case ENOENT: + case XEN_ENOENT: msg = "CAT is not enabled on the socket"; break; - case EUSERS: + case XEN_EUSERS: msg = "no free COS available"; break; - case EEXIST: + case XEN_EEXIST: msg = "The same CBM is already set to this domain"; break; -- 1.9.5 (Apple Git-50.3) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |