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:
parent
c746de9baf
commit
9df2ea9c27
@ -67,13 +67,13 @@ struct spdk_vhost_dev_event_ctx {
|
||||
};
|
||||
|
||||
static int new_connection(int vid);
|
||||
static int new_device(int vid);
|
||||
static void destroy_device(int vid);
|
||||
static int start_device(int vid);
|
||||
static void stop_device(int vid);
|
||||
static void destroy_connection(int vid);
|
||||
|
||||
const struct vhost_device_ops g_spdk_vhost_ops = {
|
||||
.new_device = new_device,
|
||||
.destroy_device = destroy_device,
|
||||
.new_device = start_device,
|
||||
.destroy_device = stop_device,
|
||||
.new_connection = new_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
|
||||
destroy_device(int vid)
|
||||
stop_device(int vid)
|
||||
{
|
||||
struct spdk_vhost_dev *vdev;
|
||||
struct rte_vhost_vring *q;
|
||||
@ -693,7 +693,7 @@ destroy_device(int vid)
|
||||
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) {
|
||||
SPDK_ERRLOG("Couldn't stop device with vid %d.\n", vid);
|
||||
pthread_mutex_unlock(&g_spdk_vhost_mutex);
|
||||
@ -712,7 +712,7 @@ destroy_device(int vid)
|
||||
}
|
||||
|
||||
static int
|
||||
new_device(int vid)
|
||||
start_device(int vid)
|
||||
{
|
||||
struct spdk_vhost_dev *vdev;
|
||||
int rc = -1;
|
||||
@ -766,7 +766,7 @@ new_device(int vid)
|
||||
}
|
||||
|
||||
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) {
|
||||
free(vdev->mem);
|
||||
spdk_vhost_free_reactor(vdev->lcore);
|
||||
|
@ -484,7 +484,7 @@ alloc_task_pool(struct spdk_vhost_blk_dev *bvdev)
|
||||
*
|
||||
*/
|
||||
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;
|
||||
int rc = 0;
|
||||
@ -556,7 +556,7 @@ destroy_device_poller_cb(void *arg)
|
||||
}
|
||||
|
||||
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_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) |
|
||||
(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),
|
||||
.new_device = new_device,
|
||||
.destroy_device = destroy_device,
|
||||
.start_device = spdk_vhost_blk_start,
|
||||
.stop_device = spdk_vhost_blk_stop,
|
||||
.dump_config_json = spdk_vhost_blk_dump_config_json,
|
||||
.vhost_remove_controller = spdk_vhost_blk_destroy,
|
||||
};
|
||||
|
@ -95,8 +95,8 @@ struct spdk_vhost_dev_backend {
|
||||
* within an arbitrary limit of 3 seconds, these
|
||||
* callbacks will time out.
|
||||
*/
|
||||
spdk_vhost_event_fn new_device;
|
||||
spdk_vhost_event_fn destroy_device;
|
||||
spdk_vhost_event_fn start_device;
|
||||
spdk_vhost_event_fn stop_device;
|
||||
|
||||
void (*dump_config_json)(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w);
|
||||
int (*vhost_remove_controller)(struct spdk_vhost_dev *vdev);
|
||||
|
@ -99,15 +99,15 @@ struct spdk_vhost_scsi_task {
|
||||
struct rte_vhost_vring *vq;
|
||||
};
|
||||
|
||||
static int new_device(struct spdk_vhost_dev *, void *);
|
||||
static int destroy_device(struct spdk_vhost_dev *, void *);
|
||||
static int spdk_vhost_scsi_start(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);
|
||||
|
||||
const struct spdk_vhost_dev_backend spdk_vhost_scsi_device_backend = {
|
||||
.virtio_features = SPDK_VHOST_SCSI_FEATURES,
|
||||
.disabled_features = SPDK_VHOST_SCSI_DISABLED_FEATURES,
|
||||
.new_device = new_device,
|
||||
.destroy_device = destroy_device,
|
||||
.start_device = spdk_vhost_scsi_start,
|
||||
.stop_device = spdk_vhost_scsi_stop,
|
||||
.dump_config_json = spdk_vhost_scsi_config_json,
|
||||
.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.
|
||||
*/
|
||||
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;
|
||||
uint32_t i;
|
||||
@ -1038,7 +1038,7 @@ destroy_device_poller_cb(void *arg)
|
||||
}
|
||||
|
||||
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_dev_destroy_ctx *destroy_ctx;
|
||||
|
Loading…
Reference in New Issue
Block a user