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,
yi.l.liu@intel.com, chao.p.peng@intel.com
Subject: Re: [PATCH] vfio/container: Rename vfio_init_container to vfio_set_iommu
Date: Thu, 21 Dec 2023 09:36:23 +0100 [thread overview]
Message-ID: <c146d0ab-19c4-4b5d-b989-cf7549d2f026@redhat.com> (raw)
In-Reply-To: <20231221024517.254074-1-zhenzhong.duan@intel.com>
On 12/21/23 03:45, Zhenzhong Duan wrote:
> vfio_container_init() and vfio_init_container() names are confusing
> especially when we see vfio_init_container() calls vfio_container_init().
>
> vfio_container_init() operates on base container which is consistent
> with all routines handling 'VFIOContainerBase *' ops.
>
> vfio_init_container() operates on legacy container and setup IOMMU
> context with ioctl(VFIO_SET_IOMMU).
>
> So choose to rename vfio_init_container to vfio_set_iommu to avoid
> the confusion.
>
> No functional change intended.
>
> Suggested-by: Cédric Le Goater <clg@redhat.com>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/container.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/vfio/container.c b/hw/vfio/container.c
> index 8d334f52f2..bd25b9fbad 100644
> --- a/hw/vfio/container.c
> +++ b/hw/vfio/container.c
> @@ -392,8 +392,8 @@ static const VFIOIOMMUClass *vfio_get_iommu_class(int iommu_type, Error **errp)
> return VFIO_IOMMU_CLASS(klass);
> }
>
> -static int vfio_init_container(VFIOContainer *container, int group_fd,
> - VFIOAddressSpace *space, Error **errp)
> +static int vfio_set_iommu(VFIOContainer *container, int group_fd,
> + VFIOAddressSpace *space, Error **errp)
> {
> int iommu_type, ret;
> const VFIOIOMMUClass *vioc;
> @@ -616,7 +616,7 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as,
> container->fd = fd;
> bcontainer = &container->bcontainer;
>
> - ret = vfio_init_container(container, group->fd, space, errp);
> + ret = vfio_set_iommu(container, group->fd, space, errp);
> if (ret) {
> goto free_container_exit;
> }
next prev parent reply other threads:[~2023-12-21 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 2:45 [PATCH] vfio/container: Rename vfio_init_container to vfio_set_iommu Zhenzhong Duan
2023-12-21 8:36 ` Cédric Le Goater [this message]
2024-01-02 8:16 ` Cédric Le Goater
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=c146d0ab-19c4-4b5d-b989-cf7549d2f026@redhat.com \
--to=clg@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=chao.p.peng@intel.com \
--cc=eric.auger@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yi.l.liu@intel.com \
--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).