From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: qemu: remove overzelaous virtio-net printf Date: Tue, 24 Jun 2008 16:14:09 -0500 Message-ID: <486163A1.2030405@us.ibm.com> References: <20080624211200.GA16361@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm-devel To: Marcelo Tosatti Return-path: Received: from e35.co.us.ibm.com ([32.97.110.153]:44692 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756370AbYFXVOt (ORCPT ); Tue, 24 Jun 2008 17:14:49 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e35.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m5OLElj4028387 for ; Tue, 24 Jun 2008 17:14:47 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5OLEXR2090374 for ; Tue, 24 Jun 2008 15:14:36 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5OLETkL012783 for ; Tue, 24 Jun 2008 15:14:29 -0600 In-Reply-To: <20080624211200.GA16361@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > When two virtio devices share an interrupt virtio-net floods the console > with "this should not happen" message. > > As Anthony points this is not a fatal condition: its possible that the > guest consumed all ring elements between the can_receive check and > actual net_receive call. > Thanks for catching this! > Signed-off-by: Marcelo Tosatti > Acked-by: Anthony Liguori Regards, Anthony Liguori > diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c > index a61fdb1..2e57e5a 100644 > --- a/qemu/hw/virtio-net.c > +++ b/qemu/hw/virtio-net.c > @@ -119,10 +119,8 @@ static void virtio_net_receive(void *opaque, const uint8_t *buf, int size) > struct virtio_net_hdr *hdr; > int offset, i; > > - if (virtqueue_pop(n->rx_vq, &elem) == 0) { > - fprintf(stderr, "virtio_net: this should not happen\n"); > + if (virtqueue_pop(n->rx_vq, &elem) == 0) > return; > - } > > if (elem.in_num < 1 || elem.in_sg[0].iov_len != sizeof(*hdr)) { > fprintf(stderr, "virtio-net header not in first element\n"); >