On 30.07.25 18:21, Anthony PERARD wrote:
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?

Okay.


+            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?

Yes, of course.


Thanks,

Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to