diff options
author | Nikolay Nikolaev <n.nikolaev@virtualopensystems.com> | 2014-05-27 15:05:35 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 16:41:56 +0300 |
commit | 24d1eb33eb2ccd995a845a4d4b793e2619a9e460 (patch) | |
tree | 92d1060c55a16ea1588b6239d55f4b8baa74497a /include/hw/virtio/vhost-backend.h | |
parent | 81647a655fa4ff99fd5748363a174edd87a40950 (diff) | |
download | qemu-24d1eb33eb2ccd995a845a4d4b793e2619a9e460.zip qemu-24d1eb33eb2ccd995a845a4d4b793e2619a9e460.tar.gz qemu-24d1eb33eb2ccd995a845a4d4b793e2619a9e460.tar.bz2 |
Add vhost_ops to vhost_dev struct and replace all relevant ioctls
Decouple vhost from the Linux kernel by introducing vhost_ops. The
intention is to provide different backends - a 'kernel' backend based on
the ioctl interface, and an 'user' backend based on a UNIX domain socket
and shared memory interface.
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 'include/hw/virtio/vhost-backend.h')
-rw-r--r-- | include/hw/virtio/vhost-backend.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h new file mode 100644 index 0000000..14e5878 --- /dev/null +++ b/include/hw/virtio/vhost-backend.h @@ -0,0 +1,27 @@ +/* + * vhost-backend + * + * Copyright (c) 2013 Virtual Open Systems Sarl. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef VHOST_BACKEND_H_ +#define VHOST_BACKEND_H_ + +struct vhost_dev; + +typedef int (*vhost_call)(struct vhost_dev *dev, unsigned long int request, + void *arg); +typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque); +typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev); + +typedef struct VhostOps { + vhost_call vhost_call; + vhost_backend_init vhost_backend_init; + vhost_backend_cleanup vhost_backend_cleanup; +} VhostOps; + +#endif /* VHOST_BACKEND_H_ */ |