>>>> "Daniel P. Berrange" <berrange@redhat.com> 2015-2-4 下午 17:17 >>>
>On Mon, Feb 02, 2015 at 10:08:21PM +0800, Lin Ma wrote:
>> It constructs a temporary static config of the network, Obtains all of
>> attached interfaces information through netcf, Then removes the config.
>>
>> Signed-off-by: Lin Ma
>> ---
>> include/libvirt/libvirt-network.h | 1 +
>> src/Makefile.am | 3 +
>> src/network/bridge_driver.c | 141 ++++++++++++++++++++++++++++++++++-
>> src/network/bridge_driver_platform.h | 7 ++
>> tests/Makefile.am | 4 +
>> 5 files changed, 155 insertions(+), 1 deletion(-)
>
>So, IIUC, the point of this change is to display a list of all the TAP
>devices attached to a network. I'm not entirely convinced this is the
>right approach to take. Also do we want to limit this to reporting of
>devices inside bridges. It could be equally useful to see a list of
>macvtap devices associated with a physical NIC.
Obtaining a list of macvtap devices associated with a physical NIC,
It's a good idea. I intend to implement this api, also implement a new
virsh subcommand to show these information to user.
If you agreed with my thought, Then what are the proper api name and
virsh subcommand name you suggest? and what about the output format?

>Modifying the XML to include the list of VIFs is certainly one options,
>but I'm not sure it is necceessarily the best. As Laine points out this
>is a output only attribute - not something you can feed in with the XML
>when defining the network.
>
>Perhaps we want to have an actual API for this - a virNetworkListPorts
>which returns a list of associated devices (of any type) from guests.
>Or perhaps we should be reporting a list of virDomainPtr's that are
>attached to the network, or perhaps even both.