RE: [PATCH 5/6] kvm: qemu: deassign device from guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark McLoughlin wrote:
> On Fri, 2009-02-13 at 14:58 +0800, Han, Weidong wrote:
>> +static void deassign_device(AssignedDevInfo *adev) +{
>> +    struct kvm_assigned_pci_dev assigned_dev_data;
>> +    AssignedDevice *dev = adev->assigned_dev;
>> +    int r;
>> +
>> +    memset(&assigned_dev_data, 0, sizeof(assigned_dev_data));
>> +    assigned_dev_data.assigned_dev_id  =
>> +       calc_assigned_dev_id(dev->h_busnr, dev->h_devfn);
> 
>> From here:
> 
>> +    assigned_dev_data.busnr = dev->h_busnr;
>> +    assigned_dev_data.devfn = dev->h_devfn;
>> +
>> +#ifdef KVM_CAP_IOMMU
>> +    /* We always enable the IOMMU if present
>> +     * (or when not disabled on the command line)
>> +     */
>> +    r = kvm_check_extension(kvm_context, KVM_CAP_IOMMU);
>> +    if (r && !adev->disable_iommu)
>> +       assigned_dev_data.flags |= KVM_DEV_ASSIGN_ENABLE_IOMMU;
>> +#endif
> 
> to here.
> 
> As, I said, these lines should not be needed and the ioctl should be
> fixed like so:
> 
> -       if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU)
> +       if (match->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU)
>                 kvm_deassign_device(kvm, match);
> 

I ignored this comment, will update it.

Regards,
Weidong

> Cheers,
> Mark.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux