[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mini-os master] add CONFIG_LIBXS item



commit a91161eb0f92dac4ad6d41f91117268bc23ef28d
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Sun Jan 16 07:45:27 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Jan 17 10:55:47 2022 +0000

    add CONFIG_LIBXS item
    
    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@xxxxxxxx>
    Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 Config.mk                     | 10 ++++++++--
 Makefile                      |  2 +-
 arch/x86/testbuild/all-no     |  1 +
 arch/x86/testbuild/all-yes    |  1 +
 arch/x86/testbuild/newxen-yes |  1 +
 lib/sys.c                     |  4 ++--
 6 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1e08388..0302303 100644
--- 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)))
diff --git a/Makefile b/Makefile
index 06b60fc..9f95d19 100644
--- 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
 
diff --git a/arch/x86/testbuild/all-no b/arch/x86/testbuild/all-no
index d6fc260..46f974d 100644
--- a/arch/x86/testbuild/all-no
+++ b/arch/x86/testbuild/all-no
@@ -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
diff --git a/arch/x86/testbuild/all-yes b/arch/x86/testbuild/all-yes
index 98bbfeb..3ead12f 100644
--- a/arch/x86/testbuild/all-yes
+++ b/arch/x86/testbuild/all-yes
@@ -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
diff --git a/arch/x86/testbuild/newxen-yes b/arch/x86/testbuild/newxen-yes
index 0603200..5c0b3c8 100644
--- a/arch/x86/testbuild/newxen-yes
+++ b/arch/x86/testbuild/newxen-yes
@@ -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__
diff --git a/lib/sys.c b/lib/sys.c
index a66cf73..98a4b88 100644
--- 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)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.