[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 47/47] serial: Open non-block
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 47/47] serial: Open non-block |
Date: |
Sat, 30 Jun 2018 08:10:40 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
chardev/char-serial.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/chardev/char-serial.c b/chardev/char-serial.c
index ae548d2..3299b46 100644
--- a/chardev/char-serial.c
+++ b/chardev/char-serial.c
@@ -265,7 +265,8 @@ static void qmp_chardev_open_serial(Chardev *chr,
ChardevHostdev *serial = backend->u.serial.data;
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) {
return;
}
--
1.8.3.1
- [Qemu-devel] [PULL 35/47] hw/net: Use the IEC binary prefix definitions, (continued)
- [Qemu-devel] [PULL 35/47] hw/net: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 36/47] hw/usb: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 37/47] hw/sd: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 40/47] hw/rdma: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 38/47] hw/vfio: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 33/47] hw/ppc: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 39/47] hw/virtio: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 41/47] cutils: Do not include "qemu/units.h" directly, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 43/47] vl: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 42/47] monitor: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 47/47] serial: Open non-block,
Paolo Bonzini <=
- [Qemu-devel] [PULL 46/47] bsd-user: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 44/47] tests/crypto: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- [Qemu-devel] [PULL 45/47] linux-user: Use the IEC binary prefix definitions, Paolo Bonzini, 2018/06/30
- Re: [Qemu-devel] [PULL 00/47] More misc patches for 3.0 soft freeze, Peter Maydell, 2018/06/30