Previously SPDK use libvfio-user library to provide emulated NVMe devices to VM, but it's limited to NVMe device type only. Here we add SPDK vfu_target library abstraction based on libvfio-user which supports more PCI device types. We will add virtio-blk and virtio-scsi devices emulation based on vfu_tgt library in following patches, actually this library can support NVMe emulation too, due to the fact that the NVMe emulation is already exist, so we will keep the NVMe emulation which based on libvfio-user directly as it is. Change-Id: Ib0ead6c6118fa62308355fe432003dd928a2fae9 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12597 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
33 lines
614 B
C
33 lines
614 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright (c) Intel Corporation.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#ifndef _TGT_INTERNAL_H
|
|
#define _TGT_INTERNAL_H
|
|
|
|
#include "spdk/vfu_target.h"
|
|
|
|
struct spdk_vfu_endpoint {
|
|
char name[SPDK_VFU_MAX_NAME_LEN];
|
|
char uuid[PATH_MAX];
|
|
|
|
struct spdk_vfu_endpoint_ops ops;
|
|
|
|
vfu_ctx_t *vfu_ctx;
|
|
void *endpoint_ctx;
|
|
|
|
struct spdk_poller *accept_poller;
|
|
struct spdk_poller *vfu_ctx_poller;
|
|
bool is_attached;
|
|
|
|
struct msixcap *msix;
|
|
vfu_pci_config_space_t *pci_config_space;
|
|
|
|
struct spdk_thread *thread;
|
|
|
|
TAILQ_ENTRY(spdk_vfu_endpoint) link;
|
|
};
|
|
|
|
#endif
|