[pve-devel] [RFC PATCH 0/7] [common] network interfaces internal API change

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Jun 22 16:06:53 CEST 2015


This is the pve-common part of a set of patches for
  [*] pve-common
  [ ] pve-manager

This changes the way the /etc/network/interfaces is represented
internally. The new internal representation is described in patch
number 4 as both part of the commit message as well as a comment
inside the code.

Patch 1 adds some more schema variables used by the other patches.
Patch 2 makes the interface parser less strict in order to not get
  confused by missing indentation or missing empty lines between
  interface blocks.
Patch 3 removes a variable which was never used, only written to,
  please make sure it was just dead left-over code or if there was a
  future purpose for it.
Patch 4 includes a major addition to the parser, please read. It
  includes a description of the new representation and adds support to
  preserve source/source-directory/... lines which were previously
  just silently dropped from the file on changes.
Patch 5 just deals with the fact that bridge_ports can be used several
  times. This approach doesn't touch the contents and should thus be
  general enough for all purposes including regex lists (untested).
Patch 6 was the easiest way to deal with duplicate known options: I
  simply remember written variables in a $once hash outside of
  __internface_to_string passed as parameter in order to make sure
  they're only written once.
  The $done hash was moved below the ovs/bridge handling code and
  simply receives an expanded %$once hash.
Patch 7 documents improves the file-header for /etc/network/interfaces
  to tell the admins that it is recommended to keep custom
  configurations in separate files included via source or
  source-directory directives.

Wolfgang Bumiller (7):
  JSONSchema: ipv6subnet and ipsubnet
  read_etc_network_interfaces: less strict parsing
  removed write-only $gateway variable
  read_etc_network_interfaces: improved parsing
  merge bridge_port declarations
  write_etc_network_interfaces: write options only once
  write_etc_network_interfaces: updated header comment

 src/PVE/INotify.pm    | 202 +++++++++++++++++++++++++++++++++++---------------
 src/PVE/JSONSchema.pm |  22 ++++++
 2 files changed, 166 insertions(+), 58 deletions(-)

-- 
2.1.4





More information about the pve-devel mailing list