ia64/xen-unstable

changeset 5920:e2d635617acd

Don't unbind port when event channel binding fails.
This happens when xend tries to introduce the same domain twice.
Signed-off-by: Rusty Russel <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Jul 28 12:33:53 2005 +0000 (2005-07-28)
parents d24e1970c205
children 501a70f3ae96
files tools/xenstore/xenstored_domain.c
line diff
     1.1 --- a/tools/xenstore/xenstored_domain.c	Thu Jul 28 12:29:23 2005 +0000
     1.2 +++ b/tools/xenstore/xenstored_domain.c	Thu Jul 28 12:33:53 2005 +0000
     1.3 @@ -261,8 +261,8 @@ static struct domain *new_domain(void *c
     1.4  {
     1.5  	struct domain *domain;
     1.6  	domain = talloc(context, struct domain);
     1.7 +	domain->port = 0;
     1.8  	domain->domid = domid;
     1.9 -	domain->port = port;
    1.10  	domain->path = talloc_strdup(domain, path);
    1.11  	domain->page = xc_map_foreign_range(*xc_handle, domain->domid,
    1.12  					    getpagesize(),
    1.13 @@ -279,9 +279,10 @@ static struct domain *new_domain(void *c
    1.14  	domain->output = domain->page + getpagesize()/2;
    1.15  
    1.16  	/* Tell kernel we're interested in this event. */
    1.17 -	if (ioctl(eventchn_fd, EVENTCHN_BIND, domain->port) != 0)
    1.18 +	if (ioctl(eventchn_fd, EVENTCHN_BIND, port) != 0)
    1.19  		return NULL;
    1.20  
    1.21 +	domain->port = port;
    1.22  	domain->conn = new_connection(writechn, readchn);
    1.23  	domain->conn->domain = domain;
    1.24  	return domain;