Revision 0219d732 hw/virtio-console.c
b/hw/virtio-console.c | ||
---|---|---|
28 | 28 |
ssize_t ret; |
29 | 29 |
|
30 | 30 |
ret = qemu_chr_write(vcon->chr, buf, len); |
31 |
|
|
32 | 31 |
trace_virtio_console_flush_buf(port->id, len, ret); |
32 |
|
|
33 |
if (ret < 0) { |
|
34 |
/* |
|
35 |
* Ideally we'd get a better error code than just -1, but |
|
36 |
* that's what the chardev interface gives us right now. If |
|
37 |
* we had a finer-grained message, like -EPIPE, we could close |
|
38 |
* this connection. Absent such error messages, the most we |
|
39 |
* can do is to return 0 here. |
|
40 |
* |
|
41 |
* This will prevent stray -1 values to go to |
|
42 |
* virtio-serial-bus.c and cause abort()s in |
|
43 |
* do_flush_queued_data(). |
|
44 |
*/ |
|
45 |
ret = 0; |
|
46 |
} |
|
33 | 47 |
return ret; |
34 | 48 |
} |
35 | 49 |
|
Also available in: Unified diff