Most of handlers start from simply .vhost_, except for these four, starting from .vhost_backend_. Let's rename them to be consistent.
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> --- hw/virtio/vhost-backend.c | 6 +++--- hw/virtio/vhost-user.c | 8 ++++---- hw/virtio/vhost-vdpa.c | 6 +++--- hw/virtio/vhost.c | 14 +++++++------- include/hw/virtio/vhost-backend.h | 17 ++++++++--------- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index fea88afc39..caeadd069b 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -358,9 +358,9 @@ static void vhost_kernel_set_iotlb_callback(struct vhost_dev *dev, const VhostOps kernel_ops = { .backend_type = VHOST_BACKEND_TYPE_KERNEL, - .vhost_backend_init = vhost_kernel_init, - .vhost_backend_cleanup = vhost_kernel_cleanup, - .vhost_backend_memslots_limit = vhost_kernel_memslots_limit, + .vhost_init = vhost_kernel_init, + .vhost_cleanup = vhost_kernel_cleanup, + .vhost_memslots_limit = vhost_kernel_memslots_limit, .vhost_net_set_backend = vhost_kernel_net_set_backend, .vhost_scsi_set_endpoint = vhost_kernel_scsi_set_endpoint, .vhost_scsi_clear_endpoint = vhost_kernel_scsi_clear_endpoint, diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index c750b32617..2e58f38ac5 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -3118,10 +3118,10 @@ void vhost_user_qmp_status(struct vhost_dev *dev, VirtioStatus *status) const VhostOps user_ops = { .backend_type = VHOST_BACKEND_TYPE_USER, - .vhost_backend_init = vhost_user_backend_init, - .vhost_backend_cleanup = vhost_user_backend_cleanup, - .vhost_backend_memslots_limit = vhost_user_memslots_limit, - .vhost_backend_no_private_memslots = vhost_user_no_private_memslots, + .vhost_init = vhost_user_backend_init, + .vhost_cleanup = vhost_user_backend_cleanup, + .vhost_memslots_limit = vhost_user_memslots_limit, + .vhost_no_private_memslots = vhost_user_no_private_memslots, .vhost_set_log_base = vhost_user_set_log_base, .vhost_set_mem_table = vhost_user_set_mem_table, .vhost_set_vring_addr = vhost_user_set_vring_addr, diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 2f8f11df86..fd9e92092d 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -1590,8 +1590,8 @@ static bool vhost_vdpa_force_iommu(struct vhost_dev *dev) const VhostOps vdpa_ops = { .backend_type = VHOST_BACKEND_TYPE_VDPA, - .vhost_backend_init = vhost_vdpa_init, - .vhost_backend_cleanup = vhost_vdpa_cleanup, + .vhost_init = vhost_vdpa_init, + .vhost_cleanup = vhost_vdpa_cleanup, .vhost_set_log_base = vhost_vdpa_set_log_base, .vhost_set_vring_addr = vhost_vdpa_set_vring_addr, .vhost_set_vring_num = vhost_vdpa_set_vring_num, @@ -1602,7 +1602,7 @@ const VhostOps vdpa_ops = { .vhost_get_features = vhost_vdpa_get_features, .vhost_set_owner = vhost_vdpa_set_owner, .vhost_set_vring_endian = NULL, - .vhost_backend_memslots_limit = vhost_vdpa_memslots_limit, + .vhost_memslots_limit = vhost_vdpa_memslots_limit, .vhost_set_mem_table = vhost_vdpa_set_mem_table, .vhost_set_features = vhost_vdpa_set_features, .vhost_reset_device = vhost_vdpa_reset_device, diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 3ee353dce0..fe63091985 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -58,7 +58,7 @@ unsigned int vhost_get_max_memslots(void) struct vhost_dev *hdev; QLIST_FOREACH(hdev, &vhost_devices, entry) { - max = MIN(max, hdev->vhost_ops->vhost_backend_memslots_limit(hdev)); + max = MIN(max, hdev->vhost_ops->vhost_memslots_limit(hdev)); } return max; } @@ -69,7 +69,7 @@ unsigned int vhost_get_free_memslots(void) struct vhost_dev *hdev; QLIST_FOREACH(hdev, &vhost_devices, entry) { - unsigned int r = hdev->vhost_ops->vhost_backend_memslots_limit(hdev); + unsigned int r = hdev->vhost_ops->vhost_memslots_limit(hdev); unsigned int cur_free = r - hdev->mem->nregions; if (unlikely(r < hdev->mem->nregions)) { @@ -664,8 +664,8 @@ static bool vhost_section(struct vhost_dev *dev, MemoryRegionSection *section) */ if ((memory_region_get_fd(section->mr) < 0 || !qemu_ram_is_shared(section->mr->ram_block)) && - dev->vhost_ops->vhost_backend_no_private_memslots && - dev->vhost_ops->vhost_backend_no_private_memslots(dev)) { + dev->vhost_ops->vhost_no_private_memslots && + dev->vhost_ops->vhost_no_private_memslots(dev)) { trace_vhost_reject_section(mr->name, 2); return false; } @@ -1677,7 +1677,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, r = vhost_set_backend_type(hdev, backend_type); assert(r >= 0); - r = hdev->vhost_ops->vhost_backend_init(hdev, opaque, errp); + r = hdev->vhost_ops->vhost_init(hdev, opaque, errp); if (r < 0) { goto fail; } @@ -1694,7 +1694,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, goto fail; } - limit = hdev->vhost_ops->vhost_backend_memslots_limit(hdev); + limit = hdev->vhost_ops->vhost_memslots_limit(hdev); if (limit < MEMORY_DEVICES_SAFE_MAX_MEMSLOTS && memory_devices_memslot_auto_decision_active()) { error_setg(errp, "some memory device (like virtio-mem)" @@ -1812,7 +1812,7 @@ void vhost_dev_cleanup(struct vhost_dev *hdev) g_free(hdev->mem); g_free(hdev->mem_sections); if (hdev->vhost_ops) { - hdev->vhost_ops->vhost_backend_cleanup(hdev); + hdev->vhost_ops->vhost_cleanup(hdev); } assert(!hdev->log); diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h index 57497e197a..aab6bf3ef7 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -51,10 +51,9 @@ struct vhost_scsi_target; struct vhost_iotlb_msg; struct vhost_virtqueue; -typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque, - Error **errp); -typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev); -typedef int (*vhost_backend_memslots_limit)(struct vhost_dev *dev); +typedef int (*vhost_init)(struct vhost_dev *dev, void *opaque, Error **errp); +typedef int (*vhost_cleanup)(struct vhost_dev *dev); +typedef int (*vhost_memslots_limit)(struct vhost_dev *dev); typedef int (*vhost_net_set_backend_op)(struct vhost_dev *dev, struct vhost_vring_file *file); @@ -131,7 +130,7 @@ typedef int (*vhost_crypto_create_session_op)(struct vhost_dev *dev, typedef int (*vhost_crypto_close_session_op)(struct vhost_dev *dev, uint64_t session_id); -typedef bool (*vhost_backend_no_private_memslots_op)(struct vhost_dev *dev); +typedef bool (*vhost_no_private_memslots_op)(struct vhost_dev *dev); typedef int (*vhost_get_inflight_fd_op)(struct vhost_dev *dev, uint16_t queue_size, @@ -166,10 +165,10 @@ typedef int (*vhost_check_device_state_op)(struct vhost_dev *dev, Error **errp); typedef struct VhostOps { VhostBackendType backend_type; - vhost_backend_init vhost_backend_init; - vhost_backend_cleanup vhost_backend_cleanup; - vhost_backend_memslots_limit vhost_backend_memslots_limit; - vhost_backend_no_private_memslots_op vhost_backend_no_private_memslots; + vhost_init vhost_init; + vhost_cleanup vhost_cleanup; + vhost_memslots_limit vhost_memslots_limit; + vhost_no_private_memslots_op vhost_no_private_memslots; vhost_net_set_backend_op vhost_net_set_backend; vhost_net_set_mtu_op vhost_net_set_mtu; vhost_scsi_set_endpoint_op vhost_scsi_set_endpoint; -- 2.52.0
