Skip to contentSkip to conversation

console exit

PATCH New Kurt Garloff 1 participant 1 message Mar 13, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 console exit

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,

Signature · 3 lines
Kurt Garloff                   <[email protected]>             [Koeln, DE]
Physics:Plasma modeling <[email protected]> [TU Eindhoven, NL]
Linux: SUSE Labs (Director)    <[email protected]>            [Novell Inc]

From: Kurt Garloff <[email protected]>
Subject: Exit console rather than spin on domain exit

tools/python/xen/util/console_client.py +2 -0
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
@@ -36,6 +36,8 @@ def __recv_from_sock(sock):
             except os.error, error:
                 if error[0] != errno.EINTR:
                     raise
+	if len(data) == 0:
+	    sys.exit(0)
     os.wait()
 
 def __send_to_sock(sock):