if the size/avail of a mount is bigger than a certain amount,
json_encode writes the number in scientific format, which was not
matched by our \d+ regex.
This then resulted in 'undef' values for the result hash and
subsequently led to errors and warnings.
Extend the regex to also match scientific formatted numbers,
perl can then use them as is, no need for any conversion.
https://forum.proxmox.com/threads/bug-in-pve-tools-df-when-adding-petabyte-scale-storage.60090/#post-277050
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
this will be used for vm/ct tag-lists, so that (config) management systems
or similar add additional information that does not reside in the
description
putting it here, since we want to eventually have it also for
nodes,storages,etc.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
As we drop the arch translation part used by pve-container packages
in version 3.0-8 or older we need to break them, to avoid broken
newly created containers.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
The current version had only one user in LXC, so move the LXC-specific
code there to reuse this in QemuServer.
Also cache, since the host's architecture can't change during runtime.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
The old format used 16 base32 chars or 40 hex digits. Since they have
a common subset it's hard to distinguish them without the our
previous length constraints, so prefix a 'v2-' of the format to
support arbitrary lengths properly.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
uplink-id is an integer
it's used to abstract the interface name (could be different on
differents hosts)
and map it to a transportzone.
uplink-id is only allowed on physical interfaces (bond,eth,vlan)
as it's used for traffic to external
example:
auto eth0
iface eth0 inet manual
uplink-id 1
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This was wrongly shipped by our ISO since quite a bit (AFAICT, at
least 4.x), so fix it up in a versioned postinst snippet.
Do so by usind sed with the following pattern:
# sed -E -i -e 's/^www:(\w)/www: \1/' /etc/aliases
proposed by Musee Ullah[0]. It even catches a bit more than exactly
our misstep, may help if one copied this line, or added some other
addresses to this specific aliases entry.
Do this here, in pve-common, as it makes it sligthly simpler to roll
the change out to both, PVE and PMG.
[0]: https://pve.proxmox.com/pipermail/pve-user/2019-September/170998.html
Reported-by: Uwe Sauter <uwe.sauter.de@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
It turns out that the line number counting was also broken (even on
files without multiple blanks), since the body of the while inside
the nextline subroutine would not be executed for a blank.
I guess the subroutine was intended to skip comments and blanks, but
since we use blanks to recognize the end of a section, I changed it
to only skip comments.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
and constant AT_EMPTY_PATH for chowning a directory/file opened via
openat(2), for example when walking/creating a directory tree without
following symlinks.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
With the change introduced in 57c0d0c69c
completion of partial commands stopped working (e.g. typing qm res<TAB><TAB>
yields nothing instead of 'reset resize resume rescan')
By returning undef as 'ref' 'print_bash_completion' has no reference of the
available (sub) commands anymore.
By checking if the current argument is a valid prefix of a possible command,
and conditionally not setting the 'ref' hash to undef, the functionality is
restored.
Additionally a small whitespace glitch was fixed.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
The abort currently cannot be reached, instead the error with the same
message (unknown command '$cmdstr') in handle_cmd is raised.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
"ip address show" prints:
inet ADDR peer PEERADDR/32 scope global DEVICE
for pointtopoint interfaces. We're not interested in the netmask itself,
just make the Regex match.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
And split out the common code into a systemd_call() sub.
This connects to the systemd bus and waits for a UnitRemoved
event to occur for the specified unit, with an optional
timeout.
We'll use this in qemu-server to wait for a VM's scope to
disappear completely before trying to start a VM's scope
anew.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
instead of having it verbatim in the format string.
This enables us to have '%' in the defaulttext without getting errors
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>