Revision 62a9fbf7 hw/virtio-serial-bus.c
b/hw/virtio-serial-bus.c | ||
---|---|---|
528 | 528 |
memcpy(&config, config_data, sizeof(config)); |
529 | 529 |
} |
530 | 530 |
|
531 |
static void set_status(VirtIODevice *vdev, uint8_t status) |
|
532 |
{ |
|
533 |
VirtIOSerial *vser; |
|
534 |
VirtIOSerialPort *port; |
|
535 |
|
|
536 |
vser = DO_UPCAST(VirtIOSerial, vdev, vdev); |
|
537 |
port = find_port_by_id(vser, 0); |
|
538 |
|
|
539 |
if (port && !use_multiport(port->vser) |
|
540 |
&& (status & VIRTIO_CONFIG_S_DRIVER_OK)) { |
|
541 |
/* |
|
542 |
* Non-multiport guests won't be able to tell us guest |
|
543 |
* open/close status. Such guests can only have a port at id |
|
544 |
* 0, so set guest_connected for such ports as soon as guest |
|
545 |
* is up. |
|
546 |
*/ |
|
547 |
port->guest_connected = true; |
|
548 |
} |
|
549 |
} |
|
550 |
|
|
531 | 551 |
static void virtio_serial_save(QEMUFile *f, void *opaque) |
532 | 552 |
{ |
533 | 553 |
VirtIOSerial *s = opaque; |
... | ... | |
798 | 818 |
return ret; |
799 | 819 |
} |
800 | 820 |
|
801 |
if (!use_multiport(port->vser)) { |
|
802 |
/* |
|
803 |
* Allow writes to guest in this case; we have no way of |
|
804 |
* knowing if a guest port is connected. |
|
805 |
*/ |
|
806 |
port->guest_connected = true; |
|
807 |
} |
|
808 |
|
|
809 | 821 |
port->elem.out_num = 0; |
810 | 822 |
|
811 | 823 |
QTAILQ_INSERT_TAIL(&port->vser->ports, port, next); |
... | ... | |
905 | 917 |
vser->vdev.get_features = get_features; |
906 | 918 |
vser->vdev.get_config = get_config; |
907 | 919 |
vser->vdev.set_config = set_config; |
920 |
vser->vdev.set_status = set_status; |
|
908 | 921 |
|
909 | 922 |
vser->qdev = dev; |
910 | 923 |
|
Also available in: Unified diff