From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, stefanha@redhat.com, mst@redhat.com,
luonengjun@huawei.com, peter.huangpeng@huawei.com,
aliguori@amazon.com, akong@redhat.com,
zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: [Qemu-devel] [PATCH 3/3] virtio-net: Remove checking vm state in virtio_net_can_receive
Date: Thu, 14 Aug 2014 14:13:58 +0800 [thread overview]
Message-ID: <1407996838-10212-4-git-send-email-zhang.zhanghailiang@huawei.com> (raw)
In-Reply-To: <1407996838-10212-1-git-send-email-zhang.zhanghailiang@huawei.com>
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(-)
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;
}
--
1.7.12.4
prev parent reply other threads:[~2014-08-14 6:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 6:13 [Qemu-devel] [PATCH 0/3] forbid dealing with net packets when VM is not running zhanghailiang
2014-08-14 6:13 ` [Qemu-devel] [PATCH 1/3] net: Forbid dealing with " zhanghailiang
2014-08-14 6:13 ` [Qemu-devel] [PATCH 2/3] net: Flush queues when runstate changes back to running zhanghailiang
2014-08-14 7:12 ` Gonglei (Arei)
2014-08-14 8:24 ` zhanghailiang
2014-08-14 10:05 ` Michael S. Tsirkin
2014-08-18 0:45 ` zhanghailiang
2014-08-14 10:09 ` Michael S. Tsirkin
2014-08-18 0:46 ` zhanghailiang
2014-08-14 6:13 ` zhanghailiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407996838-10212-4-git-send-email-zhang.zhanghailiang@huawei.com \
--to=zhang.zhanghailiang@huawei.com \
--cc=akong@redhat.com \
--cc=aliguori@amazon.com \
--cc=luonengjun@huawei.com \
--cc=mst@redhat.com \
--cc=peter.huangpeng@huawei.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).