[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 06/10] hw/vfio: create common module
From: |
Joel Schopp |
Subject: |
Re: [Qemu-devel] [PATCH v5 06/10] hw/vfio: create common module |
Date: |
Wed, 20 Aug 2014 15:08:41 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 08/20/2014 02:41 PM, Alex Williamson wrote:
> On Wed, 2014-08-20 at 14:12 -0500, Joel Schopp wrote:
>>> +int vfio_get_device(VFIOGroup *group, const char *name,
>>> + VFIODevice *vbasedev)
>>> +{
>>> + struct vfio_device_info dev_info = { .argsz = sizeof(dev_info) };
>>> + struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
>>> + struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) };
>>> + int ret;
>>> +
>>> + ret = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, name);
>>> + if (ret < 0) {
>> Should be:
>> if(ret) {
>> instead of:
>> if (ret < 0) {
>>
>> The ioctl can, and sometimes does, return positive values in case of
>> errors. This should also be fixed in vfio_container_do_ioctl()
> This particular ioctl usually does return a positive value, the file
> descriptor for the the device, so I think it's correct as written.
> Thanks,
Thanks for the catch, I stand corrected. The kernel I am running
against contains corresponding patches that are spitting out an
erroneous pr_err() on if(ret). In retrospect it looks like the kernel
patches and not the qemu patches are in the wrong.
- Re: [Qemu-devel] [PATCH v5 05/10] hw/vfio/pci: split vfio_get_device, (continued)
[Qemu-devel] [PATCH v5 06/10] hw/vfio: create common module, Eric Auger, 2014/08/09
Re: [Qemu-devel] [PATCH v5 06/10] hw/vfio: create common module, Joel Schopp, 2014/08/20
[Qemu-devel] [PATCH v5 07/10] hw/vfio/platform: add vfio-platform support, Eric Auger, 2014/08/09
Re: [Qemu-devel] [PATCH v5 07/10] hw/vfio/platform: add vfio-platform support, Alex Williamson, 2014/08/11
[Qemu-devel] [PATCH v5 08/10] hw/intc/arm_gic_kvm: advertise irqfd, Eric Auger, 2014/08/09