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

Re: [MINIOS PATCH v3 5/5] add CONFIG_LIBXS item



Juergen Gross, le dim. 16 janv. 2022 07:45:27 +0100, a ecrit:
> 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>

> ---
> V3:
> - new patch
> ---
>  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 1e083881..03023033 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 06b60fc7..9f95d197 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 d6fc2608..46f974de 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 98bbfebf..3ead12f1 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 06032004..5c0b3c80 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 7be01fd3..e0ac5099 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)
> -- 
> 2.26.2
> 

-- 
Samuel
<s> bah, j'aime bien les feux d'artifices, mais j'ai peur de me prendre un 
boeing sur le coin de la gueule si je vais sur le pont de brooklyn
 -+- #ens-mim - 11 septembre forever -+-



 


Rackspace

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