ia64/xen-unstable

changeset 14017:919879a49266

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
author john.levon@sun.com
date Mon Feb 19 20:44:42 2007 -0800 (2007-02-19)
parents 89ca591a2c21
children 832b252f1f6f
files tools/console/daemon/io.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Mon Feb 19 20:44:42 2007 -0800
     1.2 +++ b/tools/console/daemon/io.c	Mon Feb 19 20:44:42 2007 -0800
     1.3 @@ -63,6 +63,7 @@ struct domain
     1.4  	char *conspath;
     1.5  	int ring_ref;
     1.6  	evtchn_port_t local_port;
     1.7 +	evtchn_port_t remote_port;
     1.8  	int xce_handle;
     1.9  	struct xencons_interface *interface;
    1.10  };
    1.11 @@ -234,6 +235,9 @@ static int domain_create_ring(struct dom
    1.12  	if (err)
    1.13  		goto out;
    1.14  
    1.15 +	if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port))
    1.16 +		goto out;
    1.17 +
    1.18  	if (ring_ref != dom->ring_ref) {
    1.19  		if (dom->interface != NULL)
    1.20  			munmap(dom->interface, getpagesize());
    1.21 @@ -249,6 +253,7 @@ static int domain_create_ring(struct dom
    1.22  	}
    1.23  
    1.24  	dom->local_port = -1;
    1.25 +	dom->remote_port = -1;
    1.26  	if (dom->xce_handle != -1)
    1.27  		xc_evtchn_close(dom->xce_handle);
    1.28  
    1.29 @@ -270,6 +275,7 @@ static int domain_create_ring(struct dom
    1.30  		goto out;
    1.31  	}
    1.32  	dom->local_port = rc;
    1.33 +	dom->remote_port = remote_port;
    1.34  
    1.35  	if (dom->tty_fd == -1) {
    1.36  		dom->tty_fd = domain_create_tty(dom);
    1.37 @@ -279,6 +285,7 @@ static int domain_create_ring(struct dom
    1.38  			xc_evtchn_close(dom->xce_handle);
    1.39  			dom->xce_handle = -1;
    1.40  			dom->local_port = -1;
    1.41 +			dom->remote_port = -1;
    1.42  			goto out;
    1.43  		}
    1.44  	}
    1.45 @@ -336,6 +343,7 @@ static struct domain *create_domain(int 
    1.46  
    1.47  	dom->ring_ref = -1;
    1.48  	dom->local_port = -1;
    1.49 +	dom->remote_port = -1;
    1.50  	dom->interface = NULL;
    1.51  	dom->xce_handle = -1;
    1.52