qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Zhenzhong Duan <zhenzhong.duan@intel.com>, qemu-devel@nongnu.org
Cc: alex.williamson@redhat.com, eric.auger@redhat.com,
	chao.p.peng@intel.com,
	"'Philippe Mathieu-Daudé'" <philmd@linaro.org>
Subject: Re: [PATCH v3] vfio: Introduce helper vfio_pci_from_vfio_device()
Date: Fri, 1 Aug 2025 17:05:28 +0200	[thread overview]
Message-ID: <ed8451bd-853a-429e-987c-4ec86e01efe9@redhat.com> (raw)
In-Reply-To: <8b599c19-1901-4707-a8ca-943f61c0e2f9@redhat.com>

Zhenzhong,

On 8/1/25 07:42, Cédric Le Goater wrote:
> On 8/1/25 04:35, Zhenzhong Duan wrote:
>> Introduce helper vfio_pci_from_vfio_device() to transform from VFIODevice
>> to VFIOPCIDevice, also to hide low level VFIO_DEVICE_TYPE_PCI type check.
>>
>> Suggested-by: Cédric Le Goater <clg@redhat.com>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>> ---
>> v3: add one line comment to the helper
>> v2: move helper to hw/vfio/pci.[hc]
>>      rename with vfio_pci_ prefix
>>
>>   hw/vfio/pci.h       | 1 +
>>   hw/vfio/container.c | 4 ++--
>>   hw/vfio/device.c    | 2 +-
>>   hw/vfio/iommufd.c   | 4 ++--
>>   hw/vfio/listener.c  | 4 ++--
>>   hw/vfio/pci.c       | 9 +++++++++
>>   6 files changed, 17 insertions(+), 7 deletions(-)
> 
> 
> Reviewed-by: Cédric Le Goater <clg@redhat.com>
> 
> Thanks,
> 
> C.

I have modified your patch with :

+/**
+  * vfio_pci_from_vfio_device: Transform from VFIODevice to
+  * VFIOPCIDevice
+  *
+  * This function checks if the given @vbasedev is a VFIO PCI device.
+  * If it is, it returns the containing VFIOPCIDevice.
+  *
+  * @vbasedev: The VFIODevice to transform
+  *
+  * Return: The VFIOPCIDevice on success, NULL on failure.
+  */

See https://github.com/legoater/qemu/tree/vfio-10.2.

I don't think it's really necessary, as these are internal APIs and
none are documented, but Philippe seems keen on it. I guess he plans
to volunteer to document the rest ;)

No need to resend a v4.

Thanks,

C.




  reply	other threads:[~2025-08-01 15:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-01  2:35 [PATCH v3] vfio: Introduce helper vfio_pci_from_vfio_device() Zhenzhong Duan
2025-08-01  5:42 ` Cédric Le Goater
2025-08-01 15:05   ` Cédric Le Goater [this message]
2025-08-01 15:56     ` Peter Maydell
2025-08-01 16:33       ` Cédric Le Goater
2025-08-04  2:22     ` Duan, Zhenzhong
2025-08-01 14:14 ` Philippe Mathieu-Daudé
2025-08-04  2:27   ` Duan, Zhenzhong

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=ed8451bd-853a-429e-987c-4ec86e01efe9@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=chao.p.peng@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhenzhong.duan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).