>> I'm surprised: did you test this with upstream qemu? That codebase >> doesn't yet throttle writes, and this code path won't execute. Does >> it really not reproduce with this patch? > > I think > static void handle_output(VirtIODevice *vdev, VirtQueue *vq) > [....] > if (!port->throttled) { > do_flush_queued_data(port, vq, vdev); > return; > > makes a difference here, since we will never return the buffer to the guest, > no?
And of course this while static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, VirtIODevice *vdev) [...] while (!port->throttled) { unsigned int i; will also prevent further processing, as virtio_serial_throttle_port will set port-throttled.