[libvirt] [PATCH v2 RESEND 08/12] conf: Allocate/release 'uid' and 'fid' in PCI address

Yi Min Zhao zyimin at linux.ibm.com
Fri Jul 27 05:22:12 UTC 2018



在 2018/7/24 下午10:58, Andrea Bolognani 写道:
>> @@ -1385,7 +1403,12 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
>>            * parent, and will have its address collected during the scan
>>            * of the parent's device type.
>>           */
>> -        return 0;
>> +        if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI ||
>> +            info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
>> +            return virDomainPCIAddressExtensionReserveAddr(addrs, addr,
>> +                                                           info->pciAddressExtFlags);
>> +        else
>> +            return 0;
> This doesn't look right: the comment specifically states that the
> PCI address will be handled by the parent device in this case,
> why wouldn't the zPCI address not be handled in the same way?
Thanks for other comments! I cutted off them.
For this comment, we have to collect zPCI address in case that zPCI 
address is specified
but PCI address is not. I think I shall split two checks. Original code is:
if (!virDeviceInfoPCIAddressPresent(info) ||
     ((device->type == VIR_DOMAIN_DEVICE_HOSTDEV) &&
       (device->data.hostdev->parent.type != VIR_DOMAIN_DEVICE_NONE)))
Separate them and only add the new code for 
!virDeviceInfoPCIAddressPresent(info) case.




More information about the libvir-list mailing list