with 'monitor pty', it needs to flush pts device after sending command to it

Bug #1185228 reported by Yongjie Ren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Invalid
Undecided
Unassigned

Bug Description

Environment:
------------
Host OS (ia32/ia32e/IA64):ia32e
Guest OS (ia32/ia32e/IA64):ia32e
Guest OS Type (Linux/Windows):Linux
kvm.git Commit: 660696d1d16a71e15549ce1bf74953be1592bcd3
qemu.git Commit: 64afc2b4d48fb21e085517c38a59a3f61a11283c
Host Kernel Version:3.9.0-rc3
Hardware: SandyBridge

Bug detailed description:
--------------------------
when creating guest with parameter "-monitor pty", then send command (e.g. migrate, device_add) to the pts device. If I don't flush the pts device (e.g. using cat /dev/pts/8) to flush the pts device, the monitor command doesn't take effect. I know some old qemu (e.g. 1.3) didn't have this issue.

create KVM guest:
[root@vt-snb9 ~]# qemu-system-x86_64 -enable-kvm -m 1024 -smp 2 -net none /root/cathy/rhel6u4.qcow -monitor pty
char device redirected to /dev/pts/8 (label compat_monitor0)
VNC server running on `::1:5900'

hot plug a PCI device:
[root@vt-snb9 ~]# echo "device_add pci-assign,host=05:10.0,id=nic" >/dev/pts/8
 (here, the device cannot hot plug to the guest.)

if you run command "cat /dev/pts/8", the device will hot plug to the guest.

hot remove the device:
[root@vt-snb9 ~]# echo "device_del nic">/dev/pts/8
(here, the device cannot hot remove from the guest.)

if you run command "cat /dev/pts/8" the device can hot remove from the guest

Reproduce steps:
----------------
1. qemu-system-x86_64 -enable-kvm -m 1024 -smp 2 -net none /root/cathy/rhel6u4.qcow -monitor pty
2. echo "device_add pci-assign,host=05:10.0,id=nic" >/dev/pts/8
(or using 'migrate' command in qemu monitor redirection device /dev/pts/8 )

Current result:
----------------
device can not hot plug or hot remove from the guest before exec 'cat /dev/pts/8'.

Revision history for this message
Paolo Bonzini (bonzini) wrote :

This is not a bug. What happens is that QEMU echoes the command you type onto the PTY. If you do not do a "cat /dev/pts/8", the PTY's buffer gets full and QEMU stops reading from the PTY until it is emptied.

It doesn't happen if you use QMP.

Changed in qemu:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.