Commit 5fb57441 authored by Sebastian Brzezinka's avatar Sebastian Brzezinka Committed by Tomasz Zawadzki
Browse files

lib/vfio-user: add spdk_vfio_user_dev_send_request as public function



Fuzzing vfio-user require access to send request api

Signed-off-by: default avatarSebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: I6c58b8ab4fd3394150bbb3e64b4f95bff93dae6e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13881


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent ef73f559
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#define _SPDK_VFIO_USER_PCI_H

#include "spdk/stdinc.h"
#include "spdk/vfio_user_spec.h"

#ifdef __cplusplus
extern "C" {
@@ -24,6 +25,11 @@ struct vfio_device *spdk_vfio_user_setup(const char *path);

void spdk_vfio_user_release(struct vfio_device *dev);

/* For fuzzing only */
int spdk_vfio_user_dev_send_request(struct vfio_device *dev, enum vfio_user_command command,
				    void *arg, size_t arg_len, size_t buf_len, int *fds,
				    int max_fds);

#ifdef __cplusplus
}
#endif
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 3
SO_MINOR := 0
SO_MINOR := 1

C_SRCS = vfio_user_pci.c vfio_user.c
LIBNAME = vfio_user
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
	spdk_vfio_user_get_bar_addr;
	spdk_vfio_user_setup;
	spdk_vfio_user_release;
	spdk_vfio_user_dev_send_request;

	local: *;
};
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ vfio_user_read(int fd, struct vfio_user_request *req)
	return 0;
}

static int
int
vfio_user_dev_send_request(struct vfio_device *dev, enum vfio_user_command command,
			   void *arg, size_t arg_len, size_t buf_len, int *fds, int max_fds)
{
+4 −0
Original line number Diff line number Diff line
@@ -65,5 +65,9 @@ int vfio_user_get_dev_region_info(struct vfio_device *dev, struct vfio_region_in
int vfio_user_dev_dma_map_unmap(struct vfio_device *dev, struct vfio_memory_region *mr, bool map);
int vfio_user_dev_mmio_access(struct vfio_device *dev, uint32_t index, uint64_t offset, size_t len,
			      void *buf, bool is_write);
/* For fuzzing only */
int vfio_user_dev_send_request(struct vfio_device *dev, enum vfio_user_command command,
			       void *arg, size_t arg_len, size_t buf_len, int *fds,
			       int max_fds);

#endif
Loading