vhost: Move subsystem initialization to event_vhost

This removes one dependency on the event framework.

Change-Id: Ib9c8160b1704a15b662a35d5ad1f32c0b745485c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365729
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Ben Walker 2017-06-14 16:23:52 -07:00 committed by Jim Harris
parent c9f8765a69
commit aacd61d54a
3 changed files with 23 additions and 9 deletions

View File

@ -43,8 +43,8 @@
#include "spdk/event.h"
void spdk_vhost_subsystem_init(void);
int spdk_vhost_subsystem_fini(void);
int spdk_vhost_init(void);
int spdk_vhost_fini(void);
/**
* \param event event object. event arg1 is optional path to vhost socket.

View File

@ -37,5 +37,21 @@
#include "spdk_internal/event.h"
static void
spdk_vhost_subsystem_init(void)
{
int rc = 0;
rc = spdk_vhost_init();
spdk_subsystem_init_next(rc);
}
static int
spdk_vhost_subsystem_fini(void)
{
return spdk_vhost_fini();
}
SPDK_SUBSYSTEM_REGISTER(vhost, spdk_vhost_subsystem_init, spdk_vhost_subsystem_fini, NULL)
SPDK_SUBSYSTEM_DEPEND(vhost, scsi)

View File

@ -85,23 +85,21 @@ spdk_vhost_task_get(struct spdk_vhost_scsi_dev *vdev)
return task;
}
void
spdk_vhost_subsystem_init(void)
int
spdk_vhost_init(void)
{
int rc = 0;
g_task_pool = rte_mempool_create("vhost task pool", 16384, sizeof(struct spdk_vhost_task),
128, 0, NULL, NULL, NULL, NULL, SOCKET_ID_ANY, 0);
if (!g_task_pool) {
SPDK_ERRLOG("create task pool failed\n");
rc = -1;
return -1;
}
spdk_subsystem_init_next(rc);
return 0;
}
int
spdk_vhost_subsystem_fini(void)
spdk_vhost_fini(void)
{
return 0;
}