Skip to contentSkip to conversation

userspace virtio

PATCH In review Dor Laor 1 participant 1 message Dec 21, 2007 KVM

lore
Share & tools
lore

Dor Laor

author
#0 lore raw

PATCH 5/7 userspace virtio

From 35a03164c1b4d138e55898853212bded14cf4ec7 Mon Sep 17 00:00:00 2001
From: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/[email protected]>
Date: Mon, 17 Dec 2007 01:43:28 +0200
Subject: [PATCH] Check for device status on tx.

Allow tx only if VIRTIO_CONFIG_S_DRIVER_OK. It can prevent an smp race of tx and driver unload.

---
 qemu/hw/virtio-net.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
qemu/hw/virtio-net.c +0 -0
index 3320dd8..f6f1f28 100644
@@ -140,6 +140,9 @@ static void virtio_net_handle_tx(VirtIODevice *vdev, 

VirtQueue *vq)

     VirtIONet *n = to_virtio_net(vdev);
     VirtQueueElement elem;

+ if (!(n->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK))
+ return;
+

     while (virtqueue_pop(vq, &elem)) {
     int i;
     size_t len = 0;
Signature · 7 lines
1.5.3.3


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/