aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_private.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-10-13 10:32:09 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-10-13 10:32:09 +0100
commitd5a95e2863a7025ff5d416146705b82a57fffa73 (patch)
tree7dacf5187f336400af74ce60f9b48b2287d5ca60 /tools/libxc/xc_private.c
parent10befefe28405f9c439066a64625738be3fd38f9 (diff)
downloadxen-d5a95e2863a7025ff5d416146705b82a57fffa73.tar.gz
xen-d5a95e2863a7025ff5d416146705b82a57fffa73.tar.bz2
xen-d5a95e2863a7025ff5d416146705b82a57fffa73.zip
libxc: osdep: report missing backends in common code
Backends were inconsistent about reporting and it's a pain to edit them all when adding a new class of osdep. Signed-off-by: Ian Campbell <Ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> --- Requires Daniel De Graaf's "libxc: add xc_gntshr_* functions"
Diffstat (limited to 'tools/libxc/xc_private.c')
-rw-r--r--tools/libxc/xc_private.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 09a91e75ad..3ceed3e660 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -111,6 +111,18 @@ static void xc_osdep_put(xc_osdep_info_t *info)
#endif
}
+static const char *xc_osdep_type_name(enum xc_osdep_type type)
+{
+ switch ( type )
+ {
+ case XC_OSDEP_PRIVCMD: return "privcmd";
+ case XC_OSDEP_EVTCHN: return "evtchn";
+ case XC_OSDEP_GNTTAB: return "gnttab";
+ case XC_OSDEP_GNTSHR: return "gntshr";
+ }
+ return "unknown";
+}
+
static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *logger,
xentoollog_logger *dombuild_logger,
unsigned open_flags,
@@ -161,7 +173,11 @@ static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *log
xch->ops = xch->osdep.init(xch, type);
if ( xch->ops == NULL )
+ {
+ ERROR("OSDEP: interface %d (%s) not supported on this platform",
+ type, xc_osdep_type_name(type));
goto err_put_iface;
+ }
xch->ops_handle = xch->ops->open(xch);
if (xch->ops_handle == XC_OSDEP_OPEN_ERROR)