[PATCH v2 04/19] tools/xenstore: remove all watches when a domain has stopped

Juergen Gross posted 19 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH v2 04/19] tools/xenstore: remove all watches when a domain has stopped
Posted by Juergen Gross 1 year, 11 months ago
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>
---
V2:
- move call to do_release() (Julien Grall)
---
 tools/xenstore/xenstored_domain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index aa86892fed..e669c89e94 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -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);
-- 
2.35.3
Re: [PATCH v2 04/19] tools/xenstore: remove all watches when a domain has stopped
Posted by Julien Grall 1 year, 11 months ago
Hi Juergen,

On 13/12/2022 16:00, Juergen Gross wrote:
> 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.

AFAICT, the only user of the command in the tree is softreset. Would you 
be able to check this is still working as expected?

> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - move call to do_release() (Julien Grall)
> ---
>   tools/xenstore/xenstored_domain.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
> index aa86892fed..e669c89e94 100644
> --- a/tools/xenstore/xenstored_domain.c
> +++ b/tools/xenstore/xenstored_domain.c
> @@ -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);

Cheers,

-- 
Julien Grall
Re: [PATCH v2 04/19] tools/xenstore: remove all watches when a domain has stopped
Posted by Juergen Gross 1 year, 10 months ago
On 20.12.22 20:01, Julien Grall wrote:
> Hi Juergen,
> 
> On 13/12/2022 16:00, Juergen Gross wrote:
>> 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.
> 
> AFAICT, the only user of the command in the tree is softreset. Would you be able 
> to check this is still working as expected?

Seems to work fine.


Juergen
Re: [PATCH v2 04/19] tools/xenstore: remove all watches when a domain has stopped
Posted by Julien Grall 1 year, 10 months ago
Hi Juergen,

On 11/01/2023 06:36, Juergen Gross wrote:
> On 20.12.22 20:01, Julien Grall wrote:
>> On 13/12/2022 16:00, Juergen Gross wrote:
>>> 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.
>>
>> AFAICT, the only user of the command in the tree is softreset. Would 
>> you be able to check this is still working as expected?
> 
> Seems to work fine.

Thanks for the confirmation! You can add my reviewed-by:

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall