Commit Graph

1356 Commits

Author SHA1 Message Date
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
Fabian Grünbichler
da9f41f5ce 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>
2021-11-11 10:39:58 +01:00
Thomas Lamprecht
fa83d271df bump version to 7.0-13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-10 11:51:11 +01:00
Wolfgang Bumiller
c4c8a33d67 Ticket: uri-escape colons
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 13:13:46 +01:00
Thomas Lamprecht
d9339d016a getxattr: trim the returned buffer to the correct size
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-08 16:19:54 +01:00
Thomas Lamprecht
7b6b494fff bump version to 7.0-12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-07 21:36:12 +01:00
Dominik Csapak
194f706b5d cgroup v2: io stats: fix parsing disk writes
'wbytes' is for writes, but we accidentally added the value to 'diskread'
which left 'diskwrite' statistics always zero

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-27 12:03:03 +02:00
Thomas Lamprecht
507310df34 cli format: refactoring and code bloat reduction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-22 17:48:02 +02:00
Oguz Bektas
d37a718672 cgroup: cpu quota: fix resetting period length for v1
The CFS period µs value for cgroup v1 needs to be >= 1 µs and <= 1 s,
so resetting it to -1 (like we cab do for the quota) cannot work.

So, when the period is passed as undefined it should be set to 100ms,
i.e., the actual default value:

>  - cpu.cfs_quota_us: the total available run-time within a period (in microseconds)
>  - cpu.cfs_period_us: the length of a period (in microseconds)
>  - cpu.stat: exports throttling statistics [explained further below]
>
> The default values are:
>     cpu.cfs_period_us=100ms
>     cpu.cfs_quota=-1
-- https://www.kernel.org/doc/html/v5.14/scheduler/sched-bwc.html

This issue was there since initial addition in its original repo,
pve-container commit 26b645e2.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
 [ Thomas: add more information, adapt commit subject to reduce
   redundancy, link to new RsT based doc page with a fixed version ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-22 11:38:08 +02:00
Thomas Lamprecht
d94f7005ce safe_read_from: bump default size limit to 1 MiB to match pmxcfs
Done in a similar spirit as commit 8fb28ab914

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-21 11:40:27 +02:00
Thomas Lamprecht
8145f9affd bump version to 7.0-11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-19 09:35:45 +02:00
Thomas Lamprecht
c1e4c83ceb tools: getxattr: document how to get actual argument size
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-19 09:33:37 +02:00
Thomas Lamprecht
2e14735a84 tools: getxattr: drop debug statement
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-19 09:24:53 +02:00
Thomas Lamprecht
4c0c5c905d tools: add set/get xattr methods
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-19 08:18:00 +02:00
Thomas Lamprecht
bfa10639d9 syscalls: use new constants available in bullseyes perl
All previously unkown are now defined, so drop the literal numbers

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-18 10:24:18 +02:00
Thomas Lamprecht
57426c93c9 sysfs tools: indentation + text-width fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-18 10:08:42 +02:00