vhost: rename new/destroy_dev() to start/stop_dev()

Previous names were highly misleading.

Change-Id: I30256da35da4b916f39982be134fa7128e81c914
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381074
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-10-03 09:00:33 +02:00 committed by Daniel Verkamp
parent c746de9baf
commit 9df2ea9c27
4 changed files with 20 additions and 20 deletions

View File

@ -67,13 +67,13 @@ struct spdk_vhost_dev_event_ctx {
}; };
static int new_connection(int vid); static int new_connection(int vid);
static int new_device(int vid); static int start_device(int vid);
static void destroy_device(int vid); static void stop_device(int vid);
static void destroy_connection(int vid); static void destroy_connection(int vid);
const struct vhost_device_ops g_spdk_vhost_ops = { const struct vhost_device_ops g_spdk_vhost_ops = {
.new_device = new_device, .new_device = start_device,
.destroy_device = destroy_device, .destroy_device = stop_device,
.new_connection = new_connection, .new_connection = new_connection,
.destroy_connection = destroy_connection, .destroy_connection = destroy_connection,
}; };
@ -672,7 +672,7 @@ spdk_vhost_event_async_send(unsigned vdev_id, spdk_vhost_event_fn cb_fn, void *a
} }
static void static void
destroy_device(int vid) stop_device(int vid)
{ {
struct spdk_vhost_dev *vdev; struct spdk_vhost_dev *vdev;
struct rte_vhost_vring *q; struct rte_vhost_vring *q;
@ -693,7 +693,7 @@ destroy_device(int vid)
return; return;
} }
rc = spdk_vhost_event_send(vdev, vdev->backend->destroy_device, 3, "destroy device"); rc = spdk_vhost_event_send(vdev, vdev->backend->stop_device, 3, "stop device");
if (rc != 0) { if (rc != 0) {
SPDK_ERRLOG("Couldn't stop device with vid %d.\n", vid); SPDK_ERRLOG("Couldn't stop device with vid %d.\n", vid);
pthread_mutex_unlock(&g_spdk_vhost_mutex); pthread_mutex_unlock(&g_spdk_vhost_mutex);
@ -712,7 +712,7 @@ destroy_device(int vid)
} }
static int static int
new_device(int vid) start_device(int vid)
{ {
struct spdk_vhost_dev *vdev; struct spdk_vhost_dev *vdev;
int rc = -1; int rc = -1;
@ -766,7 +766,7 @@ new_device(int vid)
} }
vdev->lcore = spdk_vhost_allocate_reactor(vdev->cpumask); vdev->lcore = spdk_vhost_allocate_reactor(vdev->cpumask);
rc = spdk_vhost_event_send(vdev, vdev->backend->new_device, 3, "new device"); rc = spdk_vhost_event_send(vdev, vdev->backend->start_device, 3, "start device");
if (rc != 0) { if (rc != 0) {
free(vdev->mem); free(vdev->mem);
spdk_vhost_free_reactor(vdev->lcore); spdk_vhost_free_reactor(vdev->lcore);

View File

@ -484,7 +484,7 @@ alloc_task_pool(struct spdk_vhost_blk_dev *bvdev)
* *
*/ */
static int static int
new_device(struct spdk_vhost_dev *vdev, void *event_ctx) spdk_vhost_blk_start(struct spdk_vhost_dev *vdev, void *event_ctx)
{ {
struct spdk_vhost_blk_dev *bvdev; struct spdk_vhost_blk_dev *bvdev;
int rc = 0; int rc = 0;
@ -556,7 +556,7 @@ destroy_device_poller_cb(void *arg)
} }
static int static int
destroy_device(struct spdk_vhost_dev *vdev, void *event_ctx) spdk_vhost_blk_stop(struct spdk_vhost_dev *vdev, void *event_ctx)
{ {
struct spdk_vhost_blk_dev *bvdev; struct spdk_vhost_blk_dev *bvdev;
struct spdk_vhost_dev_destroy_ctx *destroy_ctx; struct spdk_vhost_dev_destroy_ctx *destroy_ctx;
@ -620,8 +620,8 @@ static const struct spdk_vhost_dev_backend vhost_blk_device_backend = {
.disabled_features = SPDK_VHOST_DISABLED_FEATURES | (1ULL << VIRTIO_BLK_F_GEOMETRY) | .disabled_features = SPDK_VHOST_DISABLED_FEATURES | (1ULL << VIRTIO_BLK_F_GEOMETRY) |
(1ULL << VIRTIO_BLK_F_RO) | (1ULL << VIRTIO_BLK_F_FLUSH) | (1ULL << VIRTIO_BLK_F_CONFIG_WCE) | (1ULL << VIRTIO_BLK_F_RO) | (1ULL << VIRTIO_BLK_F_FLUSH) | (1ULL << VIRTIO_BLK_F_CONFIG_WCE) |
(1ULL << VIRTIO_BLK_F_BARRIER) | (1ULL << VIRTIO_BLK_F_SCSI), (1ULL << VIRTIO_BLK_F_BARRIER) | (1ULL << VIRTIO_BLK_F_SCSI),
.new_device = new_device, .start_device = spdk_vhost_blk_start,
.destroy_device = destroy_device, .stop_device = spdk_vhost_blk_stop,
.dump_config_json = spdk_vhost_blk_dump_config_json, .dump_config_json = spdk_vhost_blk_dump_config_json,
.vhost_remove_controller = spdk_vhost_blk_destroy, .vhost_remove_controller = spdk_vhost_blk_destroy,
}; };

View File

@ -95,8 +95,8 @@ struct spdk_vhost_dev_backend {
* within an arbitrary limit of 3 seconds, these * within an arbitrary limit of 3 seconds, these
* callbacks will time out. * callbacks will time out.
*/ */
spdk_vhost_event_fn new_device; spdk_vhost_event_fn start_device;
spdk_vhost_event_fn destroy_device; spdk_vhost_event_fn stop_device;
void (*dump_config_json)(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w); void (*dump_config_json)(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w);
int (*vhost_remove_controller)(struct spdk_vhost_dev *vdev); int (*vhost_remove_controller)(struct spdk_vhost_dev *vdev);

View File

@ -99,15 +99,15 @@ struct spdk_vhost_scsi_task {
struct rte_vhost_vring *vq; struct rte_vhost_vring *vq;
}; };
static int new_device(struct spdk_vhost_dev *, void *); static int spdk_vhost_scsi_start(struct spdk_vhost_dev *, void *);
static int destroy_device(struct spdk_vhost_dev *, void *); static int spdk_vhost_scsi_stop(struct spdk_vhost_dev *, void *);
static void spdk_vhost_scsi_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w); static void spdk_vhost_scsi_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w);
const struct spdk_vhost_dev_backend spdk_vhost_scsi_device_backend = { const struct spdk_vhost_dev_backend spdk_vhost_scsi_device_backend = {
.virtio_features = SPDK_VHOST_SCSI_FEATURES, .virtio_features = SPDK_VHOST_SCSI_FEATURES,
.disabled_features = SPDK_VHOST_SCSI_DISABLED_FEATURES, .disabled_features = SPDK_VHOST_SCSI_DISABLED_FEATURES,
.new_device = new_device, .start_device = spdk_vhost_scsi_start,
.destroy_device = destroy_device, .stop_device = spdk_vhost_scsi_stop,
.dump_config_json = spdk_vhost_scsi_config_json, .dump_config_json = spdk_vhost_scsi_config_json,
.vhost_remove_controller = spdk_vhost_scsi_dev_remove, .vhost_remove_controller = spdk_vhost_scsi_dev_remove,
}; };
@ -967,7 +967,7 @@ alloc_task_pool(struct spdk_vhost_scsi_dev *svdev)
* and then allocated to a specific data core. * and then allocated to a specific data core.
*/ */
static int static int
new_device(struct spdk_vhost_dev *vdev, void *event_ctx) spdk_vhost_scsi_start(struct spdk_vhost_dev *vdev, void *event_ctx)
{ {
struct spdk_vhost_scsi_dev *svdev; struct spdk_vhost_scsi_dev *svdev;
uint32_t i; uint32_t i;
@ -1038,7 +1038,7 @@ destroy_device_poller_cb(void *arg)
} }
static int static int
destroy_device(struct spdk_vhost_dev *vdev, void *event_ctx) spdk_vhost_scsi_stop(struct spdk_vhost_dev *vdev, void *event_ctx)
{ {
struct spdk_vhost_scsi_dev *svdev; struct spdk_vhost_scsi_dev *svdev;
struct spdk_vhost_dev_destroy_ctx *destroy_ctx; struct spdk_vhost_dev_destroy_ctx *destroy_ctx;