* Stefan Berger (stefanb(a)us.ibm.com) wrote:
Gerhard Stenzel <gstenzel(a)linux.vnet.ibm.com> wrote on
05/12/2010 12:34:09
PM:
>
> On Wed, 2010-05-12 at 12:13 -0400, Stefan Berger wrote:
> > I'd suggest to use this patch as a base for triggering the setup
> > protocol with the 802.1Qb{g|h} switch.
>
> Here is a RFC patch, which demonstrates how libvirt could communicate
> with lldpad via the lldptool for the 802.1Qbg case. Please note, that
> there is currently no public available version of lldptool which accepts
> this command line. This is also work in progress.
>
[...]
> + virFormatMacAddr(mac, macaddr);
> +
> + rc = ifaceGetRootIface(-1, linkdev, rootifname);
> + if (rc != 0) {
> + macvtapError(VIR_ERR_INTERNAL_ERROR,
> + _("cannot get root interface for %s"),
> + linkdev);
> + return rc;
> + }
> + VIR_DEBUG("root iface of %s is %s\n", linkdev, rootifname);
> +
> + ifaceGetVlanID(linkdev, &vlanid);
> + VIR_DEBUG("vlan id of %s is %d\n", linkdev, vlanid);
I am wondering whether it would not be 'more general' to have lldpad
determine
the root interface and handling bonding interfaces on the way rather
than libvirt trying to determine that here.
I think so, esp. since we will need to have bonding details in lldpad to
handle some active/backup failover cases.
So we would just pass the
linkdev or the even the macvtap to lldptool. The same would be true
for finding the VLAN ID. For both the code I posted here on libvirt
mailing list could be used in lldpad. For now I won't check it in.