aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console/daemon
diff options
context:
space:
mode:
authorjohn.levon@sun.com <john.levon@sun.com>2007-02-19 20:44:42 -0800
committerjohn.levon@sun.com <john.levon@sun.com>2007-02-19 20:44:42 -0800
commit90a79f7c6f0c60a6c7ebc955d2cb1cb9a7ebc792 (patch)
treea0afd7e048ccd1eb9546da028c965419c8dfce6f /tools/console/daemon
parentec08a094b2b6437406adab0f19cb89bf26c4f3ad (diff)
downloadxen-90a79f7c6f0c60a6c7ebc955d2cb1cb9a7ebc792.tar.gz
xen-90a79f7c6f0c60a6c7ebc955d2cb1cb9a7ebc792.tar.bz2
xen-90a79f7c6f0c60a6c7ebc955d2cb1cb9a7ebc792.zip
Xenconsoled should ignore spurious watch event. Otherwise, it can rebind to the same evtchn of a dying domU during suspending and cause below error message:
(XEN) event_channel.c:177:d0 EVTCHNOP failure: domain 0, error -22, line 177
Diffstat (limited to 'tools/console/daemon')
-rw-r--r--tools/console/daemon/io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 25ca40372f..ab8ce1280e 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -63,6 +63,7 @@ struct domain
char *conspath;
int ring_ref;
evtchn_port_t local_port;
+ evtchn_port_t remote_port;
int xce_handle;
struct xencons_interface *interface;
};
@@ -234,6 +235,9 @@ static int domain_create_ring(struct domain *dom)
if (err)
goto out;
+ if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port))
+ goto out;
+
if (ring_ref != dom->ring_ref) {
if (dom->interface != NULL)
munmap(dom->interface, getpagesize());
@@ -249,6 +253,7 @@ static int domain_create_ring(struct domain *dom)
}
dom->local_port = -1;
+ dom->remote_port = -1;
if (dom->xce_handle != -1)
xc_evtchn_close(dom->xce_handle);
@@ -270,6 +275,7 @@ static int domain_create_ring(struct domain *dom)
goto out;
}
dom->local_port = rc;
+ dom->remote_port = remote_port;
if (dom->tty_fd == -1) {
dom->tty_fd = domain_create_tty(dom);
@@ -279,6 +285,7 @@ static int domain_create_ring(struct domain *dom)
xc_evtchn_close(dom->xce_handle);
dom->xce_handle = -1;
dom->local_port = -1;
+ dom->remote_port = -1;
goto out;
}
}
@@ -336,6 +343,7 @@ static struct domain *create_domain(int domid)
dom->ring_ref = -1;
dom->local_port = -1;
+ dom->remote_port = -1;
dom->interface = NULL;
dom->xce_handle = -1;