[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improper handling of fast-resumed domains by O/Cxenstored


  • To: Jürgen Groß <jgross@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrii Sultanov <andriy.sultanov@xxxxxxxxxx>
  • Date: Wed, 8 Jul 2026 14:45:44 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Delivery-date: Wed, 08 Jul 2026 13:46:10 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 7/7/26 14:53, Jürgen Groß wrote:

> In fact this is a hypervisor issue. In __domain_finalise_shutdown() 
> the call
> of domain_changed_state() should only happen if 
> send_global_virq(VIRQ_DOM_EXC)
> is done.
>
> Could you please test whether the following diff is helping?
>
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index 53ac1d6c40..a4d9095c20 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -286,11 +286,12 @@ static void __domain_finalise_shutdown(struct 
> domain *d)
>              return;
>
>      d->is_shut_down = 1;
> -    domain_changed_state(d);
>      if ( (d->shutdown_code == SHUTDOWN_suspend) && d->suspend_evtchn )
>          evtchn_send(d, d->suspend_evtchn);
> -    else
> +    else {
> +        domain_changed_state(d);
>          send_global_virq(VIRQ_DOM_EXC);
> +    }
>  }
>
>  static void vcpu_check_shutdown(struct vcpu *v)
>
>
>
> Juergen
It does look like the above patch is needed.

But even with it:

     1) toolstacks should register suspend_evtchn for all domains
        (xapi currently does not register it for any domains)
     AND
     2) both xenstoreds should use xenmanage_poll_changed_domain
        (oxenstored still hasn't integrated xenmanage)

Otherwise a VIRQ_DOM_EXC on a shutdown (shutdown_code != SHUTDOWN_suspend)
domain will force xenstored to check all the domains and to tear down the
suspended domain which did not send out the VIRQ.

Given that xenmanage is only available on 4.21+, it seems like an easier
solution would be to just skip SHUTDOWN_suspend domains in the 
check_domains()
loop (I don't believe we'd miss sending out a @releaseDomain event, another
VIRQ should be sent out on domain destruction). I'll probably integrate this
hacky fix into the older version I'm working with (4.17.6) and start work on
the proper solution long-term.

Thank you!
Andrii



--
Andriy Sultanov | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.