]> xenbits.xensource.com Git - mini-os.git/commitdiff
add CONFIG_LIBXS item
authorJuergen Gross <jgross@suse.com>
Sun, 16 Jan 2022 06:45:27 +0000 (07:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 17 Jan 2022 10:55:47 +0000 (10:55 +0000)
Mini-OS contains a stripped down version of libxenstore in lib/xs.c.
Today it is being built always if CONFIG_XENBUS is set and libc
support is enabled.

In order to allow a Mini-OS specific build of libxenstore to be used
instead add a new CONFIG_LIBXS item which per default will have the
same setting as CONFIG_XENBUS. A user wanting to replace lib/xs.c
with libxenstore would just need to set CONFIG_XENBUS=y and
CONFIG_LIBXS=n.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Config.mk
Makefile
arch/x86/testbuild/all-no
arch/x86/testbuild/all-yes
arch/x86/testbuild/newxen-yes
lib/sys.c

index 1e08388145be6397c5f86a526c5d0c3324366a2a..03023033ccb1208aa9da37def56edb7d6409a8f2 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -171,7 +171,10 @@ endif
 # arch/*/testbuild/*-yes and arch/*/testbuild/*-no should set ALL possible
 # CONFIG_ variables.
 
-# Configuration defaults
+# Configuration defaults:
+# CONFIG-y contains all items defaulting to "y"
+# CONFIG-n contains all items defaulting to "n"
+# CONFIG-x contains all items being calculated if not set explicitly
 CONFIG-y += CONFIG_START_NETWORK
 CONFIG-y += CONFIG_SPARSE_BSS
 CONFIG-y += CONFIG_BLKFRONT
@@ -205,7 +208,10 @@ CONFIG-$(lwip) += CONFIG_LWIP
 $(foreach i,$(CONFIG-y),$(eval $(i) ?= y))
 $(foreach i,$(CONFIG-n),$(eval $(i) ?= n))
 
-CONFIG-all := $(CONFIG-y) $(CONFIG-n)
+CONFIG-x += CONFIG_LIBXS
+CONFIG_LIBXS ?= $(CONFIG_XENBUS)
+
+CONFIG-all := $(CONFIG-y) $(CONFIG-n) $(CONFIG-x)
 
 # Export config items as compiler directives
 $(foreach i,$(CONFIG-all),$(eval DEFINES-$($(i)) += -D$(i)))
index 06b60fc7f0b94d3c9be2b4e4ffad530d9aef4508..9f95d1977dd21f295c76197b6c53fcbfeb0c82ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ src-y += lib/stack_chk_fail.c
 src-y += lib/string.c
 src-y += lib/sys.c
 src-y += lib/xmalloc.c
-src-$(CONFIG_XENBUS) += lib/xs.c
+src-$(CONFIG_LIBXS) += lib/xs.c
 
 src-$(CONFIG_XENBUS) += xenbus/xenbus.c
 
index d6fc2608488708db04d26fd2580da7ad63100228..46f974deb9d21e7ec0a070ef3cf32d310e491793 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_FBFRONT = n
 CONFIG_KBDFRONT = n
 CONFIG_CONSFRONT = n
 CONFIG_XENBUS = n
+CONFIG_LIBXS = n
 CONFIG_LIBXENEVTCHN = n
 CONFIG_LIBXENGNTTAB = n
 CONFIG_LWIP = n
index 98bbfebfacc7d882f8728e5ffe185b219ed06fed..3ead12f19f1767b599331c26d2dfc05f9c6df29a 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_FBFRONT = y
 CONFIG_KBDFRONT = y
 CONFIG_CONSFRONT = y
 CONFIG_XENBUS = y
+CONFIG_LIBXS = y
 CONFIG_BALLOON = y
 CONFIG_USE_XEN_CONSOLE = y
 # The following are special: they need support from outside
index 06032004c67c15843a9452ece2a8b8cc2c2c9aa4..5c0b3c8008b355af88ae8689781626fd10f07ced 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_FBFRONT = y
 CONFIG_KBDFRONT = y
 CONFIG_CONSFRONT = y
 CONFIG_XENBUS = y
+CONFIG_LIBXS = y
 CONFIG_BALLOON = y
 CONFIG_USE_XEN_CONSOLE = y
 XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
index a66cf73b4b71f17c8a61fdb6b24d5cc8b08559da..98a4b888cce1fc0403b3e15573bfec5c5b44eab3 100644 (file)
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -523,7 +523,7 @@ int close(int fd)
     switch (file->type) {
         default:
             break;
-#ifdef CONFIG_XENBUS
+#ifdef CONFIG_LIBXS
        case FTYPE_XENBUS:
             xs_daemon_close((void*)(intptr_t) fd);
             break;
@@ -958,7 +958,7 @@ static int select_poll(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exce
                 n++;
            FD_CLR(i, exceptfds);
            break;
-#ifdef CONFIG_XENBUS
+#ifdef CONFIG_LIBXS
        case FTYPE_XENBUS:
            if (FD_ISSET(i, readfds)) {
                 if (files[i].dev)