Skip to contentSkip to conversation

qemu: remove overzelaous virtio-net printf

PATCH Applied Marcelo Tosatti 3 participants 3 messages Jun 24, 2008 – Jun 25, 2008 KVM

lore
Share & tools
lore
#0 lore raw

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.

qemu/hw/virtio-net.c +1 -3
index a61fdb1..2e57e5a 100644
@@ -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");
#1 lore raw
Quoted 7 lines · Marcelo Tosatti

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!

Quoted 2 lines

Regards,

Anthony Liguori

Quoted 17 lines
qemu/hw/virtio-net.c +1 -3
index a61fdb1..2e57e5a 100644
@@ -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");
Applied
#2 lore raw
In reply to Marcelo Tosatti
Quoted 8 lines · Marcelo Tosatti

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.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function