[PATCH] dom0less: Move single-xenstore check from bindings to set_xs_domain()

Alejandro Vallejo posted 1 patch 3 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250717142806.257597-1-alejandro.garciavallejo@amd.com
xen/common/device-tree/dom0less-build.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH] dom0less: Move single-xenstore check from bindings to set_xs_domain()
Posted by Alejandro Vallejo 3 months, 2 weeks ago
Later patches extract the bindings to a separate file, where that global
won't be available. Make the check when calling the function instead so
the bindings remain agnostic.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
 xen/common/device-tree/dom0less-build.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 87828d4d9d..0012046574 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -38,6 +38,9 @@ static bool __initdata need_xenstore;
 
 void __init set_xs_domain(struct domain *d)
 {
+    if ( xs_domid != DOMID_INVALID )
+        panic("Only 1 xenstore domain can be specified! (%u)", xs_domid);
+
     xs_domid = d->domain_id;
     set_global_virq_handler(d, VIRQ_DOM_EXC);
 }
@@ -876,10 +879,6 @@ void __init create_domUs(void)
 
             if ( val & DOMAIN_CAPS_XENSTORE )
             {
-                if ( xs_domid != DOMID_INVALID )
-                    panic("Only 1 xenstore domain can be specified! (%u)\n",
-                            xs_domid);
-
                 d_cfg.flags |= XEN_DOMCTL_CDF_xs_domain;
                 d_cfg.max_evtchn_port = -1;
             }

base-commit: 14d96bd64d8b82cb7666005221c90fb0c93785a8
-- 
2.43.0
Re: [PATCH] dom0less: Move single-xenstore check from bindings to set_xs_domain()
Posted by dmkhn@proton.me 3 months, 2 weeks ago
On Thu, Jul 17, 2025 at 04:28:05PM +0200, Alejandro Vallejo wrote:
> Later patches extract the bindings to a separate file, where that global
> won't be available. Make the check when calling the function instead so
> the bindings remain agnostic.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>

Reviewed-by: Denis Mukhin <dmukhin@ford.com> 

> ---
>  xen/common/device-tree/dom0less-build.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index 87828d4d9d..0012046574 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -38,6 +38,9 @@ static bool __initdata need_xenstore;
> 
>  void __init set_xs_domain(struct domain *d)
>  {
> +    if ( xs_domid != DOMID_INVALID )
> +        panic("Only 1 xenstore domain can be specified! (%u)", xs_domid);
> +
>      xs_domid = d->domain_id;
>      set_global_virq_handler(d, VIRQ_DOM_EXC);
>  }
> @@ -876,10 +879,6 @@ void __init create_domUs(void)
> 
>              if ( val & DOMAIN_CAPS_XENSTORE )
>              {
> -                if ( xs_domid != DOMID_INVALID )
> -                    panic("Only 1 xenstore domain can be specified! (%u)\n",
> -                            xs_domid);
> -
>                  d_cfg.flags |= XEN_DOMCTL_CDF_xs_domain;
>                  d_cfg.max_evtchn_port = -1;
>              }
> 
> base-commit: 14d96bd64d8b82cb7666005221c90fb0c93785a8
> --
> 2.43.0
> 
> 
Re: [PATCH] dom0less: Move single-xenstore check from bindings to set_xs_domain()
Posted by Jason Andryuk 3 months, 2 weeks ago
On 2025-07-17 10:28, Alejandro Vallejo wrote:
> Later patches extract the bindings to a separate file, where that global
> won't be available. Make the check when calling the function instead so
> the bindings remain agnostic.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>