tools-xenstore-compatibility.diff
authorBastian Blank <waldi@debian.org>
Sat, 5 Jul 2014 09:47:36 +0000 (11:47 +0200)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 11 Jan 2019 18:01:30 +0000 (18:01 +0000)
Patch-Name: tools-xenstore-compatibility.diff

Gbp-Pq: Name tools-xenstore-compatibility.diff

tools/xenstore/include/xenstore.h
tools/xenstore/xenstore_client.c
tools/xenstore/xs.c

index 42c0dc74ea485a198cee2fa88ec441482835b472..8a9c5c2c16ee77e5181fdd2ce52a1677a44ef4cb 100644 (file)
@@ -25,6 +25,7 @@
 
 #define XS_OPEN_READONLY       1UL<<0
 #define XS_OPEN_SOCKETONLY      1UL<<1
+#define XS_OPEN_DOMAINONLY      1UL<<2
 
 /*
  * Setting XS_UNWATCH_FILTER arranges that after xs_unwatch, no
index 3d14d37e62904089e3eace9ee4ea6952833a93ab..d7ae1ec0c2c79a9c3ae4087406a1107e6d26438e 100644 (file)
@@ -636,7 +636,7 @@ main(int argc, char **argv)
            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:
index d1e01babb6a5e03ad2c6d2b19a4b1de789bdfec5..be82927528cae2eee792ecc4833dd25d0d7dd096 100644 (file)
@@ -281,17 +281,19 @@ struct xs_handle *xs_daemon_open_readonly(void)
 
 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_DOMAINONLY)) {
        if (flags & XS_OPEN_READONLY)
                xsh = get_handle(xs_daemon_socket_ro());
        else
                xsh = get_handle(xs_daemon_socket());
+       }
 
        if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
                xsh = get_handle(xs_domain_dev());