ia64/xen-unstable

changeset 6664:513ba63787fe

Add @releaseDomain watch-event.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 06 18:15:06 2005 +0000 (2005-09-06)
parents 7c269dd2cf1f
children 0922c82a4bf3
files tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_watch.c
line diff
     1.1 --- a/tools/xenstore/xenstored_domain.c	Tue Sep 06 18:14:31 2005 +0000
     1.2 +++ b/tools/xenstore/xenstored_domain.c	Tue Sep 06 18:15:06 2005 +0000
     1.3 @@ -360,6 +360,9 @@ void do_release(struct connection *conn,
     1.4  	}
     1.5  
     1.6  	talloc_free(domain->conn);
     1.7 +
     1.8 +	fire_watches(NULL, "@releaseDomain", false);
     1.9 +
    1.10  	send_ack(conn, XS_RELEASE);
    1.11  }
    1.12  
    1.13 @@ -367,6 +370,7 @@ void domain_cleanup(void)
    1.14  {
    1.15  	xc_dominfo_t dominfo;
    1.16  	struct domain *domain, *tmp;
    1.17 +	int released = 0;
    1.18  
    1.19  	list_for_each_entry_safe(domain, tmp, &domains, list) {
    1.20  		if (xc_domain_getinfo(*xc_handle, domain->domid, 1,
    1.21 @@ -375,7 +379,11 @@ void domain_cleanup(void)
    1.22  		    !dominfo.dying && !dominfo.crashed && !dominfo.shutdown)
    1.23  			continue;
    1.24  		talloc_free(domain->conn);
    1.25 +		released++;
    1.26  	}
    1.27 +
    1.28 +	if (released)
    1.29 +		fire_watches(NULL, "@releaseDomain", false);
    1.30  }
    1.31  
    1.32  void do_get_domain_path(struct connection *conn, const char *domid_str)
     2.1 --- a/tools/xenstore/xenstored_watch.c	Tue Sep 06 18:14:31 2005 +0000
     2.2 +++ b/tools/xenstore/xenstored_watch.c	Tue Sep 06 18:15:06 2005 +0000
     2.3 @@ -132,7 +132,7 @@ void fire_watches(struct connection *con
     2.4  	struct watch *watch;
     2.5  
     2.6  	/* During transactions, don't fire watches. */
     2.7 -	if (conn->transaction)
     2.8 +	if (conn && conn->transaction)
     2.9  		return;
    2.10  
    2.11  	/* Create an event for each watch.  Don't send to self. */