aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-net.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-11-22 19:52:19 +0200
committerMichael S. Tsirkin <mst@redhat.com>2010-12-09 12:47:48 +0200
commit954773230484f5afeb675e9ff814c97e54e69e17 (patch)
tree327b263d65f6e0b97d895172c1a3d10932470e77 /hw/virtio-net.c
parenteff06c40d330cdbea414331337ca6f5032dbf6d7 (diff)
virtio-net: don't dma while vm is stopped
DMA into memory while VM is stopped makes it hard to debug migration (consequitive saves result in different files). Fixing this completely is a large effort, this patch does this for virtio-net. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/virtio-net.c')
-rw-r--r--hw/virtio-net.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 1d61f191b6..43a2b3daf0 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -424,6 +424,9 @@ static void virtio_net_handle_rx(VirtIODevice *vdev, VirtQueue *vq)
static int virtio_net_can_receive(VLANClientState *nc)
{
VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
+ if (!n->vm_running) {
+ return 0;
+ }
if (!virtio_queue_ready(n->rx_vq) ||
!(n->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK))