mdev should be able to start/stop separately, not relying on grouping in a VM. And even if grouping start/stop needed, it's always easy for userspace to find out all mdevs belonging to a particular VM. Signed-off-by: Jike Song <jike.song@xxxxxxxxx> --- drivers/vfio/mdev/mdev_core.c | 4 ++-- include/linux/mdev.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index a677db7..934dac9 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -396,9 +396,9 @@ int mdev_device_start(struct device *dev, bool start) struct parent_device *parent = dev_to_parent_dev(dev->parent); if (start && parent->ops->start) - ret = parent->ops->start(mdev->uuid); + ret = parent->ops->start(mdev); else if (!start && parent->ops->stop) - ret = parent->ops->stop(mdev->uuid); + ret = parent->ops->stop(mdev); if (ret) pr_err("mdev %s failed %d\n", start ? "start" : "stop", ret); diff --git a/include/linux/mdev.h b/include/linux/mdev.h index 8488b27..c06967d 100644 --- a/include/linux/mdev.h +++ b/include/linux/mdev.h @@ -79,10 +79,10 @@ struct mdev_device { * Returns integer: success (0) or error (< 0) * @start: Called to initiate mediated device initialization * process in parent device's driver before VMM starts. - * @uuid: UUID + * @mdev: mediated device structure * Returns integer: success (0) or error (< 0) * @stop: Called to teardown mediated device related resources - * @uuid: UUID + * @mdev: mediated device structure * Returns integer: success (0) or error (< 0) * @read: Read emulation callback * @mdev: mediated device structure @@ -134,8 +134,8 @@ struct parent_ops { int (*create)(struct mdev_device *mdev, char *mdev_params); int (*destroy)(struct mdev_device *mdev); int (*reset)(struct mdev_device *mdev); - int (*start)(uuid_le uuid); - int (*stop)(uuid_le uuid); + int (*start)(struct mdev_device *mdev); + int (*stop)(struct mdev_device *mdev); ssize_t (*read)(struct mdev_device *mdev, char *buf, size_t count, loff_t pos); ssize_t (*write)(struct mdev_device *mdev, char *buf, size_t count, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html