diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2120cd11..ec8dec2c05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,10 @@ options. Options can be set independently for each implementation. Added `recv_buf_size` and 'send_buf_size' socket layer options. They are used only in posix implementation. +### vhost + +The function `spdk_vhost_blk_get_dev` has been removed. + ## v20.04: IDXD engine support for compare has been added. diff --git a/include/spdk/vhost.h b/include/spdk/vhost.h index 0bea83b015..211c2d3372 100644 --- a/include/spdk/vhost.h +++ b/include/spdk/vhost.h @@ -330,16 +330,6 @@ int spdk_vhost_blk_construct(const char *name, const char *cpumask, const char * */ int spdk_vhost_dev_remove(struct spdk_vhost_dev *vdev); -/** - * Get underlying SPDK bdev from vhost blk device. The bdev might be NULL, as it - * could have been hotremoved. - * - * \param ctrlr vhost blk device. - * - * \return SPDK bdev associated with given vdev. - */ -struct spdk_bdev *spdk_vhost_blk_get_dev(struct spdk_vhost_dev *ctrlr); - #ifdef __cplusplus } #endif diff --git a/lib/vhost/Makefile b/lib/vhost/Makefile index d887c9aaf7..1fe9b6e400 100644 --- a/lib/vhost/Makefile +++ b/lib/vhost/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -SO_VER := 3 +SO_VER := 4 SO_MINOR := 0 CFLAGS += -I. diff --git a/lib/vhost/spdk_vhost.map b/lib/vhost/spdk_vhost.map index 83eb518e5b..de38e5a5e5 100644 --- a/lib/vhost/spdk_vhost.map +++ b/lib/vhost/spdk_vhost.map @@ -22,7 +22,6 @@ spdk_vhost_scsi_dev_remove_tgt; spdk_vhost_blk_construct; spdk_vhost_dev_remove; - spdk_vhost_blk_get_dev; local: *; }; diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c index 91201f7f41..e722823c21 100644 --- a/lib/vhost/vhost_blk.c +++ b/lib/vhost/vhost_blk.c @@ -801,15 +801,6 @@ to_blk_dev(struct spdk_vhost_dev *vdev) return SPDK_CONTAINEROF(vdev, struct spdk_vhost_blk_dev, vdev); } -struct spdk_bdev * -spdk_vhost_blk_get_dev(struct spdk_vhost_dev *vdev) -{ - struct spdk_vhost_blk_dev *bvdev = to_blk_dev(vdev); - - assert(bvdev != NULL); - return bvdev->bdev; -} - static void vhost_dev_bdev_remove_cpl_cb(struct spdk_vhost_dev *vdev, void *ctx) { @@ -1031,18 +1022,18 @@ vhost_blk_stop(struct spdk_vhost_session *vsession) static void vhost_blk_dump_info_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w) { - struct spdk_bdev *bdev = spdk_vhost_blk_get_dev(vdev); struct spdk_vhost_blk_dev *bvdev; bvdev = to_blk_dev(vdev); assert(bvdev != NULL); + spdk_json_write_named_object_begin(w, "block"); spdk_json_write_named_bool(w, "readonly", bvdev->readonly); spdk_json_write_name(w, "bdev"); - if (bdev) { - spdk_json_write_string(w, spdk_bdev_get_name(bdev)); + if (bvdev->bdev) { + spdk_json_write_string(w, spdk_bdev_get_name(bvdev->bdev)); } else { spdk_json_write_null(w); } @@ -1057,6 +1048,7 @@ vhost_blk_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_ bvdev = to_blk_dev(vdev); assert(bvdev != NULL); + if (!bvdev->bdev) { return; }