5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-09 05:17:35 +03:00
Commit Graph

1521 Commits

Author SHA1 Message Date
Thomas Lamprecht
e8a515e655 cert: move trailing newline into die helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-07 18:36:42 +01:00
Thomas Lamprecht
74bb32adde cert: make die helper a private sub and fix code style on use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-07 18:36:42 +01:00
Fabian Grünbichler
60a05ecd88 certificate: add check_ prefix to cert/key match helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-03-07 11:51:35 +01:00
Max Carrara
d602284ccb certificate: fix formatting and whitespace
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
2023-03-07 10:14:42 +01:00
Max Carrara
a3baf76738 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>
2023-03-07 10:14:42 +01:00
Dominik Csapak
d8a0dff1b5 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>
2023-02-24 17:01:40 +01:00
Wolfgang Bumiller
ea9813cecf bump version to 7.3-2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-01-27 10:30:46 +01:00
Christian Ebner
12a0ec1888 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>
2023-01-18 11:13:35 +01:00
Alexandre Derumier
2e3fd24d1a 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>
2023-01-16 10:42:06 +01:00
Fabian Grünbichler
7a48f55a8f fix typo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-10 12:25:54 +01:00
Fabian Grünbichler
1ac8e6c135 build: add missing build-dependencies
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-10 12:23:44 +01:00
Thomas Lamprecht
9d14c9ddcf bump version to 7.3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-24 17:13:04 +01:00
Thomas Lamprecht
7b1aa2e84a dump logfile: avoid boolean ternary if already boolean value
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-24 17:12:18 +01:00
Daniel Tschlatscher
f0c1b0c03c 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>
2022-11-24 17:12:02 +01:00
Alexandre Derumier
99fc81231e 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>
2022-11-21 11:23:04 +01:00
Thomas Lamprecht
ae7332752a bump version to 7.2-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-20 16:26:29 +01:00
Thomas Lamprecht
0a3c65c003 network: support adding fdb directly in tap_plug
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-20 16:07:58 +01:00
Thomas Lamprecht
bf5bc3637f network: fix whitespace error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-20 16:07:58 +01:00
Dominik Csapak
76e28e0325 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>
2022-11-15 13:22:30 +01:00
Thomas Lamprecht
eb6f49f4b2 cache: allow importing nodename method
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 07:25:36 +01:00
Thomas Lamprecht
3d4739a9d3 bump version to 7.2-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-13 15:54:59 +01:00
Thomas Lamprecht
9659e1c296 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>
2022-11-13 15:48:24 +01:00
Thomas Lamprecht
ac39d36f57 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>
2022-11-13 13:56:50 +01:00
Thomas Lamprecht
65ca174341 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>
2022-11-13 13:54:59 +01:00
Thomas Lamprecht
8b7b0cc5fe 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>
2022-11-13 11:54:34 +01:00
Thomas Lamprecht
ec9e46fae6 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>
2022-11-13 11:50:42 +01:00
Thomas Lamprecht
2bbf0eae8c job registry: drop unused get_job skeleton
didn't do anything anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-13 11:49:58 +01:00
Thomas Lamprecht
8aed9b1f56 bump version to 7.2-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:05:02 +01:00
Thomas Lamprecht
74d28de23f inotify: whitespace fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:02:24 +01:00
Thomas Lamprecht
0d830ac70f 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>
2022-11-12 16:01:04 +01:00
Thomas Lamprecht
4d6de3e4ae buildsys: avoid phony 'install' target by setting actual pre-requisites
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 15:42:29 +01:00
Thomas Lamprecht
e0a74f9950 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>
2022-11-12 15:41:50 +01:00
Thomas Lamprecht
b8ab137ce7 buildsys: sort list of module sources alphabetically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 15:41:50 +01:00
Wolfgang Bumiller
85bc5755c0 add section config tests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-12 15:41:50 +01:00
Wolfgang Bumiller
c9ede1c3b3 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>
2022-11-12 15:41:50 +01:00
Thomas Lamprecht
e9367c5b9f sysfs tools: add comment w.r.t. mdev uuid to pci_cleanup_mdev_device
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-11 10:45:55 +01:00
Thomas Lamprecht
6f11b3eeb9 bump version to 7.2-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-07 16:27:20 +01:00
Thomas Lamprecht
40cacad5fb d/control: record breaks for qemu-server (<< 7.0-192-6)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-07 16:27:20 +01:00
Thomas Lamprecht
178326596d cgroup: add note w.r.t. adding new params to change_cpu_shares
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-07 16:04:07 +01:00
Fiona Ebner
91fa9a5e8f 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>
2022-11-07 14:59:51 +01:00
Fabian Grünbichler
666b0d869c 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>
2022-11-04 14:21:10 +01:00
Wolfgang Bumiller
41596147d0 bump version to 7.2-4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-04 14:11:16 +01:00
Fabian Ebner
89ed119db3 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>
2022-11-04 14:01:47 +01:00
Fabian Ebner
a95beed20d 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>
2022-11-04 14:01:38 +01:00
Fabian Ebner
139dc881ed 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>
2022-11-04 14:01:34 +01:00
Fabian Ebner
e1fa96e197 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>
2022-11-04 14:01:25 +01:00
Fabian Ebner
01d2fb7844 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>
2022-11-04 14:01:22 +01:00
Thomas Lamprecht
07c10d58a6 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>
2022-10-19 12:30:21 +02:00
Thomas Lamprecht
8949840eab bump version to 7.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-21 16:18:27 +02:00
Wolfgang Bumiller
55b6de7011 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>
2022-09-21 09:59:31 +02:00