]> git.proxmox.com Git - pve-common.git/log
pve-common.git
13 months agocert: make die helper a private sub and fix code style on use
Thomas Lamprecht [Tue, 7 Mar 2023 17:02:55 +0000 (18:02 +0100)]
cert: make die helper a private sub and fix code style on use

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agocertificate: add check_ prefix to cert/key match helper
Fabian Grünbichler [Tue, 7 Mar 2023 10:51:15 +0000 (11:51 +0100)]
certificate: add check_ prefix to cert/key match helper

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
13 months agocertificate: fix formatting and whitespace
Max Carrara [Fri, 3 Mar 2023 17:57:03 +0000 (18:57 +0100)]
certificate: fix formatting and whitespace

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
13 months agocertificate: add subroutine that checks if cert and key match
Max Carrara [Fri, 3 Mar 2023 17:57:02 +0000 (18:57 +0100)]
certificate: add subroutine that checks if cert and key match

This is done here in order to allow other packages to make use of
this subroutine.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
13 months agofix #4547: set MTU on dynamically created vlan bridges
Dominik Csapak [Fri, 24 Feb 2023 11:06:21 +0000 (12:06 +0100)]
fix #4547: set MTU on dynamically created vlan bridges

Otherwise the created vlan bridge has the default MTU, which is
unexpected when the original bridge has some other MTU configured.

We already do this for the firewall bridges, so we should do so too for
the vlan bridges.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
14 months agobump version to 7.3-2
Wolfgang Bumiller [Fri, 27 Jan 2023 09:30:46 +0000 (10:30 +0100)]
bump version to 7.3-2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
15 months agotools: Add callback based filtering for logfile dump
Christian Ebner [Wed, 11 Jan 2023 13:32:20 +0000 (14:32 +0100)]
tools: Add callback based filtering for logfile dump

This patch introduces callback based filtering functionality for logfile dumps.
Further, the `dump_logfile` function is split into a reusable part for dumps
generated based on a filehandle. The state parameter can be used to keep the
state for multiple consecutive function invocations.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
15 months agofix #4299: network : disable_ipv6: fix path checking
Alexandre Derumier [Wed, 19 Oct 2022 22:24:29 +0000 (00:24 +0200)]
fix #4299: network : disable_ipv6: fix path checking

It's possible to have a
/proc/sys/net/ipv6/ directory

but no
/proc/sys/net/ipv6/conf/$iface/disable_ipv6

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
15 months agofix typo
Fabian Grünbichler [Tue, 10 Jan 2023 11:25:54 +0000 (12:25 +0100)]
fix typo

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
15 months agobuild: add missing build-dependencies
Fabian Grünbichler [Tue, 10 Jan 2023 11:23:10 +0000 (12:23 +0100)]
build: add missing build-dependencies

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
16 months agobump version to 7.3-1
Thomas Lamprecht [Thu, 24 Nov 2022 16:13:04 +0000 (17:13 +0100)]
bump version to 7.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agodump logfile: avoid boolean ternary if already boolean value
Thomas Lamprecht [Thu, 24 Nov 2022 16:10:46 +0000 (17:10 +0100)]
dump logfile: avoid boolean ternary if already boolean value

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agodump logfile: return whole log file if limit is 0
Daniel Tschlatscher [Wed, 23 Nov 2022 14:52:10 +0000 (15:52 +0100)]
dump logfile: return whole log file if limit is 0

The dump_logfile now returns the whole log file if the limit
parameter is set to 0. This must be done explicitly though, as in the
case of 'limit' being undefined, the default as before, 50 will be
used.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
16 months agonetwork: add|del_fdb: fix learning check
Alexandre Derumier [Mon, 21 Nov 2022 09:54:04 +0000 (10:54 +0100)]
network: add|del_fdb: fix learning check

ovs port don't have sysfs path
"/sys/class/net/$iface/brport/learning"

We need to check if the value is undef too

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
16 months agobump version to 7.2-8
Thomas Lamprecht [Sun, 20 Nov 2022 15:26:29 +0000 (16:26 +0100)]
bump version to 7.2-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agonetwork: support adding fdb directly in tap_plug
Thomas Lamprecht [Sun, 20 Nov 2022 15:07:36 +0000 (16:07 +0100)]
network: support adding fdb directly in tap_plug

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agonetwork: fix whitespace error
Thomas Lamprecht [Sun, 20 Nov 2022 15:07:48 +0000 (16:07 +0100)]
network: fix whitespace error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoPBSClient: file_restore_list: add extraParams and use timeout
Dominik Csapak [Thu, 10 Nov 2022 10:36:30 +0000 (11:36 +0100)]
PBSClient: file_restore_list: add extraParams and use timeout

under some conditions, like when calling it in the api where we have
a 30s pveproxy limit, we want to make use of the '--timeout' parameter
of the file-restore binary, but we may want to call it in the future
where we don't want add timeout.

To achieve that, add an extendable 'extra_params' hash parameter to
'file_restore_list' and use the timeout from there.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
17 months agocache: allow importing nodename method
Thomas Lamprecht [Tue, 15 Nov 2022 06:25:32 +0000 (07:25 +0100)]
cache: allow importing nodename method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobump version to 7.2-7
Thomas Lamprecht [Sun, 13 Nov 2022 14:54:59 +0000 (15:54 +0100)]
bump version to 7.2-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agod/control: record breaks for older qemu-server/pve-container
Thomas Lamprecht [Sun, 13 Nov 2022 14:48:22 +0000 (15:48 +0100)]
d/control: record breaks for older qemu-server/pve-container

as we now auto-detect if the 'bridge-disable-mac-learning' is set in
the Network::tap_plug method and disable learning if so, we need to
ensure that the qemu-server and pve-container can cope with that by
manually registering the guests MAC into the FDB.

So this certainly isn't a hard break, but as network is dead for the
guest on update, if that option is set and the new qemu-server and/or
pve-container packages ain't yet updated, it seems still worthy of a
break.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agonetwork: tap plug: auto-disable learning if bridge-disable-mac-learning is set
Thomas Lamprecht [Sun, 13 Nov 2022 12:56:45 +0000 (13:56 +0100)]
network: tap plug: auto-disable learning if bridge-disable-mac-learning is set

avoids that we need to repeat the same code hunk two times each for
CT and VM call sites.

If required it can be simply overridden by setting it explicitly on
call.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoprocfs tools: modernize write_proc_entry
Thomas Lamprecht [Sun, 13 Nov 2022 12:54:57 +0000 (13:54 +0100)]
procfs tools: modernize write_proc_entry

that unless stuff is just hard to read and against our code style.

note that there's also basically the same helper in SysFSTools, and
neither is really dependent on sysfs or procfs semantics, so both
probably should go away..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotests: section config: comment need for warn on debugging
Thomas Lamprecht [Sun, 13 Nov 2022 10:54:32 +0000 (11:54 +0100)]
tests: section config: comment need for warn on debugging

as often only warn really makes it out of perl/our pit of std out/err
handling (e.g., I had a case where neither print STDERR nor syslog
worked, but warn did)

also, the tests are rather brittle w.r.t their expect_fail variant,
as the actual expected error should be enforced.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agojob registry: avoid injecting the section id unconditionally in configs
Thomas Lamprecht [Sun, 13 Nov 2022 10:50:40 +0000 (11:50 +0100)]
job registry: avoid injecting the section id unconditionally in configs

this can result in a broken config due to it getting written out on
write_config serialization, and if a plugin did not declare `id` as
an option it understood (none do currently), it would then fail the
next parse, far from ideal...

As the section ID is available already anyway we should probably just
drop this, but for now avoid rushed changes and just make it
conforming to section config semantics and check if the option is
actually understood by the respective section type we're working on.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agojob registry: drop unused get_job skeleton
Thomas Lamprecht [Sun, 13 Nov 2022 10:49:52 +0000 (11:49 +0100)]
job registry: drop unused get_job skeleton

didn't do anything anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobump version to 7.2-6
Thomas Lamprecht [Sat, 12 Nov 2022 15:05:02 +0000 (16:05 +0100)]
bump version to 7.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoinotify: whitespace fix
Thomas Lamprecht [Sat, 12 Nov 2022 15:02:24 +0000 (16:02 +0100)]
inotify: whitespace fix

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agomove Job base config & registry over from manager as PVE::Job::Registry
Thomas Lamprecht [Sat, 12 Nov 2022 15:00:58 +0000 (16:00 +0100)]
move Job base config & registry over from manager as PVE::Job::Registry

It was PVE::Jobs::Plugin in pve-manager so we don't have any clash
potential, so no Breaks record required in d/control.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobuildsys: avoid phony 'install' target by setting actual pre-requisites
Thomas Lamprecht [Sat, 12 Nov 2022 14:41:29 +0000 (15:41 +0100)]
buildsys: avoid phony 'install' target by setting actual pre-requisites

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobuildsys: actually drop Subscription.pm from sources to install list
Thomas Lamprecht [Sat, 12 Nov 2022 14:40:49 +0000 (15:40 +0100)]
buildsys: actually drop Subscription.pm from sources to install list

Fixes: e94cd57 ("remove PVE::Subscription and friends")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobuildsys: sort list of module sources alphabetically
Thomas Lamprecht [Fri, 11 Nov 2022 09:50:03 +0000 (10:50 +0100)]
buildsys: sort list of module sources alphabetically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoadd section config tests
Wolfgang Bumiller [Wed, 9 Nov 2022 14:35:01 +0000 (15:35 +0100)]
add section config tests

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
17 months agosupport unknown types in section config
Wolfgang Bumiller [Wed, 9 Nov 2022 14:35:22 +0000 (15:35 +0100)]
support unknown types in section config

This adds an opt-in flag to `parse_config` and
`write_config` to allow for unknown section types.

This will simply be left unverified.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
17 months agosysfs tools: add comment w.r.t. mdev uuid to pci_cleanup_mdev_device
Thomas Lamprecht [Fri, 11 Nov 2022 09:45:55 +0000 (10:45 +0100)]
sysfs tools: add comment w.r.t. mdev uuid to pci_cleanup_mdev_device

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobump version to 7.2-5
Thomas Lamprecht [Mon, 7 Nov 2022 15:05:32 +0000 (16:05 +0100)]
bump version to 7.2-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agod/control: record breaks for qemu-server (<< 7.0-192-6)
Thomas Lamprecht [Mon, 7 Nov 2022 15:27:13 +0000 (16:27 +0100)]
d/control: record breaks for qemu-server (<< 7.0-192-6)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agocgroup: add note w.r.t. adding new params to change_cpu_shares
Thomas Lamprecht [Mon, 7 Nov 2022 15:04:07 +0000 (16:04 +0100)]
cgroup: add note w.r.t. adding new params to change_cpu_shares

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agochange cpu shares: drop unused $cgroupv1_default parameter
Fiona Ebner [Fri, 7 Oct 2022 12:41:51 +0000 (14:41 +0200)]
change cpu shares: drop unused $cgroupv1_default parameter

The only expression it appears in short-circuits, because the line
before ensures that $shares is guaranteed to be set.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
17 months agoschema: take over 'pve-targetstorage' option
Fabian Grünbichler [Wed, 28 Sep 2022 12:50:48 +0000 (14:50 +0200)]
schema: take over 'pve-targetstorage' option

from qemu-server, for re-use in pve-container.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
17 months agobump version to 7.2-4
Wolfgang Bumiller [Fri, 4 Nov 2022 13:11:16 +0000 (14:11 +0100)]
bump version to 7.2-4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
17 months agopbs client: backup fs tree: drop namespace parameter
Fabian Ebner [Wed, 20 Jul 2022 10:59:45 +0000 (12:59 +0200)]
pbs client: backup fs tree: drop namespace parameter

Instead, use the one from the initial configuration. The only current
caller is in PMG and the namespace parameter set there agrees with
the one from the initial configuration, so this is not actually a
breaking change.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
17 months agopbs client: deprecate namespaced parameters
Fabian Ebner [Wed, 20 Jul 2022 10:59:44 +0000 (12:59 +0200)]
pbs client: deprecate namespaced parameters

All existing callers for functions with namespaced parameters just
re-use the one that's passed in via the initial configuration already,
so there is no need for namespaced parameters currently.

If the need for one PBS client to handle multiple namespaces arises, a
set_namespace() function could be added, or the relevant functions
could take an additional parameter, either for just the namespace or
like $cmd_opts in restore_pxar().

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
17 months agopbs client: default to configured namespace for non-namespaced parameters
Fabian Ebner [Wed, 20 Jul 2022 10:59:43 +0000 (12:59 +0200)]
pbs client: default to configured namespace for non-namespaced parameters

For get_snapshots(), also set the default when no namespaced parameter
is present at all.

This would break any callers that have a namespace in the initial
config and explicitly don't set it for a later call, but the only
such caller is restore_pxar() in PMG, which /should/ be using the
namespace!

In other words, this implicitly fixes the restore_pxar() call in PMG
and avoids the need to extract the namespace from the configuration
(which already is present in the client) on the call site for all
functions that currently take a namespaced parameter.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
17 months agopbs client: forget snapshot: suppress output
Fabian Ebner [Wed, 20 Jul 2022 10:59:42 +0000 (12:59 +0200)]
pbs client: forget snapshot: suppress output

Otherwise, there will be
Result: {
      "data": null
}
when calling via a CLI tool for example. This also makes it consistent
with PVE in preparation to switch to using PBSClient there.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
17 months agopbs client: delete password: return success for non-existent file
Fabian Ebner [Wed, 20 Jul 2022 10:59:41 +0000 (12:59 +0200)]
pbs client: delete password: return success for non-existent file

It's currently possible to add a remote in PMG without password (via
API), but deletion of such a remote would fail here.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
18 months agocgroup: move get_cpuunits helper from qemu-server as clamp_cpu_shares
Thomas Lamprecht [Wed, 19 Oct 2022 10:29:35 +0000 (12:29 +0200)]
cgroup: move get_cpuunits helper from qemu-server as clamp_cpu_shares

Based on a patch from Fiona[0] that proposed to move it to
guest-common, rather go for common where the CGroup module resides to
avoid having to touch multiple sites if this changes another time
(hopefully not)

[0]: https://lists.proxmox.com/pipermail/pve-devel/2022-October/054225.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agobump version to 7.2-3
Thomas Lamprecht [Wed, 21 Sep 2022 14:18:27 +0000 (16:18 +0200)]
bump version to 7.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agocgroup: get mode by checking /sys/fs/cgroup mount point
Wolfgang Bumiller [Wed, 21 Sep 2022 07:53:13 +0000 (09:53 +0200)]
cgroup: get mode by checking /sys/fs/cgroup mount point

Since even in pure unified layouts there may be a `name=systemd` v1
cgroup mounted additionally (manually or potentially via
systemd-nspawn apparently), we should check what's actually mounted
at `/sys/fs/cgroup` rather than whether v1 cgroups exist.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
18 months agocgroup: make get_v1_controllers private
Wolfgang Bumiller [Wed, 21 Sep 2022 07:53:12 +0000 (09:53 +0200)]
cgroup: make get_v1_controllers private

we have no external users left

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
18 months agoremove PVE::Subscription and friends
Fabian Grünbichler [Tue, 13 Sep 2022 12:46:03 +0000 (14:46 +0200)]
remove PVE::Subscription and friends

this has been taken over by Proxmox::RS::Subscription, which is now used
by pve-manager and pmg-api.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agoJSONSchema: refactor tag regex
Dominik Csapak [Tue, 21 Jun 2022 09:19:49 +0000 (11:19 +0200)]
JSONSchema: refactor tag regex

we'll use that elsewhere too

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
19 months agonetowrk: general perlcritic/style fixes
Thomas Lamprecht [Wed, 31 Aug 2022 07:35:02 +0000 (09:35 +0200)]
netowrk: general perlcritic/style fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agonetwork: followup style fixes
Thomas Lamprecht [Wed, 31 Aug 2022 07:33:50 +0000 (09:33 +0200)]
network: followup style fixes

biggest one is to avoid using a conditional capture group

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agonetwork: tap_plug: fix mtu
Alexandre Derumier [Thu, 25 Aug 2022 09:27:53 +0000 (11:27 +0200)]
network: tap_plug: fix mtu

- ovsint port mtu need to be set with ""ovs-vsctl set mtu-request"
- update mtu on already existing interfaces (fwbr,fwln,tap,veth)
  if existing tap|veth interface is replugged on a different mtu bridge

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
20 months agoSysFSTools: get name from mediated device types
Dominik Csapak [Fri, 12 Aug 2022 09:29:48 +0000 (11:29 +0200)]
SysFSTools: get name from mediated device types

Some vendors also provide a 'name' file here for the type, which, in case of
NVIDIA, is the official name for the vGPU type in their documentation,
so extract and return it too (if it exists).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
22 months agoproc fs tools: handle proc/stat without guest values
Fabian Ebner [Fri, 22 Apr 2022 07:17:48 +0000 (09:17 +0200)]
proc fs tools: handle proc/stat without guest values

PMG is often run as a container, and in certain environments (like
Virtuozzo 7), the last two values (guest and guest_nice) might not be
present. This led to a division by zero, because the total value was
never updated.

Reported in the community forum:
https://forum.proxmox.com/threads/106896/

Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
23 months agobump version to 7.2-2
Thomas Lamprecht [Fri, 20 May 2022 12:01:24 +0000 (14:01 +0200)]
bump version to 7.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agotools: use int() on all integer syscall parameters
Wolfgang Bumiller [Tue, 17 May 2022 12:40:03 +0000 (14:40 +0200)]
tools: use int() on all integer syscall parameters

this should fix an issue where users with custom id mappings
get bad ownership on intermediate directories caused by the
rootuid/gid being the string "100000" in perl instead of the
number 100000...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agotools: add fixme comment for waiting on uninterruptible processes
Thomas Lamprecht [Fri, 20 May 2022 07:47:27 +0000 (09:47 +0200)]
tools: add fixme comment for waiting on uninterruptible processes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agorest env: cleanup active_worker code style
Thomas Lamprecht [Fri, 20 May 2022 07:46:45 +0000 (09:46 +0200)]
rest env: cleanup active_worker code style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agobump version to 7.2-1
Thomas Lamprecht [Thu, 12 May 2022 12:43:11 +0000 (14:43 +0200)]
bump version to 7.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agopbs-client: namespace support
Wolfgang Bumiller [Thu, 12 May 2022 09:54:20 +0000 (11:54 +0200)]
pbs-client: namespace support

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agobump version to 7.1-6
Thomas Lamprecht [Thu, 28 Apr 2022 14:40:49 +0000 (16:40 +0200)]
bump version to 7.1-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoREST handler: get property description: escape curly braces for asciidoc
Fabian Ebner [Thu, 7 Apr 2022 10:05:38 +0000 (12:05 +0200)]
REST handler: get property description: escape curly braces for asciidoc

Text enclosed in unescaped curly braces will be interpreted as an
attribute reference breaking and e.g. lead to the description not
showing up at all a generated man page further down the line.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
23 months agosysfs: rename fixup_missing_domain to normalize_pci_id and make normal sub
Thomas Lamprecht [Mon, 25 Apr 2022 16:15:09 +0000 (18:15 +0200)]
sysfs: rename fixup_missing_domain to normalize_pci_id and make normal sub

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoSysFSTools: factor out the domain fixup and domain regex
Dominik Csapak [Thu, 17 Mar 2022 08:12:26 +0000 (09:12 +0100)]
SysFSTools: factor out the domain fixup and domain regex

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoformatter: render duration: support autolimiting accurarcy
Thomas Lamprecht [Fri, 1 Apr 2022 14:07:17 +0000 (16:07 +0200)]
formatter: render duration: support autolimiting accurarcy

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agojson schema: allow to export print_property_string
Thomas Lamprecht [Thu, 24 Mar 2022 11:56:39 +0000 (12:56 +0100)]
json schema: allow to export print_property_string

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.1-5
Thomas Lamprecht [Fri, 18 Mar 2022 09:13:52 +0000 (10:13 +0100)]
bump version to 7.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agonetwork: fix default of new bridge learning flag
Thomas Lamprecht [Fri, 18 Mar 2022 09:13:16 +0000 (10:13 +0100)]
network: fix default of new bridge learning flag

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.1-4
Thomas Lamprecht [Thu, 17 Mar 2022 13:11:11 +0000 (14:11 +0100)]
bump version to 7.1-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoswitch to using Proxmox::RS::CalendarEvent
Wolfgang Bumiller [Tue, 1 Mar 2022 14:55:49 +0000 (15:55 +0100)]
switch to using Proxmox::RS::CalendarEvent

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoschema: parse_config: optionally collect comments
Wolfgang Bumiller [Thu, 17 Mar 2022 10:26:03 +0000 (11:26 +0100)]
schema: parse_config: optionally collect comments

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoSysFSTools: allow longer pci domains
Dominik Csapak [Mon, 28 Feb 2022 13:48:19 +0000 (14:48 +0100)]
SysFSTools: allow longer pci domains

by default, there is only one pci domain ('0000'), but there are systems
where there are more, and they don't need to be exactly 4 characters
long (see [0]), so extend that regex to allow domains 4 characters or
longer

0: https://forum.proxmox.com/threads/problem-with-gpu-passthrough-in-a-virtual-machine.105720/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agonetwork: avoid module on imported run_command
Thomas Lamprecht [Wed, 16 Mar 2022 16:30:36 +0000 (17:30 +0100)]
network: avoid module on imported run_command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agonetwork: tap plug: switch to opts hash to avoid expanding long params
Thomas Lamprecht [Wed, 16 Mar 2022 16:30:16 +0000 (17:30 +0100)]
network: tap plug: switch to opts hash to avoid expanding long params

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoInotify: add bridge-disable-mac-learning option to bridges.
Alexandre Derumier [Fri, 24 Sep 2021 08:48:55 +0000 (10:48 +0200)]
Inotify: add bridge-disable-mac-learning option to bridges.

This is an internal option, only used by proxmox, and not ifupdown1/2

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 years agonetwork: add support for disabling bridge learning on tap|veth|fwln ports
Alexandre Derumier [Fri, 24 Sep 2021 08:48:54 +0000 (10:48 +0200)]
network: add support for disabling bridge learning on tap|veth|fwln ports

Currently, if bridge receive an unknown dest mac (network bug/attack/..),
we are flooding packets to all bridge ports.

This can waste cpu time, even more with firewall enabled.
Also, if firewall is used with reject action, the src mac of RST
packet is the original unknown dest mac.
(This can block the server at Hetzner for example)

So, we can disable learning && unicast_flood on tap|veth|fwln port interface.
Then mac address need to be add statically in bridge fdb.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 years agoRESTenv: fork worker: fallback to 'root@pam' for task log user-id
Oguz Bektas [Tue, 15 Mar 2022 11:52:39 +0000 (12:52 +0100)]
RESTenv: fork worker: fallback to 'root@pam' for task log user-id

The fallback had a "typo" in the realm and used 'root@pve' (pve vs.
pam) since initial import from SVN, but off-list talks with Dietmar
suggest that 'root@pam' was always the intended fallback value.

Call sites without a defined user parameter (found only push_file and
pull_file from pve-container) were logging the task-owner user as
'root@pve' which isn't a default one, so it wouldn't exist in most
setups.

For clarity, add a comment that this is only used for the task logs.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
[ T: Reword/add to commit message slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoREST environment: add static log_warn function
Fabian Ebner [Fri, 29 Oct 2021 11:16:22 +0000 (13:16 +0200)]
REST environment: add static log_warn function

which avoids the need for the caller to check whether the environment
was initialized or not.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoREST environment: allow export of log_warn
Fabian Ebner [Fri, 29 Oct 2021 11:16:23 +0000 (13:16 +0200)]
REST environment: allow export of log_warn

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoreadme: update instructions for bullseye
Thomas Lamprecht [Thu, 17 Feb 2022 10:43:41 +0000 (11:43 +0100)]
readme: update instructions for bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.1-3
Thomas Lamprecht [Wed, 9 Feb 2022 17:36:49 +0000 (18:36 +0100)]
bump version to 7.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoadd 'map_id' helper for ID maps
Fabian Grünbichler [Wed, 9 Feb 2022 13:07:30 +0000 (14:07 +0100)]
add 'map_id' helper for ID maps

currently these are used by qemu-server for mapping source and target
storages, but this mechanism will be extended to network bridge maps and
re-used in pve-container as well, so let's put it next to the schema
definitions/helpers.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agobump version to 7.1-2
Thomas Lamprecht [Thu, 13 Jan 2022 16:13:15 +0000 (17:13 +0100)]
bump version to 7.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: hack: drop libpve-rs-perl dependency for now
Thomas Lamprecht [Thu, 13 Jan 2022 16:07:38 +0000 (17:07 +0100)]
d/control: hack: drop libpve-rs-perl dependency for now

not available on PMG and other places we use this lib (infra stuff)..

the perlmod stuff needs to be either more conditionally included, the
perlmod move to a more generic library (proxmox-rs?) or duplicated to
at least pmg-rs (albeit that wouldn't solve the infra pain points)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.1-1
Thomas Lamprecht [Thu, 13 Jan 2022 15:31:31 +0000 (16:31 +0100)]
bump version to 7.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoread_proc_stat: use total of fields to compute percentage
Alexandre Derumier [Mon, 10 Jan 2022 04:53:00 +0000 (05:53 +0100)]
read_proc_stat: use total of fields to compute percentage

2 years agoread_proc_stat: add irq/softirq/steal to total used cpu
Alexandre Derumier [Mon, 10 Jan 2022 04:52:59 +0000 (05:52 +0100)]
read_proc_stat: add irq/softirq/steal to total used cpu

2 years agoread_proc_stat: substract guest && guest_nice from user && nice time
Alexandre Derumier [Mon, 10 Jan 2022 04:52:58 +0000 (05:52 +0100)]
read_proc_stat: substract guest && guest_nice from user && nice time

user && nice time already include guest value
https://github.com/torvalds/linux/blob/4ec9f7a18/kernel/sched/cputime.c#L151-L158

Other monitoring tools are already substracting theses guest values

https://github.com/htop-dev/htop/blob/main/linux/LinuxProcessList.c
https://github.com/influxdata/telegraf/blob/c66ccee46f47717c399ccc0348d17c95d11f477d/plugins/inputs/cpu/cpu.go

2 years agoread_proc_stat : initialize newer fields to 0
Alexandre Derumier [Mon, 10 Jan 2022 04:52:57 +0000 (05:52 +0100)]
read_proc_stat : initialize newer fields to 0

new fields has been added recently, but values are not initialized
https://git.proxmox.com/?p=pve-common.git;a=commit;h=5a82eb712e4c879a271686f07c589fadc0b09185

as total of all fields is compute later, this can give undef values

2 years agod/control: depend on libpve-rs-perl (>= 0.5.0) for calendar event perlmod
Thomas Lamprecht [Thu, 13 Jan 2022 13:53:12 +0000 (14:53 +0100)]
d/control: depend on libpve-rs-perl (>= 0.5.0) for calendar event perlmod

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoCalendarEvent: use rust implementation
Dominik Csapak [Wed, 1 Dec 2021 08:55:14 +0000 (09:55 +0100)]
CalendarEvent: use rust implementation

by replacing the parsing code and 'compute_next_event' by their
PVE::RS::CalendarEvent equivalent

adapt the tests, since we do not have access to the internal structure
(and even if we had, it would be different) and the error messages
are different

the 'compute_next_event' and parsing tests still pass though

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agosmall code/comment cleanups
Thomas Lamprecht [Thu, 13 Jan 2022 13:50:14 +0000 (14:50 +0100)]
small code/comment cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.0-14
Thomas Lamprecht [Thu, 11 Nov 2021 11:33:52 +0000 (12:33 +0100)]
bump version to 7.0-14

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: record breaks for qemu-server << 7.0-19
Thomas Lamprecht [Thu, 11 Nov 2021 10:29:23 +0000 (11:29 +0100)]
d/control: record breaks for qemu-server << 7.0-19

due to the 'storagepair' -> 'storage-pair' format rename

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoschema: add proxmox-remote format/option
Fabian Grünbichler [Fri, 5 Nov 2021 13:03:47 +0000 (14:03 +0100)]
schema: add proxmox-remote format/option

for usage in remote migration/replication.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoschema: add pve-bridge-id option/format/pair
Fabian Grünbichler [Fri, 5 Nov 2021 13:03:46 +0000 (14:03 +0100)]
schema: add pve-bridge-id option/format/pair

for re-use in qemu-server/pve-container, which already have this option
duplicated. the '-pair' is needed for remote migration, but can also be
a nice addition to regular intra-cluster migration to lift the
restriction of having identically named bridges.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoschema: rename storagepair to storage-pair
Fabian Grünbichler [Fri, 5 Nov 2021 13:03:45 +0000 (14:03 +0100)]
schema: rename storagepair to storage-pair

more consistent with the other options/formats like pve-storage-id

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>