[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 3/4] VFIO: Introduce helper vfio_pci_containe
From: |
Gavin Shan |
Subject: |
Re: [Qemu-devel] [PATCH v8 3/4] VFIO: Introduce helper vfio_pci_container_ioctl() |
Date: |
Fri, 6 Jun 2014 11:00:33 +1000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Jun 05, 2014 at 02:11:21PM +0200, Alexander Graf wrote:
>
>On 05.06.14 08:53, Gavin Shan wrote:
>>The patch introduces helper function vfio_pci_container_ioctl() to
>>pass ioctl commands to the specified VFIO container that is identified
>>by IOMMU group id. On sPAPR platform, each container only has one
>>IOMMU group.
>>
>>Signed-off-by: Gavin Shan <address@hidden>
>>---
>> hw/misc/vfio.c | 31 +++++++++++++++++++++++++++++++
>> include/hw/misc/vfio.h | 2 ++
>> 2 files changed, 33 insertions(+)
>>
>>diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
>>index 0796abf..999d97d 100644
>>--- a/hw/misc/vfio.c
>>+++ b/hw/misc/vfio.c
>>@@ -4310,3 +4310,34 @@ put_group_exit:
>> return n;
>> }
>>+
>>+int vfio_pci_container_ioctl(int iommu_group_id, int req, int opt)
>>+{
>>+ VFIOGroup *group;
>>+ int ret, fd = 0;
>>+
>>+ /* Search container's fd */
>>+ QLIST_FOREACH(group, &group_list, next) {
>>+ if (group->groupid == iommu_group_id) {
>>+ fd = group->container ? group->container->fd : 0;
>>+ break;
>>+ }
>>+ }
>>+
>>+ if (fd <= 0) {
>
>fd 0 is a valid file descriptor.
>
Yep, I'll fix :)
Thanks,
Gavin
>
>Alex
>
- [Qemu-devel] [PATCH v8 0/4] EEH Support for VFIO PCI Device, Gavin Shan, 2014/06/05
- [Qemu-devel] [PATCH v8 3/4] VFIO: Introduce helper vfio_pci_container_ioctl(), Gavin Shan, 2014/06/05
- [Qemu-devel] [PATCH v8 4/4] sPAPR: Implement sPAPRPHBClass::eeh_handler, Gavin Shan, 2014/06/05
- [Qemu-devel] [PATCH v8 1/4] sPAPR: Implement EEH RTAS calls, Gavin Shan, 2014/06/05
- [Qemu-devel] [PATCH v8 2/4] headers: Update kernel header, Gavin Shan, 2014/06/05
- Re: [Qemu-devel] [PATCH v8 0/4] EEH Support for VFIO PCI Device, Alexander Graf, 2014/06/05