WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xenstored: Guarantee to fire @releaseDoma

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenstored: Guarantee to fire @releaseDomain watch when a domain is destructed.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jul 2007 03:19:48 -0700
Delivery-date: Fri, 27 Jul 2007 03:17:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1185285005 -3600
# Node ID eff24408830c5356b130318565c4e7f8abf16070
# Parent  531b8ccda9732e521ea96b4d0a6b6d58b8981149
xenstored: Guarantee to fire @releaseDomain watch when a domain is destructed.
Previously this would be missed on some bail paths within xenstored
which would talloc_free() the connection.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstored_domain.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r 531b8ccda973 -r eff24408830c tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c Tue Jul 24 11:10:08 2007 +0100
+++ b/tools/xenstore/xenstored_domain.c Tue Jul 24 14:50:05 2007 +0100
@@ -174,6 +174,8 @@ static int destroy_domain(void *_domain)
 
        if (domain->interface)
                munmap(domain->interface, getpagesize());
+
+       fire_watches(NULL, "@releaseDomain", false);
 
        return 0;
 }
@@ -197,7 +199,7 @@ static void domain_cleanup(void)
                                continue;
                }
                talloc_free(domain->conn);
-               notify = 1;
+               notify = 0; /* destroy_domain() fires the watch */
        }
 
        if (notify)
@@ -246,7 +248,6 @@ static struct domain *new_domain(void *c
 {
        struct domain *domain;
        int rc;
-
 
        domain = talloc(context, struct domain);
        domain->port = 0;
@@ -361,7 +362,7 @@ void do_introduce(struct connection *con
                /* Now domain belongs to its connection. */
                talloc_steal(domain->conn, domain);
 
-               fire_watches(conn, "@introduceDomain", false);
+               fire_watches(NULL, "@introduceDomain", false);
        } else if ((domain->mfn == mfn) && (domain->conn != conn)) {
                /* Use XS_INTRODUCE for recreating the xenbus event-channel. */
                if (domain->port)
@@ -413,8 +414,6 @@ void do_release(struct connection *conn,
        }
 
        talloc_free(domain->conn);
-
-       fire_watches(conn, "@releaseDomain", false);
 
        send_ack(conn, XS_RELEASE);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenstored: Guarantee to fire @releaseDomain watch when a domain is destructed., Xen patchbot-unstable <=