Re: [PATCH kvm-unit-tests 06/17] pci: introduce struct pci_dev

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

 



On Tue, Nov 08, 2016 at 10:48:32AM -0500, Peter Xu wrote:
> > Both ways look strange to me. I would leave pci_find_dev() as is (low-
> > level) and move pci_dev_init() outside - so a usage would be i.e.:
> > 
> > 	dev = pci_find_dev(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_TEST);
> > 	if (dev == PCIDEVADDR_INVALID)
> > 		...
> > 	pci_dev_init(&pci_dev, dev);
> 
> IMHO actually it'll be nicer with:
> 
>   struct pci_dev *pci_find_dev(uint16_t vendor_id, uint16_t device_id);

I hesitated to propose this one, but IMO it is the most clear way
everybody are accustomed to :)

> But this needs dynamic allocation of memory, which might be an
> overkill for kvm-unit-test. So I chose to allocate the pci_dev on
> caller stack.

Well, the dynamic allocation is implemented and utilized, so why not?

> Anyway, I take the interface issue as a matter of taste.
> 
> How about I take Drew's suggestion here with true/false? Then if we
> have any better idea with solid reasons, we can post seperate patch
> for it.

As far as I am concerned in all disputed cases Drew's opinion prevails ;)

> Thanks,
> 
> -- peterx
--
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