<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 08/09/2011 06:04 AM, Dave Allan wrote:
    <blockquote cite="mid:20110808220449.GD4671@redhat.com" type="cite">
      <pre wrap="">I'm trying to write an example serial console implementation in python
(attached), but I'm having some trouble getting stream events to do
what I want.  The console itself works fine as long as the domain
stays up, but as soon as the domain shuts down the python script goes
into a tight loop repeatedly calling the stream event callback.
Debugging indicates that the stream event callback is being requested
to be removed, but it never actually is removed which makes me think I
am not properly releasing some resource, but I was under the
impression that an error on a stream resulting in the stream aborting
was supposed to free all the resources for me.  Is that not correct?

Thanks for any help anybody can provide,
Dave
</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
--
libvir-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a></pre>
    </blockquote>
           I tried it with rhel6u1 guest on rhel6u1 host,<br>
           there are two problems that causes the problems.<br>
    <br>
           One is the position of console=tty0 and console=ttyS0, 9600n8
    in grub.conf<br>
           It's ok for me using as follows:<br>
               kernel /vmlinuz-2.6.32-131.0.15.el6.x86_64 ro
    root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root
    rd_LVM_LV=VolGroup/lv_swap console=tty0 rhgb quiet
    console=ttyS0,9600n8<br>
    <br>
           The other one is to add a check to the value of
    "receivedData", <br>
           if it is "" string, stop the while loop by set run_console to
    False like it in stdin_callback function<br>
    <br>
           The tight loop caused by the continuous calling to
    virEventRunDefaultImpl()<br>
           when no data left in stream.<br>
    <br>
           I attached a modified copy of your scripts and tested it.<br>
    <br>
    <br>
          <br>
           <br>
  </body>
</html>