5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-23 10:03:33 +03:00

1406 Commits

Author SHA1 Message Date
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
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