Skip to contentSkip to conversation

check for access type in xs.c

PATCH New NAHieu 1 participant 1 message Sep 8, 2005

lore
Share & tools
lore

NAHieu

author
#0 lore raw

PATCH 1/1 check for access type in xs.c

Some library functions in xs.c don't support /proc/xen/xenbus interface (yet). Here is the patch to fix the problem.

tools/xenstore/xs.c Fri Sep 9 01:48:38 2005 renamed from tools/xenstore/xs.c Thu Sep 8 15:22:01 2005 +5 -0
diff -r c2705e74efba tools/xenstore/xs.c
@@ -508,6 +508,9 @@
        struct xsd_sockmsg msg;
        char **ret;
 
+       if (h->type == DEV)
+               return NULL; /* support only with socket interface */ 
+
        if (!read_all(h->fd, &msg, sizeof(msg)))
                return NULL;
 
@@ -624,6 +627,8 @@
 
 bool xs_shutdown(struct xs_handle *h)
 {
+       if (h->type == DEV)
+               return false; /* support only with socket interface */ 
        bool ret = xs_bool(xs_single(h, XS_SHUTDOWN, "", NULL));
        if (ret) {
                char c;