Bug 682184 - Two virtio-consoles don't work
Summary: Two virtio-consoles don't work
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Amit Shah
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 580953
TreeView+ depends on / blocked
 
Reported: 2011-03-04 11:31 UTC by juzhang
Modified: 2014-06-10 12:43 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-10 12:43:23 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 744681 0 medium CLOSED virtio_console failed to init console to /dev/hvc0 or /dev/vport* after module reload 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 963596 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 744681 963596

Description juzhang 2011-03-04 11:31:30 UTC
Description of problem:
console IO doesn't work

Version-Release number of selected component (if applicable):
Host kernel:
#uname -r
2.6.32-118.el6.x86_64
Qemu-kvm version
#qemu-kvm-0.12.1.2-2.149.el6.x86_64
Guest kernel:
#uname -r
2.6.32-118.el6.x86_64
2/2

How reproducible:


Steps to Reproduce:
1.boot guest two configured console ports
 /usr/libexec/qemu-kvm -m 2G -smp 4 -drive file=/root/zhangjunyi/rhel6.1-ide.qcow2,if=none,id=test,cache=none,format=qcow2,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -cpu qemu64,+sse2,+x2apic -boot c -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=22:11:22:45:66:95 -vnc :11 
/
-device virtio-serial-pci,id=ser0,max_ports=2 -chardev socket,path=/tmp/foo,server,nowait,id=foo -chardev socket,path=/tmp/bar,server,nowait,id=bar -device virtconsole,bus=ser0.0,chardev=foo,name=org.fedoraproject.console.foo,id=zhang1 -device virtconsole,bus=ser0.0,chardev=bar,name=org.fedoraproject.console.bar,id=zhang2
 -qmp tcp:0:4444,server,nowait -monitor stdio
2.In guest
2.1 setenforce 0
2.2 shoudown firewall
2.3 agetty /dev/hvc0 9600 vt100
2.4 agetty /dev/hvc1 9600 vt100
3.in host
3.1 setenforce 0
3.2 shoudown firewall
3.3 socat /tmp/foo -
3.4 socat /tmp/bar -

Actual results:
console IO doesn't work,didn't get the two console terminals. 


Expected results:
should get the two console terminals.


Additional info:

Comment 2 Amit Shah 2011-03-08 08:16:11 UTC
A few questions:

* Does hitting 'enter' in the host socat programs give some output?
* If not, do you have /etc/securetty and /etc/event.d flies configured for hvc IO?
* Does IO work in any other case?

Comment 3 juzhang 2011-03-09 10:05:55 UTC
(In reply to comment #2)
> A few questions:

> * If not, do you have /etc/securetty and /etc/event.d flies configured for hvc
> IO?
No

I tried this again after configure hvc0 in /etc/securetty
#cat /etc/securetty | grep hvc0
hvc0

In Host
#agetty /dev/hvc1 9600 vt100
#/dev/hvc0 9600 vt100

In guest
Just can input password,after input password.

#socat /tmp/bar -

Red Hat Enterprise Linux Server release 6.0 (Santiago)
Kernel 2.6.32-118.el6.x86_64 on an x86_64
dhcp-91-86.nay.redhat.com.englab.nay.redhat.com login: root
ls

#socat /tmp/foo -

Red Hat Enterprise Linux Server release 6.0 (Santiago)
Kernel 2.6.32-118.el6.x86_64 on an x86_64

dhcp-91-86.nay.redhat.com.englab.nay.redhat.com login: root
root
ls

re-observe in host
#agetty /dev/hvc1 9600 vt100
Connection to 10.66.91.86 closed.
# agetty /dev/hvc0 9600 vt100
Connection to 10.66.91.86 closed.

Didn't find exceptional logs in serial console and /var/log/messages

Comment 4 Golita Yue 2011-07-12 09:59:34 UTC
This bug can be reproduced in:
host:  
   qemu-kvm-0.12.1.2-2.169.el6.x86_64   
   kernel 2.6.32-166.el6.x86_64
guest:
   kernel 2.6.32-167.el6.x86_64

Comment 6 Amit Shah 2011-12-09 10:41:36 UTC
This might be a bug in the hvc code that is being discussed upstream.  Will backport when it is merged upstream.

https://lkml.org/lkml/2011/11/8/430

Comment 9 Ronen Hod 2012-07-23 10:47:39 UTC
If a single console works then we prefer to close this bug, since two consoles are not really needed.

Comment 10 Chao Yang 2012-07-24 12:04:50 UTC
(In reply to comment #9)
> If a single console works then we prefer to close this bug, since two
> consoles are not really needed.

I tried many times on qemu-kvm-0.12.1.2-2.295.el6.x86_64, 2.6.32-279.el6.x86_64(both host and guest).
 
Failed even with a single console. What interesting is:
1. sometimes, a single console works, sometimes not
2. sometimes, two consoles work, sometimes only one console works, the other one fails either doesn't prompt to input password or complains incorrect login

What more interesting is, 
1. boot with a single console, open a terminal then run 'agetty /dev/hvc0 9600 vt100', *wait for several minutes*, setup connection on host by nc, always sucessful to login.

Is there any possibility that race happens?

Comment 13 Amit Shah 2013-05-17 05:25:53 UTC
(In reply to comment #10)
 
> What more interesting is, 
> 1. boot with a single console, open a terminal then run 'agetty /dev/hvc0
> 9600 vt100', *wait for several minutes*, setup connection on host by nc,
> always sucessful to login.

This is very interesting (kudos for finding it!); do both the console always work if you wait several minutes and then connect the host side?

Comment 14 Chao Yang 2013-05-21 10:16:42 UTC
(In reply to Amit Shah from comment #13)
> (In reply to comment #10)
>  
> > What more interesting is, 
> > 1. boot with a single console, open a terminal then run 'agetty /dev/hvc0
> > 9600 vt100', *wait for several minutes*, setup connection on host by nc,
> > always sucessful to login.
> 
> This is very interesting (kudos for finding it!); do both the console always
> work if you wait several minutes and then connect the host side?

No. It always failed if booting with two virtconsole. 
1. run below commands in parallel
  agetty /dev/hvc0 9600 vt100
  agetty /dev/hvc1 9600 vt100
2. login guest through 1st socket in host by nc
3. wait for several minutes
4. login guest through 2nd then

Sometimes, the 1st login was successful but 2nd login failed. Sometimes, both login failed without Password prompt. 

version of qemu-kvm:
qemu-kvm-0.12.1.2-2.369.el6.x86_64

CLI:
/usr/libexec/qemu-kvm -name test -M rhel6.5.0 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -drive file=/home/rhel6.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:22:ab,bus=pci.0 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0 -chardev socket,id=charchannel0,path=/tmp/socket-1,server,nowait -device virtconsole,bus=virtio-serial0.0,chardev=charchannel0,id=channel0,name=com.redhat.1 -vnc :1 -k en-us -vga cirrus -monitor stdio -serial unix:/tmp/serial,server,nowait


Note You need to log in before you can comment on or make changes to this bug.