[LiSA-Devel] integrating LiSA in libvirt

Andreea-Cristina Hodea andreea.cristina.hodea at gmail.com
Thu Jun 20 16:25:18 EEST 2013


On Thu, Jun 20, 2013 at 3:10 PM, Andreea-Cristina Hodea
<andreea.cristina.hodea at gmail.com> wrote:
> Hi,
>
> When we met last week (Ionut, Radu and I), we established some tasks
> for integrating LiSA in libvirt. Mainly, the tasks are (not
> necessarily in this order):
>
> 1) add an entry to the corresponding combo in virt-manager, i.e. an
> entry with "lisa_switch" next to bridge and macvtap options.
>
> 2) implement functions to support 1):
>   a) create virnetdevlisa.[c|h]
>   b) declare and define virNetDevLisaAddPort and virNetDevLisaRemovePort
>
> 3) modify autoconf script to permit lisa enabling, maybe something
> similar to `./autoconf --enable-lisa`
>
> 4) point 1) also reflects in xml configuration file, more exactly in
> <source > tag, so define another attribute/property for <source> tag,
> as `<source lisa_switch="true"/>` compared to `<source
> network="default"/>` for example
>
> Now here it is a progress status and some questions:
>
> For task 2) I was thinking at the following prototype:
>
> virNetDevLisaAddPort(const char *portname, const char *if_tag,
> virNetDevVlanPtr virtVlan) {
>      obtain if_index on portname
>      if (if_tag)
>         switch_set_if_tag(if_index, if_tag)
>      if (virtVlan)
          foreach vlan
              sw_ops->add_vif(...)
        else
          sw_ops->if_add(...)
> }

I'm sorry, bad combination of keys prematurely has sent the mail.
Please see inline prototype for task 2. For port removal I think it
would be something similar. ** Would that cover the desired
functionality? **

For the first task 1), digging into the code confused me. Here there
are the steps I followed to add a new bridge and figure out where
could lisa penetrate:
 - start virt-manager (qemu connection)
 - open connection details window and navigate to Virtual Networks tab
 - create a new virtual network (+ sign in left-down corner) - make it
isolated for example
 - open a virtual machine window and navigate to "info" icon; all
hardware components of the virtual machine are listed on left panel
 - in order to connect the guest to the host through a new virtual
network, click on add hardware and select network tab, then select the
host device (the one created earlier) and the device model

Moreover I was able to create a bridge from virsh (the virtual shell
from libvirt) by running `virsh net-create config_file.xml`. It might
seem stupid, but I still cannot figure out when I express my
preference on the connection type: either bridge, macvtap or lisa. **
Is it when I select the host device? In the drop-down list of Host
device should be an entry for lisa_switch? **

For task 4), there are some functions that generate XML config and
parse XML (see tools/virsh-domain.c and src/conf/domain_conf.c). For
example in cmdAttachInterface, based on the interface type (network or
bridge) it is generated the <source> tag. My intuition is that here I
should extend the if-else with LiSA's <source> tag. As I've said, the
<source> tag is generated based on interface type, so let's assume
that for referring the lisa switch the configuration would contain a
`<source lisa_switch="true"/>` tag, but ** what value would interface
type would take? ** Now it takes values as <interface type="bridge"/>
or <interface type="network"/> or <interface type="direct"/> etc. Is
it ok `<interface type="switch"/>`?

I'm not sure if it is relevant, but in terms of virtual port there is
a <virtualport /> tag, with a type property that for now takes values
such as "openvswitch" and "802.1Qbh".

Thanks,
Andreea


More information about the LiSA-Devel mailing list