From: Gerd Hoffmann <kraxel@suse.de>
To: Xen devel list <xen-devel@lists.xensource.com>
Subject: [patch 1/3] add xenbus_strstate()
Date: Thu, 31 Aug 2006 09:39:34 +0200 [thread overview]
Message-ID: <44F69236.1050404@suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
Hi,
This patch adds xenbus_strstate() helper function for more readable
debug output.
please apply,
Gerd
--
Gerd Hoffmann <kraxel@suse.de>
http://www.suse.de/~kraxel/julika-dora.jpeg
[-- Attachment #2: linux-xenbus-strstate.diff --]
[-- Type: text/x-patch, Size: 2699 bytes --]
Add xenbus_strstate() helper function for more readable debug output.
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
---
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c | 15 +++++++++++++++
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c | 4 ++--
linux-2.6-xen-sparse/include/xen/xenbus.h | 2 ++
3 files changed, 19 insertions(+), 2 deletions(-)
Index: build-32-unstable-11286/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
===================================================================
--- build-32-unstable-11286.orig/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
+++ build-32-unstable-11286/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
@@ -41,6 +41,21 @@ extern char *kasprintf(const char *fmt,
#define DPRINTK(fmt, args...) \
pr_debug("xenbus_client (%s:%d) " fmt ".\n", __FUNCTION__, __LINE__, ##args)
+char *xenbus_strstate(enum xenbus_state state)
+{
+ static char *name[] = {
+ [ XenbusStateUnknown ] = "Unknown",
+ [ XenbusStateInitialising ] = "Initialising",
+ [ XenbusStateInitWait ] = "InitWait",
+ [ XenbusStateInitialised ] = "Initialised",
+ [ XenbusStateConnected ] = "Connected",
+ [ XenbusStateClosing ] = "Closing",
+ [ XenbusStateClosed ] = "Closed",
+ };
+ return state < sizeof(name)/sizeof(name[0])
+ ? name[state] : "INVALID";
+}
+
int xenbus_watch_path(struct xenbus_device *dev, const char *path,
struct xenbus_watch *watch,
void (*callback)(struct xenbus_watch *,
Index: build-32-unstable-11286/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
===================================================================
--- build-32-unstable-11286.orig/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
+++ build-32-unstable-11286/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
@@ -316,8 +316,8 @@ static void otherend_changed(struct xenb
state = xenbus_read_driver_state(dev->otherend);
- DPRINTK("state is %d, %s, %s",
- state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
+ DPRINTK("state is %s, %s, %s", xenbus_strstate(state),
+ dev->otherend_watch.node, vec[XS_WATCH_PATH]);
if (drv->otherend_changed)
drv->otherend_changed(dev, state);
}
Index: build-32-unstable-11286/linux-2.6-xen-sparse/include/xen/xenbus.h
===================================================================
--- build-32-unstable-11286.orig/linux-2.6-xen-sparse/include/xen/xenbus.h
+++ build-32-unstable-11286/linux-2.6-xen-sparse/include/xen/xenbus.h
@@ -297,4 +297,6 @@ void xenbus_dev_fatal(struct xenbus_devi
int __init xenbus_dev_init(void);
+char *xenbus_strstate(enum xenbus_state state);
+
#endif /* _XEN_XENBUS_H */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-08-31 7:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-31 7:39 Gerd Hoffmann [this message]
2006-08-31 18:17 ` [patch 1/3] add xenbus_strstate() Chris Wright
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44F69236.1050404@suse.de \
--to=kraxel@suse.de \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.