From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: qemu: remove overzelaous virtio-net printf Date: Tue, 24 Jun 2008 18:12:00 -0300 Message-ID: <20080624211200.GA16361@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel To: Anthony Liguori , Avi Kivity Return-path: Received: from mx1.redhat.com ([66.187.233.31]:53687 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbYFXVNg (ORCPT ); Tue, 24 Jun 2008 17:13:36 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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. Signed-off-by: Marcelo Tosatti 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");