From: Anthony PERARD <anthony@xenproject.org>
To: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org,
Anthony PERARD <anthony.perard@vates.tech>,
Nick Rosbrook <enr0n@ubuntu.com>,
George Dunlap <gwd@xenproject.org>,
Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH v2 7/7] tools: allow to limit xenstore features via guest config
Date: Wed, 30 Jul 2025 18:21:35 +0200 [thread overview]
Message-ID: <aIpGjxj2vyMwUTBi@l14> (raw)
In-Reply-To: <20250725131928.19286-8-jgross@suse.com>
On Fri, Jul 25, 2025 at 03:19:28PM +0200, Juergen Gross wrote:
> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
> index a61085ca3b..2a7923533f 100644
> --- a/tools/libs/light/libxl_dom.c
> +++ b/tools/libs/light/libxl_dom.c
> @@ -494,6 +494,18 @@ retry_transaction:
> if (!xs_transaction_end(ctx->xsh, t, 0))
> if (errno == EAGAIN)
> goto retry_transaction;
> +
> + if (info->xenstore_feature_mask != ~0U) {
> + unsigned int features;
> +
> + if (xs_get_features_supported(ctx->xsh, &features) &&
> + !xs_set_features_domain(ctx->xsh, domid,
> + features & info->xenstore_feature_mask)) {
> + LOG(ERROR, "Failed to set Xenstore features");
Surly xs_{get,set}* set errno on failure, and we know the domid, can you
use LOGED for the error message?
> + return ERROR_FAIL;
Unfortunately, this function does an allocation that isn't collected in
GC, `vm_path` is leaked. Could you replace that by `rc=ERROR_FAIL; goto
out;`, then place out: at the right place and return `rc` at the end of
the function?
> + }
> + }
> +
> xs_introduce_domain(ctx->xsh, domid, state->store_mfn, state->store_port);
> free(vm_path);
> return 0;
Thanks,
--
Anthony PERARD
next prev parent reply other threads:[~2025-07-30 16:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 13:19 [PATCH v2 0/7] tools: add support for domain specific Xenstore features Juergen Gross
2025-07-25 13:19 ` [PATCH v2 1/7] tools/libs/store: add get- and set-feature related functions Juergen Gross
2025-07-25 13:19 ` [PATCH v2 2/7] tools/xenstored: support specification of migration stream version Juergen Gross
2025-07-25 13:19 ` [PATCH v2 3/7] tools/xenstored: add missing migration record definitions Juergen Gross
2025-07-25 13:19 ` [PATCH v2 4/7] tools/xenstored: add server feature support Juergen Gross
2025-07-25 13:38 ` Jason Andryuk
2025-07-25 13:19 ` [PATCH v2 5/7] tools/xenstored: support SET/GET_FEATURE commands Juergen Gross
2025-07-25 13:19 ` [PATCH v2 6/7] tools/xl: add available Xenstore features to xl info output Juergen Gross
2025-07-30 16:02 ` Anthony PERARD
2025-07-25 13:19 ` [PATCH v2 7/7] tools: allow to limit xenstore features via guest config Juergen Gross
2025-07-25 14:33 ` Nick Rosbrook
2025-07-30 16:21 ` Anthony PERARD [this message]
2025-07-30 18:23 ` Jürgen Groß
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aIpGjxj2vyMwUTBi@l14 \
--to=anthony@xenproject.org \
--cc=anthony.perard@vates.tech \
--cc=enr0n@ubuntu.com \
--cc=gwd@xenproject.org \
--cc=jason.andryuk@amd.com \
--cc=jgross@suse.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.