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:
parent
c9f8765a69
commit
aacd61d54a
@ -43,8 +43,8 @@
|
|||||||
|
|
||||||
#include "spdk/event.h"
|
#include "spdk/event.h"
|
||||||
|
|
||||||
void spdk_vhost_subsystem_init(void);
|
int spdk_vhost_init(void);
|
||||||
int spdk_vhost_subsystem_fini(void);
|
int spdk_vhost_fini(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \param event event object. event arg1 is optional path to vhost socket.
|
* \param event event object. event arg1 is optional path to vhost socket.
|
||||||
|
@ -37,5 +37,21 @@
|
|||||||
|
|
||||||
#include "spdk_internal/event.h"
|
#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_REGISTER(vhost, spdk_vhost_subsystem_init, spdk_vhost_subsystem_fini, NULL)
|
||||||
SPDK_SUBSYSTEM_DEPEND(vhost, scsi)
|
SPDK_SUBSYSTEM_DEPEND(vhost, scsi)
|
||||||
|
@ -85,23 +85,21 @@ spdk_vhost_task_get(struct spdk_vhost_scsi_dev *vdev)
|
|||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
spdk_vhost_subsystem_init(void)
|
spdk_vhost_init(void)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
g_task_pool = rte_mempool_create("vhost task pool", 16384, sizeof(struct spdk_vhost_task),
|
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);
|
128, 0, NULL, NULL, NULL, NULL, SOCKET_ID_ANY, 0);
|
||||||
if (!g_task_pool) {
|
if (!g_task_pool) {
|
||||||
SPDK_ERRLOG("create task pool failed\n");
|
SPDK_ERRLOG("create task pool failed\n");
|
||||||
rc = -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
spdk_subsystem_init_next(rc);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_vhost_subsystem_fini(void)
|
spdk_vhost_fini(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user