summaryrefslogtreecommitdiffstats
path: root/hw/net/vhost_net.c
diff options
context:
space:
mode:
authorYajun Wu2022-10-17 08:44:51 +0200
committerMichael S. Tsirkin2022-11-07 20:08:17 +0100
commit8b67fe00652b2640f3f841a7b102f6bcf82483a3 (patch)
tree9b720b78f7cd6309fe47e9eedc6cfd33b593db1a /hw/net/vhost_net.c
parentintel-iommu: PASID support (diff)
downloadqemu-8b67fe00652b2640f3f841a7b102f6bcf82483a3.tar.gz
qemu-8b67fe00652b2640f3f841a7b102f6bcf82483a3.tar.xz
qemu-8b67fe00652b2640f3f841a7b102f6bcf82483a3.zip
vhost: Change the sequence of device start
This patch is part of adding vhost-user vhost_dev_start support. The motivation is to improve backend configuration speed and reduce live migration VM downtime. Moving the device start routines after finishing all the necessary device and VQ configuration, further aligning to the virtio specification for "device initialization sequence". Following patch will add vhost-user vhost_dev_start support. Signed-off-by: Yajun Wu <yajunw@nvidia.com> Acked-by: Parav Pandit <parav@nvidia.com> Message-Id: <20221017064452.1226514-2-yajunw@nvidia.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net/vhost_net.c')
-rw-r--r--hw/net/vhost_net.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 53b2fac4f6..feda448878 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -389,21 +389,20 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
} else {
peer = qemu_get_peer(ncs, n->max_queue_pairs);
}
- r = vhost_net_start_one(get_vhost_net(peer), dev);
-
- if (r < 0) {
- goto err_start;
- }
if (peer->vring_enable) {
/* restore vring enable state */
r = vhost_set_vring_enable(peer, peer->vring_enable);
if (r < 0) {
- vhost_net_stop_one(get_vhost_net(peer), dev);
goto err_start;
}
}
+
+ r = vhost_net_start_one(get_vhost_net(peer), dev);
+ if (r < 0) {
+ goto err_start;
+ }
}
return 0;