diff options
author | Nikolay Nikolaev <n.nikolaev@virtualopensystems.com> | 2014-05-27 15:05:49 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 16:41:56 +0300 |
commit | 1a1bfac9ee13d76a4b257431cc4193c8a42efa19 (patch) | |
tree | 47c0d93e3931a6992f5835c5d292533e931789bf /hw/virtio/vhost.c | |
parent | 24d1eb33eb2ccd995a845a4d4b793e2619a9e460 (diff) |
Add vhost-backend and VhostBackendType
Use vhost_set_backend_type to initialise a proper vhost_ops structure.
In vhost_net_init and vhost_net_start_one call conditionally TAP related
initialisation depending on the vhost backend type.
Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r-- | hw/virtio/vhost.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 85841019c0..c1b1aad6cf 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -808,11 +808,15 @@ static void vhost_virtqueue_cleanup(struct vhost_virtqueue *vq) } int vhost_dev_init(struct vhost_dev *hdev, void *opaque, - bool force) + VhostBackendType backend_type, bool force) { uint64_t features; int i, r; + if (vhost_set_backend_type(hdev, backend_type) < 0) { + return -1; + } + if (hdev->vhost_ops->vhost_backend_init(hdev, opaque) < 0) { return -errno; } |