Message ID | 1407996838-10212-4-git-send-email-zhang.zhanghailiang@huawei.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 268eff9..287d762 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -839,10 +839,6 @@ static int virtio_net_can_receive(NetClientState *nc) VirtIODevice *vdev = VIRTIO_DEVICE(n); VirtIONetQueue *q = virtio_net_get_subqueue(nc); - if (!vdev->vm_running) { - return 0; - } - if (nc->queue_index >= n->curr_queues) { return 0; }
We will check vm-running state in the generic net layer. Also we have to flush queues in nic_vmstate_change_handler() when vm state changes to run. The check here will prevent the flushing process, because we will check the return value of virtio_net_can_receive in nic_vmstate_change_handler, When the vdev->vm_running is still false. Actually it depends on the register sequence of callback functions. Here nic_vmstate_change_handler will called before virtio_vmstate_change. So remove the unnecessarily checking. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> --- hw/net/virtio-net.c | 4 ---- 1 file changed, 4 deletions(-)