5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-24 14:03:35 +03:00

1322 Commits

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

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
Thomas Lamprecht
85237c0b68 tempfile: add some comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-15 11:25:09 +02:00
Thomas Lamprecht
9cccad5e3e tempfile: improve base path selection
The path is not /that/ relevant privacy wise as we try to use
`O_TMPFILE` anyway and defaulting to /run generates trouble for calls
from non-root processes.

Try the user session run dir first, then /run if root or /tmp else.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-15 11:23:24 +02:00
Thomas Lamprecht
9915a41bb6 tools: sendmail: code cleanup, factor out some noise
Reduce by a few lines in general and move out checking the address to
avoid to much (repeated) inline noise..

no semantic change intended.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-15 11:22:41 +02:00
Thomas Lamprecht
7ac222d137 tools: fix some perlcritic lints
- Two-argument "open" used at line 462, column 3.  See page 207 of
  PBP. (Severity: 5)
- Subroutine "new" called using indirect syntax at line 487, column
  15. See page 349 of PBP.  (Severity: 5)
- Bareword file handle opened at line 1533, column 5. See pages 202,
  204 of PBP.  (Severity: 5)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-15 10:46:06 +02:00
Thomas Lamprecht
7d91b7b83e bump version to 7.0-10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-29 10:01:11 +02:00
Thomas Lamprecht
0dc7fd7b50 inotify: network: improve "allow-hotplug" & "auto" interaction
commit c86cfb8bbd9b505d06b580582297fa670561437b dropped allow-hotplug
from the primary interfaces file completely on write, but that breaks
setups that come from plain Debian.

Instead, as stop-gap measurement, transform "allow-hotplug" to auto
in the PVE controlled config.

That avoids conflict and improves installing PVE on top of plain
Debian, as the interface still comes up after the first reboot.

But it is not ideal auto is not the same as hotplug, so we need to
also track that difference in the future, but that needs some
adaptions in the API too (change autostart from boolean to
string+enum or so=

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-29 09:57:59 +02:00
Thomas Lamprecht
ed94660616 subscription: switch verification domain over to shop.proxmox.com
With the merger the shop got moved from shop.maurer-it to
shop.proxmox.com, while we transparently redirect we also want to
stop doing that in a few years, so use new domain.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-27 08:58:23 +02:00
Thomas Lamprecht
0dcace5a6e inotify: network: detect "allow-auto" as "auto" synonym
> Note that "allow-auto" and "auto" are synonyms.
-- man 5 interfaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-24 12:56:09 +02:00
Thomas Lamprecht
75a2a1c658 inotify: network: code+whitespace+indentation cleanup
no semantic change intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-24 12:56:09 +02:00
Thomas Lamprecht
89075c3505 test: import JSON for quicker debugging
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-24 12:56:09 +02:00
Thomas Lamprecht
97809c6906 net: get local ip: catch any error from get_reachable_networks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-20 16:52:35 +02:00
Thomas Lamprecht
b296c4dd81 tools: fix typo in comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-20 16:52:03 +02:00
Thomas Lamprecht
236e86cac5 bump version to 7.0-9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-18 14:51:51 +02:00
Thomas Lamprecht
ac487a888b net: add get_local_ip helper
Sometimes we need to have a fallback for gai (get_ip_from_hostname)
but cannot yet rely on configured networks (get_reachable_networks)
from kernel POV (those may not have been configured yet, e.g., on
boot), so the ones configured in /etc/network/interfaces would be
nice too then, as they're the ones that will get configured soon
anyway on boot.

Add a new helper that takes in all those sources and allows to return
a single (first found) or all of those addresses.

Still prioritize the address we get from getaddrinfo, as there the
admin has control through /etc/hosts, DNS and gai.conf and treat the
remaining ones as fallback.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-18 14:51:01 +02:00
Thomas Lamprecht
ebbbb05e00 bump version to 7.0-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-17 18:38:47 +02:00
Thomas Lamprecht
4e4059580a net: add get reachable networks: fix sorter closure
argh, perl sorters and nested greps are weird!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-17 18:38:47 +02:00
Thomas Lamprecht
d7cafe5124 net: add get_reachable_networks
will be used for the issue banner generators and for some "get
nodeip" calls as fallback for get_ip_from_hostname, which tends to
fail in our CT envs (e.g., PMG)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-17 16:25:52 +02:00
Thomas Lamprecht
29dde5f46b net: ip from host: code shrink
Return a suitable address directly instead of breaking out of the
loop to do that.

no semantic change intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-17 11:37:00 +02:00
Thomas Lamprecht
c45692e04a net: ip from host: avoid using an undefined variable in die
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-17 11:14:02 +02:00
Lorenz Stechauner
1981940474 fix #2368: network: extend infiniband recognition in regex
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>

fixed RE

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-08-12 11:51:09 +02:00
Fabian Grünbichler
22529da434 bump version to 7.0-6
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-08-06 13:53:03 +02:00
Dominik Csapak
5a82eb712e ProcFSTools: read_proc_stat: add more cpu stats from /proc/stat
those fields might be interesting to users. At the moment, this is
only used in the external metrics export.

These fields exist in the kernel since:
* irq - 2.6.0
* softirq - 2.6.0
* steal - 2.6.11
* guest - 2.6.24
* guest_nice - 2.6.33

so they must all exist

also add a 'total' field which simply sums up the (non-guest) fields

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-29 10:29:05 +02:00
Thomas Lamprecht
576dadb137 interfaces: do not warn about FD if it was not set explicitly
As that would be weird, the use explicitly did not configure it,
which is OK, and we'd then warn due to *our* fallback to `0`.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-16 12:54:17 +02:00
Thomas Lamprecht
43997e844e interfaces: code cleanup and use some more actual telling variable names
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-16 12:52:29 +02:00
Fabian Grünbichler
abf1f9cf19 interfaces: improve bridge_fd handling
and ignore values with a warning that are outside of the kernels
expected range.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-07-16 11:50:40 +02:00
Fabian Grünbichler
e960f7948f fix #2831: never set bridge_fd to 0 with STP on
it's an invalid combination that causes the network reload/setup to
fail. unfortunately, this is not caught by ifupdown2 itself, but only
rejected by the kernel with ERANGE over netlink.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-07-16 11:50:40 +02:00
Thomas Lamprecht
0966f99ccc bump version to 7.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-14 11:50:51 +02:00
Wolfgang Bumiller
61f1cb1a92 fix #3527: cgroup: drop file buffers from memory usage
matches the behavior of lxcfs

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-14 11:45:21 +02:00
Thomas Lamprecht
228ab4b408 bump version to 7.0-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 14:57:24 +02:00
Lorenz Stechauner
f2ac9dd3b4 fix #3153: INotify: adding comment of interface to inet6 section when this is the only section
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-06-28 14:53:34 +02:00
Thomas Lamprecht
ae54eabff9 tools: followup: fix comment length and rename to upid_normalize_status_type
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 14:51:54 +02:00
Dominik Csapak
4e5360384c PVE/Tools: add 'upid_get_status_type'
as a single point where we get the type of upid status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 14:47:53 +02:00
Dominik Csapak
f43ace29ca PVE/JSONSchema: add pve-task-status-type
to have a format that contains the possible worker task states

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 14:47:53 +02:00
Thomas Lamprecht
13c771819a inotify/network: indentation fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-24 15:36:04 +02:00