[PATCH] tools/libs/store: use single_with_domid() in xs_get_domain_path()

Juergen Gross posted 1 patch 4 days, 5 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250305085536.26311-1-jgross@suse.com
tools/libs/store/xs.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[PATCH] tools/libs/store: use single_with_domid() in xs_get_domain_path()
Posted by Juergen Gross 4 days, 5 hours ago
xs_get_domain_path() can be simplified by using single_with_domid().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/store/xs.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index e22f99b59f..cf3266807f 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -1345,11 +1345,7 @@ bool xs_resume_domain(struct xs_handle *h, unsigned int domid)
 
 char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)
 {
-	char domid_str[MAX_STRLEN(domid)];
-
-	snprintf(domid_str, sizeof(domid_str), "%u", domid);
-
-	return xs_single(h, XBT_NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
+	return single_with_domid(h, XS_GET_DOMAIN_PATH, domid);
 }
 
 bool xs_path_is_subpath(const char *parent, const char *child)
-- 
2.43.0
Re: [PATCH] tools/libs/store: use single_with_domid() in xs_get_domain_path()
Posted by Andrew Cooper 2 days, 18 hours ago
On 05/03/2025 8:55 am, Juergen Gross wrote:
> xs_get_domain_path() can be simplified by using single_with_domid().
>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>