vhost: add device type field

Change-Id: I848c8c5dcf837c11e052bb03cba962a843f28778
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/363088
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Pawel Wodkowski 2017-05-25 19:45:26 +02:00 committed by Daniel Verkamp
parent 3671543a5b
commit 0888dd4cc6
2 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,10 @@
#define MAX_VHOST_VRINGS 256
enum spdk_vhost_dev_type {
SPDK_VHOST_DEV_T_SCSI,
};
struct spdk_vhost_dev {
struct rte_vhost_memory *mem;
char *name;
@ -54,6 +58,8 @@ struct spdk_vhost_dev {
int32_t lcore;
uint64_t cpumask;
enum spdk_vhost_dev_type type;
uint16_t num_queues;
uint64_t negotiated_features;
struct rte_vhost_vring virtqueue[MAX_VHOST_VRINGS] __attribute((aligned(SPDK_CACHE_LINE_SIZE)));

View File

@ -639,6 +639,8 @@ spdk_vhost_scsi_dev_construct(const char *name, uint64_t cpumask)
vdev->cpumask = cpumask;
vdev->lcore = -1;
vdev->type = SPDK_VHOST_DEV_T_SCSI;
rc = spdk_vhost_dev_register(vdev, &spdk_vhost_scsi_device_backend);
if (rc < 0) {
free(vdev->name);