with 'monitor pty', it needs to flush pts device after sending command to it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Environment:
------------
Host OS (ia32/ia32e/
Guest OS (ia32/ia32e/
Guest OS Type (Linux/
kvm.git Commit: 660696d1d16a71e
qemu.git Commit: 64afc2b4d48fb21
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/
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,
(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/
2. echo "device_add pci-assign,
(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'.
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.