diff --git a/include/spdk/vhost.h b/include/spdk/vhost.h index c7285b737..a66e7a29f 100644 --- a/include/spdk/vhost.h +++ b/include/spdk/vhost.h @@ -107,10 +107,9 @@ const char *spdk_vhost_dev_get_name(struct spdk_vhost_dev *vdev); * of SPDK app cpuset vhost was started with. * * \param dev vhost device - * \param cpuset pointer to the cpuset of the vdev. + * \return cpuset of the vdev. */ -void spdk_vhost_dev_get_cpumask(struct spdk_vhost_dev *vdev, - struct spdk_cpuset *cpuset); +const struct spdk_cpuset *spdk_vhost_dev_get_cpumask(struct spdk_vhost_dev *vdev); /** * By default, events are generated when asked, but for high queue depth and diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 61ce3bfaa..e46bd0ae8 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -765,12 +765,11 @@ spdk_vhost_dev_get_name(struct spdk_vhost_dev *vdev) return vdev->name; } -void -spdk_vhost_dev_get_cpumask(struct spdk_vhost_dev *vdev, struct spdk_cpuset *cpumask) +const struct spdk_cpuset * +spdk_vhost_dev_get_cpumask(struct spdk_vhost_dev *vdev) { assert(vdev != NULL); - assert(cpumask != NULL); - spdk_cpuset_copy(cpumask, vdev->cpumask); + return vdev->cpumask; } static uint32_t