From: Kouya Shimura Subject: [PATCH][TOOL] Fix infinite loop in xenconsoled Date: Tue, 14 Aug 2007 16:04:48 +0900 Message-ID: <7kodha8ulr.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NvOdHKzDGc" 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 --NvOdHKzDGc Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit xenconsoled hungs when domid=(DOMID_FIRST_RESERVED-1). (i.e. domid + 1 == DOMID_SELF) Attached patch fixes it. Thanks, Kouya Signed-off-by: Kouya Shimura --NvOdHKzDGc Content-Type: text/plain Content-Disposition: inline; filename="fix_infinite_loop.patch" Content-Transfer-Encoding: 7bit diff -r 7953164cebb6 tools/console/daemon/io.c --- a/tools/console/daemon/io.c Tue Aug 07 09:07:29 2007 +0100 +++ b/tools/console/daemon/io.c Tue Aug 14 15:36:23 2007 +0900 @@ -569,6 +569,8 @@ void enum_domains(void) create_domain(dominfo.domid); } domid = dominfo.domid + 1; + if (domid >= DOMID_FIRST_RESERVED) + break; } } diff -r 7953164cebb6 tools/libxc/xc_domain.c --- a/tools/libxc/xc_domain.c Tue Aug 07 09:07:29 2007 +0100 +++ b/tools/libxc/xc_domain.c Tue Aug 14 15:36:23 2007 +0900 @@ -205,6 +205,10 @@ int xc_domain_getinfo(int xc_handle, sizeof(xen_domain_handle_t)); next_domid = (uint16_t)domctl.domain + 1; + if (next_domid >= DOMID_FIRST_RESERVED) { + nr_doms++; + break; + } info++; } --NvOdHKzDGc Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --NvOdHKzDGc--