All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Rename public xenstore headers
@ 2012-04-16 15:42 Bastian Blank
  2012-04-16 15:51 ` Ian Campbell
  0 siblings, 1 reply; 11+ messages in thread
From: Bastian Blank @ 2012-04-16 15:42 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

The xenstore header xs.h is producing conflicts with other software[1].

xs is a too short identifier and does not matche the library. Renaming
the headers to xenstore.h and xenstore_lib.h is the easiest way to make
them easy recognizable and prevent furthe problems.

Bastian

[1]: http://bugs.debian.org/668550
-- 
Where there's no emotion, there's no motive for violence.
		-- Spock, "Dagger of the Mind", stardate 2715.1

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 13247 bytes --]

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,7 @@
 	rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
 	rm -rf $(D)$(BINDIR)/xsls
 	rm -rf $(D)$(INCLUDEDIR)/xenctrl.h $(D)$(INCLUDEDIR)/xenguest.h
-	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
 	rm -rf $(D)$(INCLUDEDIR)/xen
 	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
 	rm -rf $(D)$(LIBDIR)/libxenstore*
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -28,7 +28,7 @@
 #include <blkfront.h>
 #include <fbfront.h>
 #include <xenbus.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include <sys/types.h>
 #include <sys/unistd.h>
diff --git a/extras/mini-os/lib/xs.c b/extras/mini-os/lib/xs.c
--- a/extras/mini-os/lib/xs.c
+++ b/extras/mini-os/lib/xs.c
@@ -9,7 +9,7 @@
 #ifdef HAVE_LIBC
 #include <os.h>
 #include <lib.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xenbus.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tools/blktap/drivers/blktapctrl.c b/tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c
+++ b/tools/blktap/drivers/blktapctrl.c
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 #include <string.h>
 #include <unistd.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/time.h>
 #include <syslog.h>
 #include <memshr.h>
diff --git a/tools/blktap/lib/blktaplib.h b/tools/blktap/lib/blktaplib.h
--- a/tools/blktap/lib/blktaplib.h
+++ b/tools/blktap/lib/blktaplib.h
@@ -38,7 +38,7 @@
 #include <xen/xen.h>
 #include <xen/io/blkif.h>
 #include <xen/io/ring.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <unistd.h>
 
diff --git a/tools/blktap/lib/xenbus.c b/tools/blktap/lib/xenbus.c
--- a/tools/blktap/lib/xenbus.c
+++ b/tools/blktap/lib/xenbus.c
@@ -41,7 +41,7 @@
 #include <err.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/tools/blktap/lib/xs_api.c b/tools/blktap/lib/xs_api.c
--- a/tools/blktap/lib/xs_api.c
+++ b/tools/blktap/lib/xs_api.c
@@ -38,7 +38,7 @@
 #include <err.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -39,7 +39,7 @@
 #include <sys/stropts.h>
 #endif
 
-#include "xs.h"
+#include <xenstore.h>
 #include "xenctrl.h"
 
 #define ESCAPE_CHARACTER 0x1d
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -22,7 +22,7 @@
 
 #include "utils.h"
 #include "io.h"
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/io/console.h>
 
 #include <stdlib.h>
diff --git a/tools/console/daemon/utils.h b/tools/console/daemon/utils.h
--- a/tools/console/daemon/utils.h
+++ b/tools/console/daemon/utils.h
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <xenctrl.h>
 
-#include "xs.h"
+#include <xenstore.h>
 
 void daemonize(const char *pidfile);
 bool xen_setup(void);
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -40,7 +40,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/sys/evtchn.h>
 #include <xen/sys/gntalloc.h>
 #include <xen/sys/gntdev.h>
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -43,7 +43,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 
 #include "xentoollog.h"
diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c
--- a/tools/misc/xen-lowmemd.c
+++ b/tools/misc/xen-lowmemd.c
@@ -5,7 +5,7 @@
 
 #include <stdio.h>
 #include <xenctrl.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/tools/python/xen/lowlevel/checkpoint/checkpoint.c b/tools/python/xen/lowlevel/checkpoint/checkpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.c
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.c
@@ -2,7 +2,7 @@
 
 #include <Python.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 
 #include "checkpoint.h"
diff --git a/tools/python/xen/lowlevel/checkpoint/checkpoint.h b/tools/python/xen/lowlevel/checkpoint/checkpoint.h
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.h
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.h
@@ -8,7 +8,7 @@
 #include <time.h>
 
 #include <xenguest.h>
-#include <xs.h>
+#include <xenstore.h>
 
 typedef enum {
     dt_unknown,
diff --git a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
@@ -11,7 +11,7 @@
 
 #include <xenctrl.h>
 #include <xenguest.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include "checkpoint.h"
 
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c
+++ b/tools/python/xen/lowlevel/xs/xs.c
@@ -30,7 +30,7 @@
 #include <fcntl.h>
 #include <errno.h>
 
-#include "xs.h"
+#include <xenstore.h>
 
 /** @file
  * Python interface to the Xen Store Daemon (xs).
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -38,7 +38,7 @@
 #include <sys/time.h>
 #include <xen/arch-x86/xen-mca.h>
 #include <xg_save_restore.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #define MCi_type_CTL        0x0
 #define MCi_type_STATUS     0x1
diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c
+++ b/tools/xcutils/xc_save.c
@@ -19,7 +19,7 @@
 #include <fcntl.h>
 #include <err.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 #include <xenguest.h>
 
diff --git a/tools/xenbackendd/xenbackendd.c b/tools/xenbackendd/xenbackendd.c
--- a/tools/xenbackendd/xenbackendd.c
+++ b/tools/xenbackendd/xenbackendd.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <syslog.h>
 
-#include <xs.h>
+#include <xenstore.h>
 
 #define DEVTYPE_UNKNOWN 0
 #define DEVTYPE_VIF 1
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -29,7 +29,7 @@
 #include <unistd.h>
 #include <poll.h>
 #include <xc_private.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <getopt.h>
 
 #include "xc_bitops.h"
diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c
--- a/tools/xenpmd/xenpmd.c
+++ b/tools/xenpmd/xenpmd.c
@@ -40,7 +40,7 @@
 #include <dirent.h>
 #include <unistd.h>
 #include <sys/stat.h>
-#include <xs.h>
+#include <xenstore.h>
 
 /* #define RUN_STANDALONE */
 #define RUN_IN_SIMULATE_MODE
diff --git a/tools/xenstat/libxenstat/src/xenstat_priv.h b/tools/xenstat/libxenstat/src/xenstat_priv.h
--- a/tools/xenstat/libxenstat/src/xenstat_priv.h
+++ b/tools/xenstat/libxenstat/src/xenstat_priv.h
@@ -24,7 +24,7 @@
 #define XENSTAT_PRIV_H
 
 #include <sys/types.h>
-#include <xs.h>
+#include <xenstore.h>
 #include "xenstat.h"
 
 #include "xenctrl.h"
diff --git a/tools/xenstore/COPYING b/tools/xenstore/COPYING
--- a/tools/xenstore/COPYING
+++ b/tools/xenstore/COPYING
@@ -1,6 +1,6 @@
 This license (LGPL) applies to the xenstore library which interfaces
-with the xenstore daemon (as stated in xs.c, xs.h, xs_lib.c and
-xs_lib.h).  The remaining files in the directory are licensed as
+with the xenstore daemon (as stated in xs.c, xenstore.h, xs_lib.c and
+xenstore_lib.h).  The remaining files in the directory are licensed as
 stated in the comments (as of this writing, GPL, see ../../COPYING).
 
 
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -122,8 +122,8 @@
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
 
 -include $(DEPS)
 
diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -7,7 +7,7 @@
 #include <sys/mman.h>
 #include <xenctrl.h>
 #include <xc_dom.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 
 static uint32_t domid = -1;
diff --git a/tools/xenstore/xs.h b/tools/xenstore/xenstore.h
rename from tools/xenstore/xs.h
rename to tools/xenstore/xenstore.h
--- a/tools/xenstore/xs.h
+++ b/tools/xenstore/xenstore.h
@@ -17,10 +17,10 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef _XS_H
-#define _XS_H
+#ifndef XENSTORE_H
+#define XENSTORE_H
 
-#include <xs_lib.h>
+#include <xenstore_lib.h>
 
 #define XBT_NULL 0
 
@@ -223,7 +223,7 @@
 		       void *data, unsigned int len);
 
 int xs_suspend_evtchn_port(int domid);
-#endif /* _XS_H */
+#endif /* XENSTORE_H */
 
 /*
  * Local variables:
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -18,7 +18,7 @@
 #include <string.h>
 #include <termios.h>
 #include <unistd.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include <sys/ioctl.h>
 
diff --git a/tools/xenstore/xenstore_control.c b/tools/xenstore/xenstore_control.c
--- a/tools/xenstore/xenstore_control.c
+++ b/tools/xenstore/xenstore_control.c
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "xs.h"
+#include "xenstore.h"
 
 
 int main(int argc, char **argv)
diff --git a/tools/xenstore/xs_lib.h b/tools/xenstore/xenstore_lib.h
rename from tools/xenstore/xs_lib.h
rename to tools/xenstore/xenstore_lib.h
--- a/tools/xenstore/xs_lib.h
+++ b/tools/xenstore/xenstore_lib.h
@@ -17,8 +17,8 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef _XS_LIB_H
-#define _XS_LIB_H
+#ifndef XENSTORE_LIB_H
+#define XENSTORE_LIB_H
 
 #include <stdbool.h>
 #include <limits.h>
@@ -82,4 +82,4 @@
 /* *out_len_r on entry is ignored; out must be at least strlen(in)+1 bytes. */
 void unsanitise_value(char *out, unsigned *out_len_r, const char *in);
 
-#endif /* _XS_LIB_H */
+#endif /* XENSTORE_LIB_H */
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -44,7 +44,7 @@
 #include "utils.h"
 #include "list.h"
 #include "talloc.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "xenstored_core.h"
 #include "xenstored_watch.h"
 #include "xenstored_transaction.h"
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -27,7 +27,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "list.h"
 #include "tdb.h"
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -33,7 +33,7 @@
 #include "xenstored_transaction.h"
 #include "xenstored_watch.h"
 #include "xenstored_domain.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "utils.h"
 
 struct changed_node
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -27,7 +27,7 @@
 #include "talloc.h"
 #include "list.h"
 #include "xenstored_watch.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "utils.h"
 #include "xenstored_domain.h"
 
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -32,7 +32,7 @@
 #include <signal.h>
 #include <stdint.h>
 #include <errno.h>
-#include "xs.h"
+#include "xenstore.h"
 #include "list.h"
 #include "utils.h"
 
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <assert.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 
 /* Common routines for the Xen store daemon and client library. */
 
diff --git a/tools/xenstore/xs_tdb_dump.c b/tools/xenstore/xs_tdb_dump.c
--- a/tools/xenstore/xs_tdb_dump.c
+++ b/tools/xenstore/xs_tdb_dump.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "tdb.h"
 #include "talloc.h"
 #include "utils.h"

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-04-16 15:42 [PATCH] Rename public xenstore headers Bastian Blank
@ 2012-04-16 15:51 ` Ian Campbell
  2012-04-24 16:36   ` Ian Jackson
  2012-04-25 10:22   ` Bastian Blank
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Campbell @ 2012-04-16 15:51 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel

On Mon, 2012-04-16 at 16:42 +0100, Bastian Blank wrote:
> The xenstore header xs.h is producing conflicts with other software[1].
> 
> xs is a too short identifier and does not matche the library. Renaming
> the headers to xenstore.h and xenstore_lib.h is the easiest way to make
> them easy recognizable and prevent furthe problems.

Thanks Bastian.

This needs a Signed-off-by from you, per the DCO at
http://wiki.xen.org/wiki/SubmittingXenPatches

For my part:

Acked-by: Ian Campbell <ian.campbell@citrix.com>

I can't see a good way to do this in a compatible manner for out of tree
users[0], so I think if we are going to make this change then we should
make a freeze exception and do it in 4.2 (i.e. rip the plaster off
quickly rather than have distros solve this their own way while waiting
for 4.3).

Ian.

[0] apart perhaps from having /usr/include/xen-compat/xs.h and
suggesting that people can use -I/usr/include/xen-compat as a bandaid,
but at that point they may as well just sed their code, since they may
need to support 4.1 anyhow.

Ian.
> Bastian
> 
> [1]: http://bugs.debian.org/668550

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-04-16 15:51 ` Ian Campbell
@ 2012-04-24 16:36   ` Ian Jackson
  2012-05-11 16:49     ` Ian Campbell
  2012-04-25 10:22   ` Bastian Blank
  1 sibling, 1 reply; 11+ messages in thread
From: Ian Jackson @ 2012-04-24 16:36 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Bastian Blank, xen-devel

Ian Campbell writes ("Re: [Xen-devel] [PATCH] Rename public xenstore headers"):
> On Mon, 2012-04-16 at 16:42 +0100, Bastian Blank wrote:
> > The xenstore header xs.h is producing conflicts with other software[1].
> > 
> > xs is a too short identifier and does not matche the library. Renaming
> > the headers to xenstore.h and xenstore_lib.h is the easiest way to make
> > them easy recognizable and prevent furthe problems.
> 
> Thanks Bastian.
> 
> This needs a Signed-off-by from you, per the DCO at
> http://wiki.xen.org/wiki/SubmittingXenPatches
> 
> For my part:
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

I agree.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

> I can't see a good way to do this in a compatible manner for out of tree
> users[0], so I think if we are going to make this change then we should
> make a freeze exception and do it in 4.2 (i.e. rip the plaster off
> quickly rather than have distros solve this their own way while waiting
> for 4.3).

Yes.

> [0] apart perhaps from having /usr/include/xen-compat/xs.h and
> suggesting that people can use -I/usr/include/xen-compat as a bandaid,
> but at that point they may as well just sed their code, since they may
> need to support 4.1 anyhow.

I think this would be a useful thing to add.  Providing that would
mean that with -I/usr/include/xen-compat, the same code could compile
against both 4.1 and 4.2, if it said <xs.h>.

Ian.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-04-16 15:51 ` Ian Campbell
  2012-04-24 16:36   ` Ian Jackson
@ 2012-04-25 10:22   ` Bastian Blank
  1 sibling, 0 replies; 11+ messages in thread
From: Bastian Blank @ 2012-04-25 10:22 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

On Mon, Apr 16, 2012 at 04:51:24PM +0100, Ian Campbell wrote:
> On Mon, 2012-04-16 at 16:42 +0100, Bastian Blank wrote:
> > The xenstore header xs.h is producing conflicts with other software[1].
> > 
> > xs is a too short identifier and does not matche the library. Renaming
> > the headers to xenstore.h and xenstore_lib.h is the easiest way to make
> > them easy recognizable and prevent furthe problems.

Signed-off-by: Bastian Blank <waldi@debian.org>

-- 
All your people must learn before you can reach for the stars.
		-- Kirk, "The Gamesters of Triskelion", stardate 3259.2

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-04-24 16:36   ` Ian Jackson
@ 2012-05-11 16:49     ` Ian Campbell
  2012-05-11 17:02       ` Bastian Blank
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Campbell @ 2012-05-11 16:49 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Bastian Blank, xen-devel, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 17416 bytes --]


> > [0] apart perhaps from having /usr/include/xen-compat/xs.h and
> > suggesting that people can use -I/usr/include/xen-compat as a bandaid,
> > but at that point they may as well just sed their code, since they may
> > need to support 4.1 anyhow.
> 
> I think this would be a useful thing to add.  Providing that would
> mean that with -I/usr/include/xen-compat, the same code could compile
> against both 4.1 and 4.2, if it said <xs.h>.

I'm a little concerned about breaking out of tree users (specifically
upstream Qemu). How about the following based on Bastian's patch.

This installs the headers as xenstore.h and xenstore_lib.h and provides
compat headers in /usr/include/xenstore-compat/xs{,_lib}.h which #warn
and then include the new names. This means that upstream code should be
buildable using -I/usr/include/xenstore-compat.

However, since we are now frozen for 4.2 I propose that we also create
symlinks from the old xs.h and xs_lib.h to the compat versions inorder
to not break 3rd party software for the 4.2 release. We will ship these
for the 4.2 release only. If distros wish to omit these from their
packaging then that's fine, although they should probably check their
reverse-build depends etc. We will remove these links early in 4.3.

qemu-xs-compat.patch fixes trad qemu, upstream is fixed when built in
our build system by this patch and is fixed when built independently by
the symlinks, for now. We can convert these properly at our leisure
before 4.3

(NB: git style patch, so the rename is represented in the minimised
manner)

8<------------------------------------

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1336754841 -3600
# Node ID b61d5b46f3a91f7cc9064186e10acacfab10b184
# Parent  15ed8f45c4e57a1e206af020e0ff17b792108e99
xenstore: rename public xenstore headers


The xenstore header xs.h is producing conflicts with other software[1].

xs is a too short identifier and does not matche the library. Renaming
the headers to xenstore.h and xenstore_lib.h is the easiest way to make
them easy recognizable and prevent furthe problems.

[1]: http://bugs.debian.org/668550

Signed-off-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -241,6 +241,8 @@ uninstall:
 	rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
 	rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
 	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xensotre-compat/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
 	rm -rf $(D)$(INCLUDEDIR)/xen
 	rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
 	rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -28,7 +28,7 @@
 #include <blkfront.h>
 #include <fbfront.h>
 #include <xenbus.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include <sys/types.h>
 #include <sys/unistd.h>
diff --git a/extras/mini-os/lib/xs.c b/extras/mini-os/lib/xs.c
--- a/extras/mini-os/lib/xs.c
+++ b/extras/mini-os/lib/xs.c
@@ -9,7 +9,7 @@
 #ifdef HAVE_LIBC
 #include <os.h>
 #include <lib.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xenbus.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tools/Makefile b/tools/Makefile
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -150,7 +150,8 @@ subdir-all-qemu-xen-dir subdir-install-q
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc \
-		-I$(XEN_ROOT)/tools/xenstore" \
+		-I$(XEN_ROOT)/tools/xenstore \
+		-I$(XEN_ROOT)/tools/xenstore/compat" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore" \
 		--bindir=$(LIBEXEC) \
diff --git a/tools/blktap/drivers/blktapctrl.c b/tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c
+++ b/tools/blktap/drivers/blktapctrl.c
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 #include <string.h>
 #include <unistd.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/time.h>
 #include <syslog.h>
 #ifdef MEMSHR
diff --git a/tools/blktap/lib/blktaplib.h b/tools/blktap/lib/blktaplib.h
--- a/tools/blktap/lib/blktaplib.h
+++ b/tools/blktap/lib/blktaplib.h
@@ -38,7 +38,7 @@
 #include <xen/xen.h>
 #include <xen/io/blkif.h>
 #include <xen/io/ring.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <unistd.h>
 
diff --git a/tools/blktap/lib/xenbus.c b/tools/blktap/lib/xenbus.c
--- a/tools/blktap/lib/xenbus.c
+++ b/tools/blktap/lib/xenbus.c
@@ -41,7 +41,7 @@
 #include <err.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/tools/blktap/lib/xs_api.c b/tools/blktap/lib/xs_api.c
--- a/tools/blktap/lib/xs_api.c
+++ b/tools/blktap/lib/xs_api.c
@@ -38,7 +38,7 @@
 #include <err.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -39,7 +39,7 @@
 #include <sys/stropts.h>
 #endif
 
-#include "xs.h"
+#include <xenstore.h>
 #include "xenctrl.h"
 
 #define ESCAPE_CHARACTER 0x1d
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -22,7 +22,7 @@
 
 #include "utils.h"
 #include "io.h"
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/io/console.h>
 
 #include <stdlib.h>
diff --git a/tools/console/daemon/utils.h b/tools/console/daemon/utils.h
--- a/tools/console/daemon/utils.h
+++ b/tools/console/daemon/utils.h
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <xenctrl.h>
 
-#include "xs.h"
+#include <xenstore.h>
 
 void daemonize(const char *pidfile);
 bool xen_setup(void);
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -40,7 +40,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/sys/evtchn.h>
 #include <xen/sys/gntalloc.h>
 #include <xen/sys/gntdev.h>
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -43,7 +43,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 
 #include "xentoollog.h"
diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c
--- a/tools/misc/xen-lowmemd.c
+++ b/tools/misc/xen-lowmemd.c
@@ -5,7 +5,7 @@
 
 #include <stdio.h>
 #include <xenctrl.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/tools/python/xen/lowlevel/checkpoint/checkpoint.c b/tools/python/xen/lowlevel/checkpoint/checkpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.c
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.c
@@ -2,7 +2,7 @@
 
 #include <Python.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 
 #include "checkpoint.h"
diff --git a/tools/python/xen/lowlevel/checkpoint/checkpoint.h b/tools/python/xen/lowlevel/checkpoint/checkpoint.h
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.h
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.h
@@ -8,7 +8,7 @@
 #include <time.h>
 
 #include <xenguest.h>
-#include <xs.h>
+#include <xenstore.h>
 
 typedef enum {
     dt_unknown,
diff --git a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
@@ -11,7 +11,7 @@
 
 #include <xenctrl.h>
 #include <xenguest.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include "checkpoint.h"
 
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c
+++ b/tools/python/xen/lowlevel/xs/xs.c
@@ -30,7 +30,7 @@
 #include <fcntl.h>
 #include <errno.h>
 
-#include "xs.h"
+#include <xenstore.h>
 
 /** @file
  * Python interface to the Xen Store Daemon (xs).
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -38,7 +38,7 @@
 #include <sys/time.h>
 #include <xen/arch-x86/xen-mca.h>
 #include <xg_save_restore.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #define MCi_type_CTL        0x0
 #define MCi_type_STATUS     0x1
diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c
+++ b/tools/xcutils/xc_save.c
@@ -19,7 +19,7 @@
 #include <fcntl.h>
 #include <err.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 #include <xenguest.h>
 
diff --git a/tools/xenbackendd/xenbackendd.c b/tools/xenbackendd/xenbackendd.c
--- a/tools/xenbackendd/xenbackendd.c
+++ b/tools/xenbackendd/xenbackendd.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <syslog.h>
 
-#include <xs.h>
+#include <xenstore.h>
 
 #define DEVTYPE_UNKNOWN 0
 #define DEVTYPE_VIF 1
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -29,7 +29,7 @@
 #include <unistd.h>
 #include <poll.h>
 #include <xc_private.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <getopt.h>
 
 #include "xc_bitops.h"
diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c
--- a/tools/xenpmd/xenpmd.c
+++ b/tools/xenpmd/xenpmd.c
@@ -40,7 +40,7 @@
 #include <dirent.h>
 #include <unistd.h>
 #include <sys/stat.h>
-#include <xs.h>
+#include <xenstore.h>
 
 /* #define RUN_STANDALONE */
 #define RUN_IN_SIMULATE_MODE
diff --git a/tools/xenstat/libxenstat/src/xenstat_priv.h b/tools/xenstat/libxenstat/src/xenstat_priv.h
--- a/tools/xenstat/libxenstat/src/xenstat_priv.h
+++ b/tools/xenstat/libxenstat/src/xenstat_priv.h
@@ -24,7 +24,7 @@
 #define XENSTAT_PRIV_H
 
 #include <sys/types.h>
-#include <xs.h>
+#include <xenstore.h>
 #include "xenstat.h"
 
 #include "xenctrl.h"
diff --git a/tools/xenstore/COPYING b/tools/xenstore/COPYING
--- a/tools/xenstore/COPYING
+++ b/tools/xenstore/COPYING
@@ -1,6 +1,6 @@
 This license (LGPL) applies to the xenstore library which interfaces
-with the xenstore daemon (as stated in xs.c, xs.h, xs_lib.c and
-xs_lib.h).  The remaining files in the directory are licensed as
+with the xenstore daemon (as stated in xs.c, xenstore.h, xs_lib.c and
+xenstore_lib.h).  The remaining files in the directory are licensed as
 stated in the comments (as of this writing, GPL, see ../../COPYING).
 
 
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -109,6 +109,7 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
 	$(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
 	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
@@ -122,8 +123,12 @@ install: all
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
+	$(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
+	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
+	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
 -include $(DEPS)
 
diff --git a/tools/xenstore/compat/xs.h b/tools/xenstore/compat/xs.h
new file mode 100644
--- /dev/null
+++ b/tools/xenstore/compat/xs.h
@@ -0,0 +1,5 @@
+#ifndef XENSTORE_COMPAT_H
+#define XENSTORE_COMPAT_H
+#warning xs.h is deprecated use xenstore.h instead
+#include <xenstore.h>
+#endif
diff --git a/tools/xenstore/compat/xs_lib.h b/tools/xenstore/compat/xs_lib.h
new file mode 100644
--- /dev/null
+++ b/tools/xenstore/compat/xs_lib.h
@@ -0,0 +1,5 @@
+#ifndef XENSTORE_LIB_COMPAT_H
+#define XENSTORE_LIB_COMPAT_H
+#warning xs_lib.h is deprecated use xenstore_lib.h instead
+#include <xenstore_lib.h>
+#endif
diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -7,7 +7,7 @@
 #include <sys/mman.h>
 #include <xenctrl.h>
 #include <xc_dom.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 
 static uint32_t domid = -1;
diff --git a/tools/xenstore/xs.h b/tools/xenstore/xenstore.h
rename from tools/xenstore/xs.h
rename to tools/xenstore/xenstore.h
--- a/tools/xenstore/xs.h
+++ b/tools/xenstore/xenstore.h
@@ -17,10 +17,10 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef _XS_H
-#define _XS_H
+#ifndef XENSTORE_H
+#define XENSTORE_H
 
-#include <xs_lib.h>
+#include <xenstore_lib.h>
 
 #define XBT_NULL 0
 
@@ -223,7 +223,7 @@ char *xs_debug_command(struct xs_handle 
 		       void *data, unsigned int len);
 
 int xs_suspend_evtchn_port(int domid);
-#endif /* _XS_H */
+#endif /* XENSTORE_H */
 
 /*
  * Local variables:
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -18,7 +18,7 @@
 #include <string.h>
 #include <termios.h>
 #include <unistd.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include <sys/ioctl.h>
 
diff --git a/tools/xenstore/xenstore_control.c b/tools/xenstore/xenstore_control.c
--- a/tools/xenstore/xenstore_control.c
+++ b/tools/xenstore/xenstore_control.c
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "xs.h"
+#include "xenstore.h"
 
 
 int main(int argc, char **argv)
diff --git a/tools/xenstore/xs_lib.h b/tools/xenstore/xenstore_lib.h
rename from tools/xenstore/xs_lib.h
rename to tools/xenstore/xenstore_lib.h
--- a/tools/xenstore/xs_lib.h
+++ b/tools/xenstore/xenstore_lib.h
@@ -17,8 +17,8 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef _XS_LIB_H
-#define _XS_LIB_H
+#ifndef XENSTORE_LIB_H
+#define XENSTORE_LIB_H
 
 #include <stdbool.h>
 #include <limits.h>
@@ -82,4 +82,4 @@ char *sanitise_value(struct expanding_bu
 /* *out_len_r on entry is ignored; out must be at least strlen(in)+1 bytes. */
 void unsanitise_value(char *out, unsigned *out_len_r, const char *in);
 
-#endif /* _XS_LIB_H */
+#endif /* XENSTORE_LIB_H */
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -44,7 +44,7 @@
 #include "utils.h"
 #include "list.h"
 #include "talloc.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "xenstored_core.h"
 #include "xenstored_watch.h"
 #include "xenstored_transaction.h"
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -27,7 +27,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "list.h"
 #include "tdb.h"
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -33,7 +33,7 @@
 #include "xenstored_transaction.h"
 #include "xenstored_watch.h"
 #include "xenstored_domain.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "utils.h"
 
 struct changed_node
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -27,7 +27,7 @@
 #include "talloc.h"
 #include "list.h"
 #include "xenstored_watch.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "utils.h"
 #include "xenstored_domain.h"
 
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -32,7 +32,7 @@
 #include <signal.h>
 #include <stdint.h>
 #include <errno.h>
-#include "xs.h"
+#include "xenstore.h"
 #include "list.h"
 #include "utils.h"
 
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <assert.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 
 /* Common routines for the Xen store daemon and client library. */
 
diff --git a/tools/xenstore/xs_tdb_dump.c b/tools/xenstore/xs_tdb_dump.c
--- a/tools/xenstore/xs_tdb_dump.c
+++ b/tools/xenstore/xs_tdb_dump.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "tdb.h"
 #include "talloc.h"
 #include "utils.h"


[-- Attachment #2: qemu-xs-compat.patch --]
[-- Type: text/x-patch, Size: 899 bytes --]

diff --git a/Makefile b/Makefile
index 37c7066..a43ca67 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ recurse-all: $(SUBDIR_RULES)
 CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
 CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
 CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore/compat
 CPPFLAGS += -I$(XEN_ROOT)/tools/include
 
 tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
diff --git a/xen-hooks.mak b/xen-hooks.mak
index b55f45b..8e9cadf 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,5 +1,6 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/compat
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
 
 SSE2 := $(call cc-option,-msse2,)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-05-11 16:49     ` Ian Campbell
@ 2012-05-11 17:02       ` Bastian Blank
  2012-05-11 17:07         ` Ian Jackson
  0 siblings, 1 reply; 11+ messages in thread
From: Bastian Blank @ 2012-05-11 17:02 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Stefano Stabellini, xen-devel, Ian Jackson

On Fri, May 11, 2012 at 05:49:59PM +0100, Ian Campbell wrote:
> --- /dev/null
> +++ b/tools/xenstore/compat/xs.h

Why not in tools/xenstore?

> +#ifndef XENSTORE_COMPAT_H
> +#define XENSTORE_COMPAT_H

Don't.

Bastian

-- 
Well, Jim, I'm not much of an actor either.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-05-11 17:02       ` Bastian Blank
@ 2012-05-11 17:07         ` Ian Jackson
  2012-05-12  5:47           ` Ian Campbell
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Jackson @ 2012-05-11 17:07 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel, Ian Campbell, Stefano Stabellini

Bastian Blank writes ("Re: [Xen-devel] [PATCH] Rename public xenstore headers"):
> On Fri, May 11, 2012 at 05:49:59PM +0100, Ian Campbell wrote:
> > --- /dev/null
> > +++ b/tools/xenstore/compat/xs.h
> 
> Why not in tools/xenstore?

Good question.  One answer is that this prevents in-tree users from
accidentally using the old header - but do we really care about that ?

> > +#ifndef XENSTORE_COMPAT_H
> > +#define XENSTORE_COMPAT_H
> 
> Don't.

I guess you mean that we want a warning each time <xs.h> is #included,
rather than only the first time.  In which case I agree.

Ian: I tried your patch but it didn't seem to apply to my current tip.

Ian.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-05-11 17:07         ` Ian Jackson
@ 2012-05-12  5:47           ` Ian Campbell
  2012-05-14  8:34             ` Ian Campbell
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Campbell @ 2012-05-12  5:47 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Bastian Blank, xen-devel, Stefano Stabellini

On Fri, 2012-05-11 at 18:07 +0100, Ian Jackson wrote:
> Bastian Blank writes ("Re: [Xen-devel] [PATCH] Rename public xenstore headers"):
> > On Fri, May 11, 2012 at 05:49:59PM +0100, Ian Campbell wrote:
> > > --- /dev/null
> > > +++ b/tools/xenstore/compat/xs.h
> > 
> > Why not in tools/xenstore?
> 
> Good question.  One answer is that this prevents in-tree users from
> accidentally using the old header - but do we really care about that ?

I thought it was worth doing it -- the cost is minimal.

> 
> > > +#ifndef XENSTORE_COMPAT_H
> > > +#define XENSTORE_COMPAT_H
> > 
> > Don't.
> 
> I guess you mean that we want a warning each time <xs.h> is #included,
> rather than only the first time.  In which case I agree.

I'm not convinced that getting multiple warnings+backtraces for each .c
file which includes xs.h is any more useful than just getting one, but
OK.

> Ian: I tried your patch but it didn't seem to apply to my current tip.

You've been shovelling stuff in all day ;-) I'll refresh/resend on
Monday.

You did take note of the "git-ness" of the patch though? -- ISTR your
tools had trouble with this format last time.

Ian.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-05-12  5:47           ` Ian Campbell
@ 2012-05-14  8:34             ` Ian Campbell
  2012-05-14 16:21               ` Ian Jackson
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Campbell @ 2012-05-14  8:34 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Bastian Blank, xen-devel, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 40289 bytes --]

On Sat, 2012-05-12 at 06:47 +0100, Ian Campbell wrote:
> 
> You've been shovelling stuff in all day ;-) I'll refresh/resend on
> Monday.

It applied for me this morning so I suspect you hadn't noticed this:

> You did take note of the "git-ness" of the patch though? -- ISTR your
> tools had trouble with this format last time.

Here it is a gain in non-git format and with the header guards removed
from the compat headers as requested. I stuck with the compat subdir.

qemu-xs-compat.patch is again attached.

8<--------------------------------

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1336984299 -3600
# Node ID e71b19157a4788d8a56bb578f9ddc01cb92c331f
# Parent  54fcdee8740f86c9d3ca4f8bf5b780d292cd11f7
xenstore: rename public xenstore headers


The xenstore header xs.h is producing conflicts with other software[1].

xs is a too short identifier and does not matche the library. Renaming
the headers to xenstore.h and xenstore_lib.h is the easiest way to make
them easy recognizable and prevent furthe problems.

[1]: http://bugs.debian.org/668550

Signed-off-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 54fcdee8740f -r e71b19157a47 Makefile
--- a/Makefile	Mon May 14 09:11:00 2012 +0100
+++ b/Makefile	Mon May 14 09:31:39 2012 +0100
@@ -241,6 +241,8 @@ uninstall:
 	rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
 	rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
 	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xensotre-compat/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
 	rm -rf $(D)$(INCLUDEDIR)/xen
 	rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
 	rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
diff -r 54fcdee8740f -r e71b19157a47 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c	Mon May 14 09:11:00 2012 +0100
+++ b/extras/mini-os/lib/sys.c	Mon May 14 09:31:39 2012 +0100
@@ -28,7 +28,7 @@
 #include <blkfront.h>
 #include <fbfront.h>
 #include <xenbus.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include <sys/types.h>
 #include <sys/unistd.h>
diff -r 54fcdee8740f -r e71b19157a47 extras/mini-os/lib/xs.c
--- a/extras/mini-os/lib/xs.c	Mon May 14 09:11:00 2012 +0100
+++ b/extras/mini-os/lib/xs.c	Mon May 14 09:31:39 2012 +0100
@@ -9,7 +9,7 @@
 #ifdef HAVE_LIBC
 #include <os.h>
 #include <lib.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xenbus.h>
 #include <stdlib.h>
 #include <unistd.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/Makefile
--- a/tools/Makefile	Mon May 14 09:11:00 2012 +0100
+++ b/tools/Makefile	Mon May 14 09:31:39 2012 +0100
@@ -150,7 +150,8 @@ subdir-all-qemu-xen-dir subdir-install-q
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc \
-		-I$(XEN_ROOT)/tools/xenstore" \
+		-I$(XEN_ROOT)/tools/xenstore \
+		-I$(XEN_ROOT)/tools/xenstore/compat" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore" \
 		--bindir=$(LIBEXEC) \
diff -r 54fcdee8740f -r e71b19157a47 tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/blktap/drivers/blktapctrl.c	Mon May 14 09:31:39 2012 +0100
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 #include <string.h>
 #include <unistd.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/time.h>
 #include <syslog.h>
 #ifdef MEMSHR
diff -r 54fcdee8740f -r e71b19157a47 tools/blktap/lib/blktaplib.h
--- a/tools/blktap/lib/blktaplib.h	Mon May 14 09:11:00 2012 +0100
+++ b/tools/blktap/lib/blktaplib.h	Mon May 14 09:31:39 2012 +0100
@@ -38,7 +38,7 @@
 #include <xen/xen.h>
 #include <xen/io/blkif.h>
 #include <xen/io/ring.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <unistd.h>
 
diff -r 54fcdee8740f -r e71b19157a47 tools/blktap/lib/xenbus.c
--- a/tools/blktap/lib/xenbus.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/blktap/lib/xenbus.c	Mon May 14 09:31:39 2012 +0100
@@ -41,7 +41,7 @@
 #include <err.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/blktap/lib/xs_api.c
--- a/tools/blktap/lib/xs_api.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/blktap/lib/xs_api.c	Mon May 14 09:31:39 2012 +0100
@@ -38,7 +38,7 @@
 #include <err.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/console/client/main.c
--- a/tools/console/client/main.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/console/client/main.c	Mon May 14 09:31:39 2012 +0100
@@ -39,7 +39,7 @@
 #include <sys/stropts.h>
 #endif
 
-#include "xs.h"
+#include <xenstore.h>
 #include "xenctrl.h"
 
 #define ESCAPE_CHARACTER 0x1d
diff -r 54fcdee8740f -r e71b19157a47 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/console/daemon/io.c	Mon May 14 09:31:39 2012 +0100
@@ -22,7 +22,7 @@
 
 #include "utils.h"
 #include "io.h"
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/io/console.h>
 
 #include <stdlib.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/console/daemon/utils.h
--- a/tools/console/daemon/utils.h	Mon May 14 09:11:00 2012 +0100
+++ b/tools/console/daemon/utils.h	Mon May 14 09:31:39 2012 +0100
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <xenctrl.h>
 
-#include "xs.h"
+#include <xenstore.h>
 
 void daemonize(const char *pidfile);
 bool xen_setup(void);
diff -r 54fcdee8740f -r e71b19157a47 tools/libvchan/init.c
--- a/tools/libvchan/init.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/libvchan/init.c	Mon May 14 09:31:39 2012 +0100
@@ -40,7 +40,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/sys/evtchn.h>
 #include <xen/sys/gntalloc.h>
 #include <xen/sys/gntdev.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon May 14 09:11:00 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon May 14 09:31:39 2012 +0100
@@ -44,7 +44,7 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 
 #include "xentoollog.h"
diff -r 54fcdee8740f -r e71b19157a47 tools/misc/xen-lowmemd.c
--- a/tools/misc/xen-lowmemd.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/misc/xen-lowmemd.c	Mon May 14 09:31:39 2012 +0100
@@ -5,7 +5,7 @@
 
 #include <stdio.h>
 #include <xenctrl.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <stdlib.h>
 #include <string.h>
 
diff -r 54fcdee8740f -r e71b19157a47 tools/python/xen/lowlevel/checkpoint/checkpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.c	Mon May 14 09:31:39 2012 +0100
@@ -2,7 +2,7 @@
 
 #include <Python.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 
 #include "checkpoint.h"
diff -r 54fcdee8740f -r e71b19157a47 tools/python/xen/lowlevel/checkpoint/checkpoint.h
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.h	Mon May 14 09:11:00 2012 +0100
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.h	Mon May 14 09:31:39 2012 +0100
@@ -8,7 +8,7 @@
 #include <time.h>
 
 #include <xenguest.h>
-#include <xs.h>
+#include <xenstore.h>
 
 typedef enum {
     dt_unknown,
diff -r 54fcdee8740f -r e71b19157a47 tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c	Mon May 14 09:31:39 2012 +0100
@@ -11,7 +11,7 @@
 
 #include <xenctrl.h>
 #include <xenguest.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include "checkpoint.h"
 
diff -r 54fcdee8740f -r e71b19157a47 tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/python/xen/lowlevel/xs/xs.c	Mon May 14 09:31:39 2012 +0100
@@ -30,7 +30,7 @@
 #include <fcntl.h>
 #include <errno.h>
 
-#include "xs.h"
+#include <xenstore.h>
 
 /** @file
  * Python interface to the Xen Store Daemon (xs).
diff -r 54fcdee8740f -r e71b19157a47 tools/tests/mce-test/tools/xen-mceinj.c
--- a/tools/tests/mce-test/tools/xen-mceinj.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/tests/mce-test/tools/xen-mceinj.c	Mon May 14 09:31:39 2012 +0100
@@ -38,7 +38,7 @@
 #include <sys/time.h>
 #include <xen/arch-x86/xen-mca.h>
 #include <xg_save_restore.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #define MCi_type_CTL        0x0
 #define MCi_type_STATUS     0x1
diff -r 54fcdee8740f -r e71b19157a47 tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xcutils/xc_save.c	Mon May 14 09:31:39 2012 +0100
@@ -19,7 +19,7 @@
 #include <fcntl.h>
 #include <err.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 #include <xenguest.h>
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenbackendd/xenbackendd.c
--- a/tools/xenbackendd/xenbackendd.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenbackendd/xenbackendd.c	Mon May 14 09:31:39 2012 +0100
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <syslog.h>
 
-#include <xs.h>
+#include <xenstore.h>
 
 #define DEVTYPE_UNKNOWN 0
 #define DEVTYPE_VIF 1
diff -r 54fcdee8740f -r e71b19157a47 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Mon May 14 09:31:39 2012 +0100
@@ -29,7 +29,7 @@
 #include <unistd.h>
 #include <poll.h>
 #include <xc_private.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <getopt.h>
 
 #include "xc_bitops.h"
diff -r 54fcdee8740f -r e71b19157a47 tools/xenpmd/xenpmd.c
--- a/tools/xenpmd/xenpmd.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenpmd/xenpmd.c	Mon May 14 09:31:39 2012 +0100
@@ -40,7 +40,7 @@
 #include <dirent.h>
 #include <unistd.h>
 #include <sys/stat.h>
-#include <xs.h>
+#include <xenstore.h>
 
 /* #define RUN_STANDALONE */
 #define RUN_IN_SIMULATE_MODE
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstat/libxenstat/src/xenstat_priv.h
--- a/tools/xenstat/libxenstat/src/xenstat_priv.h	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstat/libxenstat/src/xenstat_priv.h	Mon May 14 09:31:39 2012 +0100
@@ -24,7 +24,7 @@
 #define XENSTAT_PRIV_H
 
 #include <sys/types.h>
-#include <xs.h>
+#include <xenstore.h>
 #include "xenstat.h"
 
 #include "xenctrl.h"
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/COPYING
--- a/tools/xenstore/COPYING	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/COPYING	Mon May 14 09:31:39 2012 +0100
@@ -1,6 +1,6 @@
 This license (LGPL) applies to the xenstore library which interfaces
-with the xenstore daemon (as stated in xs.c, xs.h, xs_lib.c and
-xs_lib.h).  The remaining files in the directory are licensed as
+with the xenstore daemon (as stated in xs.c, xenstore.h, xs_lib.c and
+xenstore_lib.h).  The remaining files in the directory are licensed as
 stated in the comments (as of this writing, GPL, see ../../COPYING).
 
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/Makefile	Mon May 14 09:31:39 2012 +0100
@@ -109,6 +109,7 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
 	$(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
 	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
@@ -122,8 +123,12 @@ install: all
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
+	$(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
+	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
+	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
 -include $(DEPS)
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/compat/xs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xenstore/compat/xs.h	Mon May 14 09:31:39 2012 +0100
@@ -0,0 +1,2 @@
+#warning xs.h is deprecated use xenstore.h instead
+#include <xenstore.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/compat/xs_lib.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xenstore/compat/xs_lib.h	Mon May 14 09:31:39 2012 +0100
@@ -0,0 +1,2 @@
+#warning xs_lib.h is deprecated use xenstore_lib.h instead
+#include <xenstore_lib.h>
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/init-xenstore-domain.c
--- a/tools/xenstore/init-xenstore-domain.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/init-xenstore-domain.c	Mon May 14 09:31:39 2012 +0100
@@ -7,7 +7,7 @@
 #include <sys/mman.h>
 #include <xenctrl.h>
 #include <xc_dom.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 
 static uint32_t domid = -1;
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstore.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xenstore/xenstore.h	Mon May 14 09:31:39 2012 +0100
@@ -0,0 +1,236 @@
+/* 
+    Xen Store Daemon providing simple tree-like database.
+    Copyright (C) 2005 Rusty Russell IBM Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef XENSTORE_H
+#define XENSTORE_H
+
+#include <xenstore_lib.h>
+
+#define XBT_NULL 0
+
+#define XS_OPEN_READONLY	1UL<<0
+#define XS_OPEN_SOCKETONLY      1UL<<1
+
+struct xs_handle;
+typedef uint32_t xs_transaction_t;
+
+/* IMPORTANT: For details on xenstore protocol limits, see
+ * docs/misc/xenstore.txt in the Xen public source repository, and use the
+ * XENSTORE_*_MAX limit macros defined in xen/io/xs_wire.h.
+ */
+
+/* On failure, these routines set errno. */
+
+/* Open a connection to the xs daemon.
+ * Attempts to make a connection over the socket interface, 
+ * and if it fails, then over the  xenbus interface.
+ * Mode 0 specifies read-write access, XS_OPEN_READONLY for
+ * read-only access.
+ * Returns a handle or NULL.
+ */
+struct xs_handle *xs_open(unsigned long flags);
+
+/* Close the connection to the xs daemon. */
+void xs_close(struct xs_handle *xsh);
+
+/* Connect to the xs daemon.
+ * Returns a handle or NULL.
+ * Deprecated, please use xs_open(0) instead
+ */
+struct xs_handle *xs_daemon_open(void);
+struct xs_handle *xs_domain_open(void);
+
+/* Connect to the xs daemon (readonly for non-root clients).
+ * Returns a handle or NULL.
+ * Deprecated, please use xs_open(XS_OPEN_READONLY) instead
+ */
+struct xs_handle *xs_daemon_open_readonly(void);
+
+/* Close the connection to the xs daemon.
+ * Deprecated, please use xs_close() instead
+ */
+void xs_daemon_close(struct xs_handle *);
+
+/* Throw away the connection to the xs daemon, for use after fork(). */
+void xs_daemon_destroy_postfork(struct xs_handle *);
+
+/* Get contents of a directory.
+ * Returns a malloced array: call free() on it after use.
+ * Num indicates size.
+ */
+char **xs_directory(struct xs_handle *h, xs_transaction_t t,
+		    const char *path, unsigned int *num);
+
+/* Get the value of a single file, nul terminated.
+ * Returns a malloced value: call free() on it after use.
+ * len indicates length in bytes, not including terminator.
+ */
+void *xs_read(struct xs_handle *h, xs_transaction_t t,
+	      const char *path, unsigned int *len);
+
+/* Write the value of a single file.
+ * Returns false on failure.
+ */
+bool xs_write(struct xs_handle *h, xs_transaction_t t,
+	      const char *path, const void *data, unsigned int len);
+
+/* Create a new directory.
+ * Returns false on failure, or success if it already exists.
+ */
+bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,
+	      const char *path);
+
+/* Destroy a file or directory (and children).
+ * Returns false on failure, or if it doesn't exist.
+ */
+bool xs_rm(struct xs_handle *h, xs_transaction_t t,
+	   const char *path);
+
+/* Restrict a xenstore handle so that it acts as if it had the
+ * permissions of domain @domid.  The handle must currently be
+ * using domain 0's credentials.
+ *
+ * Returns false on failure, in which case the handle continues
+ * to use the old credentials, or true on success.
+ */
+bool xs_restrict(struct xs_handle *h, unsigned domid);
+
+/* Get permissions of node (first element is owner, first perms is "other").
+ * Returns malloced array, or NULL: call free() after use.
+ */
+struct xs_permissions *xs_get_permissions(struct xs_handle *h,
+					  xs_transaction_t t,
+					  const char *path, unsigned int *num);
+
+/* Set permissions of node (must be owner).
+ * Returns false on failure.
+ */
+bool xs_set_permissions(struct xs_handle *h, xs_transaction_t t,
+			const char *path, struct xs_permissions *perms,
+			unsigned int num_perms);
+
+/* Watch a node for changes (poll on fd to detect, or call read_watch()).
+ * When the node (or any child) changes, fd will become readable.
+ * Token is returned when watch is read, to allow matching.
+ * Returns false on failure.
+ */
+bool xs_watch(struct xs_handle *h, const char *path, const char *token);
+
+/* Return the FD to poll on to see if a watch has fired. */
+int xs_fileno(struct xs_handle *h);
+
+/* Check for node changes.  On success, returns a non-NULL pointer ret
+ * such that ret[0] and ret[1] are valid C strings, namely the
+ * triggering path (see docs/misc/xenstore.txt) and the token (from
+ * xs_watch).  On error return value is NULL setting errno.
+ * 
+ * Callers should, after xs_fileno has become readable, repeatedly
+ * call xs_check_watch until it returns NULL and sets errno to EAGAIN.
+ * (If the fd became readable, xs_check_watch is allowed to make it no
+ * longer show up as readable even if future calls to xs_check_watch
+ * will return more watch events.)
+ *
+ * After the caller is finished with the returned information it
+ * should be freed all in one go with free(ret).
+ */
+char **xs_check_watch(struct xs_handle *h);
+
+/* Find out what node change was on (will block if nothing pending).
+ * Returns array containing the path and token. Use XS_WATCH_* to access these
+ * elements. Call free() after use.
+ */
+char **xs_read_watch(struct xs_handle *h, unsigned int *num);
+
+/* Remove a watch on a node: implicitly acks any outstanding watch.
+ * Returns false on failure (no watch on that node).
+ */
+bool xs_unwatch(struct xs_handle *h, const char *path, const char *token);
+
+/* Start a transaction: changes by others will not be seen during this
+ * transaction, and changes will not be visible to others until end.
+ * Returns NULL on failure.
+ */
+xs_transaction_t xs_transaction_start(struct xs_handle *h);
+
+/* End a transaction.
+ * If abandon is true, transaction is discarded instead of committed.
+ * Returns false on failure: if errno == EAGAIN, you have to restart
+ * transaction.
+ */
+bool xs_transaction_end(struct xs_handle *h, xs_transaction_t t,
+			bool abort);
+
+/* Introduce a new domain.
+ * This tells the store daemon about a shared memory page, event channel and
+ * store path associated with a domain: the domain uses these to communicate.
+ */
+bool xs_introduce_domain(struct xs_handle *h,
+			 unsigned int domid,
+			 unsigned long mfn,
+                         unsigned int eventchn); 
+
+/* Set the target of a domain
+ * This tells the store daemon that a domain is targetting another one, so
+ * it should let it tinker with it.
+ */
+bool xs_set_target(struct xs_handle *h,
+		   unsigned int domid,
+		   unsigned int target);
+
+/* Resume a domain.
+ * Clear the shutdown flag for this domain in the store.
+ */
+bool xs_resume_domain(struct xs_handle *h, unsigned int domid);
+
+/* Release a domain.
+ * Tells the store domain to release the memory page to the domain.
+ */
+bool xs_release_domain(struct xs_handle *h, unsigned int domid);
+
+/* Query the home path of a domain.  Call free() after use.
+ */
+char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
+
+/* Returns true if child is either equal to parent, or a node underneath
+ * parent; or false otherwise.  Done by string comparison, so relative and
+ * absolute pathnames never in a parent/child relationship by this
+ * definition.  Cannot fail.
+ */
+bool xs_path_is_subpath(const char *parent, const char *child);
+
+/* Return whether the domain specified has been introduced to xenstored.
+ */
+bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid);
+
+/* Only useful for DEBUG versions */
+char *xs_debug_command(struct xs_handle *h, const char *cmd,
+		       void *data, unsigned int len);
+
+int xs_suspend_evtchn_port(int domid);
+#endif /* XENSTORE_H */
+
+/*
+ * Local variables:
+ *  c-file-style: "linux"
+ *  indent-tabs-mode: t
+ *  c-indent-level: 8
+ *  c-basic-offset: 8
+ *  tab-width: 8
+ * End:
+ */
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xenstore_client.c	Mon May 14 09:31:39 2012 +0100
@@ -18,7 +18,7 @@
 #include <string.h>
 #include <termios.h>
 #include <unistd.h>
-#include <xs.h>
+#include <xenstore.h>
 
 #include <sys/ioctl.h>
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstore_control.c
--- a/tools/xenstore/xenstore_control.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xenstore_control.c	Mon May 14 09:31:39 2012 +0100
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "xs.h"
+#include "xenstore.h"
 
 
 int main(int argc, char **argv)
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstore_lib.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xenstore/xenstore_lib.h	Mon May 14 09:31:39 2012 +0100
@@ -0,0 +1,85 @@
+/* 
+    Common routines between Xen store user library and daemon.
+    Copyright (C) 2005 Rusty Russell IBM Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef XENSTORE_LIB_H
+#define XENSTORE_LIB_H
+
+#include <stdbool.h>
+#include <limits.h>
+#include <errno.h>
+#include <stdint.h>
+#include <xen/io/xs_wire.h>
+
+/* Bitmask of permissions. */
+enum xs_perm_type {
+	XS_PERM_NONE = 0,
+	XS_PERM_READ = 1,
+	XS_PERM_WRITE = 2,
+	/* Internal use. */
+	XS_PERM_ENOENT_OK = 4,
+	XS_PERM_OWNER = 8,
+};
+
+struct xs_permissions
+{
+	unsigned int id;
+	enum xs_perm_type perms;
+};
+
+/* Each 10 bits takes ~ 3 digits, plus one, plus one for nul terminator. */
+#define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2)
+
+/* Path for various daemon things: env vars can override. */
+const char *xs_daemon_rootdir(void);
+const char *xs_daemon_rundir(void);
+const char *xs_daemon_socket(void);
+const char *xs_daemon_socket_ro(void);
+const char *xs_domain_dev(void);
+const char *xs_daemon_tdb(void);
+
+/* Simple write function: loops for you. */
+bool xs_write_all(int fd, const void *data, unsigned int len);
+
+/* Convert strings to permissions.  False if a problem. */
+bool xs_strings_to_perms(struct xs_permissions *perms, unsigned int num,
+			 const char *strings);
+
+/* Convert permissions to a string (up to len MAX_STRLEN(unsigned int)+1). */
+bool xs_perm_to_string(const struct xs_permissions *perm,
+                       char *buffer, size_t buf_len);
+
+/* Given a string and a length, count how many strings (nul terms). */
+unsigned int xs_count_strings(const char *strings, unsigned int len);
+
+/* Sanitising (quoting) possibly-binary strings. */
+struct expanding_buffer {
+	char *buf;
+	int avail;
+};
+
+/* Ensure that given expanding buffer has at least min_avail characters. */
+char *expanding_buffer_ensure(struct expanding_buffer *, int min_avail);
+
+/* sanitise_value() may return NULL if malloc fails. */
+char *sanitise_value(struct expanding_buffer *, const char *val, unsigned len);
+
+/* *out_len_r on entry is ignored; out must be at least strlen(in)+1 bytes. */
+void unsanitise_value(char *out, unsigned *out_len_r, const char *in);
+
+#endif /* XENSTORE_LIB_H */
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xenstored_core.c	Mon May 14 09:31:39 2012 +0100
@@ -44,7 +44,7 @@
 #include "utils.h"
 #include "list.h"
 #include "talloc.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "xenstored_core.h"
 #include "xenstored_watch.h"
 #include "xenstored_transaction.h"
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstored_core.h
--- a/tools/xenstore/xenstored_core.h	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xenstored_core.h	Mon May 14 09:31:39 2012 +0100
@@ -27,7 +27,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "list.h"
 #include "tdb.h"
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstored_transaction.c
--- a/tools/xenstore/xenstored_transaction.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xenstored_transaction.c	Mon May 14 09:31:39 2012 +0100
@@ -33,7 +33,7 @@
 #include "xenstored_transaction.h"
 #include "xenstored_watch.h"
 #include "xenstored_domain.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "utils.h"
 
 struct changed_node
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xenstored_watch.c
--- a/tools/xenstore/xenstored_watch.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xenstored_watch.c	Mon May 14 09:31:39 2012 +0100
@@ -27,7 +27,7 @@
 #include "talloc.h"
 #include "list.h"
 #include "xenstored_watch.h"
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "utils.h"
 #include "xenstored_domain.h"
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xs.c	Mon May 14 09:31:39 2012 +0100
@@ -32,7 +32,7 @@
 #include <signal.h>
 #include <stdint.h>
 #include <errno.h>
-#include "xs.h"
+#include "xenstore.h"
 #include "list.h"
 #include "utils.h"
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xs.h
--- a/tools/xenstore/xs.h	Mon May 14 09:11:00 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-/* 
-    Xen Store Daemon providing simple tree-like database.
-    Copyright (C) 2005 Rusty Russell IBM Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _XS_H
-#define _XS_H
-
-#include <xs_lib.h>
-
-#define XBT_NULL 0
-
-#define XS_OPEN_READONLY	1UL<<0
-#define XS_OPEN_SOCKETONLY      1UL<<1
-
-struct xs_handle;
-typedef uint32_t xs_transaction_t;
-
-/* IMPORTANT: For details on xenstore protocol limits, see
- * docs/misc/xenstore.txt in the Xen public source repository, and use the
- * XENSTORE_*_MAX limit macros defined in xen/io/xs_wire.h.
- */
-
-/* On failure, these routines set errno. */
-
-/* Open a connection to the xs daemon.
- * Attempts to make a connection over the socket interface, 
- * and if it fails, then over the  xenbus interface.
- * Mode 0 specifies read-write access, XS_OPEN_READONLY for
- * read-only access.
- * Returns a handle or NULL.
- */
-struct xs_handle *xs_open(unsigned long flags);
-
-/* Close the connection to the xs daemon. */
-void xs_close(struct xs_handle *xsh);
-
-/* Connect to the xs daemon.
- * Returns a handle or NULL.
- * Deprecated, please use xs_open(0) instead
- */
-struct xs_handle *xs_daemon_open(void);
-struct xs_handle *xs_domain_open(void);
-
-/* Connect to the xs daemon (readonly for non-root clients).
- * Returns a handle or NULL.
- * Deprecated, please use xs_open(XS_OPEN_READONLY) instead
- */
-struct xs_handle *xs_daemon_open_readonly(void);
-
-/* Close the connection to the xs daemon.
- * Deprecated, please use xs_close() instead
- */
-void xs_daemon_close(struct xs_handle *);
-
-/* Throw away the connection to the xs daemon, for use after fork(). */
-void xs_daemon_destroy_postfork(struct xs_handle *);
-
-/* Get contents of a directory.
- * Returns a malloced array: call free() on it after use.
- * Num indicates size.
- */
-char **xs_directory(struct xs_handle *h, xs_transaction_t t,
-		    const char *path, unsigned int *num);
-
-/* Get the value of a single file, nul terminated.
- * Returns a malloced value: call free() on it after use.
- * len indicates length in bytes, not including terminator.
- */
-void *xs_read(struct xs_handle *h, xs_transaction_t t,
-	      const char *path, unsigned int *len);
-
-/* Write the value of a single file.
- * Returns false on failure.
- */
-bool xs_write(struct xs_handle *h, xs_transaction_t t,
-	      const char *path, const void *data, unsigned int len);
-
-/* Create a new directory.
- * Returns false on failure, or success if it already exists.
- */
-bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,
-	      const char *path);
-
-/* Destroy a file or directory (and children).
- * Returns false on failure, or if it doesn't exist.
- */
-bool xs_rm(struct xs_handle *h, xs_transaction_t t,
-	   const char *path);
-
-/* Restrict a xenstore handle so that it acts as if it had the
- * permissions of domain @domid.  The handle must currently be
- * using domain 0's credentials.
- *
- * Returns false on failure, in which case the handle continues
- * to use the old credentials, or true on success.
- */
-bool xs_restrict(struct xs_handle *h, unsigned domid);
-
-/* Get permissions of node (first element is owner, first perms is "other").
- * Returns malloced array, or NULL: call free() after use.
- */
-struct xs_permissions *xs_get_permissions(struct xs_handle *h,
-					  xs_transaction_t t,
-					  const char *path, unsigned int *num);
-
-/* Set permissions of node (must be owner).
- * Returns false on failure.
- */
-bool xs_set_permissions(struct xs_handle *h, xs_transaction_t t,
-			const char *path, struct xs_permissions *perms,
-			unsigned int num_perms);
-
-/* Watch a node for changes (poll on fd to detect, or call read_watch()).
- * When the node (or any child) changes, fd will become readable.
- * Token is returned when watch is read, to allow matching.
- * Returns false on failure.
- */
-bool xs_watch(struct xs_handle *h, const char *path, const char *token);
-
-/* Return the FD to poll on to see if a watch has fired. */
-int xs_fileno(struct xs_handle *h);
-
-/* Check for node changes.  On success, returns a non-NULL pointer ret
- * such that ret[0] and ret[1] are valid C strings, namely the
- * triggering path (see docs/misc/xenstore.txt) and the token (from
- * xs_watch).  On error return value is NULL setting errno.
- * 
- * Callers should, after xs_fileno has become readable, repeatedly
- * call xs_check_watch until it returns NULL and sets errno to EAGAIN.
- * (If the fd became readable, xs_check_watch is allowed to make it no
- * longer show up as readable even if future calls to xs_check_watch
- * will return more watch events.)
- *
- * After the caller is finished with the returned information it
- * should be freed all in one go with free(ret).
- */
-char **xs_check_watch(struct xs_handle *h);
-
-/* Find out what node change was on (will block if nothing pending).
- * Returns array containing the path and token. Use XS_WATCH_* to access these
- * elements. Call free() after use.
- */
-char **xs_read_watch(struct xs_handle *h, unsigned int *num);
-
-/* Remove a watch on a node: implicitly acks any outstanding watch.
- * Returns false on failure (no watch on that node).
- */
-bool xs_unwatch(struct xs_handle *h, const char *path, const char *token);
-
-/* Start a transaction: changes by others will not be seen during this
- * transaction, and changes will not be visible to others until end.
- * Returns NULL on failure.
- */
-xs_transaction_t xs_transaction_start(struct xs_handle *h);
-
-/* End a transaction.
- * If abandon is true, transaction is discarded instead of committed.
- * Returns false on failure: if errno == EAGAIN, you have to restart
- * transaction.
- */
-bool xs_transaction_end(struct xs_handle *h, xs_transaction_t t,
-			bool abort);
-
-/* Introduce a new domain.
- * This tells the store daemon about a shared memory page, event channel and
- * store path associated with a domain: the domain uses these to communicate.
- */
-bool xs_introduce_domain(struct xs_handle *h,
-			 unsigned int domid,
-			 unsigned long mfn,
-                         unsigned int eventchn); 
-
-/* Set the target of a domain
- * This tells the store daemon that a domain is targetting another one, so
- * it should let it tinker with it.
- */
-bool xs_set_target(struct xs_handle *h,
-		   unsigned int domid,
-		   unsigned int target);
-
-/* Resume a domain.
- * Clear the shutdown flag for this domain in the store.
- */
-bool xs_resume_domain(struct xs_handle *h, unsigned int domid);
-
-/* Release a domain.
- * Tells the store domain to release the memory page to the domain.
- */
-bool xs_release_domain(struct xs_handle *h, unsigned int domid);
-
-/* Query the home path of a domain.  Call free() after use.
- */
-char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
-
-/* Returns true if child is either equal to parent, or a node underneath
- * parent; or false otherwise.  Done by string comparison, so relative and
- * absolute pathnames never in a parent/child relationship by this
- * definition.  Cannot fail.
- */
-bool xs_path_is_subpath(const char *parent, const char *child);
-
-/* Return whether the domain specified has been introduced to xenstored.
- */
-bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid);
-
-/* Only useful for DEBUG versions */
-char *xs_debug_command(struct xs_handle *h, const char *cmd,
-		       void *data, unsigned int len);
-
-int xs_suspend_evtchn_port(int domid);
-#endif /* _XS_H */
-
-/*
- * Local variables:
- *  c-file-style: "linux"
- *  indent-tabs-mode: t
- *  c-indent-level: 8
- *  c-basic-offset: 8
- *  tab-width: 8
- * End:
- */
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xs_lib.c
--- a/tools/xenstore/xs_lib.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xs_lib.c	Mon May 14 09:31:39 2012 +0100
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <assert.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 
 /* Common routines for the Xen store daemon and client library. */
 
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xs_lib.h
--- a/tools/xenstore/xs_lib.h	Mon May 14 09:11:00 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/* 
-    Common routines between Xen store user library and daemon.
-    Copyright (C) 2005 Rusty Russell IBM Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _XS_LIB_H
-#define _XS_LIB_H
-
-#include <stdbool.h>
-#include <limits.h>
-#include <errno.h>
-#include <stdint.h>
-#include <xen/io/xs_wire.h>
-
-/* Bitmask of permissions. */
-enum xs_perm_type {
-	XS_PERM_NONE = 0,
-	XS_PERM_READ = 1,
-	XS_PERM_WRITE = 2,
-	/* Internal use. */
-	XS_PERM_ENOENT_OK = 4,
-	XS_PERM_OWNER = 8,
-};
-
-struct xs_permissions
-{
-	unsigned int id;
-	enum xs_perm_type perms;
-};
-
-/* Each 10 bits takes ~ 3 digits, plus one, plus one for nul terminator. */
-#define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2)
-
-/* Path for various daemon things: env vars can override. */
-const char *xs_daemon_rootdir(void);
-const char *xs_daemon_rundir(void);
-const char *xs_daemon_socket(void);
-const char *xs_daemon_socket_ro(void);
-const char *xs_domain_dev(void);
-const char *xs_daemon_tdb(void);
-
-/* Simple write function: loops for you. */
-bool xs_write_all(int fd, const void *data, unsigned int len);
-
-/* Convert strings to permissions.  False if a problem. */
-bool xs_strings_to_perms(struct xs_permissions *perms, unsigned int num,
-			 const char *strings);
-
-/* Convert permissions to a string (up to len MAX_STRLEN(unsigned int)+1). */
-bool xs_perm_to_string(const struct xs_permissions *perm,
-                       char *buffer, size_t buf_len);
-
-/* Given a string and a length, count how many strings (nul terms). */
-unsigned int xs_count_strings(const char *strings, unsigned int len);
-
-/* Sanitising (quoting) possibly-binary strings. */
-struct expanding_buffer {
-	char *buf;
-	int avail;
-};
-
-/* Ensure that given expanding buffer has at least min_avail characters. */
-char *expanding_buffer_ensure(struct expanding_buffer *, int min_avail);
-
-/* sanitise_value() may return NULL if malloc fails. */
-char *sanitise_value(struct expanding_buffer *, const char *val, unsigned len);
-
-/* *out_len_r on entry is ignored; out must be at least strlen(in)+1 bytes. */
-void unsanitise_value(char *out, unsigned *out_len_r, const char *in);
-
-#endif /* _XS_LIB_H */
diff -r 54fcdee8740f -r e71b19157a47 tools/xenstore/xs_tdb_dump.c
--- a/tools/xenstore/xs_tdb_dump.c	Mon May 14 09:11:00 2012 +0100
+++ b/tools/xenstore/xs_tdb_dump.c	Mon May 14 09:31:39 2012 +0100
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include "xs_lib.h"
+#include "xenstore_lib.h"
 #include "tdb.h"
 #include "talloc.h"
 #include "utils.h"


[-- Attachment #2: qemu-xs-compat.patch --]
[-- Type: text/x-patch, Size: 1045 bytes --]

qemu-xen-traditional: use compat xenstore headers.

Pending a transition to the new names

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff --git a/Makefile b/Makefile
index 37c7066..a43ca67 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ recurse-all: $(SUBDIR_RULES)
 CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
 CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
 CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore/compat
 CPPFLAGS += -I$(XEN_ROOT)/tools/include
 
 tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
diff --git a/xen-hooks.mak b/xen-hooks.mak
index b55f45b..8e9cadf 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,5 +1,6 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/compat
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
 
 SSE2 := $(call cc-option,-msse2,)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-05-14  8:34             ` Ian Campbell
@ 2012-05-14 16:21               ` Ian Jackson
  2012-05-14 16:24                 ` Ian Campbell
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Jackson @ 2012-05-14 16:21 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Bastian Blank, xen-devel, Stefano Stabellini

Ian Campbell writes ("Re: [Xen-devel] [PATCH] Rename public xenstore headers"):
> xenstore: rename public xenstore headers
> 
> 
> The xenstore header xs.h is producing conflicts with other software[1].
> 
> xs is a too short identifier and does not matche the library. Renaming
> the headers to xenstore.h and xenstore_lib.h is the easiest way to make
> them easy recognizable and prevent furthe problems.
> 
> [1]: http://bugs.debian.org/668550
> 
> Signed-off-by: Bastian Blank <waldi@debian.org>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

I have applied the xen-unstable.hg part of this.  For the
qemu-xen-traditional part, I felt the number of warnings that result
was really rather excessive for one of our own trees.

I have therefore updated qemu-xen-traditional.git (with the patch
below) to immediately use the new name, and included a corresponding
update to QEMU_TAG in xen-unstable.hg.

People who are working with xen-unstable will find that they have to
update their qemu.

Ian.

commit 7bde54662d45b0bbc2ee78c7a8bf2c97c6655445
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Mon May 14 17:05:48 2012 +0100

    xenstore: Use <xenstore.h>
    
    <xs.h> is going away.
    
    This change needs to be made in lockstep with xen-unstable.hg, which
    will be done by a change to the QEMU_TAG in the xen-unstable.hg
    changeset.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 64dc93a..92b3506 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -32,7 +32,7 @@
 #include <sys/mman.h>
 #include <sys/signal.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 #include <xen/grant_table.h>
 
diff --git a/hw/xen_common.h b/hw/xen_common.h
index 7562567..a615052 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -5,7 +5,7 @@
 #include <inttypes.h>
 
 #include <xenctrl.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/io/xenbus.h>
 
 #include "hw.h"
diff --git a/hw/xen_console.c b/hw/xen_console.c
index 8d14131..80beb31 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -29,7 +29,7 @@
 #include <termios.h>
 #include <stdarg.h>
 #include <sys/mman.h>
-#include <xs.h>
+#include <xenstore.h>
 #include <xen/io/console.h>
 #include <xenctrl.h>
 
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 5db58ac..04a62e2 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -33,7 +33,7 @@
 #include <sys/mman.h>
 #include <sys/uio.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 #include <xen/io/xenbus.h>
 
diff --git a/hw/xenfb.c b/hw/xenfb.c
index 96c2a6f..75b2bc2 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -37,7 +37,7 @@
 #include <string.h>
 #include <time.h>
 
-#include <xs.h>
+#include <xenstore.h>
 #include <xenctrl.h>
 #include <xen/event_channel.h>
 #include <xen/io/xenbus.h>
diff --git a/xen-config-host.h b/xen-config-host.h
index 818f25d..647f6be 100644
--- a/xen-config-host.h
+++ b/xen-config-host.h
@@ -17,7 +17,7 @@ extern int domid, domid_backend;
 #include <stdbool.h>
 
 #include "xenctrl.h"
-#include "xs.h"
+#include "xenstore.h"
 #if !defined(CONFIG_STUBDOM) && !defined(__NetBSD__)
 #include "blktaplib.h"
 #endif

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Rename public xenstore headers
  2012-05-14 16:21               ` Ian Jackson
@ 2012-05-14 16:24                 ` Ian Campbell
  0 siblings, 0 replies; 11+ messages in thread
From: Ian Campbell @ 2012-05-14 16:24 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Bastian Blank, xen-devel, Stefano Stabellini

On Mon, 2012-05-14 at 17:21 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH] Rename public xenstore headers"):
> > xenstore: rename public xenstore headers
> > 
> > 
> > The xenstore header xs.h is producing conflicts with other software[1].
> > 
> > xs is a too short identifier and does not matche the library. Renaming
> > the headers to xenstore.h and xenstore_lib.h is the easiest way to make
> > them easy recognizable and prevent furthe problems.
> > 
> > [1]: http://bugs.debian.org/668550
> > 
> > Signed-off-by: Bastian Blank <waldi@debian.org>
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> I have applied the xen-unstable.hg part of this.  For the
> qemu-xen-traditional part, I felt the number of warnings that result
> was really rather excessive for one of our own trees.
> 
> I have therefore updated qemu-xen-traditional.git (with the patch
> below) to immediately use the new name, and included a corresponding
> update to QEMU_TAG in xen-unstable.hg.

Looks fine, thanks. I would Ack but assume it's too late.

> 
> People who are working with xen-unstable will find that they have to
> update their qemu.
> 
> Ian.
> 
> commit 7bde54662d45b0bbc2ee78c7a8bf2c97c6655445
> Author: Ian Jackson <ian.jackson@eu.citrix.com>
> Date:   Mon May 14 17:05:48 2012 +0100
> 
>     xenstore: Use <xenstore.h>
>     
>     <xs.h> is going away.
>     
>     This change needs to be made in lockstep with xen-unstable.hg, which
>     will be done by a change to the QEMU_TAG in the xen-unstable.hg
>     changeset.
>     
>     Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> 
> diff --git a/hw/xen_backend.c b/hw/xen_backend.c
> index 64dc93a..92b3506 100644
> --- a/hw/xen_backend.c
> +++ b/hw/xen_backend.c
> @@ -32,7 +32,7 @@
>  #include <sys/mman.h>
>  #include <sys/signal.h>
>  
> -#include <xs.h>
> +#include <xenstore.h>
>  #include <xenctrl.h>
>  #include <xen/grant_table.h>
>  
> diff --git a/hw/xen_common.h b/hw/xen_common.h
> index 7562567..a615052 100644
> --- a/hw/xen_common.h
> +++ b/hw/xen_common.h
> @@ -5,7 +5,7 @@
>  #include <inttypes.h>
>  
>  #include <xenctrl.h>
> -#include <xs.h>
> +#include <xenstore.h>
>  #include <xen/io/xenbus.h>
>  
>  #include "hw.h"
> diff --git a/hw/xen_console.c b/hw/xen_console.c
> index 8d14131..80beb31 100644
> --- a/hw/xen_console.c
> +++ b/hw/xen_console.c
> @@ -29,7 +29,7 @@
>  #include <termios.h>
>  #include <stdarg.h>
>  #include <sys/mman.h>
> -#include <xs.h>
> +#include <xenstore.h>
>  #include <xen/io/console.h>
>  #include <xenctrl.h>
>  
> diff --git a/hw/xen_disk.c b/hw/xen_disk.c
> index 5db58ac..04a62e2 100644
> --- a/hw/xen_disk.c
> +++ b/hw/xen_disk.c
> @@ -33,7 +33,7 @@
>  #include <sys/mman.h>
>  #include <sys/uio.h>
>  
> -#include <xs.h>
> +#include <xenstore.h>
>  #include <xenctrl.h>
>  #include <xen/io/xenbus.h>
>  
> diff --git a/hw/xenfb.c b/hw/xenfb.c
> index 96c2a6f..75b2bc2 100644
> --- a/hw/xenfb.c
> +++ b/hw/xenfb.c
> @@ -37,7 +37,7 @@
>  #include <string.h>
>  #include <time.h>
>  
> -#include <xs.h>
> +#include <xenstore.h>
>  #include <xenctrl.h>
>  #include <xen/event_channel.h>
>  #include <xen/io/xenbus.h>
> diff --git a/xen-config-host.h b/xen-config-host.h
> index 818f25d..647f6be 100644
> --- a/xen-config-host.h
> +++ b/xen-config-host.h
> @@ -17,7 +17,7 @@ extern int domid, domid_backend;
>  #include <stdbool.h>
>  
>  #include "xenctrl.h"
> -#include "xs.h"
> +#include "xenstore.h"
>  #if !defined(CONFIG_STUBDOM) && !defined(__NetBSD__)
>  #include "blktaplib.h"
>  #endif

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-05-14 16:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 15:42 [PATCH] Rename public xenstore headers Bastian Blank
2012-04-16 15:51 ` Ian Campbell
2012-04-24 16:36   ` Ian Jackson
2012-05-11 16:49     ` Ian Campbell
2012-05-11 17:02       ` Bastian Blank
2012-05-11 17:07         ` Ian Jackson
2012-05-12  5:47           ` Ian Campbell
2012-05-14  8:34             ` Ian Campbell
2012-05-14 16:21               ` Ian Jackson
2012-05-14 16:24                 ` Ian Campbell
2012-04-25 10:22   ` Bastian Blank

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.