diff --git a/include/spdk/nbd.h b/include/spdk/nbd.h index d987c1c4b..0e63ec1b0 100644 --- a/include/spdk/nbd.h +++ b/include/spdk/nbd.h @@ -77,6 +77,11 @@ struct spdk_nbd_disk *spdk_nbd_start(const char *bdev_name, const char *nbd_path */ void spdk_nbd_stop(struct spdk_nbd_disk *nbd); +/** + * Get the local filesystem path used for the network block device. + */ +const char *spdk_nbd_get_path(struct spdk_nbd_disk *nbd); + /** * Write NBD subsystem configuration into provided JSON context. * diff --git a/lib/nbd/nbd.c b/lib/nbd/nbd.c index 639f122ce..77c2d6daa 100644 --- a/lib/nbd/nbd.c +++ b/lib/nbd/nbd.c @@ -966,4 +966,10 @@ err: return NULL; } +const char * +spdk_nbd_get_path(struct spdk_nbd_disk *nbd) +{ + return nbd->nbd_path; +} + SPDK_LOG_REGISTER_COMPONENT("nbd", SPDK_LOG_NBD)