[libvirt] [PATCHv2 0/3] network: new network forward mode 'vlan'

Shi Lei posted 3 patches 5 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1534230052-10359-1-git-send-email-shilei.massclouds@gmx.com
Test syntax-check passed
configure.ac                                       |   6 +
docs/formatnetwork.html.in                         |  27 ++-
docs/schemas/network.rng                           |   1 +
src/conf/domain_conf.c                             |   1 +
src/conf/network_conf.c                            |  24 ++-
src/conf/network_conf.h                            |   1 +
src/conf/virnetworkobj.c                           |   1 +
src/esx/esx_network_driver.c                       |   1 +
src/libvirt_private.syms                           |   4 +
src/network/bridge_driver.c                        |  55 +++++-
src/qemu/qemu_process.c                            |   1 +
src/util/virnetdev.c                               | 203 +++++++++++++++++++++
src/util/virnetdev.h                               |  18 ++
tests/networkxml2confdata/vlan-network.conf        |  16 ++
tests/networkxml2confdata/vlan-network.xml         |  13 ++
tests/networkxml2conftest.c                        |   1 +
.../vlan-network-multi-vlan-tag.xml                |  11 ++
.../vlan-network-no-forward-dev.xml                |  10 +
tests/networkxml2xmlin/vlan-network-with-dhcp.xml  |  15 ++
tests/networkxml2xmlin/vlan-network.xml            |  10 +
tests/networkxml2xmlout/vlan-network-with-dhcp.xml |  17 ++
tests/networkxml2xmlout/vlan-network.xml           |  12 ++
tests/networkxml2xmltest.c                         |   5 +
23 files changed, 448 insertions(+), 5 deletions(-)
create mode 100644 tests/networkxml2confdata/vlan-network.conf
create mode 100644 tests/networkxml2confdata/vlan-network.xml
create mode 100644 tests/networkxml2xmlin/vlan-network-multi-vlan-tag.xml
create mode 100644 tests/networkxml2xmlin/vlan-network-no-forward-dev.xml
create mode 100644 tests/networkxml2xmlin/vlan-network-with-dhcp.xml
create mode 100644 tests/networkxml2xmlin/vlan-network.xml
create mode 100644 tests/networkxml2xmlout/vlan-network-with-dhcp.xml
create mode 100644 tests/networkxml2xmlout/vlan-network.xml
[libvirt] [PATCHv2 0/3] network: new network forward mode 'vlan'
Posted by Shi Lei 5 years, 8 months ago
Hi, everyone!

This patch supports VLan by '8021q' kernel module
other than by OVS. The way of '8021q' is simpler and more robust.

Mode 'vlan' is like mode 'route' except these major differences:
 - mode 'vlan' inserts a vlan-device between the specified host's
   interface and the internal bridge. The vlan-device is based on
   '8021q' kernel module.
 - mode 'vlan' has no routed iptables rules but has other common
   iptables rules

It can simplify the work of management apps whose developers want to
implement VLan but don't want to introduce OVS into their project.

Thank John for his comments in v1. v1 here:
https://www.redhat.com/archives/libvir-list/2018-July/msg00331.html

since v1:
 - Change docs/formatnetwork.html.in
 - Change docs/schemas/network.rng
 - Add tests/networkxml2*
 - Other code fixes

Besides, I have post two patches followed by John's suggestions.
 - Replace 'if' type conditions with 'switch' for VIR_NETWORK_FORWARD_*
   https://www.redhat.com/archives/libvir-list/2018-July/msg01537.html
   This has been accepted.

 - Introduce timeout mode for virKModLoad to solve the potential problem
   of the 'strange delay' when loading '8021q' module
   https://www.redhat.com/archives/libvir-list/2018-August/msg00605.html
   This has been rejected and I don't know wether I should continue to
   solve this problem. Now I just check the INIT process code of '8021q'
   module and I think this module should not cause delay now. The loading
   time of '8021q' by virKModLoad on my PC is about 30 milliseconds.

Shi Lei (3):
  add functions: load 8021q module, create/destroy vlan-dev
  support new forward mode 'vlan' for virtual network
  tests and docs for new forward mode 'vlan'

 configure.ac                                       |   6 +
 docs/formatnetwork.html.in                         |  27 ++-
 docs/schemas/network.rng                           |   1 +
 src/conf/domain_conf.c                             |   1 +
 src/conf/network_conf.c                            |  24 ++-
 src/conf/network_conf.h                            |   1 +
 src/conf/virnetworkobj.c                           |   1 +
 src/esx/esx_network_driver.c                       |   1 +
 src/libvirt_private.syms                           |   4 +
 src/network/bridge_driver.c                        |  55 +++++-
 src/qemu/qemu_process.c                            |   1 +
 src/util/virnetdev.c                               | 203 +++++++++++++++++++++
 src/util/virnetdev.h                               |  18 ++
 tests/networkxml2confdata/vlan-network.conf        |  16 ++
 tests/networkxml2confdata/vlan-network.xml         |  13 ++
 tests/networkxml2conftest.c                        |   1 +
 .../vlan-network-multi-vlan-tag.xml                |  11 ++
 .../vlan-network-no-forward-dev.xml                |  10 +
 tests/networkxml2xmlin/vlan-network-with-dhcp.xml  |  15 ++
 tests/networkxml2xmlin/vlan-network.xml            |  10 +
 tests/networkxml2xmlout/vlan-network-with-dhcp.xml |  17 ++
 tests/networkxml2xmlout/vlan-network.xml           |  12 ++
 tests/networkxml2xmltest.c                         |   5 +
 23 files changed, 448 insertions(+), 5 deletions(-)
 create mode 100644 tests/networkxml2confdata/vlan-network.conf
 create mode 100644 tests/networkxml2confdata/vlan-network.xml
 create mode 100644 tests/networkxml2xmlin/vlan-network-multi-vlan-tag.xml
 create mode 100644 tests/networkxml2xmlin/vlan-network-no-forward-dev.xml
 create mode 100644 tests/networkxml2xmlin/vlan-network-with-dhcp.xml
 create mode 100644 tests/networkxml2xmlin/vlan-network.xml
 create mode 100644 tests/networkxml2xmlout/vlan-network-with-dhcp.xml
 create mode 100644 tests/networkxml2xmlout/vlan-network.xml

-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv2 0/3] network: new network forward mode 'vlan'
Posted by John Ferlan 5 years, 7 months ago

On 08/14/2018 03:00 AM, Shi Lei wrote:
> Hi, everyone!
> 
> This patch supports VLan by '8021q' kernel module
> other than by OVS. The way of '8021q' is simpler and more robust.
> 
> Mode 'vlan' is like mode 'route' except these major differences:
>  - mode 'vlan' inserts a vlan-device between the specified host's
>    interface and the internal bridge. The vlan-device is based on
>    '8021q' kernel module.
>  - mode 'vlan' has no routed iptables rules but has other common
>    iptables rules
> 
> It can simplify the work of management apps whose developers want to
> implement VLan but don't want to introduce OVS into their project.
> 

First off - apologies no one has even looked at your v2 yet. If after a
week no one looks, please feel free to just ping the cover letter and
usually that helps get someone to look or direct at the right person.
August is a month where many take vacations so series do get lost in the
volume of upstream postings at times. Generally for network things like
this I defer to Laine as he understand the comings and goings in that
space much more so than I do.

Considering your other changes, could you just update this series with
all the changes to use switch's instead of if/then logic and repost one
you ensure that for each patch you can 'make check syntax-check'.  I
have a feeling patch3 just merges into patch2.

Some of the text you put in here could be used to beef up the commit
messages for each patch which are too sparse...  The commit message text
should describe the change or addition and not just be a single line header.

I think you would need to add a docs/news.xml article.  But wait until
4.8.0 opens in order to repost.  Should be soon anyway.

Tks,

John

> Thank John for his comments in v1. v1 here:
> https://www.redhat.com/archives/libvir-list/2018-July/msg00331.html
> 
> since v1:
>  - Change docs/formatnetwork.html.in
>  - Change docs/schemas/network.rng
>  - Add tests/networkxml2*
>  - Other code fixes
> 
> Besides, I have post two patches followed by John's suggestions.
>  - Replace 'if' type conditions with 'switch' for VIR_NETWORK_FORWARD_*
>    https://www.redhat.com/archives/libvir-list/2018-July/msg01537.html
>    This has been accepted.
> 
>  - Introduce timeout mode for virKModLoad to solve the potential problem
>    of the 'strange delay' when loading '8021q' module
>    https://www.redhat.com/archives/libvir-list/2018-August/msg00605.html
>    This has been rejected and I don't know wether I should continue to
>    solve this problem. Now I just check the INIT process code of '8021q'
>    module and I think this module should not cause delay now. The loading
>    time of '8021q' by virKModLoad on my PC is about 30 milliseconds.
> 
> Shi Lei (3):
>   add functions: load 8021q module, create/destroy vlan-dev
>   support new forward mode 'vlan' for virtual network
>   tests and docs for new forward mode 'vlan'
> 
>  configure.ac                                       |   6 +
>  docs/formatnetwork.html.in                         |  27 ++-
>  docs/schemas/network.rng                           |   1 +
>  src/conf/domain_conf.c                             |   1 +
>  src/conf/network_conf.c                            |  24 ++-
>  src/conf/network_conf.h                            |   1 +
>  src/conf/virnetworkobj.c                           |   1 +
>  src/esx/esx_network_driver.c                       |   1 +
>  src/libvirt_private.syms                           |   4 +
>  src/network/bridge_driver.c                        |  55 +++++-
>  src/qemu/qemu_process.c                            |   1 +
>  src/util/virnetdev.c                               | 203 +++++++++++++++++++++
>  src/util/virnetdev.h                               |  18 ++
>  tests/networkxml2confdata/vlan-network.conf        |  16 ++
>  tests/networkxml2confdata/vlan-network.xml         |  13 ++
>  tests/networkxml2conftest.c                        |   1 +
>  .../vlan-network-multi-vlan-tag.xml                |  11 ++
>  .../vlan-network-no-forward-dev.xml                |  10 +
>  tests/networkxml2xmlin/vlan-network-with-dhcp.xml  |  15 ++
>  tests/networkxml2xmlin/vlan-network.xml            |  10 +
>  tests/networkxml2xmlout/vlan-network-with-dhcp.xml |  17 ++
>  tests/networkxml2xmlout/vlan-network.xml           |  12 ++
>  tests/networkxml2xmltest.c                         |   5 +
>  23 files changed, 448 insertions(+), 5 deletions(-)
>  create mode 100644 tests/networkxml2confdata/vlan-network.conf
>  create mode 100644 tests/networkxml2confdata/vlan-network.xml
>  create mode 100644 tests/networkxml2xmlin/vlan-network-multi-vlan-tag.xml
>  create mode 100644 tests/networkxml2xmlin/vlan-network-no-forward-dev.xml
>  create mode 100644 tests/networkxml2xmlin/vlan-network-with-dhcp.xml
>  create mode 100644 tests/networkxml2xmlin/vlan-network.xml
>  create mode 100644 tests/networkxml2xmlout/vlan-network-with-dhcp.xml
>  create mode 100644 tests/networkxml2xmlout/vlan-network.xml
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list