Commit Graph

1137 Commits

Author SHA1 Message Date
Alexandre Derumier
aa91ae3d1b network: vlan-aware bridge: fix pvid when trunks is defined
Currently, when a trunks is defined, the vlan tag is not used
for pvid with vlan-aware bridge. (It's ok with ovs switch)

example:

net0: e1000=BA:90:68:B8:CF:F5,bridge=vmbr1,tag=2,trunks=2-11

before
------
tap100i0	 2-11

after
-----
tap100i0	 2 PVID Egress Untagged
	 3-11

No regression for other configurations:

net0: e1000=BA:90:68:B8:CF:F5,bridge=vmbr1

before
------
tap100i0	 1 PVID Egress Untagged
	 2-4094

after
-----
tap100i0	 1 PVID Egress Untagged
	 2-4094

net0: e1000=BA:90:68:B8:CF:F5,bridge=vmbr1,tag=2

before
------
tap100i0	 2 PVID Egress Untagged

after
-----
tap100i0	 2 PVID Egress Untagged

net0: e1000=BA:90:68:B8:CF:F5,bridge=vmbr1,trunks=2-11

before
------
tap100i0	 1 PVID Egress Untagged
	 2-11

after
-----
tap100i0	 1 PVID Egress Untagged
	 2-11

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-03 14:38:17 +02:00
Alexandre Derumier
1b6ad61c61 read_bridge_mtu: public method instead private 2020-05-11 17:14:24 +02:00
Thomas Lamprecht
fdda9da4ab bump version to 6.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-09 21:01:10 +02:00
Thomas Lamprecht
0777906df2 network: bridge add IF: do not add all VLANs if $trunks are passed
fixes commit 89ea13ef6b and
restores old behavior, the "if !$trunks" post-if was a bit suble, it
did not guard the die, but the system command previously - the die
was || (ORd) to the command, bad code style to begin with..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-09 20:55:25 +02:00
Thomas Lamprecht
2c3ecf299f bump version to 6.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-06 12:14:42 +02:00
Fabian Grünbichler
16cecc0dcc network: fix adding vlan tags to bridge
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-06 12:03:31 +02:00
Stoiko Ivanov
9c1ccaf922 ProcFSTools: fix read_meminfo without KSM
on kernel configs where KSM is not enabled (e.g. an openstack instance at
OVH) the file /sys/kernel/mm/ksm/pages_sharing does not exist.
In that case there is no memory shared so assuming 0 is reasonable.

While this is not the case with our shipped kernel, and thus will probably
not happen on a PVE installation, PMG can run quite happily with a different
kernel (the reporter had this on an openstack instance at OVH).

a quick grep through our codebase showed only the API2::Nodes::Nodeinfo::status
call as user of the memshared property.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-05-05 18:25:57 +02:00
Fabian Ebner
890d25d963 print_text_table: handle undefined values in comparision
by introducing a safe_compare helper. Fixes warnings, e.g.
pvesh get /nodes/<NODE>/network
would print "use of uninitialized"-warnings if there are inactive
network interfaces, because for those, 'active' is undef.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
2020-05-04 18:20:39 +02:00
Stefan Reiter
87e31b2358 fix #2696: avoid 'undefined value' warning in 'pvesh help unknown'
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-05-04 18:05:50 +02:00
Fabian Grünbichler
938dedc285 bump version to 6.0-20
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-02 18:42:42 +02:00
Thomas Lamprecht
79ac628b9e JSONSchema: allow to import parse_property_string
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-02 18:42:42 +02:00
Fabian Grünbichler
d0c43c2121 build: remove ACME modules
from Makefile as well

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-30 12:17:06 +02:00
Wolfgang Link
12b0d5a959 Move the code to proxmox-acme and add a dependency on it.
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-30 12:17:06 +02:00
Thomas Lamprecht
7db4e5d763 section config: use croak so that the error is from the callers POV
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-29 14:51:59 +02:00
Dominik Csapak
6b0c18d4db JSONSchema: extend pve-configid regex by '-'
we use this format for all 'delete' options but we have some options
that have a '-' in the name (e.g. 'sync-defaults-options') that cannot
be deleted if it is not included

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-23 07:50:24 +02:00
Fabian Grünbichler
89ea13ef6b network: replace system() with run_command()
easier to read and extend, and safer as well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-08 15:03:11 +02:00
Fabian Grünbichler
6256f2c39e network: remove unused debug code
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-08 14:56:04 +02:00
Thomas Lamprecht
de906ba347 inotify: trailing whitespaces: comment and drop now superfluous chomp
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-07 18:12:54 +02:00
Alexandre Derumier
684e07f2dd Inotify: read_interfaces : remove trailing whitespaces
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-04-07 18:10:47 +02:00
Thomas Lamprecht
5c183fd276 bump version to 6.0-19
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-04 19:55:27 +02:00
Thomas Lamprecht
e12df964dc idmap followup: avoid false-negatives through falsy values in collision check
By using "exists" when checking if a hash entry is set, else things
like "0" could get accepted by mistake.

Also cleanup the code a little, like dropping the "PVE::JSONSchema::"
prefix, this is now in that module after all.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-02 17:33:47 +02:00
Fabian Grünbichler
18f93ddf63 JSONSchema: add idmap parser and storagepair format
generalized from the start to support extension to bridges or other
entities as well.

this gets us incremental support for the CLI, e.g.:

--targetstorage foo:bar --targetstorage bar:baz --targetstorage foo

creates a mapping of

foo=>bar
bar=>baz

with a default of foo

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-01 17:30:49 +02:00
Wolfgang Bumiller
b60a44e0da cpuset: also split write methods
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-01 17:02:13 +02:00
Wolfgang Bumiller
ea2884f04d cpuset: allow empty cpusets
This is explicitly allowed in the documentation and happens
easily with cgroupv2 as there it is used to inherit from the
closest ancestor.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-01 17:02:13 +02:00
Wolfgang Link
a8117ff3d8 Register acme-plugin-format
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-01 11:30:27 +02:00
Wolfgang Link
731950fd1c Reuse id parse code.
The storage_id is the same as the plugin_id.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-01 11:30:27 +02:00
Wolfgang Bumiller
7c3db4b80c cpuset: cgroupv2 support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-31 08:50:10 +02:00
Wolfgang Bumiller
dd13f1836f cpuset: further factorization
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-31 08:50:10 +02:00
Wolfgang Bumiller
3e02302a64 cpuset: replace 'kind' with an 'effective' boolean
All of our users of this function currently either pass
'effective_cpus' or nothing (undef), and in cgroupv2 the
effective-cpuset file uses a different naming scheme.

Since this is only a distinction between "intended" and
"effective", use this as a boolean instead, for easier
future cgroupv2 support.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-31 08:50:10 +02:00
Wolfgang Bumiller
591be96958 cpuset: cleanup/refactor
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-31 08:50:10 +02:00
Thomas Lamprecht
062b6480fa bump version to 6.0-18
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:49:51 +01:00
Dominik Csapak
340e0881d5 ldap: add optional classes to query_users
and filter by it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-20 09:33:53 +01:00
Dominik Csapak
3c775763dc ldap: optionally save group name by attribute
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-20 09:33:53 +01:00
Thomas Lamprecht
1f32d4ce78 bump version to 6.0-17
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 12:25:03 +01:00
Alexandre Derumier
e1b784f36e t.list-interfaces.pl: add cidr address test
also reuse wanted values

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 12:16:52 +01:00
Thomas Lamprecht
9197b04672 inotify/interfaces: fallback to cidr for address on write
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:36:31 +01:00
Thomas Lamprecht
fa6e694656 inotify/interfaces: ensure cidr, address and netmask are set correctly
This should bring back compatibillity in the read site and one for
all clears that cidr is cidr, netmask is mask and address is address
(outgoing).

We're still very flexible on what can be written out.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:35:52 +01:00
Thomas Lamprecht
f110671de4 test: list ifaces: fix indentation of expected structure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:07:17 +01:00
Thomas Lamprecht
afd50f0d4a INotify: sort and spli module usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:04:46 +01:00
Thomas Lamprecht
ffe0b0e075 runtest: clone config before passing to write to avoid side effects
write changes some parts of the config, if this is a reference to the
config used for checking parsing it may lead to unexpected failures
due to those side effects..

For me it was "cidr" and "cidr6" getting deleted, and thus upcomming
tests for a compat change failing without any apparent reason.. :/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:02:01 +01:00
Thomas Lamprecht
3219cb94e3 bump version to 6.0-16
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-12 16:15:21 +01:00
Thomas Lamprecht
f6c9d9a4f3 inotify: fix compatibillity with address + netmask separate passed
fixes commit 78c6656c9aba1d57786f916717c2622a3059fb6 which dropped
writing out the netmask but missed to add compat code for the case
where the caller did not suplly a address in CIDR format already.

Check if an address ends with /\d+, if not see if a netmask is
available and add that similar how it gets handled on read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-03-12 16:10:18 +01:00
Thomas Lamprecht
040fc87d59 inotify: indentation fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-12 15:21:15 +01:00
Thomas Lamprecht
75c83508f6 bump version to 6.0-15
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 17:30:29 +01:00
Thomas Lamprecht
1175979f78 LDAP: fix missing newline in error message
seems like LDAP->new doesn't adds it, so we get the ". at
/path/to/module.pm line xy" ugly error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 17:30:29 +01:00
Thomas Lamprecht
1714a63b36 d/control: break pmg-api (<< 6.1-7)
as we now register the ldap-simple-attr' format, and double
registrations result in exceptions.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 16:59:47 +01:00
Dominik Csapak
283ac2bae1 add ldap-simple-attr from pmg
we also need it in pve

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-09 12:34:06 +01:00
Thomas Lamprecht
772038d440 RESTHandler getopt_usage: schema properties can be undef
While seldom some of our API endpoints do not define it, e.g., the
world readable /access/ticket call.

As all of the stack can cope with that just fine make getopt_usage
also follow that behavior and don't assume that properties has to be
defined.

This fixes a complaint about undefined value use in the following
calls:
 pvesh usage /access/ticket
 pmgsh help /access

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 12:26:06 +01:00
Thomas Lamprecht
d2513a84df inotify: read interfaces: avoid uninitialized value access
check if 'ovs_type' is defined first

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 11:28:38 +01:00
Thomas Lamprecht
4566729d4e Revert "Network: tap_create|plug : sdn : use bridge_vlan"
With revert "network: followup: move graceful require SDN out from
subs" squashed.

This reverts commit c02d6d1c96.
This reverts commit 35f2791ffa.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 07:33:13 +01:00