Amit Shah <amit.s...@redhat.com> wrote:
> This can happen if a port gets unplugged before guest has chance to
> initialise vqs.
>
> Reported-by: Juan Quintela <quint...@redhat.com>
> Signed-off-by: Amit Shah <amit.s...@redhat.com>
> ---
>  hw/virtio-serial-bus.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
> index 09e22aa..e05ab5e 100644
> --- a/hw/virtio-serial-bus.c
> +++ b/hw/virtio-serial-bus.c
> @@ -117,6 +117,9 @@ static void discard_vq_data(VirtQueue *vq, VirtIODevice 
> *vdev)
>  {
>      VirtQueueElement elem;
>  
> +    if (!virtio_queue_ready(vq)) {
> +        return;
> +    }
>      while (virtqueue_pop(vq, &elem)) {
>          virtqueue_push(vq, &elem, 0);
>      }

Reviewed-by: Juan Quintela <quint...@redhat.com>

Reply via email to