direct-io.hg

changeset 11459:98fcd017c5f3

[CONSOLED] Shouldn't call domain_create_ring() for a domU which is shutting down.
There is a race condition between domain_create_ring() and the removal
of the domU entry from xenstore. If the removal of the domU entry from xenstore
comes later than the first xs_gather() call in domain_create_ring(), it will go
on and bind the evtchn port to the dying domU, which will cause below error
message: (XEN) (file=event_channel.c, line=144) EVTCHNOP failure: domain 0, error -22, line 144

Signed-off-by: Max Zhen <max.zhen@sun.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 13 14:01:23 2006 +0100 (2006-09-13)
parents b7f763a8a7ef
children 1ece34466781
files tools/console/daemon/io.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Wed Sep 13 13:54:59 2006 +0100
     1.2 +++ b/tools/console/daemon/io.c	Wed Sep 13 14:01:23 2006 +0100
     1.3 @@ -293,12 +293,14 @@ static bool watch_domain(struct domain *
     1.4  	bool success;
     1.5  
     1.6  	sprintf(domid_str, "dom%u", dom->domid);
     1.7 -	if (watch)
     1.8 +	if (watch) {
     1.9  		success = xs_watch(xs, dom->conspath, domid_str);
    1.10 -	else
    1.11 +		if (success)
    1.12 +			domain_create_ring(dom);
    1.13 +	} else {
    1.14  		success = xs_unwatch(xs, dom->conspath, domid_str);
    1.15 -	if (success)
    1.16 -		domain_create_ring(dom);
    1.17 +	}
    1.18 +
    1.19  	return success;
    1.20  }
    1.21