Revision 199646d8 hw/virtio-serial-bus.c

b/hw/virtio-serial-bus.c
285 285
    return 0;
286 286
}
287 287

  
288
static void flush_queued_data_bh(void *opaque)
289
{
290
    VirtIOSerialPort *port = opaque;
291

  
292
    flush_queued_data(port);
293
}
294

  
288 295
void virtio_serial_throttle_port(VirtIOSerialPort *port, bool throttle)
289 296
{
290 297
    if (!port) {
......
295 302
    if (throttle) {
296 303
        return;
297 304
    }
298

  
299
    flush_queued_data(port);
305
    qemu_bh_schedule(port->bh);
300 306
}
301 307

  
302 308
/* Guest wants to notify us of some event */
......
726 732
    bool plugging_port0;
727 733

  
728 734
    port->vser = bus->vser;
735
    port->bh = qemu_bh_new(flush_queued_data_bh, port);
729 736

  
730 737
    /*
731 738
     * Is the first console port we're seeing? If so, put it up at
......
792 799
    VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, qdev);
793 800
    VirtIOSerial *vser = port->vser;
794 801

  
802
    qemu_bh_delete(port->bh);
795 803
    remove_port(port->vser, port->id);
796 804

  
797 805
    QTAILQ_REMOVE(&vser->ports, port, next);

Also available in: Unified diff