tools/xenstore: don't let special watches be children of /
PATCH 1/1 tools/xenstore: don't let special watches be children of /
When firing special watches (e.g. "@releaseDomain"), they will be regarded to be valid children of the "/" node. So a domain having registered a watch for "/" and having the privilege to receive the special watches will receive those special watch events for the registered "/" watch.
Fix that by calling the related fire_watches() with the "exact" parameter set to true, causing a mismatch for the "/" node.
--- tools/xenstore/xenstored_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/xenstore/xenstored_domain.c +3 -3
@@ -231,7 +231,7 @@ static int destroy_domain(void *_domain)unmap_interface (domain->interface); } -fire_watches (NULL , domain,"@releaseDomain" ,NULL , false,NULL ); +fire_watches (NULL , domain,"@releaseDomain" ,NULL , true,NULL );wrl_domain_destroy (domain);
@@ -282,7 +282,7 @@ void check_domains(void) }if (notify) -fire_watches (NULL ,NULL ,"@releaseDomain" ,NULL , false,NULL ); +fire_watches (NULL ,NULL ,"@releaseDomain" ,NULL , true,NULL ); }/* We scan all domains rather than use the information given here. */
@@ -495,7 +495,7 @@ static struct domain *introduce_domain(const void *ctx,if (!is_master_domain && !restore)fire_watches (NULL , ctx,"@introduceDomain" ,NULL , - false,NULL ); + true,NULL ); }else {/* Use XS_INTRODUCE for recreating the xenbus event-channel. */ if (domain->port)
Signature · 1 line
2.34.1
Hi Juergen,
Quoted 10 lines · Juergen Gross
When firing special watches (e.g. "@releaseDomain"), they will be regarded to be valid children of the "/" node. So a domain having registered a watch for "/" and having the privilege to receive the special watches will receive those special watch events for the registered "/" watch.
Fix that by calling the related
fire_watches()with the "exact" parameter set to true, causing a mismatch for the "/" node.Reported-by Raphael Ning <[email protected]>
Can I ask you to use my Amazon email instead:
Sorry about the inconsistency. I work on Xen as part of my job, but I decided to use Gmail for posting on xen-devel, because I heard that it's a pain to make Amazon mail work properly with external mailing lists.
Quoted 28 lines
Signed-off-by Juergen Gross <[email protected]>--- tools/xenstore/xenstored_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/xenstore/xenstored_domain.c +2
-2@@ -231,7 +231,7 @@ static int destroy_domain(void *_domain)unmap_interface (domain->interface); } -fire_watches (NULL , domain,"@releaseDomain" ,NULL , false,NULL ); +fire_watches (NULL , domain,"@releaseDomain" ,NULL , true,NULL );wrl_domain_destroy (domain);@@ -282,7 +282,7 @@ void check_domains(void) }if (notify) -fire_watches (NULL ,NULL ,"@releaseDomain" ,NULL , false,NULL ); +fire_watches (NULL ,NULL ,"@releaseDomain" ,NULL , true,NULL ); }/* We scan all domains rather than use the information given here. */
tools/xenstore/xenstored_domain.c static struct domain *introduce_domain(const void *ctx, · line 501
Quoted 8 lines
tools/xenstore/xenstored_domain.c +1
-1@@ -495,7 +495,7 @@ static struct domain *introduce_domain(const void *ctx,if (!is_master_domain && !restore)fire_watches (NULL , ctx,"@introduceDomain" ,NULL , - false,NULL ); + true,NULL ); }else {/* Use XS_INTRODUCE for recreating the xenbus event-channel. */ if (domain->port)
Thanks, the patch looks good.
Raphael
Quoted 13 lines · Raphael Ning
Hi Juergen,
Quoted 9 lines · Juergen Gross
When firing special watches (e.g. "@releaseDomain"), they will be regarded to be valid children of the "/" node. So a domain having registered a watch for "/" and having the privilege to receive the special watches will receive those special watch events for the registered "/" watch.
Fix that by calling the related
fire_watches()with the "exact" parameter set to true, causing a mismatch for the "/" node.
Quoted 6 lines
Quoted 1 line
Reported-by Raphael Ning <[email protected]>Can I ask you to use my Amazon email instead:
Reported-by Raphael Ning <[email protected]>
Yes, of course.
Quoted 44 lines
Sorry about the inconsistency. I work on Xen as part of my job, but I decided to use Gmail for posting on xen-devel, because I heard that it's a pain to make Amazon mail work properly with external mailing lists.
Quoted 28 lines
Signed-off-by Juergen Gross <[email protected]>--- tools/xenstore/xenstored_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/xenstore/xenstored_domain.c +2
-2@@ -231,7 +231,7 @@ static int destroy_domain(void *_domain)unmap_interface (domain->interface); } -fire_watches (NULL , domain,"@releaseDomain" ,NULL , false,NULL ); +fire_watches (NULL , domain,"@releaseDomain" ,NULL , true,NULL );wrl_domain_destroy (domain);@@ -282,7 +282,7 @@ void check_domains(void) }if (notify) -fire_watches (NULL ,NULL ,"@releaseDomain" ,NULL , false,NULL ); +fire_watches (NULL ,NULL ,"@releaseDomain" ,NULL , true,NULL ); }/* We scan all domains rather than use the information given here. */ tools/xenstore/xenstored_domain.c static struct domain *introduce_domain(const void *ctx, · line 501
Quoted 8 lines
tools/xenstore/xenstored_domain.c +1
-1@@ -495,7 +495,7 @@ static struct domain *introduce_domain(const void *ctx,if (!is_master_domain && !restore)fire_watches (NULL , ctx,"@introduceDomain" ,NULL , - false,NULL ); + true,NULL ); }else {/* Use XS_INTRODUCE for recreating the xenbus event-channel. */ if (domain->port)Thanks, the patch looks good.
Quoted 1 line
Reviewed-by Raphael Ning <[email protected]>
Thanks,
Juergen