• L
    util: make virPCIGetNetName() more versatile · b3b5aa75
    Laine Stump 提交于
    A single PCI device may have multiple netdevs associated with it. Each
    of those netdevs will have a different phys_port_id entry in
    sysfs. This patch modifies virPCIGetNetName() to allow selecting one
    of the potential many netdevs in two different ways:
    
    1) by setting the "idx" argument, the caller can select the 1st (0),
    2nd (1), etc. netdev from the PCI device's net subdirectory.
    
    2) If the physPortID arg is set (to a null-terminated string) then
    virPCIGetNetName() returns the netdev that has that phys_port_id in
    the sysfs file of the same name in the netdev's directory.
    b3b5aa75
virhostdev.c 75.2 KB