qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Zhenzhong Duan" <zhenzhong.duan@intel.com>,
	qemu-devel@nongnu.org, 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 18:33:39 +0200	[thread overview]
Message-ID: <2c3f3861-0a6f-49f4-902d-d1265b842795@redhat.com> (raw)
In-Reply-To: <CAFEAcA9uc7PFvD8e=+WS-1WSAsqoZR5BRSPDjNeYsHU=TUcrhQ@mail.gmail.com>

On 8/1/25 17:56, Peter Maydell wrote:
> On Fri, 1 Aug 2025 at 16:47, Cédric Le Goater <clg@redhat.com> wrote:
>> 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 ;)
> 
> This is one of those cases where we have a rule in place
> that we apply on code review for newly added prototypes
> in header files, as an exercise in trying to at least not
> make an existing problem worse :-)

Sure. May be, this is something we could add to checkpatch.pl
then ? This would reduce the resends for simple things.

> I think Philippe's intent was just to say "put that one
> line comment by the prototype in the .h file rather than
> by the implementation in the .c file", rather than to
> require a full-on doc-comment format comment, though
> I do appreciate having one.
I've tried to reorganize the VFIO code to define some software
subcomponents and layers in previous versions. This to handle
recent (rather significant) changes and also because vfio-pci
was initially a device and is gradually evolving into a kind
of library.

I'd also like to address documentation, so my comment was
self-interested :) as it's a pretty broad topic; any help is
welcome !

I should find a way to generate some of it to start with. At least.

Thanks,

C.



  reply	other threads:[~2025-08-01 18:08 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
2025-08-01 15:56     ` Peter Maydell
2025-08-01 16:33       ` Cédric Le Goater [this message]
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=2c3f3861-0a6f-49f4-902d-d1265b842795@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=chao.p.peng@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).