From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 1/3] tools/libxl: don't rely on xc_vcpu_setaffinity() returned cpumaps
Date: Wed, 1 Jul 2026 13:16:04 +0200 [thread overview]
Message-ID: <20260701111606.4063972-2-jgross@suse.com> (raw)
In-Reply-To: <20260701111606.4063972-1-jgross@suse.com>
In order to prepare for XEN_DOMCTL_setvcpuaffinity no longer returning
the effective affinity settings, use xc_vcpu_getaffinity() for getting
the effective affinities after having set them.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
tools/libs/light/libxl_sched.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/libs/light/libxl_sched.c b/tools/libs/light/libxl_sched.c
index 2d6635dae7..2f6a70aef5 100644
--- a/tools/libs/light/libxl_sched.c
+++ b/tools/libs/light/libxl_sched.c
@@ -69,6 +69,15 @@ static int libxl__set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid,
* is possible that Xen will use something different from what we asked
* for various reasons. If that's the case, report it.
*/
+ if ((cpumap_hard || cpumap_soft) &&
+ xc_vcpu_getaffinity(ctx->xch, domid, vcpuid,
+ cpumap_hard ? hard.map : NULL,
+ cpumap_soft ? soft.map : NULL,
+ flags & ~XEN_VCPUAFFINITY_FORCE)) {
+ LOGED(ERROR, domid, "Checking vcpu affinity");
+ rc = ERROR_FAIL;
+ goto out;
+ }
if (cpumap_hard &&
!libxl_bitmap_equal(cpumap_hard, &hard, 0))
LOGD(DEBUG, domid, "New hard affinity for vcpu %d has unreachable cpus", vcpuid);
--
2.54.0
next prev parent reply other threads:[~2026-07-01 11:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 11:16 [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface Juergen Gross
2026-07-01 11:16 ` Juergen Gross [this message]
2026-07-01 11:16 ` [PATCH 2/3] xen: don't let XEN_DOMCTL_setvcpuaffinity return the new affinities Juergen Gross
2026-07-01 11:16 ` [PATCH 3/3] tools/libxenctrl: rename parameters of xc_vcpu_setaffinity() Juergen Gross
2026-07-01 11:39 ` [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface Jan Beulich
2026-07-01 11:45 ` Andrew Cooper
2026-07-01 13:00 ` Jürgen Groß
2026-07-01 13:08 ` Jürgen Groß
2026-07-01 13:48 ` Jan Beulich
2026-07-01 14:19 ` Jürgen Groß
2026-07-01 15:34 ` Juergen Gross
2026-07-02 5:54 ` Jan Beulich
2026-07-02 6:13 ` Jürgen Groß
2026-07-02 6:25 ` Jan Beulich
2026-07-02 6:30 ` Juergen Gross
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=20260701111606.4063972-2-jgross@suse.com \
--to=jgross@suse.com \
--cc=anthony.perard@vates.tech \
--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.