hw/virtio: move vhost_set_backend_type() to vhost.c

Just a small refactor patch.

vhost_set_backend_type() gets called only in vhost.c, so we can move the
function there and make it static. We can then extern the visibility of
kernel_ops, to match the other VhostOps in vhost-backend.h.
The VhostOps constants now make more sense in vhost.h

Suggested-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Signed-off-by: Tiberiu Georgescu <tiberiu.georgescu@nutanix.com>
Message-Id: <20210809134015.67941-1-tiberiu.georgescu@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Tiberiu Georgescu 2021-08-09 13:40:15 +00:00 committed by Michael S. Tsirkin
parent fe8adae345
commit 9b1d929adb
4 changed files with 34 additions and 35 deletions

View file

@ -173,12 +173,6 @@ typedef struct VhostOps {
vhost_force_iommu_op vhost_force_iommu;
} VhostOps;
extern const VhostOps user_ops;
extern const VhostOps vdpa_ops;
int vhost_set_backend_type(struct vhost_dev *dev,
VhostBackendType backend_type);
int vhost_backend_update_device_iotlb(struct vhost_dev *dev,
uint64_t iova, uint64_t uaddr,
uint64_t len,