# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 8c2aa08789277490d6ff5ee3523a080d514c5570
# Parent 811559fb02ab1e1c5a7731895bd57ca7f9d6dbfe
xenstore fires @releaseDomain both when a domain shuts
down and when it eventually dies. xenconsoled now only
relinquishes its handle on a domain when it dies. This
allows us to 'xm console' connect to a crashed domain,
which is very useful!
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
diff -r 811559fb02ab -r 8c2aa0878927 .hgignore
--- a/.hgignore Mon Sep 26 15:31:33 2005
+++ b/.hgignore Mon Sep 26 17:49:21 2005
@@ -158,6 +158,7 @@
^tools/xenstore/xs_dom0_test$
^tools/xenstore/xs_random$
^tools/xenstore/xs_stress$
+^tools/xenstore/xs_tdb_dump$
^tools/xenstore/xs_test$
^tools/xenstore/xs_watch_stress$
^tools/xentrace/xenctx$
diff -r 811559fb02ab -r 8c2aa0878927 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Mon Sep 26 15:31:33 2005
+++ b/tools/console/daemon/io.c Mon Sep 26 17:49:21 2005
@@ -399,7 +399,7 @@
while (xc_domain_getinfo(xc, domid, 1, &dominfo) == 1) {
dom = lookup_domain(dominfo.domid);
- if (dominfo.dying || dominfo.crashed || dominfo.shutdown) {
+ if (dominfo.dying) {
if (dom)
shutdown_domain(dom);
} else {
diff -r 811559fb02ab -r 8c2aa0878927 tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c Mon Sep 26 15:31:33 2005
+++ b/tools/xenstore/xenstored_domain.c Mon Sep 26 17:49:21 2005
@@ -63,6 +63,8 @@
/* The connection associated with this. */
struct connection *conn;
+ /* Have we noticed that this domain is shutdown? */
+ int shutdown;
};
static LIST_HEAD(domains);
@@ -222,19 +224,25 @@
{
xc_dominfo_t dominfo;
struct domain *domain, *tmp;
- int released = 0;
+ int notify = 0;
list_for_each_entry_safe(domain, tmp, &domains, list) {
if (xc_domain_getinfo(*xc_handle, domain->domid, 1,
&dominfo) == 1 &&
- dominfo.domid == domain->domid &&
- !dominfo.dying && !dominfo.crashed && !dominfo.shutdown)
- continue;
+ dominfo.domid == domain->domid) {
+ if ((dominfo.crashed || dominfo.shutdown)
+ && !domain->shutdown) {
+ domain->shutdown = 1;
+ notify = 1;
+ }
+ if (!dominfo.dying)
+ continue;
+ }
talloc_free(domain->conn);
- released++;
- }
-
- if (released)
+ notify = 1;
+ }
+
+ if (notify)
fire_watches(NULL, "@releaseDomain", false);
}
@@ -272,6 +280,7 @@
struct domain *domain;
domain = talloc(context, struct domain);
domain->port = 0;
+ domain->shutdown = 0;
domain->domid = domid;
domain->path = talloc_strdup(domain, path);
domain->page = xc_map_foreign_range(*xc_handle, domain->domid,
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|