From 55189bee6b8255a29c6164c8b8a018730d405687 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Fri, 7 May 2021 17:48:20 +0800 Subject: [PATCH] libvfio-user: update submodule This update will stop using `struct vfio_device_info` from . Fix issue #1922. Change-Id: Ia7ad745db8d7ed8f5248ca13e3188ebd540b0e40 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7831 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Reviewed-by: Ben Walker --- include/spdk/vfio_user_spec.h | 8 ++++++++ lib/vfio_user/vfio_user.c | 4 ++-- lib/vfio_user/vfio_user_internal.h | 3 ++- lib/vfio_user/vfio_user_pci.c | 2 +- libvfio-user | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/include/spdk/vfio_user_spec.h b/include/spdk/vfio_user_spec.h index ac87ba1810..1da127b98b 100644 --- a/include/spdk/vfio_user_spec.h +++ b/include/spdk/vfio_user_spec.h @@ -81,6 +81,14 @@ struct vfio_user_version { uint8_t data[]; } __attribute__((packed)); +struct vfio_user_device_info { + uint32_t argsz; + /* VFIO_DEVICE_FLAGS_* */ + uint32_t flags; + uint32_t num_regions; + uint32_t num_irqs; +} __attribute__((packed)); + struct vfio_user_dma_region { uint64_t addr; uint64_t size; diff --git a/lib/vfio_user/vfio_user.c b/lib/vfio_user/vfio_user.c index 4024dc1054..53f297001f 100644 --- a/lib/vfio_user/vfio_user.c +++ b/lib/vfio_user/vfio_user.c @@ -285,10 +285,10 @@ vfio_user_get_dev_region_info(struct vfio_device *dev, struct vfio_region_info * } int -vfio_user_get_dev_info(struct vfio_device *dev, struct vfio_device_info *dev_info, +vfio_user_get_dev_info(struct vfio_device *dev, struct vfio_user_device_info *dev_info, size_t buf_len) { - dev_info->argsz = sizeof(struct vfio_device_info); + dev_info->argsz = sizeof(struct vfio_user_device_info); return vfio_user_dev_send_request(dev, VFIO_USER_DEVICE_GET_INFO, dev_info, dev_info->argsz, buf_len, NULL, 0); } diff --git a/lib/vfio_user/vfio_user_internal.h b/lib/vfio_user/vfio_user_internal.h index f14cc87a40..d03b328e5f 100644 --- a/lib/vfio_user/vfio_user_internal.h +++ b/lib/vfio_user/vfio_user_internal.h @@ -34,6 +34,7 @@ #define _VFIO_INTERNAL_H #include +#include "spdk/vfio_user_spec.h" #define VFIO_USER_MAJOR_VER 0 #define VFIO_USER_MINOR_VER 1 @@ -85,7 +86,7 @@ struct vfio_device { }; int vfio_user_dev_setup(struct vfio_device *dev); -int vfio_user_get_dev_info(struct vfio_device *dev, struct vfio_device_info *dev_info, +int vfio_user_get_dev_info(struct vfio_device *dev, struct vfio_user_device_info *dev_info, size_t buf_len); int vfio_user_get_dev_region_info(struct vfio_device *dev, struct vfio_region_info *region_info, size_t buf_len, int *fds, int num_fds); diff --git a/lib/vfio_user/vfio_user_pci.c b/lib/vfio_user/vfio_user_pci.c index 6e3b2c34e8..37758e2930 100644 --- a/lib/vfio_user/vfio_user_pci.c +++ b/lib/vfio_user/vfio_user_pci.c @@ -369,7 +369,7 @@ spdk_vfio_user_setup(const char *path) { int ret; struct vfio_device *device = NULL; - struct vfio_device_info dev_info = {}; + struct vfio_user_device_info dev_info = {}; device = calloc(1, sizeof(*device)); if (!device) { diff --git a/libvfio-user b/libvfio-user index 3acb97477f..702a4cad49 160000 --- a/libvfio-user +++ b/libvfio-user @@ -1 +1 @@ -Subproject commit 3acb97477f261bf11c866b5764deabe693607bc3 +Subproject commit 702a4cad49c40406ff498e0da4a80c6d07b4fc83