[PATCH v4 12/12] tools/xenstored: Remove hardcoded implicit path

Jason Andryuk posted 12 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v4 12/12] tools/xenstored: Remove hardcoded implicit path
Posted by Jason Andryuk 3 months, 1 week ago
Update get_implicit_path to return the correct value for a non-dom0
xenstored domain.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index f1527a6db7..ae59b6e60b 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1238,11 +1238,13 @@ static int close_xgt_handle(void *_handle)
 	return 0;
 }
 
+static char store_domain_path[] = "/local/domain/65535";
+
 /* Returns the implicit path of a connection (only domains have this) */
 const char *get_implicit_path(const struct connection *conn)
 {
 	if (!conn->domain)
-		return "/local/domain/0";
+		return store_domain_path;
 	return conn->domain->path;
 }
 
@@ -1309,6 +1311,9 @@ void init_domains(void)
 		}
 	}
 
+	snprintf(store_domain_path, sizeof(store_domain_path),
+		 "/local/domain/%u", store_domid);
+
 	for (unsigned int i = 0; i < nr_domids; i++) {
 		evtchn_port_t port;
 		struct domain *domain;
-- 
2.50.1
Re: [PATCH v4 12/12] tools/xenstored: Remove hardcoded implicit path
Posted by Jürgen Groß 3 months, 1 week ago
On 25.07.25 04:28, Jason Andryuk wrote:
> Update get_implicit_path to return the correct value for a non-dom0
> xenstored domain.
> 
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen