On 08/11/13 15:25, Gal Hammer wrote: > The redundant notification caused the Windows' driver to duplicate the > pending write request's buffer. The driver was fixed, but I think this > change is still required. > > Signed-off-by: Gal Hammer <[email protected]> > --- > hw/char/virtio-serial-bus.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c > index da417c7..0d38b4b 100644 > --- a/hw/char/virtio-serial-bus.c > +++ b/hw/char/virtio-serial-bus.c > @@ -105,6 +105,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, > VirtQueue *vq, > VirtIODevice *vdev) > { > VirtIOSerialPortClass *vsc; > + bool elem_pushed = false; > > assert(port); > assert(virtio_queue_ready(vq)); > @@ -145,9 +146,12 @@ static void do_flush_queued_data(VirtIOSerialPort *port, > VirtQueue *vq, > break; > } > virtqueue_push(vq, &port->elem, 0); > + elem_pushed = true; > port->elem.out_num = 0; > } > - virtio_notify(vdev, vq); > + if (elem_pushed) { > + virtio_notify(vdev, vq); > + } > } > > static void flush_queued_data(VirtIOSerialPort *port) >
Differs from v1 only in a more precise subject / more details in the commit msg. Reviewed-by: Laszlo Ersek <[email protected]>
