On 11/21/2013 11:24 PM, Nehal J Wani wrote:
Yes. Each guest interface (except those of type='hostdev', which are just host hardware devices passed through to the guest) has a corresponding unique vnetX tap device or macvtapX device. The socket end of this tap/macvtap device is connected to the qemu process, and the netdev end is connected to a Linux host bridge, OpenvSwitch bridge (in the case of tap), or directly to a host network device (in the case of macvtap).
No, not for libvirt-managed virtual networks. It *is* possible for two libvirt "unmanaged" networks (which merely shadow already-existing host system bridge devices without adding any extra services such as dhcp, dns, or iptables rules) to specify the same bridge device, but I don't think that's what you're talking about (and I also see no practical value in doing that).
What do you mean by "the interface name for a given bridge name"? A bridge *is* a type of network device, i.e. an interface from the host's point of view.
If you're wondering how to get a list of all vnetX interfaces that are attached to a particular bridge via libvirt, the answer is either 1) you don't, or 2) you would need to cycle through all active guests looking for guest interfaces that use the network you're interested in, and grab the interface name from that guest's <interface> xml. libvirt's networks don't maintain a ready-made list of the devices that are attached to that network, because it would need to be reconstructed whenever libvirt was restarted, and up until now nobody has needed it.