Commit Graph

278 Commits

Author SHA1 Message Date
Dietmar Maurer
889e45ee1a bump version to 4.0-17 2015-08-28 11:37:32 +02:00
Wolfgang Bumiller
b6bff92ee5 Added PVE::Network::tcp_ping to replace Net::Ping
We use Net::Ping twice in pve-storage (once for ISCSIPlugin
and once in GlusterfsPlugin, both with the 'tcp' variant.),
but Net::Ping doesn't support IPv6.
2015-08-28 10:55:17 +02:00
Wolfgang Bumiller
c38cea65b6 Tools::run_with_timeout improvement + hires alarm
The following situations could lead to the 'unknown error':
1) As commented, when the alarm triggered after the first
signal handler was installed and before the new alarm was
installed. In this case the $signalcount was increased,
and worse: the original signal handler was never called.

2) When $code died, since the call itself wasn't in an eval
block, we'd leave the eval block containing the inner alarm
signal handler. Then there's a time window from leaving the
signal block (and with that restoring the first installed
only-counting signal-handler) and reaching the code to
restore the previous alarm where the counting alarm handler
could get triggered by our own alarm set before running
$code. In this case at least the the old alarm would be
restored, but we'd still trigger the 'unknown error'.

The new code starts off by suspending the original alarm
before installing any signal handler, then installing the
timeout handler inside the first eval block. The $code is
then run inside another eval block to make sure we reach the
alarm(0) statement before restoring the old signal handler
and alarm timeout.
2015-08-28 10:45:26 +02:00
Wolfgang Bumiller
b261377727 Add generic parse_host_and_port function
Added a generic function to split a host+port string to the
host and port part supporting the two most common ipv6
notations beside domains and ipv4: with brackets for the
address or a dot as port separator.
2015-08-25 12:58:09 +02:00
Wolfgang Link
fe949d0e2f Update prerequisites for development environment 2015-08-18 16:36:15 +02:00
Dietmar Maurer
570e8df762 bump version to 4.0-16 2015-08-17 09:43:57 +02:00
Wolfgang
5d35df41fc fix bug #860: fix the upload from a VM when it is restricted. 2015-08-17 08:32:51 +02:00
Dietmar Maurer
f56505bc5e bump cversion to 4.0-15 2015-08-10 09:06:39 +02:00
Alen Grizonic
32cb7d272f tap device name parse fix
Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
2015-08-10 09:05:37 +02:00
Dietmar Maurer
ba039ebd1e bump version to 4.0-14 2015-08-04 08:59:56 +02:00
Dietmar Maurer
c38ac70fe0 get_standard_option: do not overwrite defaults when they evaluate to false 2015-08-04 08:58:09 +02:00
Wolfgang Bumiller
24cea9a96e fix a typo pointed out by Immo Wetzel 2015-08-04 08:38:17 +02:00
Dietmar Maurer
971a8d8c17 bump version to 4.0-13 2015-08-03 16:13:55 +02:00
Alexandre Derumier
ff0420567b fix tap_plug with vlan for non aware vlan bridges
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-08-03 16:13:04 +02:00
Dietmar Maurer
555eefa07b bump version to 4.0-12 2015-07-30 09:00:17 +02:00
Wolfgang Bumiller
6fc54cb240 replace /sbin/vconfig with /sbin/ip call 2015-07-29 11:29:47 +02:00
Alexandre Derumier
4d25f4aafe tap_plug : add support for vlan aware linux bridge
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-29 10:48:06 +02:00
Dietmar Maurer
0177b13795 bump version to 4.0-11 2015-07-27 13:12:42 +02:00
Wolfgang Bumiller
27107d5b96 add ProcFSTools::read_proc_net_ipv6_route 2015-07-23 06:43:52 +02:00
Wolfgang Bumiller
61aa94e472 PVE::Network: add some common constants
added ipv4_reverse_mask and ipv4_mask_hash_localnet as they
are used in several places.
2015-07-23 06:27:47 +02:00
Alen Grizonic
9030a7d7f6 validate error message (typo) corrected
Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
2015-07-22 08:16:22 +02:00
Wolfgang Bumiller
3c4d612a70 improve parse_config in JSONSchema and SectionConfig
The old code used string substitution for every line of the
input string, while perl can also iterate over all matches
via the /g re modifier, and can turn ^ and $ to act as
beginning/end of line via the /m modifier.

Effectively allowing a "match over all lines" via a simple
while ($data =~ /^.*$/gm);

The situation is a little different in SectionConfig because
there's a nested loop invovled which doesn't work with /g.
For this there are two options and I chose the safer one by
simply doing a split on newlines first.
The alternative would be to open the data as a
filehandle-to-string and use <$fh> to read lines, however
I'd have to throw in an eval{} to be sure to close the
handle afterwards.
2015-07-22 08:15:54 +02:00
Thomas Lamprecht
8998d715de added missing install build prerequisites for development environment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-07-02 14:34:56 +02:00
Dietmar Maurer
3e8210a1db bump version to 4.0-10 2015-06-26 11:51:24 +02:00
Alexandre Derumier
f3f0bc3afd add veth_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-26 11:49:39 +02:00
Alexandre Derumier
35efc4ebcc add veth_create
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-26 11:49:16 +02:00
Dietmar Maurer
e26837e6e9 bump version to 4.0-9 2015-06-26 07:56:28 +02:00
Dietmar Maurer
d5f6190912 run regression tests before building the package 2015-06-26 07:54:48 +02:00
Wolfgang Bumiller
c7c4208a33 tests: list/create/update network interfaces 2015-06-26 07:51:26 +02:00
Wolfgang Bumiller
562fad0bab write_network_interfaces: improved sorting
This way option line positions between interfaces can be
preserved.
2015-06-26 07:51:07 +02:00
Wolfgang Bumiller
11e7facb94 PVE::INotify::write_network_interfaces: readability 2015-06-26 07:50:07 +02:00
Wolfgang Bumiller
936218b86f importing etc_network_interfaces tests 2015-06-26 07:49:16 +02:00
Wolfgang Bumiller
516a50a4ac /etc/network/interfaces: deal with OVS allow- lines
* __read_etc_interfaces:
Delete OVS ports from "allow-$OVS_BRIDGE" option lines in
order to prevent them from being duplicated or kept after
removing the port from the bridge.

* __write_etc_interfaces:
Deleting unused OVSPorts has the side effect of them not
being written out at all. If, however, they are
physical interfaces they'll reappear the next time the
configuration is read, because they're added from
/proc/net/dev.
Fix: if the deleted interface matches the same condition as
in read_etc_interfaces, readd it with the standard options:
{exists => 1, method => manual }
This is a purely aesthetical change in order to make sure a
write()->read()->write() chain doesn't produce two
different files each write().
2015-06-26 07:48:06 +02:00
Wolfgang Bumiller
cb07ff78ca read_etc_interfaces: missing iface initialization
If no 'auto' line was read the interface hash has to be
initialized.
2015-06-26 07:46:30 +02:00
Wolfgang Bumiller
7832576690 PVE::INotify: testable interface parser
read_etc_network_interfaces now opens all /proc files and
passes them as filehandles to the actual implementation
which is now is __read_etc_network_interfaces.

Similarly write_etc_network_interfaces now prints the
content string returned by the implementation now named
__write_etc_network_interfaces.

This way a testsuite can use the __* variants directly to
test the parser, passing its own versions of the /proc
files.
2015-06-26 07:45:52 +02:00
Wolfgang Bumiller
9d27ef418c write_etc_network_interfaces: updated header comment
The header now mentions that the file is auto-generated and
should not be tempered with directly.
It now recommends to add custom network configurations via
source/source-directory lines.
2015-06-26 07:44:06 +02:00
Wolfgang Bumiller
48ab17b3ee read_etc_network_interfaces: improved parsing
* parsing ipv6 blocks
* parsing extra lines like source/source-directory/...
* merge multiple bridge_port lines into one
* write options only once

The returned config hash is not just the interface hash
anymore. Interfaces are now in its 'ifaces' member hash. All
unknown options (including mappings) end up in its 'options'
hash.

Added a comment describing the config hash's layout in
detail.

An interface can now have an ipv4 and an ipv6 entry, they
will be returned as a single interface with
address/netmask/gateway and address6/netmask6/gateway6
elements. Additionally a 'families' array is available
listing which families are available. Ideally we'll at some
point allow unhandled families to be kept too, however, now
that extra lines like 'source' and 'source-directory' are
preserved, it is recommended to move all custom
configuration into separate files to not interfere with our
interface parsing.

Options such as bridge ports or ovs_* will now be written
out only for the first interface. If multiple protocol
families of a bridge contain bridge_ports lines they will be
merged into the first interface.
2015-06-26 07:43:18 +02:00
Wolfgang Bumiller
0541ec90f2 removed write-only $gateway variable 2015-06-26 07:07:18 +02:00
Wolfgang Bumiller
b1d7951f61 read_etc_network_interfaces: less strict parsing
*) Don't require indented lines, instead know when to end a
   section.
*) Don't require empty lines between sections.
*) Fixed non-/greedy regex issue

And turned (.*)\s* into just (.*) as .* eats the whitespace
too.
2015-06-26 07:06:57 +02:00
Dietmar Maurer
dc1c21d323 bump version to 4.0-8 2015-06-19 07:24:15 +02:00
Alen Grizonic
a526ab1cfc PVE:Daemon start/restart with systemd
Added some lines which make it possible to stop/start/restart daemon services with pve scripts,
avoiding the problem of systemd not recognizing the new status of the (re)started service processes.

The scripts now rely on systemctl.

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
2015-06-19 07:22:48 +02:00
Dietmar Maurer
2c4ec58c52 bump version to 4.0-7 2015-06-09 12:16:50 +02:00
Dietmar Maurer
6de95a662f new helper dump_journal to view systemd journal 2015-06-09 12:15:41 +02:00
Wolfgang Bumiller
a1609259d3 remove superfluous substitution
regexps are greedy so the first substitution eats up
multiple groups of double-colons up to the last one already.
So unless there's some intended hidden side effect this
statement has no obvious purpose.
2015-06-05 15:33:58 +02:00
Dietmar Maurer
2336b19ef3 bump version to 4.0-6 2015-06-01 13:18:14 +02:00
Dietmar Maurer
21d51dcafa add trigger for pve-api-updates 2015-06-01 13:17:30 +02:00
Dietmar Maurer
f74d5763d5 bump version to 4.0-5 2015-05-28 18:07:50 +02:00
Wolfgang Bumiller
8e3e9929ac defer some daemon setup routines
A first step towards untangling some of the intermingled data and
functionality setup tasks for the daemons:

Daemon::new now only validates and untaints arguments, but doesn't
perform any actions such as setuid/setgid until the new Daemon::setup
method which is now executed from Daemon::start right before entering
Daemon::$server_run.

CLIHandler::handle_cmd now takes an optional $preparefunc which is
called after handling 'printmanpod' and 'verifyapi'.
2015-05-28 18:03:15 +02:00
Wolfgang Bumiller
22d4efe612 fix a regex typo in run_command
m/|/ is always true as it effectively matches 'nothing or nothing
anywhere in a string'
looks like it was supposed to be m/\|/
2015-05-28 10:28:44 +02:00
Dietmar Maurer
74b3593bf5 bump version to 4.0-4 2015-05-27 15:34:06 +02:00