virtio: Move extern declaration to header file
[qemu/kevin.git] / include / hw / virtio / vhost-backend.h
blobe472f29714e89a78ae07f26be4aef48d00eb60b1
1 /*
2 * vhost-backend
4 * Copyright (c) 2013 Virtual Open Systems Sarl.
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
9 */
11 #ifndef VHOST_BACKEND_H_
12 #define VHOST_BACKEND_H_
14 typedef enum VhostBackendType {
15 VHOST_BACKEND_TYPE_NONE = 0,
16 VHOST_BACKEND_TYPE_KERNEL = 1,
17 VHOST_BACKEND_TYPE_USER = 2,
18 VHOST_BACKEND_TYPE_MAX = 3,
19 } VhostBackendType;
21 struct vhost_dev;
23 typedef int (*vhost_call)(struct vhost_dev *dev, unsigned long int request,
24 void *arg);
25 typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque);
26 typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev);
28 typedef struct VhostOps {
29 VhostBackendType backend_type;
30 vhost_call vhost_call;
31 vhost_backend_init vhost_backend_init;
32 vhost_backend_cleanup vhost_backend_cleanup;
33 } VhostOps;
35 extern const VhostOps user_ops;
37 int vhost_set_backend_type(struct vhost_dev *dev,
38 VhostBackendType backend_type);
40 #endif /* VHOST_BACKEND_H_ */