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>
This commit is contained in:
parent
eff06c40d3
commit
9547732304
1 changed files with 3 additions and 0 deletions
|
@ -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))
|
||||
|
|
Reference in a new issue