From 81647a655fa4ff99fd5748363a174edd87a40950 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolaev Date: Tue, 27 May 2014 15:05:22 +0300 Subject: vhost_net_init will use VhostNetOptions to get all its arguments vhost_dev_init will replace devfd and devpath with a single opaque argument. This is initialised with a file descriptor. When TAP is used (through vhost_net), open /dev/vhost-net and pass the fd as an opaque parameter in VhostNetOptions. The same applies to vhost-scsi - open /dev/vhost-scsi and pass the fd. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost.h | 2 +- include/net/vhost_net.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index df1f2149cc..8afc6f9f22 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -51,7 +51,7 @@ struct vhost_dev { hwaddr mem_changed_end_addr; }; -int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath, +int vhost_dev_init(struct vhost_dev *hdev, void *opaque, bool force); void vhost_dev_cleanup(struct vhost_dev *hdev); bool vhost_dev_query(struct vhost_dev *hdev, VirtIODevice *vdev); diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index e2bd61c784..2067ee2298 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -6,7 +6,13 @@ struct vhost_net; typedef struct vhost_net VHostNetState; -VHostNetState *vhost_net_init(NetClientState *backend, int devfd, bool force); +typedef struct VhostNetOptions { + NetClientState *net_backend; + void *opaque; + bool force; +} VhostNetOptions; + +struct vhost_net *vhost_net_init(VhostNetOptions *options); bool vhost_net_query(VHostNetState *net, VirtIODevice *dev); int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues); -- cgit v1.2.1