5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-23 10:03:33 +03:00

600 Commits

Author SHA1 Message Date
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
Wolfgang Bumiller
d07b7084c4 spice-proxy format now uses new address format
spice-proxy used dns-name before which matches a combination of letters,
digits and dots, which happens to include ipv4 addresses but not ipv6
ones.
Since 'dns-name' sounds like it's only for names, I'm adding an address
format which is either a dns-name or an ip (including ipv6).
2015-05-27 15:32:11 +02:00
Wolfgang Bumiller
e43b3a0f50 prevent the use of AI_ADDRCONFIG
perl's IO::Socket::IP passes AI_ADDRCONFIG if no GetAddrInfoFlags are passed,
which is often useful but also causes it to error when explicitly trying to
bind to 127.0.0.1 when there are no _other_ IPv4 addresses present.
2015-05-27 15:32:08 +02:00
Dietmar Maurer
7d97ec60e8 update changelog 2015-05-12 10:36:40 +02:00
Wolfgang Bumiller
a0b6ef523a new helper: getaddrinfo_all
As it's commonly used in ipv6 support code a getaddrinfo wrapper passing
default flags and dealing with the (err,result) tuple was added.
2015-05-12 10:35:35 +02:00
Wolfgang Bumiller
467752183d add a socket family argument to next_*_port functions
Instead of assuming a local address of 0.0.0.0, the next_*_port family
of functions now takes an optional packet family argument (AF_INET/AF_INET6),
used for ipv6 support.
2015-05-12 10:35:31 +02:00
Dietmar Maurer
4808fea7c0 bump version to 4.0-3 2015-05-08 12:38:17 +02:00
Wolfgang Bumiller
a956854f8d add utility to fetch the socket family for a hostname 2015-05-08 12:36:30 +02:00
Wolfgang Bumiller
83397d50e0 optional socket family parameter for create_reusable_socket 2015-05-08 12:36:21 +02:00
Wolfgang Bumiller
8df6b79439 provide Tools::unpack_sockaddr_in46 2015-05-08 12:36:11 +02:00
Wolfgang Bumiller
00dc9d0fa9 Use IO::Socket::IP instead of INET 2015-05-08 12:35:15 +02:00
Dietmar Maurer
93276209cc fix typo 2015-04-23 09:14:48 +02:00
Dietmar Maurer
ed5880acdc add additional methods for IP address verification 2015-04-23 08:19:03 +02:00
Dietmar Maurer
c70c3bbc83 cleanup: remove unnecessary prefix 2015-04-22 10:08:37 +02:00
Dietmar Maurer
c6aff4766c bump version to 4.0-2 2015-04-22 09:56:37 +02:00
Dietmar Maurer
b0edd8e6d2 register new standard option pve-startup-order
We can use this for lxc and qemu.
2015-04-22 09:49:15 +02:00
Dietmar Maurer
3432ae0c5e improve error message 2015-04-03 08:10:23 +02:00
Dietmar Maurer
1cfd43f6f9 use libspice-protocol-dev (instead of debian package) 2015-03-23 12:40:03 +01:00
Dietmar Maurer
a4a9a32857 use wiki style headers for README.dev 2015-03-04 06:59:12 +01:00
Dietmar Maurer
8bc53243e0 update installation instructions 2015-03-02 11:11:49 +01:00
Dietmar Maurer
b51b16e6f5 rename data to src 2015-02-27 16:57:20 +01:00
Dietmar Maurer
47e4eb1129 bump version for Debian Jessie 2015-02-26 11:19:59 +01:00
Dietmar Maurer
c58f205b5c bump version to 3.0-24 2015-02-11 06:38:44 +01:00
Stefan Priebe
16d74d09ca next_migrate_port: higher port range - all other ranges are 100 ports
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2015-02-11 06:36:09 +01:00
Stefan Priebe
940be49b86 Fix next_unused_port already bin detection
unsecure migration does not use localhost to bind to. Instead it uses a specific IP on the node.
As we don't know that IP in this part of the code the only chance to check for a possible already
existing bind is to bind to all IPs.

Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2015-02-11 06:35:37 +01:00
Dietmar Maurer
0324c6a27f bump version to 3.0-23 2015-02-09 07:02:29 +01:00
Alexandre Derumier
4b40ad1871 read_etc_network_interfaces : don't always add vmbr0
Currently it's impossible to remove vmbr0 from network gui,

if we really want to remove it, or replace it with an OVS vmbr0

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-02-09 07:01:27 +01:00
Dietmar Maurer
363a51a0d4 bump version to 3.0-22 2015-01-08 14:49:59 +01:00
Dietmar Maurer
309d99e718 Daemon: change option name 'run_dir' to 'pidfile' 2015-01-02 14:15:09 +01:00