]> xenbits.xensource.com Git - xen.git/commitdiff
tools/xenstore: remove all watches when a domain has stopped
authorJuergen Gross <jgross@suse.com>
Wed, 18 Jan 2023 09:50:01 +0000 (10:50 +0100)
committerJulien Grall <jgrall@amazon.com>
Fri, 20 Jan 2023 09:23:51 +0000 (09:23 +0000)
When a domain has been released by Xen tools, 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.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
tools/xenstore/xenstored_domain.c

index aa86892fed9ee062e7609503861839b7b609e741..e669c89e9440fc4853e2231e2342e31ab5e868c5 100644 (file)
@@ -740,6 +740,9 @@ int do_release(const void *ctx, struct connection *conn,
        if (IS_ERR(domain))
                return -PTR_ERR(domain);
 
+       /* Avoid triggering watch events when the domain's nodes are deleted. */
+       conn_delete_all_watches(domain->conn);
+
        talloc_free(domain->conn);
 
        send_ack(conn, XS_RELEASE);