From a38f51516848c86fae75f295af8be1a50f96cabd Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 10 Mar 2026 14:45:42 +0100 Subject: [PATCH] domain: move vmtrace_alloc_buffer() invocation in vcpu_create() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The label used upon the function failing is wrong. Instead of correcting the label, move the invocation up a little, to also avoid it altogether for the idle domain (where ->vmtrace_size would be zero, and hence the function would bail right away anyway). Fixes: 217dd79ee292 ("xen/domain: Add vmtrace_size domain creation parameter") Reported-by: Roger Pau Monné Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné master commit: adfbdaa347d05e53c8c61ad00a6851bd5b82c760 master date: 2026-03-10 09:23:25 +0100 --- xen/common/domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 168f709423..77dacffd22 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -262,14 +262,14 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id) set_bit(_VPF_down, &v->pause_flags); vcpu_info_reset(v); init_waitqueue_vcpu(v); + + if ( vmtrace_alloc_buffer(v) != 0 ) + goto fail_wq; } if ( sched_init_vcpu(v) != 0 ) goto fail_wq; - if ( vmtrace_alloc_buffer(v) != 0 ) - goto fail_wq; - if ( arch_vcpu_create(v) != 0 ) goto fail_sched;