summaryrefslogtreecommitdiffstats
path: root/sys/xen/xenbus/xenbus_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/xen/xenbus/xenbus_client.c')
-rw-r--r--sys/xen/xenbus/xenbus_client.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/xen/xenbus/xenbus_client.c b/sys/xen/xenbus/xenbus_client.c
index ef0c930..a6f9e6b 100644
--- a/sys/xen/xenbus/xenbus_client.c
+++ b/sys/xen/xenbus/xenbus_client.c
@@ -55,6 +55,21 @@ __FBSDID("$FreeBSD$");
#define kfree(ptr) free(ptr, M_DEVBUF)
#define BUG_ON PANIC_IF
+
+const char *xenbus_strstate(XenbusState state)
+{
+ static const char *const name[] = {
+ [ XenbusStateUnknown ] = "Unknown",
+ [ XenbusStateInitialising ] = "Initialising",
+ [ XenbusStateInitWait ] = "InitWait",
+ [ XenbusStateInitialised ] = "Initialised",
+ [ XenbusStateConnected ] = "Connected",
+ [ XenbusStateClosing ] = "Closing",
+ [ XenbusStateClosed ] = "Closed",
+ };
+ return (state < (XenbusStateClosed + 1)) ? name[state] : "INVALID";
+}
+
int
xenbus_watch_path(struct xenbus_device *dev, char *path,
struct xenbus_watch *watch,
OpenPOWER on IntegriCloud