5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-02-09 17:57:21 +03:00

449 Commits

Author SHA1 Message Date
Dietmar Maurer
2701dc7479 bump version to 4.0-47 2016-02-10 11:14:06 +01:00
Fabian Grünbichler
f127adaba5 Implement refcounting for flocks
This was already implemented in PVE::LXC::lock_aquire() and
lock_release(). Enabling refcounting in the general
PVE::Tools::lock_file() and lock_file_full() methods allows
us to use one code base for flocking.

Furthermore, we could get rid of various xx_no_lock methods
that were required because the old non-refcounting version
did not support nested flocks (the inner most flock would
close the file handle and thus release the flock).
2016-02-10 11:12:12 +01:00
Wolfgang Bumiller
881eb75531 CLIHandler: add missing use PVE::INotify
It uses PVE::INotify::inotify_init() in run_cli_handler().
2016-02-10 10:26:33 +01:00
Dietmar Maurer
8cbc26d3a8 bump version to 4.0-46 2016-01-27 16:56:00 +01:00
Thomas Lamprecht
c1073fdc48 add upid_wait method
Waits for a process identified by a UPID to end by busy waiting
and is intended for long running workers.

waitfunc gets called every wait cycle after min $sleep_interval
seconds and can be used for outputting/logging something or timing
out the wait.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-01-27 16:54:50 +01:00
Dietmar Maurer
ebd2b0aca5 SectionConfig: disable duplicate plugin registration 2016-01-26 13:16:19 +01:00
Wolfgang Bumiller
891b224a8f Tools: add setns system call 2016-01-23 08:59:07 +01:00
Dietmar Maurer
d601e17b10 bump version to 4.0-45 2016-01-18 16:54:30 +01:00
Wolfgang Bumiller
846337ad41 network: fix uninitialized value error 2016-01-18 11:01:35 +01:00
Dietmar Maurer
8992139368 bump version to 4.0-44 2016-01-15 17:26:22 +01:00
Alexandre Derumier
b0b34ffd4e network : add trunks support
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-01-15 17:25:42 +01:00
Dietmar Maurer
df6da413d4 bump version to 4.0-43 2016-01-08 12:51:16 +01:00
Wolfgang Bumiller
e34c27f474 Fix #861: use safer sprintf formatting 2016-01-08 12:49:40 +01:00
Dietmar Maurer
7a83df1bc9 improve asciidoc markup 2015-12-29 18:43:12 +01:00
Dietmar Maurer
fe3f1fdef1 add experimental 'asciidoc' generator
useful to generate manual pages using asciidoc.
2015-12-29 17:02:00 +01:00
Dietmar Maurer
3d7f2d2ae6 bump version to 4.0-42 2015-12-19 09:06:41 +01:00
Thomas Lamprecht
b148e99f3f Output also lockname if it cannot be acquired
If we can't acquire the lock in lock_file_full and get interrupted
by a signal inqeual to EINTR (e.g. SIGTERM), output also it's name
in the error message to allow better debugging.

Also fix a typo.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-12-19 09:05:00 +01:00
Thomas Lamprecht
e4a1d8e240 allow fall back to default completion
This allows a fall back to the default completion, which completes
possible paths/files, if nothing can be generated from the PVE
completion handler ($print_bash_completion) or if the user starts
to entry a path.
This is especially useful for restore or create commands which can
take an archive file as argument.

The bash-completions get generated at each package build through the
respective Makefile, so to let this change come in effect the package
needs to be rebuild and installed (and the respective file from
/usr/share/bash-completion/completions/<pve cli tool> needs to be
sourced again (or simply open a new terminal))

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-12-19 09:04:40 +01:00
Dietmar Maurer
8eed5f915d bump version to 4.0-41 2015-12-07 11:17:56 +01:00
Wolfgang Bumiller
9db0800b69 Daemon: don't clear CLOEXEC on daemon sockets
They were leaking into processes blocking full restarts of
the daemons.

Note that perl's fcntl doesn't work on numeric
filedescriptors (neither does POSIX::fcntl, which even stays
silent about it and returns EBADF without ever trying to
actually perform the fcntl syscall), so the socket handles
need to be stored ($daemon_sockets).
The flag is added back when the socket gets reopened.
2015-12-07 11:16:44 +01:00
Dietmar Maurer
59beafd43a bump version to 4.0-40 2015-11-30 13:00:41 +01:00
Thomas Lamprecht
7e82692825 run_command: return exit code and add noerr
Allow to return the exit code of the executed command.
And as we do not reach the return of the exit code if it was not 0,
a noerr parameter is also needed so we can suppress the 'command
failed' die in case of an exit code unequal to 0.

This is required as some programs return another value than 0 when
they succeed, For example `systemctl list-jobs` returns  a value
>= 0 on a successful execution, normally 1.
Without this patch a run_command call to `systemctl list-jobs` gets
marked as failed although it was successful.

This does not break current behaviour in any way as setting the
noerr parameter is required to return something other than 0 or
undef, which are equal in a boolean comparison.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-11-30 12:59:45 +01:00
Wolfgang Bumiller
35e7d23983 print_property_string: skip keys early
Keys in the skip-list don't need to be valid schema keys.
This was overly strict before which makes it harder to
include temporary internal keys in a such an object.
2015-11-26 12:10:48 +01:00
Dietmar Maurer
dca615d2e8 bump version to 4.0-39 2015-11-26 08:09:44 +01:00
Wolfgang Link
23e0e0d786 add function file_copy
to have a save copy.
2015-11-26 08:08:31 +01:00
Dietmar Maurer
015b013080 bump version to 4.0-38 2015-11-19 06:25:36 +01:00
Dietmar Maurer
34eb365639 avoid access to undefinded var $tag 2015-11-19 06:23:12 +01:00
Dietmar Maurer
87432734f6 bump version to 4.0-37 2015-11-13 11:16:48 +01:00
Wolfgang Bumiller
072dfa92a5 ProcFSTools: implement conforming parse_mounts
There are a few places where we grep over /proc/mounts
without taking the encoding into acount.
ProcFSTools::parse_mounts parses mount data and decodes all
the special character the kernel might encode into it.

Shortcut: parse_proc_mounts to do
parse_mounts(read_proc_mounts()).
is_mounted() updated to parse mounts correctly.
2015-11-13 11:16:13 +01:00
Dietmar Maurer
c8ae5c7e9c update changelog 2015-10-30 11:05:49 +01:00
Wolfgang Bumiller
be8f0477bc fix CLONE constant declaration 2015-10-30 11:04:51 +01:00
Wolfgang Bumiller
817c6be02c Tools: make unshare behave like other perl syscalls
Most syscall wrappers in perl return 1 on success and our
current use of Tools::unshare isn't using the return value
(yet), so let's fix this while we can.

Also it seems to make sense to use prototyping on syscalls
to add some compile-time argument checking.
2015-10-30 11:03:55 +01:00
Dietmar Maurer
9de823bdc3 bump version to 4.0-36 2015-10-30 07:04:08 +01:00
Wolfgang Bumiller
20b69017a8 print_property_string: skip undefined values 2015-10-30 07:03:10 +01:00
Wolfgang Bumiller
97c8c8577d Tools::df: fork and use Filesys::Df
Instead of depending on the 'df' commandline tool do a
fork() to create a killable process and run Filesys::Df,
returning the data over a pipe.
2015-10-30 07:00:37 +01:00
Dietmar Maurer
d8ade58f3a bump version to 4.0-35 2015-10-23 13:08:22 +02:00
Wolfgang Bumiller
ef67212cf2 read_prox_net_ipv6_route fixup
- read_v6addr used the wrong $_
- All values in the file are hex and possibly prefixed with
zeroes so we need to make sure they don't get interpreted as
octal.
2015-10-23 12:13:35 +02:00
Dietmar Maurer
87ffaecbfb bump version to 4.0-34 2015-10-19 11:14:35 +02:00
Wolfgang Bumiller
aeac55e138 half-revert: remove autostart property from bridge ports
In commit 21d32c95cd autostart was removed from all bridge
ports but should have only been removed from ovs bridge ports.
2015-10-19 11:11:29 +02:00
Wolfgang Bumiller
bf52d27bb3 network: IP_from_cidr and is_ip_in_cidr helpers 2015-10-16 16:51:01 +02:00
Dietmar Maurer
da6362722d bump version to 4.0-33 2015-10-16 09:54:07 +02:00
Wolfgang Bumiller
0526cc2d79 allow /32 ipv4 cidrs 2015-10-16 09:52:26 +02:00
Wolfgang Bumiller
303a9b34ea support aliases in property strings
In qemu the 'volume' key maps to 'file', both can be used,
so to support this case in the comma-separated property
list parser we need a way to alias keys to one another.
This allows declaring a key like:

  volume => {
      alias => 'file'
  }
  file => {
      type => 'string',
      format => 'pve-volume-id',
      default_key => 1,
      format_description => 'volume'
  }

With this the following property strings are equivalent and
result in the same datastructure being returned from
parse_property_string:

  local:disk.raw
  file=local:disk.raw
  volume=local:disk.raw
2015-10-15 12:36:07 +02:00
Dietmar Maurer
df0c6a7cd8 bump version tio 4.0-32 2015-10-15 12:22:59 +02:00
Wolfgang Bumiller
5f3f697dcd print_property_string: disk-size is a format, not a type 2015-10-15 12:20:50 +02:00
Dietmar Maurer
85d5625a15 random_ether_addr: code cleanups 2015-10-09 11:48:25 +02:00
Philipp Marek
de9a267fec Shorter implementation of random_ether_addr(). 2015-10-09 11:46:50 +02:00
Dietmar Maurer
e88f9c631c bump version to 4.0-31 2015-10-09 08:43:54 +02:00
Dietmar Maurer
2d468b1aa2 parse_property_string: add newline to error strings
to prevent perl from adding 'at line xxx'
2015-10-09 08:38:37 +02:00
Wolfgang Bumiller
7a82210017 don't reorder unknown interface types
Giving unknown interfaces an order-id of 0 caused them to
always be on top of the interfaces file. This is often
undesired. Instead we now only take type-ordering into
account when both interfaces which are being compared have a
known type, and otherwise only use the priority attribute.
This should result in a more stable modification of
interfaces.

Fixes #747
2015-10-07 13:43:28 +02:00