[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] virtio-serial-bus: add port arg to discard_
From: |
Amit Shah |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] virtio-serial-bus: add port arg to discard_vq_data() |
Date: |
Wed, 14 Sep 2011 19:06:08 +0530 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On (Wed) 14 Sep 2011 [14:52:50], Markus Armbruster wrote:
> Amit Shah <address@hidden> writes:
>
> > To discard throttled data as well as maintain statistics of bytes
> > received and discarded, discard_vq_data() will need the port associated
> > with the vq.
> >
> > Signed-off-by: Amit Shah <address@hidden>
> > ---
> > hw/virtio-serial-bus.c | 9 +++++----
> > 1 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
> > index a4825b9..6838d73 100644
> > --- a/hw/virtio-serial-bus.c
> > +++ b/hw/virtio-serial-bus.c
> > @@ -114,7 +114,8 @@ static size_t write_to_port(VirtIOSerialPort *port,
> > return offset;
> > }
> >
> > -static void discard_vq_data(VirtQueue *vq, VirtIODevice *vdev)
> > +static void discard_vq_data(VirtIOSerialPort *port, VirtQueue *vq,
> > + VirtIODevice *vdev)
> > {
> > VirtQueueElement elem;
> >
>
> Two of three callers pass port, port->ovq, &port->vser->vdev. Third one
> isn't as obvious, but could be the same (didn't check thoroughly).
> Makes me wonder whether parameters vq and vdev are really needed.
Because port can be NULL (when a port has been hot-unplugged but guest
continues to send data, or when a malicious guest sends data to a
non-existent port).
Amit