From: Rusty Russell Subject: [PATCH 7/11] Don't unbind port when event channel binding fails! This happens when xend tries to introduce the same domain twice, giving strange effects when xend restarts. Date: Thu, 04 Aug 2005 22:31:43 +1000 Message-ID: <1123158703.4372.19.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Rusty Russell # Node ID 3550a20343ba6762cfca9e43d38866b036363e32 # Parent b0de1894df67ac7c7d905bf61cdf0210b42752cc Don't unbind port when event channel binding fails! This happens when xend tries to introduce the same domain twice, giving strange effects when xend restarts. Signed-off-by: Rusty Russell diff -r b0de1894df67 -r 3550a20343ba tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c Thu Aug 4 11:39:03 2005 +++ b/tools/xenstore/xenstored_domain.c Thu Aug 4 11:41:51 2005 @@ -261,8 +261,8 @@ { struct domain *domain; domain = talloc(context, struct domain); + domain->port = 0; domain->domid = domid; - domain->port = port; domain->path = talloc_strdup(domain, path); domain->page = xc_map_foreign_range(*xc_handle, domain->domid, getpagesize(), @@ -279,9 +279,10 @@ domain->output = domain->page + getpagesize()/2; /* Tell kernel we're interested in this event. */ - if (ioctl(eventchn_fd, EVENTCHN_BIND, domain->port) != 0) + if (ioctl(eventchn_fd, EVENTCHN_BIND, port) != 0) return NULL; + domain->port = port; domain->conn = new_connection(writechn, readchn); domain->conn->domain = domain; return domain;