Bug 1301830

Summary: Key event queue full when input through keyboard after boot vm
Product: Red Hat Enterprise Linux 7 Reporter: jingzhao <jinzhao>
Component: qemu-kvm-rhevAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED WORKSFORME QA Contact: hachen <hachen>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: ailan, chayang, coli, hachen, huding, jinzhao, juzhang, knoel, kraxel, michen, mkenneth, rbalakri, virt-bugs, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1293234 Environment:
Last Closed: 2017-02-03 08:01:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1293234    
Bug Blocks:    

Comment 1 jingzhao 2016-01-26 05:19:46 UTC
Reproduced on kernel-3.10.0-327.10.1.el7.x86_64 and qemu-kvm-rhev-2.3.0-31.el7_2.7.x86_64 with win10 guest 

Another info:

Gerd, following is the usb info which boot vm and the info which re-add the usb-keyboard. 

(qemu) info usb
  Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB MSD
  Device 0.1, Port 2, Speed 12 Mb/s, Product QEMU USB Hub
  Device 0.1, Port 3, Speed 1.5 Mb/s, Product CS-1734A V4.2.418
  Device 0.2, Port 4, Speed 480 Mb/s, Product QEMU USB Keyboard
  Device 0.3, Port 5, Speed 480 Mb/s, Product QEMU USB Mouse
  Device 0.4, Port 6, Speed 480 Mb/s, Product QEMU USB Tablet
  Device 0.2, Port 2.1, Speed 12 Mb/s, Product QEMU USB CCID
(qemu) dev
device_add  device_del  
(qemu) device_del kbd1 
(qemu) info usb
  Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB MSD
  Device 0.1, Port 2, Speed 12 Mb/s, Product QEMU USB Hub
  Device 0.1, Port 3, Speed 1.5 Mb/s, Product CS-1734A V4.2.418
  Device 0.3, Port 5, Speed 480 Mb/s, Product QEMU USB Mouse
  Device 0.4, Port 6, Speed 480 Mb/s, Product QEMU USB Tablet
  Device 0.2, Port 2.1, Speed 12 Mb/s, Product QEMU USB CCID
(qemu) ehci warning: guest updated active QH

(qemu) dev
device_add  device_del  
(qemu) device_add usb-kbd,id=kbd1,serial=1111
(qemu) info usb
  Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB MSD
  Device 0.1, Port 2, Speed 12 Mb/s, Product QEMU USB Hub
  Device 0.1, Port 3, Speed 1.5 Mb/s, Product CS-1734A V4.2.418
  Device 0.3, Port 5, Speed 480 Mb/s, Product QEMU USB Mouse
  Device 0.4, Port 6, Speed 480 Mb/s, Product QEMU USB Tablet
  Device 0.2, Port 2.1, Speed 12 Mb/s, Product QEMU USB CCID
  Device 0.3, Port 2.2, Speed 12 Mb/s, Product QEMU USB Keyboard

Comment 3 Gerd Hoffmann 2017-01-10 09:17:22 UTC
Can you re-test with qemu-2.8 and a fresh windows install please?

Comment 4 hachen 2017-01-20 09:15:48 UTC
It works correctly.

I have tried win10_64 guest twice with:
3.10.0-541.el7.x86_64
qemu-kvm-rhev-2.8.0-2.el7.x86_64

/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1'  \
    -sandbox off  \
    -machine pc  \
    -nodefaults  \
    -vga cirrus  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/hachen/monitor-qmpmonitor1-20170120-031759-FSOSsoeT,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=qmp_id_catch_monitor,path=/var/tmp/hachen/monitor-catch_monitor-20170120-031759-FSOSsoeT,server,nowait \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idXCDPC9  \
    -chardev socket,id=serial_id_serial0,path=/var/tmp/hachen/serial-serial0-20170120-031759-FSOSsoeT,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20170120-031759-FSOSsoeT,path=/var/tmp/hachen/seabios-20170120-031759-FSOSsoeT,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20170120-031759-FSOSsoeT,iobase=0x402 \
    -device ich9-usb-ehci1,id=usb1,addr=1d.7,multifunction=on,bus=pci.0 \
    -device ich9-usb-uhci1,id=usb1.0,multifunction=on,masterbus=usb1.0,addr=1d.0,firstport=0,bus=pci.0 \
    -device ich9-usb-uhci2,id=usb1.1,multifunction=on,masterbus=usb1.0,addr=1d.2,firstport=2,bus=pci.0 \
    -device ich9-usb-uhci3,id=usb1.2,multifunction=on,masterbus=usb1.0,addr=1d.4,firstport=4,bus=pci.0 \
    -drive id=drive_image1,if=none,snapshot=off,aio=native,cache=none,format=qcow2,file=/home/kvm_autotest_root/images/win10-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=03 \
    -device virtio-net-pci,mac=9a:1b:1c:1d:1e:1f,id=id0DIFuj,vectors=4,netdev=ids9igQ1,bus=pci.0,addr=04  \
    -netdev tap,id=ids9igQ1 \
    -m 16384  \
    -smp 8,maxcpus=8,cores=4,threads=1,sockets=2  \
    -cpu 'Haswell-noTSX',+kvm_pv_unhalt \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm \
    -monitor stdio \
    -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 \
    -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 \
    -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 \
    -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 \
    -drive file=/home/usb/usb-storage.qcow2,if=none,id=storage0,media=disk,cache=none,format=qcow2 \
    -device usb-storage,drive=storage0,removable=on,bus=usb.0,id=storage0,bootindex=1 \
    -device usb-hub \
    -device usb-host \
    -device usb-kbd,bus=usb1.0,port=1  \
    -device usb-mouse,bus=usb1.0,port=3  \
    -device usb-tablet,bus=usb1.0,port=5  \  <----**with or without this line**
    -device usb-ccid \

Comment 6 hachen 2017-01-24 09:40:01 UTC
I have tried win10_64 guest 7 times with:
3.10.0-327.10.1.el7.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.7.x86_64

/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1'  \
    -sandbox off  \
    -machine pc  \
    -nodefaults  \
    -vga cirrus  \
    -device ich9-usb-ehci1,id=usb1,addr=1d.7,multifunction=on,bus=pci.0 \
    -device ich9-usb-uhci1,id=usb1.0,multifunction=on,masterbus=usb1.0,addr=1d.0,firstport=0,bus=pci.0 \
    -device ich9-usb-uhci2,id=usb1.1,multifunction=on,masterbus=usb1.0,addr=1d.2,firstport=2,bus=pci.0 \
    -device ich9-usb-uhci3,id=usb1.2,multifunction=on,masterbus=usb1.0,addr=1d.4,firstport=4,bus=pci.0 \
    -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=unsafe,format=qcow2,file=/root/win10-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=03 \
    -device virtio-net-pci,mac=9a:1d:1e:1f:20:21,id=idndA2FD,vectors=4,netdev=idRZl6iJ,bus=pci.0,addr=04  \
    -netdev tap,id=idRZl6iJ \
    -m 4096  \
    -smp 4,maxcpus=4,cores=2,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm \
    -monitor stdio \
    -no-shutdown \
    -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 \
    -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 \
    -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 \
    -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 \
    -drive file=/home/usb/usb-storage.qcow2,if=none,id=storage0,media=disk,cache=none,format=qcow2 \
    -device usb-storage,drive=storage0,removable=on,bus=usb.0,id=storage0,bootindex=1 \
    -device usb-hub \
    -device usb-host \
    -device usb-kbd,bus=usb.0  \
    -device usb-mouse,bus=usb.0  \
    -device usb-ccid \


The last 5 times, the bug is reproduced.
It seems once it happens, it will always happen in the future.
How reproducible: 5/7

QEMU 2.3.0 monitor - type 'help' for more information
(qemu) ehci warning: guest updated active QH
ehci warning: guest updated active QH
usb-kbd: warning: key event queue full
usb-kbd: warning: key event queue full
usb-kbd: warning: key event queue full

(qemu) info usb
  Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB Tablet
  Device 1.1, Port 1, Speed 480 Mb/s, Product QEMU USB MSD
  Device 1.1, Port 2, Speed 12 Mb/s, Product QEMU USB Hub
  Device 1.2, Port 3, Speed 480 Mb/s, Product RNDIS/Ethernet Gadget
  Device 1.3, Port 4, Speed 480 Mb/s, Product QEMU USB Keyboard
  Device 1.4, Port 5, Speed 480 Mb/s, Product QEMU USB Mouse
  Device 1.1, Port 6, Speed 12 Mb/s, Product QEMU USB CCID


Also 3 times with 
3.10.0-541.el7.x86_64 and
qemu-kvm-rhev-2.8.0-2.el7.x86_64
everything else is same. It can not be reproduced.

Comment 7 hachen 2017-01-24 10:08:14 UTC
(In reply to hachen from comment #6)

> Also 3 times with 
> 3.10.0-541.el7.x86_64 and
> qemu-kvm-rhev-2.8.0-2.el7.x86_64
> everything else is same. It can not be reproduced.

In fact, I tried another 7 times, 10 times in total.It can not be reproduced.

Comment 9 Gerd Hoffmann 2017-02-03 08:01:51 UTC
> In fact, I tried another 7 times, 10 times in total.It can not be reproduced.

closing as worksforme then.