All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jike Song <jike.song@intel.com>
To: alex.williamson@redhat.com, kwankhede@nvidia.com, cjia@nvidia.com
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
	bjsdjshi@linux.vnet.ibm.com, kevin.tian@intel.com,
	guangrong.xiao@linux.intel.com, zhenyuw@linux.intel.com,
	jike.song@intel.com, pbonzini@redhat.com, kraxel@redhat.com
Subject: [RFC v6-based v1 3/5] mdev: remove uuid from parent_ops
Date: Tue, 16 Aug 2016 16:14:15 +0800	[thread overview]
Message-ID: <1471335257-6226-4-git-send-email-jike.song@intel.com> (raw)
In-Reply-To: <1471335257-6226-1-git-send-email-jike.song@intel.com>

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(-)

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


WARNING: multiple messages have this Message-ID (diff)
From: Jike Song <jike.song@intel.com>
To: alex.williamson@redhat.com, kwankhede@nvidia.com, cjia@nvidia.com
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
	bjsdjshi@linux.vnet.ibm.com, kevin.tian@intel.com,
	guangrong.xiao@linux.intel.com, zhenyuw@linux.intel.com,
	jike.song@intel.com, pbonzini@redhat.com, kraxel@redhat.com
Subject: [Qemu-devel] [RFC v6-based v1 3/5] mdev: remove uuid from parent_ops
Date: Tue, 16 Aug 2016 16:14:15 +0800	[thread overview]
Message-ID: <1471335257-6226-4-git-send-email-jike.song@intel.com> (raw)
In-Reply-To: <1471335257-6226-1-git-send-email-jike.song@intel.com>

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(-)

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

  parent reply	other threads:[~2016-08-16  8:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16  8:14 [RFC v6-based v1 0/5] refine mdev framework Jike Song
2016-08-16  8:14 ` [Qemu-devel] " Jike Song
2016-08-16  8:14 ` [RFC v6-based v1 1/5] mdev: create separate device for parent_device Jike Song
2016-08-16  8:14   ` [Qemu-devel] " Jike Song
2016-08-16  8:14 ` [RFC v6-based v1 2/5] mdev: drop management information and utilize driver-core instead Jike Song
2016-08-16  8:14   ` [Qemu-devel] " Jike Song
2016-08-16  8:14 ` Jike Song [this message]
2016-08-16  8:14   ` [Qemu-devel] [RFC v6-based v1 3/5] mdev: remove uuid from parent_ops Jike Song
2016-08-16  8:14 ` [RFC v6-based v1 4/5] vfio_mpci: remove PCI-specific logic Jike Song
2016-08-16  8:14   ` [Qemu-devel] " Jike Song
2016-08-16  8:14 ` [RFC v6-based v1 5/5] rename 'vfio_mpci' to 'vfio_mdev' since it is now BUS-agnostic Jike Song
2016-08-16  8:14   ` [Qemu-devel] " Jike Song
2016-08-17  8:58 ` [RFC v6-based v1 0/5] refine mdev framework Dong Jia
2016-08-17  8:58   ` [Qemu-devel] " Dong Jia
2016-08-17 10:09   ` Neo Jia
2016-08-17 10:09     ` [Qemu-devel] " Neo Jia
2016-08-18  8:42     ` Dong Jia
2016-08-18  8:42       ` [Qemu-devel] " Dong Jia
2016-08-18 18:25       ` Alex Williamson
2016-08-18 18:25         ` [Qemu-devel] " Alex Williamson
2016-08-19 17:29         ` Kirti Wankhede
2016-08-19 17:29           ` [Qemu-devel] " Kirti Wankhede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471335257-6226-4-git-send-email-jike.song@intel.com \
    --to=jike.song@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=bjsdjshi@linux.vnet.ibm.com \
    --cc=cjia@nvidia.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhenyuw@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.