John Levon
2007-Feb-09 14:13 UTC
[Xen-devel] [PATCH] xenconsoled: ignore spurious watch event
# HG changeset patch
# User max.zhen@sun.com
# Date 1171024588 28800
# Node ID a2d15838ea72ee049d8a657e9ecd406b5c6cb53e
# Parent d609929f140809ec1c9a059f2eeaffb7ce56c891
Xenconsoled should ignore spurious watch event. Otherwise, xenconsoled could
bind to a dying domU during its suspending and cause complaint from Xen:
(XEN) event_channel.c:177:d0 EVTCHNOP failure: domain 0, error -22, line 177
Signed-off-by: Max Zhen <max.zhen@sun.com>
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
--- 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 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 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 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 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
dom->ring_ref = -1;
dom->local_port = -1;
+ dom->remote_port = -1;
dom->interface = NULL;
dom->xce_handle = -1;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Maybe Matching Threads
- [PATCH] 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:
- [PATCH] xenconsoled: use grant references instead of map_foreign_range
- [PATCH v2 1/2] xenconsoled: use grant references instead of map_foreign_range
- Re: [Xen-changelog] New console transport and update xenconsoled.
- [PATCH] [resend] xen-access: Check return values and clean up on errors during init
