Re: [PATCHv4 3/9] Introduce virDomainUSBAddressSet

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

 



On 13/07/16 23:41, John Ferlan wrote:
> 
> 
> On 07/01/2016 11:38 AM, Ján Tomko wrote:
>> A new type to track USB addresses.
>>
>> Every <controller type='usb' index='i'/> is represented by an
>> object of type virDomainUSBAddressHub located at buses[i].
>>
>> Each of these hubs has up to 'nports' ports.
>> If a port is occupied, it has the corresponding bit set in
>> the 'ports' bitmap, e.g. port 1 would have the 0th bit set.
>> If there is a hub on this port, then hubs[i] will point
>> to this hub.
>> ---
>>  src/conf/domain_addr.c   | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>>  src/conf/domain_addr.h   | 22 ++++++++++++++++++++++
>>  src/libvirt_private.syms |  2 ++
>>  3 files changed, 70 insertions(+)
>>
> 
> Possibly trading fast/direct array access for linear searches matching
> numerical controller values.
> 
> I wonder how this would play in a "common" <addr> algorithm. That is
> could PCI, SCSI, etc. make use of this paradigm. Secondarily whether
> "usb#" could be used as a key to a hashTable of addresses (where # is
> the controller index).  OK beyond the scope of this change...
> 
> The one confusing thing to see is "nports" is used to walk the 'hubs'
> array.  Maybe if 'ports' was renamed 'portmap' and then 'hubs' changed
> to 'ports'... I dunno, guess you understand where things are going
> better so I'm fine as is, albeit a bit odd.

^^^ I agree with John's rename proposal. It felt a bit odd for me as
well, but since I could not come up with a suitable alternative I didn't
want to just say "I'm not sure about this naming because it's not clear
enough..."

Erik

> 
> ACK for what's here
> 
> John
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]