@@ -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);
@@ -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,
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@intel.com> --- drivers/vfio/mdev/mdev_core.c | 4 ++-- include/linux/mdev.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)