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
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
Dominik Csapak
6ac98ad562 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>
2022-03-16 19:07:59 +01:00
Thomas Lamprecht
b863860407 network: avoid module on imported run_command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-16 17:30:36 +01:00
Thomas Lamprecht
93cc2aa9b2 network: tap plug: switch to opts hash to avoid expanding long params
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-16 17:30:16 +01:00
Alexandre Derumier
25558f136b 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>
2022-03-16 17:20:12 +01:00
Alexandre Derumier
354ec8dee3 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>
2022-03-16 17:20:12 +01:00
Oguz Bektas
f44838ff41 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>
2022-03-16 07:58:35 +01:00
Fabian Ebner
06885ac8bb 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>
2022-03-04 11:39:07 +01:00
Fabian Ebner
cc78c1eba2 REST environment: allow export of log_warn
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-03-04 11:21:17 +01:00
Thomas Lamprecht
b096f49c1a readme: update instructions for bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-02-17 11:43:41 +01:00
Thomas Lamprecht
4e70970c89 bump version to 7.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-02-09 18:36:49 +01:00
Fabian Grünbichler
f627fab7dc 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>
2022-02-09 18:31:27 +01:00
Thomas Lamprecht
ac47f1e617 bump version to 7.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-13 17:13:41 +01:00
Thomas Lamprecht
10b92f6d5c 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>
2022-01-13 17:07:40 +01:00
Thomas Lamprecht
a00ce8efc3 bump version to 7.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-13 16:31:31 +01:00
Alexandre Derumier
faa1b46f08 read_proc_stat: use total of fields to compute percentage 2022-01-13 16:11:01 +01:00
Alexandre Derumier
24f19ef7a1 read_proc_stat: add irq/softirq/steal to total used cpu 2022-01-13 16:05:26 +01:00
Alexandre Derumier
c140206bf8 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
c66ccee46f/plugins/inputs/cpu/cpu.go
2022-01-13 16:03:49 +01:00
Alexandre Derumier
5224b31bbd 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
2022-01-13 16:03:15 +01:00
Thomas Lamprecht
964684b5e2 d/control: depend on libpve-rs-perl (>= 0.5.0) for calendar event perlmod
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-13 14:53:12 +01:00
Dominik Csapak
9572e1046b 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>
2022-01-13 14:50:47 +01:00
Thomas Lamprecht
a45a1df1ed small code/comment cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-13 14:50:14 +01:00
Thomas Lamprecht
3efa9ecd60 bump version to 7.0-14
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 12:33:52 +01:00
Thomas Lamprecht
0d30351227 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>
2021-11-11 11:29:25 +01:00
Fabian Grünbichler
b75893ddf4 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>
2021-11-11 10:39:58 +01:00
Fabian Grünbichler
6e55ce7d0f 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>
2021-11-11 10:39:58 +01:00