mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@xensource.com>
This commit is contained in:
1 parent
f61d64c62e
commit
45dc6ad80a
3 files changed
+17
-7
No files matched your search
@@ -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$
|
||||
|
||||
@@ -399,7 +399,7 @@ void enum_domains(void)
|
||||
|
||||
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 {
|
||||
|
||||
@@ -63,6 +63,8 @@ struct domain
|
||||
/* 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 @@ static void domain_cleanup(void)
|
||||
{
|
||||
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++;
|
||||
notify = 1;
|
||||
}
|
||||
|
||||
if (released)
|
||||
if (notify)
|
||||
fire_watches(NULL, "@releaseDomain", false);
|
||||
}
|
||||
|
||||
@@ -272,6 +280,7 @@ static struct domain *new_domain(void *context, domid_t domid,
|
||||
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,
|
||||
|
||||