Hi Juergen, On 01/11/2022 15:28, Juergen Gross wrote:
When a domain has been recognized to have stopped, remove all its registered watches. This avoids sending watch events to the dead domain when all the nodes related to it are being removed by the Xen tools.
From my understanding, shutdown doesn't mean dead. It may be used during migration (or snapshotting), where we don't want to touch the state in case of a cancellation (or resume).
For instance, see the command XS_RESUME which will clear domain->shutdown.
Signed-off-by: Juergen Gross <jgr...@suse.com> --- tools/xenstore/xenstored_domain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index aa86892fed..1516df71d8 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -364,6 +364,12 @@ void check_domains(void) && !domain->shutdown) { domain->shutdown = true; notify = 1; + /* + * Avoid triggering watch events when the + * domain's nodes are being deleted. + */ + if (domain->conn) + conn_delete_all_watches(domain->conn); } if (!dominfo.dying) continue;
Cheers, -- Julien Grall