pve-common.git
2 days agobump version to 6.3-1 master
Thomas Lamprecht [Fri, 27 Nov 2020 14:30:25 +0000 (15:30 +0100)]
bump version to 6.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 days agoInotify: delete vlan-id for "iface.X" vlan iface.
Alexandre Derumier [Thu, 26 Nov 2020 09:18:46 +0000 (10:18 +0100)]
Inotify: delete vlan-id for "iface.X" vlan iface.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 days agosubscription: use more specific machine repo definition for PVE/PMG
Thomas Lamprecht [Fri, 27 Nov 2020 14:22:34 +0000 (15:22 +0100)]
subscription: use more specific machine repo definition for PVE/PMG

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 days agoinotify: apt auth: sort longest machine entry first and allow deletion
Thomas Lamprecht [Fri, 27 Nov 2020 14:21:37 +0000 (15:21 +0100)]
inotify: apt auth: sort longest machine entry first and allow deletion

plus a few code cleanups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agobump version to 6.2-6
Thomas Lamprecht [Tue, 17 Nov 2020 15:08:04 +0000 (16:08 +0100)]
bump version to 6.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agorest: register method: allow minus in path template parameter names
Thomas Lamprecht [Tue, 17 Nov 2020 15:05:20 +0000 (16:05 +0100)]
rest: register method: allow minus in path template parameter names

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agorest: register method: non-capturing group for path regex outer group
Thomas Lamprecht [Tue, 17 Nov 2020 15:05:04 +0000 (16:05 +0100)]
rest: register method: non-capturing group for path regex outer group

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agobump version to 6.2-5
Thomas Lamprecht [Tue, 17 Nov 2020 13:29:25 +0000 (14:29 +0100)]
bump version to 6.2-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agoPBS client: backup tree: avoid over generic param has
Thomas Lamprecht [Tue, 17 Nov 2020 12:04:53 +0000 (13:04 +0100)]
PBS client: backup tree: avoid over generic param has

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agoPBS client: get snapshots: avoid over generic param has
Thomas Lamprecht [Tue, 17 Nov 2020 12:04:43 +0000 (13:04 +0100)]
PBS client: get snapshots: avoid over generic param has

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agoPBS client: cannot use normal method call style for private subs
Thomas Lamprecht [Tue, 17 Nov 2020 12:03:42 +0000 (13:03 +0100)]
PBS client: cannot use normal method call style for private subs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agopbs: restore pxar: add required parameters explicitly in method signature
Thomas Lamprecht [Tue, 17 Nov 2020 08:39:03 +0000 (09:39 +0100)]
pbs: restore pxar: add required parameters explicitly in method signature

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agopbs: code cleanup param array assembly
Thomas Lamprecht [Tue, 17 Nov 2020 08:38:28 +0000 (09:38 +0100)]
pbs: code cleanup param array assembly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agopbs: autogen key: adapt recent changes in storage module
Thomas Lamprecht [Tue, 17 Nov 2020 08:12:31 +0000 (09:12 +0100)]
pbs: autogen key: adapt recent changes in storage module

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agoPBS client: use our normal blessed method call style
Thomas Lamprecht [Tue, 17 Nov 2020 08:12:02 +0000 (09:12 +0100)]
PBS client: use our normal blessed method call style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 days agoadd PBSClient module
Stoiko Ivanov [Mon, 16 Nov 2020 11:01:08 +0000 (12:01 +0100)]
add PBSClient module

PBSClient.pm contains methods for:
* handling (sensitive) config-information (passwords, encryption keys)
* creating/restoring/forgetting/listing backups

code is mostly based on the current PBSPlugin in pve-storage

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 weeks agosystemd: add CPUWeight encoding
Alexandre Derumier [Fri, 6 Nov 2020 08:24:55 +0000 (09:24 +0100)]
systemd: add CPUWeight encoding

3 weeks agobugfix: cpushares : default value is 1024 for cgroup v1
Alexandre Derumier [Fri, 6 Nov 2020 08:24:54 +0000 (09:24 +0100)]
bugfix: cpushares : default value is 1024 for cgroup v1

Currently if we delete cpuunit (undef), the default value is 100

3 weeks agoCgroups: remove specific lxc code
Alexandre Derumier [Fri, 6 Nov 2020 08:24:53 +0000 (09:24 +0100)]
Cgroups: remove specific lxc code

3 weeks agomove PVE::LXC::CGroup to PVE::CGroup
Alexandre Derumier [Fri, 6 Nov 2020 08:24:52 +0000 (09:24 +0100)]
move PVE::LXC::CGroup to PVE::CGroup

3 weeks agobump version to 6.2-4
Thomas Lamprecht [Thu, 5 Nov 2020 09:56:03 +0000 (10:56 +0100)]
bump version to 6.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agofix 3108: properly check IPv6 addr
Fabian Grünbichler [Mon, 2 Nov 2020 07:33:51 +0000 (08:33 +0100)]
fix 3108: properly check IPv6 addr

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 weeks agoSystemd: add helpers for parsing unit files
Stoiko Ivanov [Wed, 28 Oct 2020 18:54:17 +0000 (19:54 +0100)]
Systemd: add helpers for parsing unit files

taken from pve-storage/PVE/API2/Disks/Directory.pm (and made available as
public sub)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 weeks agoMake configid regex public
Dominic Jäger [Wed, 28 Oct 2020 10:04:53 +0000 (11:04 +0100)]
Make configid regex public

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
4 weeks agoAdd tests for verify_configid
Dominic Jäger [Wed, 28 Oct 2020 10:04:52 +0000 (11:04 +0100)]
Add tests for verify_configid

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
4 weeks agosendmail: code cleanup
Thomas Lamprecht [Thu, 29 Oct 2020 14:20:17 +0000 (15:20 +0100)]
sendmail: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agonetwork: fix conditional variable declaration
Thomas Lamprecht [Fri, 23 Oct 2020 19:09:23 +0000 (21:09 +0200)]
network: fix conditional variable declaration

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agonetwork: cleanup "check bond" code
Thomas Lamprecht [Fri, 23 Oct 2020 19:08:38 +0000 (21:08 +0200)]
network: cleanup "check bond" code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agoInotify: allow bond of bond
Alexandre Derumier [Tue, 20 Oct 2020 11:26:11 +0000 (13:26 +0200)]
Inotify: allow bond of bond

for example,some users need to do active-backup bond, on top of 2 lacp bond.

6 weeks agoProcFSTools: add read_pressure
Alexandre Derumier [Tue, 6 Oct 2020 11:58:39 +0000 (13:58 +0200)]
ProcFSTools: add read_pressure

read new /proc/pressure/(cpu,disk,io) introduced in kernel 4.20.

This give more granular informations than loadaverage.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agobump version to 6.2-3
Thomas Lamprecht [Fri, 18 Sep 2020 15:35:58 +0000 (17:35 +0200)]
bump version to 6.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoproperly encode YAML via YAML::XS
Fabian Grünbichler [Thu, 17 Sep 2020 11:16:58 +0000 (13:16 +0200)]
properly encode YAML via YAML::XS

otherwise we get strange errors when formatting data that was originally
JSON, and can thus contain JSON::true/JSON::false.

one example is the QMP query-blockstats command, which gets called (and
the resulting values returned) by /nodes/NODE/qemu/VMID/status/current

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 months agotools: sync_mountpoint: throw actual error is syncfs fails
Thomas Lamprecht [Fri, 18 Sep 2020 09:59:32 +0000 (11:59 +0200)]
tools: sync_mountpoint: throw actual error is syncfs fails

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agosync_mountpoint: open path so that sync works
Stoiko Ivanov [Thu, 17 Sep 2020 19:17:00 +0000 (21:17 +0200)]
sync_mountpoint: open path so that sync works

sync_mountpoint takes a path, gets an open filedescriptor and calls
syncfs(2) on it.
by opening with O_PATH the syncfs call fails with EBADF (see open(2)).

found by running:
```
pkill -f 'pvedaemon worker';
strace -yyttT -s 512 -o /tmp/trace -fp $(pgrep -f pvedaemon$)
```

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agod/control: add missing libtimedate-perl to depends
Fabian Grünbichler [Thu, 17 Sep 2020 11:00:33 +0000 (13:00 +0200)]
d/control: add missing libtimedate-perl to depends

Fixes: b18826ce61e6e2438acc08f05aaa5395bdcd4974

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 months agowrap-and-sort d/control
Fabian Grünbichler [Thu, 17 Sep 2020 10:54:30 +0000 (12:54 +0200)]
wrap-and-sort d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 months agod/copyright: update
Thomas Lamprecht [Tue, 8 Sep 2020 16:30:28 +0000 (18:30 +0200)]
d/copyright: update

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agobump version to 6.2-2
Thomas Lamprecht [Mon, 7 Sep 2020 08:01:09 +0000 (10:01 +0200)]
bump version to 6.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoget_options: allow no arguments if all are optional
Thomas Lamprecht [Mon, 7 Sep 2020 07:59:01 +0000 (09:59 +0200)]
get_options: allow no arguments if all are optional

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agosendmail helper: allow empty display name in from
Stoiko Ivanov [Thu, 3 Sep 2020 12:09:45 +0000 (14:09 +0200)]
sendmail helper: allow empty display name in from

This patch enables the sendmail helper sub to send emails with a non-existant
display name in the from address. This is used to replace the direct call to
the sendmail binary in pve-manager/PVE/API2/APT.pm.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agosendmail-helper: only send multipart if necessary
Stoiko Ivanov [Thu, 3 Sep 2020 12:09:44 +0000 (14:09 +0200)]
sendmail-helper: only send multipart if necessary

PVE::Tools::sendmail currently always sends a multipart/alternative message
irrespective of the actual content of the mail (e.g. a plain-text only mail
need not be sent as multipart message).

Additionally a few small refactorings based on the discussion
in https://lists.proxmox.com/pipermail/pbs-devel/2020-August/000423.html
and commited in 66004f22c6475ceb0146cf2df1f380f9f0274be4 in the
rust proxmox repository git://git.proxmox.com/git/proxmox.git
were carried over.

tested by creating a backup of a VM and setting an e-mail address, having
ha-manager send a mail after fencing as well as sending a few small mails via
'perl -e'

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 months agoget_options: allow optional arguments "arg_params" if no ambiguity
Thomas Lamprecht [Wed, 26 Aug 2020 19:21:03 +0000 (21:21 +0200)]
get_options: allow optional arguments "arg_params" if no ambiguity

If we run out of passed arguments from the user but still had defined
"arg_params" (those params which went after the command in fixed
order without option -- dashes) we always errored out with "not
enough arguments". But, there are situations where the remaining
arg_params are all marked as optional in the schema, so we do not
need to error out in that case.

A prime (future) use case is "pvesm prune-backups". Currently the
usage is:
> pvesm prune-backups storeid --prune-backups keep-last=1,keep-...

Because the "prune-backups" keep retention property is optional as it
can fallback to the one defined in the storage configuration.
With this patch we can make it an argument and allow the following
two usages:

1. As above, but avoiding the extra ugly --prune-backups
> pvesm prune-backups storeid keep-last=1,keep-...

2. Fallback to storage config:
> pvesm prune-backups storeid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agobump version to 6.2-1
Thomas Lamprecht [Wed, 19 Aug 2020 10:29:13 +0000 (12:29 +0200)]
bump version to 6.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agorun command: fix matching \r\n and use non-capturing group for it
Thomas Lamprecht [Wed, 19 Aug 2020 06:54:08 +0000 (08:54 +0200)]
run command: fix matching \r\n and use non-capturing group for it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agorun_command: improve performance for logging and long lines
Dominik Csapak [Thu, 30 Jul 2020 09:04:10 +0000 (11:04 +0200)]
run_command: improve performance for logging and long lines

to call out/err/logfunc with each line, we search for a newline and call
outfunc/logfunc with everything before that

since we do a select/read (with 4096 size) in a loop, this means
that if we have very long lines, we search for a newline in an
ever growing buffer (for which we know does not contain a newline)

so instead, only search the new data for newlines

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agosafe_read_from: bump default size limit to 512k
Fabian Grünbichler [Fri, 14 Aug 2020 07:48:33 +0000 (09:48 +0200)]
safe_read_from: bump default size limit to 512k

this is (via file_get_contents and file_copy) used for reading from
pmxcfs, which has a file size limit of 512k. since quite a number of
call sites would need to explicitly override this (and then get updated
if we bump the limit on the pmxcfs side again in the future), making our
default file reader compatible by default seems the better solution.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agobump version to 6.1-5
Thomas Lamprecht [Tue, 7 Jul 2020 17:27:26 +0000 (19:27 +0200)]
bump version to 6.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agosendmail: separate 'mailto' list from the rest of the parameters
Oguz Bektas [Tue, 7 Jul 2020 12:55:41 +0000 (14:55 +0200)]
sendmail: separate 'mailto' list from the rest of the parameters

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 months agoJSONSchema: use validator in print_property_string too
Stefan Reiter [Thu, 25 Jun 2020 11:35:40 +0000 (13:35 +0200)]
JSONSchema: use validator in print_property_string too

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 months agoJSONSchema: add format validator support and cleanup check_format
Stefan Reiter [Thu, 25 Jun 2020 11:35:39 +0000 (13:35 +0200)]
JSONSchema: add format validator support and cleanup check_format

Adds a third, optional parameter to register_format that allows specifying
a function that will be called after parsing and can validate the parsed
data. A validator should die on failed validation, and can also change the
parsed object by returning a modified version of it.

This is useful so one can register a format with its hash, thus allowing
documentation to be generated automatically, while still enforcing certain
validation rules.

The validator only needs to be called in parse_property_string, since
check_format always calls parse_property_string if there is a
possibility of a validator existing at all. parse_property_string should
then be called with named formats for best effect, as only then can
validators be used.

Clean up 'check_format' as well (which pretty much amounts to a rewrite).
No existing functionality is intentionally changed.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 months agobump version to 6.1-4
Thomas Lamprecht [Fri, 3 Jul 2020 12:17:04 +0000 (14:17 +0200)]
bump version to 6.1-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agofollouwp: improve comment detection and refactor slightly
Thomas Lamprecht [Fri, 26 Jun 2020 07:55:21 +0000 (09:55 +0200)]
follouwp: improve comment detection and refactor slightly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoschema: register 'timezone' format and add verification method
Oguz Bektas [Wed, 17 Jun 2020 13:32:29 +0000 (15:32 +0200)]
schema: register 'timezone' format and add verification method

/usr/share/zoneinfo/zone.tab has the valid list of time zones.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agofix #2796: debian/postinst: check for existing /etc/aliases
Stoiko Ivanov [Fri, 12 Jun 2020 09:14:38 +0000 (11:14 +0200)]
fix #2796: debian/postinst: check for existing /etc/aliases

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agofix #2374: bridge-ports is assumed to be defined
Mira Limbeck [Wed, 10 Jun 2020 14:03:38 +0000 (16:03 +0200)]
fix #2374: bridge-ports is assumed to be defined

bridge-ports is an optional parameter but was assumed to be defined in
the code. This resulted in 'use of uninitialized value' warnings.

By reordering of the $ports definition before the replace, we get rid of
the 'use of uninitialized value' when no bridge-port is specified.

In the second case we set it to an empty string when it is undefined.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 months agobump version to 6.1-3
Thomas Lamprecht [Mon, 8 Jun 2020 15:37:13 +0000 (17:37 +0200)]
bump version to 6.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoInotify: write_network_interfaces : always autostart bond slaves interfaces
Alexandre Derumier [Sun, 7 Jun 2020 11:39:47 +0000 (13:39 +0200)]
Inotify: write_network_interfaces : always autostart bond slaves interfaces

Currently, bond slaves are mostly working without autostart,
because bond slaves scripts from ifupdown1 && also ifupdown2
 have some kind of hacks to start the slaves.

But if users want to do some tuning on the ifaces, they are not applied.

Also, with ifupdown2 + ovs, this kind of hack is not implemented (yet), so the
slaves of the bond are still down.

Debian/Ubuntu official docs always set "auto ethX" for bond slaves,
it's really more clean like this.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
5 months agoAdd cpu core count to /nodes/{id}/status API result
Mike Beattie [Fri, 29 May 2020 10:58:52 +0000 (22:58 +1200)]
Add cpu core count to /nodes/{id}/status API result

This is useful for when collecting data for Guest OS licensing (Microsoft)
where physical core count matters, not socket or thread count.

The "cpus" value counts threads when Hyperthreading is enabled.

Signed-off-by: Mike Beattie <mike@ethernal.org>
5 months agonetwork: vlan-aware bridge: fix pvid when trunks is defined
Alexandre Derumier [Mon, 25 May 2020 11:05:08 +0000 (13:05 +0200)]
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>
6 months agoread_bridge_mtu: public method instead private
Alexandre Derumier [Fri, 17 Apr 2020 05:47:05 +0000 (07:47 +0200)]
read_bridge_mtu: public method instead private

6 months agobump version to 6.1-2
Thomas Lamprecht [Sat, 9 May 2020 19:01:10 +0000 (21:01 +0200)]
bump version to 6.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agonetwork: bridge add IF: do not add all VLANs if $trunks are passed
Thomas Lamprecht [Sat, 9 May 2020 18:53:28 +0000 (20:53 +0200)]
network: bridge add IF: do not add all VLANs if $trunks are passed

fixes commit 89ea13ef6b1555f92309da5c298e16579163eaf4 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>
6 months agobump version to 6.1-1
Thomas Lamprecht [Wed, 6 May 2020 10:14:10 +0000 (12:14 +0200)]
bump version to 6.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agonetwork: fix adding vlan tags to bridge
Fabian Grünbichler [Wed, 6 May 2020 10:03:20 +0000 (12:03 +0200)]
network: fix adding vlan tags to bridge

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 months agoProcFSTools: fix read_meminfo without KSM
Stoiko Ivanov [Tue, 5 May 2020 15:01:07 +0000 (17:01 +0200)]
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>
6 months agoprint_text_table: handle undefined values in comparision
Fabian Ebner [Tue, 28 Apr 2020 08:18:26 +0000 (10:18 +0200)]
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>
6 months agofix #2696: avoid 'undefined value' warning in 'pvesh help unknown'
Stefan Reiter [Mon, 4 May 2020 12:02:47 +0000 (14:02 +0200)]
fix #2696: avoid 'undefined value' warning in 'pvesh help unknown'

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
6 months agobump version to 6.0-20
Fabian Grünbichler [Mon, 20 Apr 2020 08:04:10 +0000 (10:04 +0200)]
bump version to 6.0-20

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 months agoJSONSchema: allow to import parse_property_string
Thomas Lamprecht [Sat, 2 May 2020 16:42:35 +0000 (18:42 +0200)]
JSONSchema: allow to import parse_property_string

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agobuild: remove ACME modules
Fabian Grünbichler [Mon, 20 Apr 2020 08:03:08 +0000 (10:03 +0200)]
build: remove ACME modules

from Makefile as well

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 months agoMove the code to proxmox-acme and add a dependency on it.
Wolfgang Link [Thu, 16 Apr 2020 05:18:20 +0000 (07:18 +0200)]
Move the code to proxmox-acme and add a dependency on it.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
7 months agosection config: use croak so that the error is from the callers POV
Thomas Lamprecht [Wed, 29 Apr 2020 12:51:59 +0000 (14:51 +0200)]
section config: use croak so that the error is from the callers POV

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoJSONSchema: extend pve-configid regex by '-'
Dominik Csapak [Thu, 9 Apr 2020 14:10:41 +0000 (16:10 +0200)]
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>
7 months agonetwork: replace system() with run_command()
Fabian Grünbichler [Wed, 8 Apr 2020 12:02:50 +0000 (14:02 +0200)]
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>
7 months agonetwork: remove unused debug code
Fabian Grünbichler [Wed, 8 Apr 2020 12:02:48 +0000 (14:02 +0200)]
network: remove unused debug code

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 months agoinotify: trailing whitespaces: comment and drop now superfluous chomp
Thomas Lamprecht [Tue, 7 Apr 2020 16:12:54 +0000 (18:12 +0200)]
inotify: trailing whitespaces: comment and drop now superfluous chomp

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoInotify: read_interfaces : remove trailing whitespaces
Alexandre Derumier [Sun, 5 Apr 2020 08:33:00 +0000 (10:33 +0200)]
Inotify: read_interfaces : remove trailing whitespaces

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
7 months agobump version to 6.0-19
Thomas Lamprecht [Sat, 4 Apr 2020 17:55:27 +0000 (19:55 +0200)]
bump version to 6.0-19

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoidmap followup: avoid false-negatives through falsy values in collision check
Thomas Lamprecht [Thu, 2 Apr 2020 15:30:55 +0000 (17:30 +0200)]
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>
7 months agoJSONSchema: add idmap parser and storagepair format
Fabian Grünbichler [Mon, 30 Mar 2020 11:41:28 +0000 (13:41 +0200)]
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>
7 months agocpuset: also split write methods
Wolfgang Bumiller [Wed, 1 Apr 2020 10:20:59 +0000 (12:20 +0200)]
cpuset: also split write methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agocpuset: allow empty cpusets
Wolfgang Bumiller [Wed, 1 Apr 2020 10:20:58 +0000 (12:20 +0200)]
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>
7 months agoRegister acme-plugin-format
Wolfgang Link [Tue, 31 Mar 2020 10:08:35 +0000 (12:08 +0200)]
Register acme-plugin-format

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
7 months agoReuse id parse code.
Wolfgang Link [Tue, 31 Mar 2020 10:08:34 +0000 (12:08 +0200)]
Reuse id parse code.

The storage_id is the same as the plugin_id.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
8 months agocpuset: cgroupv2 support
Wolfgang Bumiller [Mon, 30 Mar 2020 14:30:35 +0000 (16:30 +0200)]
cpuset: cgroupv2 support

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agocpuset: further factorization
Wolfgang Bumiller [Mon, 30 Mar 2020 14:30:34 +0000 (16:30 +0200)]
cpuset: further factorization

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agocpuset: replace 'kind' with an 'effective' boolean
Wolfgang Bumiller [Mon, 30 Mar 2020 14:30:33 +0000 (16:30 +0200)]
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>
8 months agocpuset: cleanup/refactor
Wolfgang Bumiller [Mon, 30 Mar 2020 14:30:32 +0000 (16:30 +0200)]
cpuset: cleanup/refactor

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agobump version to 6.0-18
Thomas Lamprecht [Sat, 21 Mar 2020 15:49:51 +0000 (16:49 +0100)]
bump version to 6.0-18

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoldap: add optional classes to query_users
Dominik Csapak [Fri, 13 Mar 2020 12:18:43 +0000 (13:18 +0100)]
ldap: add optional classes to query_users

and filter by it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agoldap: optionally save group name by attribute
Dominik Csapak [Fri, 13 Mar 2020 12:18:42 +0000 (13:18 +0100)]
ldap: optionally save group name by attribute

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agobump version to 6.0-17
Thomas Lamprecht [Fri, 13 Mar 2020 11:25:03 +0000 (12:25 +0100)]
bump version to 6.0-17

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agot.list-interfaces.pl: add cidr address test
Alexandre Derumier [Fri, 13 Mar 2020 10:48:11 +0000 (11:48 +0100)]
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>
8 months agoinotify/interfaces: fallback to cidr for address on write
Thomas Lamprecht [Fri, 13 Mar 2020 10:36:31 +0000 (11:36 +0100)]
inotify/interfaces: fallback to cidr for address on write

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoinotify/interfaces: ensure cidr, address and netmask are set correctly
Thomas Lamprecht [Fri, 13 Mar 2020 10:14:55 +0000 (11:14 +0100)]
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>
8 months agotest: list ifaces: fix indentation of expected structure
Thomas Lamprecht [Fri, 13 Mar 2020 10:07:17 +0000 (11:07 +0100)]
test: list ifaces: fix indentation of expected structure

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoINotify: sort and spli module usage
Thomas Lamprecht [Fri, 13 Mar 2020 10:04:46 +0000 (11:04 +0100)]
INotify: sort and spli module usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoruntest: clone config before passing to write to avoid side effects
Thomas Lamprecht [Fri, 13 Mar 2020 10:01:01 +0000 (11:01 +0100)]
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>
8 months agobump version to 6.0-16
Thomas Lamprecht [Thu, 12 Mar 2020 15:15:21 +0000 (16:15 +0100)]
bump version to 6.0-16

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoinotify: fix compatibillity with address + netmask separate passed
Thomas Lamprecht [Thu, 12 Mar 2020 14:21:55 +0000 (15:21 +0100)]
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>