Re: [PATCH 0/4] VLAN support for NetworkManager(V6)



On 12/13/2011 11:20 AM, Weiping Pan wrote:
This patchset is to add vlan support for NetworkManager,
based on nm upstream,
commit bed4d1533970(cli: use nm_utils_hwaddr_ntoa() from libnm-util).

Requires libnl-3.2.1

FEATURE DESCRIPTION
1 example of vlan ifcfg file
We try to make it compitable with the format used by initscripts,
and there is no need to change anything for ifcfg-eth9.

VLAN=yes
TYPE=Vlan
DEVICE=vlan43 or DEVICE=eth9.43
PHYSDEV=eth9
REORDER_HDR=0
vlan_FLAGS=GVRP,LOOSE_BINDING
vlan_INGRESS_PRIORITY_MAP=0:1,2:5
vlan_EGRESS_PRIORITY_MAP=12:3,14:7
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.43.149
NETMASK=255.255.255.0

2 create and delete vlan device
We use libnl to create and delete vlan device in kernel.

3 support both static IP configuration and DHCP for vlan device
support both ipv4 and ipv6

TODO
1 accept MAC address or NM connection UUID as PHYSDEV

2 activating dependency
Before activating a vlan device, we should make sure that the underlying
physical ethernet device is up.
For example, before activating eth0.100, we should make sure that eth0 is up.
NetworkManager calls g_udev_client_query_by_subsystem() to get the device
list, and then activates each devices on that device list.
And luckily I found that the physical ethernet device is prior to vlan device
on that device list, so there is nothing to do to make sure the activating
sequence between a vlan device and its underlying physical ethernet device.

Maybe we should not rely on the behavior of
g_udev_client_query_by_subsystem(), and we should add special restriction to
make sure that before activating a vlan device, the underlying physical
ethernet device is up.

Changelog:
V6:
1 PHYSDEV can be assumed from fortmat "DEVICE=eth9.43"

V5:
1 rebase on nm upstream,
commit bed4d1533970(cli: use nm_utils_hwaddr_ntoa() from libnm-util).

V4:
1 rebase on nm upstream, and [PATCH 0/7] bonding updates rebased,
from Thomas Graf(tgraf redhat com).
2 use nm_connection_get_virtual_iface_name()

V3:
1 parse format "DEVICE=eth9.43"
2 modify NMSettingVlan->get_property()
3 call nm_system_add_vlan_device() to create vlan device in kernel

V2:
1 rebase on nm/bonding branch
2 use "vlan" or "Vlan" instead of "VLAN" for consistency.
3 use GSList to store vlan ingress/egress priority map.
4 add enum NMVlanFlags.
5 delete NMDeviceVLAN, just use NMDeviceEthernet.
6 add ifcfg-vlan writer


Weiping Pan (4):
   vlan: add ifcfg-vlan parser
   vlan: create/delete kernel vlan device
   vlan: create NMDeviceEthernet for vlan device
   vlan: add ifcfg-vlan writer

  libnm-util/Makefile.am                             |    2 +
  libnm-util/libnm-util.ver                          |   12 +
  libnm-util/nm-connection.c                         |   26 +-
  libnm-util/nm-connection.h                         |    2 +
  libnm-util/nm-setting-vlan.c                       |  652 ++++++++++++++++++++
  libnm-util/nm-setting-vlan.h                       |  118 ++++
  src/nm-device-ethernet.c                           |    3 +
  src/nm-device-ethernet.h                           |    2 -
  src/nm-manager.c                                   |   11 +
  src/nm-system.c                                    |  152 +++++
  src/nm-system.h                                    |    4 +
  src/nm-udev-manager.c                              |    5 +-
  src/settings/plugins/ifcfg-rh/common.h             |    1 +
  src/settings/plugins/ifcfg-rh/reader.c             |  183 +++++-
  .../network-scripts/ifcfg-test-vlan-interface      |   11 +-
  .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c         |   41 ++-
  src/settings/plugins/ifcfg-rh/writer.c             |   84 +++
  17 files changed, 1286 insertions(+), 23 deletions(-)
  create mode 100644 libnm-util/nm-setting-vlan.c
  create mode 100644 libnm-util/nm-setting-vlan.h

Any comments ?

thanks
Weiping Pan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]