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

928 Commits

Author SHA1 Message Date
Dominik Csapak
a923104f23 SysFSTools: implement IOMMU check
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 13:43:14 +01:00
Dominik Csapak
4ca3851c6c SysFSTools: implement filter by id in lspci
use the new filter parameter as a filter for devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 13:42:29 +01:00
Dominik Csapak
bf94e590f2 SysFSTools: factor out PCI regex
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 13:41:23 +01:00
Dominik Csapak
f0765c7174 introduce SysFSTools
initially, copy pci related subs from PVE::QemuServer we want to have
it in common, so we can maybe reuse them later, also the code is not
really qemu-server related

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 13:40:06 +01:00
Thomas Lamprecht
8010ddfdc0 readme.dev: s/needed/required/ packages
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 12:05:31 +01:00
Oguz Bektas
1149dc7be4 minor updates to README.dev
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2018-11-19 12:03:14 +01:00
Thomas Lamprecht
14410e5f20 tools: template_replace: esacpe braces
To avoid warnings (and in the future, errors) like:

> Unescaped left brace in regex is deprecated here (and will be fatal
> in Perl 5.32), passed through in regex; marked by <-- HERE in
> m/([^{]+)?({ <-- HERE ([^}]+)})?/ at /usr/share/perl5/PVE/Tools.pm
> line 673.

with future perl versions, like Debian Buster for example has.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 10:05:54 +01:00
Tim Marx
0681aa7157 fix #1548: replace perl use vars with our
replace deprecated 'use vars qw($frob @mung %seen);' with the now in favor
'our $foo;' declaration
see NOTE at: http://perldoc.perl.org/vars.html

Signed-off-by: Tim Marx <t.marx@proxmox.com>
2018-11-15 09:53:06 +01:00
Thomas Lamprecht
f4f3bd98ae bump version to 5.0-41
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-10-31 15:03:56 +01:00
Wolfgang Bumiller
f236e57602 tests: update to utc flag and add daylight savings test
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-31 14:56:45 +01:00
Wolfgang Bumiller
0b7ba0445c CalendarEvent: add 'utc' flag to calendar specs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-31 14:56:45 +01:00
Wolfgang Bumiller
1457ffefbe fix #1963: don't do day-time related math on time stamps
Since our schedules are usually written in local time, we
cannot actually perform calculations using time stamps as
for instance adding 3600 (1 hour) may yield the exact same
local time as before when translated to the current timezone
during a DST change, or might skip an hour. Thus, 2:30am + 1
hour can be all of 2:30am, 3:30am or 4:30am.

Instead, perform the translation to a "day time" array once,
then search for the scheduled time, and only at the end
translate to a time stamp again. This means adding helpers
to wrap around minutes, hours, days (of month)...

Previously, the following code looped endlessly in
compute_next_event under CEST:
    my $dst_time = timelocal(0, 0, 0, 28, 9, 2018);
    my $t = PVE::CalendarEvent::parse_calendar_event('mon..fri');
    my $next = PVE::CalendarEvent::compute_next_event($t, $dst_time);
Afterwards $next will be '2018-10-29 00:00 CET' as expected.

Of course, a day in which 3am appears twice with a scheduled
event for 3am will cause the event to be scheduled twice
now. Ideally we add the ability to make calendar specs use
UTC (and actually use the $utc parameter we have in
compute_next_event()). systemd.time(7) seems to allow simply
suffixing the spec with the string " UTC" for that purpose,
so we should follow this.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-10-31 14:56:18 +01:00
Fabian Grünbichler
8881a28277 d/control: wrap-and-sort
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
ceeb5d7bd8 build: base BUILDDIR on VERSION
this is the standard naming used in Debian/dpkg

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
c5e2d73f75 d/control: bump standards version
to current one.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
a892351539 d/source/format: set format
removes a warning during build

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
12228cabf4 d/control: bump compat to 10
and debhelper dependency accordingly

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
c11de0173f build: inline $GITVERSION
since the top-level Makefile is called during build now, where we might
no be in a git working tree.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
fc0fe26612 d/control: add missing build-dependencies
found by building in a clean minimal chroot

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Fabian Grünbichler
b1766d78d3 build: split deb target into deb and src
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-29 14:10:50 +01:00
Wolfgang Bumiller
0c0bcf7cdc INotify: simplify lookup_type_prio
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-04 13:34:22 +02:00
Alexandre Derumier
51eec39065 improve lookup_type_prio
- use d->{type} instead regex on ifname
- add stacked vlan support
2018-10-04 13:06:54 +02:00
Alexandre Derumier
8f5d56bfc9 Inotify: add support for 802.1ad stacked vlans 2018-10-04 13:06:54 +02:00
David Limbeck
ee83493613 fix #1938: increase filesize limit for /proc/mounts
Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2018-10-03 17:06:44 +02:00
Wolfgang Bumiller
b67bd9140f version bump fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-25 11:33:46 +02:00
Wolfgang Bumiller
51d4123423 bump version to 5.0-40
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-25 10:39:29 +02:00
Wolfgang Bumiller
31b5a3a7fc JSONSchema: typo fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-25 10:38:04 +02:00
Thomas Lamprecht
c10939c2fa bump version to 5.0-39
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-20 09:39:13 +02:00
Thomas Lamprecht
fb3a1b2985 fix some erro mesage and comment typos
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-20 09:31:19 +02:00
Dietmar Maurer
732b693f14 new helper get_host_arch 2018-09-20 06:21:55 +02:00
Dominik Csapak
fbd10e04e7 fix #1914: CLIFormatter: check also for existence of 'type'
we sometimes define

result => {}

on an api call, so check that result->{type} is defined
and guess the type if not

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-17 10:58:35 +02:00
Dominik Csapak
9194ee0657 INotify.pm: add methods for reading/writing /etc/hosts
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-14 11:37:32 +02:00
Dominik Csapak
69758574a1 INotify.pm: use run_command instead of open for calling diff
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-14 07:09:03 +02:00
Dominik Csapak
1b505ae239 decode comments in /etc/network/interfaces as utf8
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-14 07:08:35 +02:00
Dietmar Maurer
d01452bdce api_dump_full: use api_clone_schema() for 'returns' schema
This  convert indexed parameters like -net\d+ to -net[n], so resulting dump
is smaller.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-09-13 13:00:05 +02:00
Wolfgang Bumiller
8b49281929 INotify: add tests for non-defined vlan bridge ports
This tests the case covered by the previous commit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-11 14:13:39 +02:00
Alexandre Derumier
514c2138d1 Inotify: check bridgeport: fix vlan interface not defined
We can add to a bridge a non defined vlan interface.
We only need to check that physical interface exist

example:
    auto eno1
    iface eno1 inet manual

    auto vmbr0
    iface vmbr0 inet manual
        bridge_ports eno1.1

[w.bumiller@proxmox.com: style & commit message fixup]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-11 14:13:33 +02:00
Alexandre Derumier
000e32bc4a Inotify: fix mtu check
- special check for bond, set parent mtu from slaves mtu if no defined.

- error if parent mtu is lower than child mtu (not bigger)

- return if child mtu is not defined

- fix vlan check (parent/child was inverted)
2018-09-11 10:53:58 +02:00
Thomas Lamprecht
fb6134feaa README.dev: enhance installing build-dependcy section
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-05 10:57:49 +02:00
Thomas Lamprecht
2c2b3b55bc README.dev: note that one can start from a PVE installation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-05 10:26:37 +02:00
Martin Beckert
bb9d386588 Rework of the installation documentation 2018-09-05 10:24:18 +02:00
Dominik Csapak
2e353dfb5f run_fork_with_timeout: handle SIGTERM
when stopping a worker while doing a run_fork_with_timeout,
we want to handle that there and send the child the SIGTERM
so that it can clean up

for this we have to use readline_nointr,
because the read from the pipe gets interrupted by the signal

this partially fixes #1874
as we now correctly clean up the new disk, except if it is
on lvm/lvmthin (possibly other storages as well), and use the old disk
in the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-22 15:32:56 +02:00
Dominik Csapak
e03a836591 add readline_nointr to Tools
this is a wrapper to have an uninterruptible readline
so that we can read e.g. from a pipe even if interrupted by
a signal

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-22 15:32:56 +02:00
Dietmar Maurer
3496d4bf4d render_bytes: avoid untaint by simply change the sprintf call
There is no need to untaint if we do it this way (no idea why).
2018-08-06 13:36:23 +02:00
Dietmar Maurer
a91ee28fe5 render_bytes: check format, untaint before calling sprintf
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-08-06 13:16:44 +02:00
Dietmar Maurer
c701c5659e print_usage_short: do not group subcommands
For examply, do not group 'qm guest' usage.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-08-01 08:54:35 +02:00
Dietmar Maurer
7b2ba123b4 generate_usage_str: do not group sub-commands
Usually, sub commands already form a logical group, so further grouping
just adds confusion (see 'qm' as example)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-31 10:57:15 +02:00
Dietmar Maurer
90851cec3c print_api_result: fix test for undefined $result_schema 2018-07-31 08:29:45 +02:00
Dietmar Maurer
b51b930d2b print_api_result: allow to pass undefined schema
This is useful if we do not have a fixed schema, for example to
print results from qemu agent commands.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-30 15:53:06 +02:00
Dietmar Maurer
6bc094934b print_api_result_plain: new helper
Usefull to print result without borders an headers.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-30 15:52:53 +02:00