@@ -584,12 +584,14 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
VirtIOSerial *s = opaque;
VirtIOSerialPort *port;
uint8_t host_connected;
+ VirtIOSerialPortClass *vsc;
if (!s->post_load) {
return;
}
for (i = 0 ; i < s->post_load->nr_active_ports; ++i) {
port = s->post_load->connected[i].port;
+ vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port);
host_connected = s->post_load->connected[i].host_connected;
if (host_connected != port->host_connected) {
/*
@@ -599,6 +601,9 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
send_control_event(s, port->id, VIRTIO_CONSOLE_PORT_OPEN,
port->host_connected);
}
+ if (vsc->post_load) {
+ vsc->post_load(port);
+ }
}
g_free(s->post_load->connected);
qemu_free_timer(s->post_load->timer);
@@ -107,6 +107,8 @@ typedef struct VirtIOSerialPortClass {
*/
ssize_t (*have_data)(VirtIOSerialPort *port, const uint8_t *buf,
size_t len);
+
+ void (*post_load)(VirtIOSerialPort *port);
} VirtIOSerialPortClass;
/*
Signed-off-by: Alon Levy <alevy@redhat.com> --- hw/virtio-serial-bus.c | 5 +++++ hw/virtio-serial.h | 2 ++ 2 files changed, 7 insertions(+)