From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60689 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlL94-0001yd-TA for qemu-devel@nongnu.org; Fri, 04 Feb 2011 07:52:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlL93-0000AK-DX for qemu-devel@nongnu.org; Fri, 04 Feb 2011 07:52:14 -0500 Received: from mail-vx0-f173.google.com ([209.85.220.173]:53570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlL93-0000AG-A4 for qemu-devel@nongnu.org; Fri, 04 Feb 2011 07:52:13 -0500 Received: by vxb40 with SMTP id 40so671079vxb.4 for ; Fri, 04 Feb 2011 04:52:12 -0800 (PST) Message-ID: <4D4BF674.5050305@codemonkey.ws> Date: Fri, 04 Feb 2011 06:52:04 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH master/0.14] virtio-serial: Make sure virtqueue is ready before discarding data References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list , Juan Quintela On 02/04/2011 02:54 AM, Amit Shah wrote: > This can happen if a port gets unplugged before guest has chance to > initialise vqs. > > Reported-by: Juan Quintela > Signed-off-by: Amit Shah > Applied to master, Thanks. Regards, Anthony Liguori > --- > 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); > } >