From: Ian Campbell Subject: Re: [PATCH] Rename public xenstore headers Date: Fri, 11 May 2012 17:49:59 +0100 Message-ID: <1336754999.23818.144.camel@zakaz.uk.xensource.com> References: <20120416154210.GA6338@wavehammer.waldi.eu.org> <1334591484.14560.219.camel@zakaz.uk.xensource.com> <20374.54942.132249.434292@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-clOl9qCt3yG9yvqgPCDe" Return-path: In-Reply-To: <20374.54942.132249.434292@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Bastian Blank , "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org --=-clOl9qCt3yG9yvqgPCDe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit > > [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 . 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 # 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 Signed-off-by: Ian Campbell 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 #include #include -#include +#include #include #include 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 #include -#include +#include #include #include #include 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 #include #include -#include +#include #include #include #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 #include #include -#include +#include #include #include 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 #include #include -#include +#include #include #include #include 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 #include #include -#include +#include #include #include #include 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 #endif -#include "xs.h" +#include #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 +#include #include #include 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 #include -#include "xs.h" +#include 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 #include -#include +#include #include #include #include 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 #include -#include +#include #include #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 #include -#include +#include #include #include 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 -#include +#include #include #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 #include -#include +#include 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 #include -#include +#include #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 #include -#include "xs.h" +#include /** @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 #include #include -#include +#include #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 #include -#include +#include #include #include 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 #include -#include +#include #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 #include #include -#include +#include #include #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 #include #include -#include +#include /* #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 -#include +#include #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 +#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 +#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 #include #include -#include +#include #include 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 +#include #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 #include #include -#include +#include #include 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 #include -#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 #include @@ -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 #include #include -#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 #include #include -#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 #include #include -#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 #include #include -#include "xs_lib.h" +#include "xenstore_lib.h" #include "tdb.h" #include "talloc.h" #include "utils.h" --=-clOl9qCt3yG9yvqgPCDe Content-Disposition: attachment; filename="qemu-xs-compat.patch" Content-Type: text/x-patch; name="qemu-xs-compat.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 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,) --=-clOl9qCt3yG9yvqgPCDe Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=-clOl9qCt3yG9yvqgPCDe--