Revision ad3005ad hw/virtio-serial-bus.c
b/hw/virtio-serial-bus.c | ||
---|---|---|
287 | 287 |
size_t virtio_serial_guest_ready(VirtIOSerialPort *port) |
288 | 288 |
{ |
289 | 289 |
VirtQueue *vq = port->ivq; |
290 |
unsigned int bytes; |
|
290 | 291 |
|
291 | 292 |
if (!virtio_queue_ready(vq) || |
292 | 293 |
!(port->vser->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK) || |
... | ... | |
296 | 297 |
if (use_multiport(port->vser) && !port->guest_connected) { |
297 | 298 |
return 0; |
298 | 299 |
} |
299 |
|
|
300 |
if (virtqueue_avail_bytes(vq, 4096, 0)) { |
|
301 |
return 4096; |
|
302 |
} |
|
303 |
if (virtqueue_avail_bytes(vq, 1, 0)) { |
|
304 |
return 1; |
|
305 |
} |
|
306 |
return 0; |
|
300 |
virtqueue_get_avail_bytes(vq, &bytes, NULL); |
|
301 |
return bytes; |
|
307 | 302 |
} |
308 | 303 |
|
309 | 304 |
static void flush_queued_data_bh(void *opaque) |
Also available in: Unified diff