5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-10 09:17:37 +03:00
Commit Graph

1063 Commits

Author SHA1 Message Date
Thomas Lamprecht
b07bec34ec bump version to 5.0-49
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-21 12:56:58 +01:00
Thomas Lamprecht
98d5b8cb72 JSONSchema: register 'pve-snapshot-name' here to avoid cyclic dependencies
move it from qemu-server as it was also used in pve-container and
pve-manager (pvesr), while guest-commons AbstractConfig could be a
fit too, just move it here as all depending on this already use
JSONSchema and it just fits here...

Break respective qemu-server version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-21 12:51:16 +01:00
Thomas Lamprecht
42e927905d bump version to 5.0-48
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-14 09:52:22 +01:00
Thomas Lamprecht
4fdf30c439 followup: add verbose_description to new mac-addr standard option
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-14 09:49:54 +01:00
Stoiko Ivanov
a750d596c2 JSONSchema: Adapt MAC address format to unicast
MAC-addresses having the LSB of the first octet set, are considered
multicast-addresses (see [0,1]).

the 'mac-addr' format got changed to only permit unicast addresses, which should
work for its current use-case (WOL for nodes).
additionally a default option was registered via register_standard_option to be
used in both PVE::LXC::Config and PVE::QemuServer.

[0] https://lists.linuxcontainers.org/pipermail/lxc-users/2010-August/000783.html
[1] https://en.wikipedia.org/wiki/MAC_address

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-03-14 09:41:12 +01:00
Oguz Bektas
4cd6dc0a98 fix #2111: regex match for email addresses
now allows:
* addresses without tld (f.e. user@localhost per bug)
* remove limits for number of subdomains
* allow +, -, ~ in local part
* disallow double dots (.. .a. etc) and dots in the end (abc.@mail.com)

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-01 10:36:50 +01:00
Thomas Lamprecht
7b4f791bfd bump version to 5.0-47
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-20 12:24:19 +01:00
Christian Ebner
ad2cc59995 Fix 1891: Add zsh command completion generator
This adds the function needed to generate the zsh autocompletion scripts.
Using the bash completion code path, this generates the list of possible
completions and adds them to the zsh completion by compadd.
For the autocompletion scripts to be loaded automatically, the following two
lines have to be placed in the .zshrc:

autoload -U compinit
compinit

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-20 12:11:42 +01:00
Rhonda D'Vine
3b3ae60e09 partially fix #2023: Switch to https for yubico.com API
Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-19 14:23:50 +01:00
Wolfgang Bumiller
188097500d bump version to 5.0-46
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-11 10:55:27 +01:00
Fabian Grünbichler
3591822189 d/control: add missing dependencies
used by the ACME standalone challenge.

these were previously already depended on by pve-manager, where they were
recently removed - exposing the fact they are in fact required by
libpve-common-perl.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-02-11 10:54:44 +01:00
Thomas Lamprecht
efe3113a40 bump version to 5.0-45
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-04 11:46:08 +01:00
Wolfgang Bumiller
243c4e5892 tools: add dev_t_major/minor
Extract major/minor from `dev_t` values as found in stat()
calls, with support for the full 32 bit values.

The device value returned by stat() is 32 bits long and encoded as
high 12 bit of the minor value as in the 12 MSBs, 12 bit major value,
then the low 8 bit of the minor value in the low byte.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 11:36:35 +01:00
Thomas Lamprecht
cee0e23ac0 Tools: add fsync sycall
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-31 11:42:17 +01:00
Thomas Lamprecht
bbdb1ae921 bump version to 5.0-44
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-22 11:56:40 +01:00
Christian Ebner
14324ea874 JSONSchema: Add format for MAC address verification
Adds a format to verify MAC addresses to JSONSchema.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-22 11:11:43 +01:00
Oguz Bektas
3b44baed32 fix defaults for standard_output_options
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-01-09 17:20:10 +01:00
Oguz Bektas
cc74c62d6d add builddeps in readme for qemu
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-01-09 17:19:56 +01:00
Wolfgang Bumiller
e90fc1e64b Fixup testcases for the previous commit
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-03 09:05:46 +01:00
Tim Marx
b3e3b51ba0 INotify: fix wording in networkdoc
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-01-03 09:03:46 +01:00
Oguz Bektas
5d87f1cc0b update builddeps in readme
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2018-11-29 11:12:57 +01:00
Dominik Csapak
639c3030a7 SysFSTools: add return format comments
for lspci and get_mdev_types

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-26 13:04:56 +01:00
Thomas Lamprecht
d4eefbcd9a bump version to 5.0-43
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 11:20:00 +01:00
Thomas Lamprecht
937fb11e28 break qemu-server << 5.0-42
changed the lspci return format

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 11:18:30 +01:00
Dominik Csapak
a70972cd05 SysFSTools.pm: improve and extend lspci
this implements following improvements and optimizations for lspci

* removes the unecessary split between id and function
  since everywhere we need that information, we stitch them together
  anyway. to preserve ordering, simply order by id with string
  comparison 'cmp' (this is important for the shorthand syntax '00:01' in
  the config)
* returns now a list directly, instead of an hash with lists
* returns now always the vendor/device id and class[1]
* filter is now either a string (matches the id partially), or a
  sub, which filters the device out if it returns a falsy value
* adds a verbose flag to include more information about the device,
  such as device/vendor name, iommu-group, mdev support, etc.
  this will be used for the pci scan api call for the gui

1: https://pci-ids.ucw.cz/read/PD/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-22 11:11:20 +01:00
Dominik Csapak
44a4db5b60 SysFSTools.pm: add mediated devices subs
adds helpers for listing/creating/removing mediated devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-22 11:11:20 +01:00
Alexandre Derumier
d6a2cdcb76 Network : veth pair : fix mtu
The ip link set command which create the veth pair is not setting mtu on both peers

example:
vm 106 is on a bridge with mtu 9000

222: tap160i1: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast master fwbr160i1 state UNKNOWN group default qlen 1000
223: fwbr160i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
224: fwpr160p1@fwln160i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
225: fwln160i1@fwpr160p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

fwpr160p1@fwln160i1 is correctly created with mtu 9000
but
fwln160i1@fwpr160p1 is created with mtu 1500.
(and then vmbr106i1 is lowered to 1500 too).

This is doing network problem, as tap160i1 is mtu9000.

After this patch:

222: tap160i1: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast master fwbr160i1 state UNKNOWN group default qlen 1000
223: fwbr160i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
224: fwpr160p1@fwln160i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
225: fwln160i1@fwpr160p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
2018-11-22 10:27:41 +01:00
Dominik Csapak
0a3de87e0f Tools.pm: do not ignore "0" in split_list
giving split_list the string "0" would actually return
an empty list instead of a list with the element "0"

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-21 11:06:20 +01:00
Thomas Lamprecht
a609b2f787 fork_worker: readd the kill safety for _exit again
to be sure, plus we have this in other places too here, so be
consistent and double safe(tm)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-20 10:07:35 +01:00
Stoiko Ivanov
6a09f09630 fix #1956: return controlling terminal to parent
The changes introduced in e97f807c38 let the
child in fork_worker take the controlling terminal of the session, without
returning it after finishing.
This breaks using/reading from the terminal after both parent and child exit
- e.g. when the code is called from within a shellscript.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-11-20 09:50:38 +01:00
Stoiko Ivanov
edbb302ec8 fork_worker: refactor child exit
* factor out duplicated code.
* drop final kill(-9, $$), since the POSIX:_exit call does not return
  (see man 2 _exit).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-11-20 09:50:38 +01:00
Thomas Lamprecht
7571d25b3d bump version to 5.0-42
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 13:46:25 +01:00
Thomas Lamprecht
b5dacd1053 SysFSTools: lspci: fixup: improve naming and refactor a bit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 13:45:13 +01:00
Thomas Lamprecht
63075acb41 SysFSTools: iommu_support: improve comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 13:45:07 +01:00
Dominik Csapak
6eb61ecd4a SysFSTools: copy over scan_usb from PVE::Storage
it makes more sense to have this (not storage dependent) method here,
than in pve-storage

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 13:43:41 +01:00
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