Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 747490

Summary: [virt-manager]virt-manager text console can hang if run Ctrl+C in guest when guest STDOUT
Product: Red Hat Enterprise Linux 6 Reporter: zhpeng
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: cwei, jwu, mshao, mzhan, rwu, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Prior to this update, the glib integration did not work correctly. As a consequence, serial consoles of virtual machines could stall when transferring large amounts of data. This update modifies the underlying code to allow the transfer of larger amounts of data without stalling.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 12:39:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
virt-manager debug message none

Description zhpeng 2011-10-20 03:13:55 UTC
Description of problem:
Console will hang if run Ctrl+C in guest when guest STDOUT


Version-Release number of selected component (if applicable):
libvirt-0.9.4-18.el6.x86_64
qemu-kvm-0.12.1.2-2.196.el6.x86_64
kernel-2.6.32-207.el6.x86_64
virt-manager-0.9.0-7.el6.x86_64

How reproducible:
30%

Steps to Reproduce:

1. prepare a guest with a serial. xml like:
<domain type='kvm'>
  <name>kvm2</name>
  <uuid>a326b9fd-3f86-12dd-f254-ccff7ff6fd8d</uuid>
  <memory>1024000</memory>
  <currentMemory>1024000</currentMemory>
  <vcpu current='1'>2</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.2.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/kvm2.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:72:c4:5a'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

2. add console=tty0 console=ttyS0,115200 to the guest kernel line.

3. open virt-manager and open the guest window. start the guest.
   click "View" --> "Text Consoles" shift the vnc and serial console make sure they are both work fine.

4. login in the guest run
   # cat /var/log/messages

5. Ctrl+C before "cat /var/log/messages" finished.

6. do several times of step4 and step5

7. press any key in guest theck if the console is hang.and  click "View" --> "Text Consoles" shift to the vnc to make sure the guest is fine.


in debug info:

there is no error in ~/.virt-manager/virt-manager.log

Actual results:
guest console is hang.


Expected results:
guest console will not hang.

Comment 1 zhpeng 2011-10-20 03:24:19 UTC
An additional info:
if you use # virsh console guest and do the step 4 and 5. the virsh console will not hang.

Comment 2 Cole Robinson 2011-12-09 22:07:04 UTC
Hmm, not being able to ctrl-c significantly reduces the usefulness of the text console.

Does restarting virt-manager fix the console hang? How about connecting to virsh console when virt-manager text connection is hung? Any error messages in the virt-manager --debug output?

Comment 3 Cole Robinson 2012-01-25 22:04:07 UTC
zhpeng, any info on the questions in comment #2?

Comment 4 zhpeng 2012-01-29 08:10:59 UTC
Created attachment 558127 [details]
virt-manager debug message

Comment 5 zhpeng 2012-01-29 08:16:29 UTC
(In reply to comment #2)
> Hmm, not being able to ctrl-c significantly reduces the usefulness of the text
> console.
> 
> Does restarting virt-manager fix the console hang? How about connecting to
> virsh console when virt-manager text connection is hung? Any error messages in
> the virt-manager --debug output?


Does restarting virt-manager fix the console hang?
Yes.

How about connecting to virsh console when virt-manager text connection is hung?
2 ways 2 results:

Case 1:
virt-manager text connection is hung. DO NOT CLOSE virt-manager.
I can connect virsh console, but input/output messages are not good like:
...
Escape character is ^]

-bash: asdf: com ~]# ot found
7 ~]# ]# -bash: asdf: command[root@dhcp-93-237 ~]# -bash: asdf: command not[root@dhcp-93-23ound7 ~]# -bash: sdf: command not f[root@dhcp-93-237 ~]# -b[ro-bash: f: command not found[root@dhcp-93-237 ~]# d not found
# 
...

Case 2:
virt-manager text connection is hung. CLOSE virt-manager.
I can connect virsh console, input/output messages are good.

Any error messages in the virt-manager --debug output?
PLS check the attachment.

Comment 7 Cole Robinson 2012-02-01 20:03:26 UTC
Fixed in virt-manager-0.9.0-8.el6

Comment 9 Daisy Wu 2012-02-10 11:05:54 UTC
This bug can be reproduced with:
virt-manager-0.9.0-7.el6.x86_64
kernel-2.6.32-220.el6.x86_64
libvirt-0.9.4-23.el6.x86_64
python-virtinst-0.600.0-5.el6.noarch

Verified with:
kernel-2.6.32-220.el6.x86_64
libvirt-0.9.10-0rc2.el6.x86_64
python-virtinst-0.600.0-7.el6.noarch
virt-manager-0.9.0-9.el6.x86_64

Steps:
1. Prepared a rhel6.2 guest:
# virsh dumpxml rhel6.2
<domain type='kvm' id='3'>
  <name>rhel6.2</name>
  <uuid>68cadd65-7868-df7c-e685-2745334c7bf4</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.2.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel6.2.img'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:21:47:9f'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c301,c803</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c301,c803</imagelabel>
  </seclabel>
</domain>

2. Add console=tty0 console=ttyS0,115200 to the guest kernel line.

3. Open virt-manager and open the guest window. start the guest.
   click "View" --> "Text Consoles" shift the vnc and serial console make sure
they are both work fine.

4. Login in the guest run
   # cat /var/log/messages

5. Ctrl+C before "cat /var/log/messages" finished.

6. Do 10+ times of step4 and step5

7. Guest works well and console not hang.

Changed the status to VERIFIED.

Comment 10 Cole Robinson 2012-06-12 15:40:30 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the glib integration did not work correctly. As a consequence, serial consoles of virtual machines could stall when transferring large amounts of data. This update modifies the underlying code to allow the transfer of larger amounts of data without stalling.

Comment 12 errata-xmlrpc 2012-06-20 12:39:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0785.html