WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxc: osdep: report missing backends in common code

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxc: osdep: report missing backends in common code
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 30 Sep 2011 09:37:07 +0100
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, konrad.wilk@xxxxxxxxxx
Delivery-date: Fri, 30 Sep 2011 01:38:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1317371652.26672.236.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1317371652.26672.236.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1317371726 -3600
# Node ID 19d4d6b854a6e54612a4a3a993af0716668e6627
# Parent  e50da6b98e3d5933b9c98e8f43096fd3ebbae00d
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@xxxxxxxxxx>
---
Requires Daniel De Graaf's "libxc: add xc_gntshr_* functions"

diff -r e50da6b98e3d -r 19d4d6b854a6 tools/libxc/xc_netbsd.c
--- a/tools/libxc/xc_netbsd.c   Thu Sep 29 17:21:32 2011 +0100
+++ b/tools/libxc/xc_netbsd.c   Fri Sep 30 09:35:26 2011 +0100
@@ -386,9 +386,6 @@ static struct xc_osdep_ops *netbsd_osdep
         return &netbsd_privcmd_ops;
     case XC_OSDEP_EVTCHN:
         return &netbsd_evtchn_ops;
-    case XC_OSDEP_GNTTAB:
-        ERROR("GNTTAB interface not supported on this platform");
-        return NULL;
     default:
         return NULL;
     }
diff -r e50da6b98e3d -r 19d4d6b854a6 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Thu Sep 29 17:21:32 2011 +0100
+++ b/tools/libxc/xc_private.c  Fri Sep 30 09:35:26 2011 +0100
@@ -111,6 +111,18 @@ static void xc_osdep_put(xc_osdep_info_t
 #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_inte
 
         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)
diff -r e50da6b98e3d -r 19d4d6b854a6 tools/libxc/xc_solaris.c
--- a/tools/libxc/xc_solaris.c  Thu Sep 29 17:21:32 2011 +0100
+++ b/tools/libxc/xc_solaris.c  Fri Sep 30 09:35:26 2011 +0100
@@ -322,9 +322,6 @@ static struct xc_osdep_ops *solaris_osde
         return &solaris_privcmd_ops;
     case XC_OSDEP_EVTCHN:
         return &solaris_evtchn_ops;
-    case XC_OSDEP_GNTTAB:
-        ERROR("GNTTAB interface not supported on this platform");
-        return NULL;
     default:
         return NULL;
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel