summaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-08-04 14:12:39 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-09-02 17:28:25 +0300
commit2d2507ef23d2a28eaeea5507ff4ec68657f1792f (patch)
tree8c13bbba7aedce771968fd1d27dd27b31a469173 /hw/net
parentb5a280c00840f4ebc2f40afb4f74e37e34d19f7c (diff)
downloadqemu-2d2507ef23d2a28eaeea5507ff4ec68657f1792f.tar.gz
qemu-2d2507ef23d2a28eaeea5507ff4ec68657f1792f.tar.bz2
qemu-2d2507ef23d2a28eaeea5507ff4ec68657f1792f.zip
vhost_net: cleanup start/stop condition
Checking vhost device internal state in vhost_net looks like a layering violation since vhost_net does not set this flag: it is set and tested by vhost.c. There seems to be no reason to check this: caller in virtio net uses its own flag, vhost_started, to ensure vhost is started/stopped as appropriate. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/vhost_net.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index f87c79824b..9bbf2ee4ce 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -195,10 +195,6 @@ static int vhost_net_start_one(struct vhost_net *net,
struct vhost_vring_file file = { };
int r;
- if (net->dev.started) {
- return 0;
- }
-
net->dev.nvqs = 2;
net->dev.vqs = net->vqs;
net->dev.vq_index = vq_index;
@@ -256,10 +252,6 @@ static void vhost_net_stop_one(struct vhost_net *net,
{
struct vhost_vring_file file = { .fd = -1 };
- if (!net->dev.started) {
- return;
- }
-
if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP) {
for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
const VhostOps *vhost_ops = net->dev.vhost_ops;