diff -r dbf2ddf652dc tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c	Thu Apr 07 15:26:58 2011 +0100
+++ b/tools/xenstore/xenstore_client.c	Mon Apr 11 22:15:41 2011 +0200
@@ -633,7 +633,7 @@
 	    max_width = ws.ws_col - 2;
     }
 
-    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
+    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : XS_OPEN_DOMAINONLY);
     if (xsh == NULL) err(1, "xs_open");
 
 again:
diff -r dbf2ddf652dc tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Thu Apr 07 15:26:58 2011 +0100
+++ b/tools/xenstore/xs.c	Mon Apr 11 22:15:41 2011 +0200
@@ -250,17 +250,19 @@
 
 struct xs_handle *xs_domain_open(void)
 {
-	return xs_open(0);
+	return xs_open(XS_OPEN_DOMAINONLY);
 }
 
 struct xs_handle *xs_open(unsigned long flags)
 {
 	struct xs_handle *xsh = NULL;
 
-	if (flags & XS_OPEN_READONLY)
-		xsh = get_handle(xs_daemon_socket_ro(), flags);
-	else
-		xsh = get_handle(xs_daemon_socket(), flags);
+	if (!(flags & XS_OPEN_DOMAINONLY)) {
+		if (flags & XS_OPEN_READONLY)
+			xsh = get_handle(xs_daemon_socket_ro(), flags);
+		else
+			xsh = get_handle(xs_daemon_socket(), flags);
+	}
 
 	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
 		xsh = get_handle(xs_domain_dev(), flags);
diff -r dbf2ddf652dc tools/xenstore/xs.h
--- a/tools/xenstore/xs.h	Thu Apr 07 15:26:58 2011 +0100
+++ b/tools/xenstore/xs.h	Mon Apr 11 22:15:41 2011 +0200
@@ -26,6 +26,7 @@
 
 #define XS_OPEN_READONLY	1UL<<0
 #define XS_OPEN_SOCKETONLY      1UL<<1
+#define XS_OPEN_DOMAINONLY      1UL<<2
 
 struct xs_handle;
 typedef uint32_t xs_transaction_t;
