mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-18 05:28:36 -07:00
serial: Open non-block
On a real serial device, the open can block if the handshake lines are in a particular state. If a QEMU is passing the serial device to the guest, the QEMU startup is blocked opening the device (with a symptom seen as a timeout from libvirt). Open the serial port with O_NONBLOCK. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
66d26ddb23
commit
76b004d10d
1 changed files with 2 additions and 1 deletions
|
|
@ -265,7 +265,8 @@ static void qmp_chardev_open_serial(Chardev *chr,
|
||||||
ChardevHostdev *serial = backend->u.serial.data;
|
ChardevHostdev *serial = backend->u.serial.data;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
fd = qmp_chardev_open_file_source(serial->device, O_RDWR, errp);
|
fd = qmp_chardev_open_file_source(serial->device, O_RDWR | O_NONBLOCK,
|
||||||
|
errp);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue