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

1396 Commits

Author SHA1 Message Date
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
Wolfgang Bumiller
2cae54b99d cgroup: make get_v1_controllers private
we have no external users left

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-09-21 09:59:22 +02:00
Fabian Grünbichler
e94cd574e1 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>
2022-09-20 13:34:46 +02:00
Dominik Csapak
056bbe2da4 JSONSchema: refactor tag regex
we'll use that elsewhere too

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-09-20 13:19:02 +02:00
Thomas Lamprecht
ceff9a846c netowrk: general perlcritic/style fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-31 10:13:11 +02:00
Thomas Lamprecht
89022ed598 network: followup style fixes
biggest one is to avoid using a conditional capture group

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-31 10:13:11 +02:00
Alexandre Derumier
c3db7708a4 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>
2022-08-31 10:13:11 +02:00
Dominik Csapak
0fbcf73656 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>
2022-08-12 13:40:47 +02:00
Fabian Ebner
2e8331ba22 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>
2022-06-14 10:25:24 +02:00
Thomas Lamprecht
08853d22cc bump version to 7.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-20 14:01:24 +02:00
Wolfgang Bumiller
6647801cb3 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>
2022-05-20 09:47:34 +02:00
Thomas Lamprecht
c663330d85 tools: add fixme comment for waiting on uninterruptible processes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-20 09:47:27 +02:00
Thomas Lamprecht
f74da40ebb rest env: cleanup active_worker code style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-20 09:46:45 +02:00
Thomas Lamprecht
efb57c6b08 bump version to 7.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-12 14:43:11 +02:00
Wolfgang Bumiller
4a09bdc3ef pbs-client: namespace support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-05-12 12:04:05 +02:00
Thomas Lamprecht
2efc79d6ce bump version to 7.1-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-28 16:40:49 +02:00
Fabian Ebner
6c19a10dd9 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>
2022-04-27 10:46:43 +02:00
Thomas Lamprecht
7b7e669e77 sysfs: rename fixup_missing_domain to normalize_pci_id and make normal sub
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-25 18:15:11 +02:00
Dominik Csapak
853fcdef31 SysFSTools: factor out the domain fixup and domain regex
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-04-25 18:13:03 +02:00
Thomas Lamprecht
969c4ffd9e formatter: render duration: support autolimiting accurarcy
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 16:07:17 +02:00
Thomas Lamprecht
d3ef19c104 json schema: allow to export print_property_string
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-24 12:56:39 +01:00
Thomas Lamprecht
47ec888510 bump version to 7.1-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-18 10:13:52 +01:00
Thomas Lamprecht
c1978f2edb network: fix default of new bridge learning flag
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-18 10:13:22 +01:00
Thomas Lamprecht
1d448cc718 bump version to 7.1-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-17 14:11:11 +01:00
Wolfgang Bumiller
4656d14a4b switch to using Proxmox::RS::CalendarEvent
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-17 14:01:31 +01:00
Wolfgang Bumiller
2f85ab8fde schema: parse_config: optionally collect comments
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-17 12:26:41 +01:00