From: Kurt Garloff Subject: [PATCH] console exit Date: Sun, 13 Mar 2005 19:16:31 +0100 Message-ID: <20050313181631.GD11594@tpkurt.garloff.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0rSojgWGcpz+ezC3" Content-Disposition: inline Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Xen development list List-Id: xen-devel@lists.xenproject.org --0rSojgWGcpz+ezC3 Content-Type: multipart/mixed; boundary="Qz2CZ664xQdCRdPu" Content-Disposition: inline --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, in xen-2.0-testing, when a domain exits and you have a console attached to it from domain 0, you'll get 100% CPU usage as you're console is looping reading 0 bytes. Attached patch makes the console exit when this happens. It spits a few ugly error messages, but this is better than eating CPU. Regards, --=20 Kurt Garloff [Koeln, DE] Physics:Plasma modeling [TU Eindhoven, NL] Linux: SUSE Labs (Director) [Novell Inc] --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-console-exit.diff" Content-Transfer-Encoding: quoted-printable =46rom: Kurt Garloff Subject: Exit console rather than spin on domain exit Signed-off-by: Kurt Garloff diff -uNrp xen-2.0-testing/tools/python/xen/util/console_client.py xen-2.0-= testing.exit/tools/python/xen/util/console_client.py --- xen-2.0-testing/tools/python/xen/util/console_client.py 2005-03-08 11:2= 0:38.000000000 +0100 +++ xen-2.0-testing.exit/tools/python/xen/util/console_client.py 2005-03-08= 11:19:47.000000000 +0100 @@ -36,6 +36,8 @@ def __recv_from_sock(sock): except os.error, error: if error[0] !=3D errno.EINTR: raise + if len(data) =3D=3D 0: + sys.exit(0) os.wait() =20 def __send_to_sock(sock): --Qz2CZ664xQdCRdPu-- --0rSojgWGcpz+ezC3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCNIN/xmLh6hyYd04RAhmXAJ9FKituZErEy7iw8xKqYbrMTv3YWQCfbqQb N/pPm0uJzhf5cOX0K2lZ0Bs= =BsiH -----END PGP SIGNATURE----- --0rSojgWGcpz+ezC3-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click