[pve-devel] [PATCH common 5/5] Tools: add new mount api wrappers

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/Tools.pm | 65 1 file changed, 65 insertions(+) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 801977d..02c2886 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -1696,5 +1696,70 @@ sub ar

[pve-devel] [PATCH container 5/8] add mount stage directory helpers

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 1225c8b..eb4313d 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -11,7 +11,7 @@ use File::Path; use File

[pve-devel] [PATCH container 2/8] add open_pid_fd, open_lxc_pid, open_ppid helpers

2019-11-08 Thread Wolfgang Bumiller
Getting a pid and acting on it is always a race, so add safer helpers for this. Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 38 ++ 1 file changed, 38 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index b5a97b8..3bbaa36 100644 --- a/src/

[pve-devel] [PATCH container 4/8] add get_container_namespace helper

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 13 + 1 file changed, 13 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index d40f490..1225c8b 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1047,6 +1047,19 @@ my $enter_namespace = sub { close $fd; }; +

[pve-devel] [PATCH container 1/8] implement "staged mountpoints"

2019-11-08 Thread Wolfgang Bumiller
Staging a mount point requires the new kernel mount API and will mount the volume at a fixed path, then use open_tree() to "pick it up" into a file descriptor. For most of our volumes we wouldn't need the temp directory, but some things cannot be handled with _only_ the new API (like single-step r

[pve-devel] [PATCH common 4/5] add missing 1; at the end of Syscall.pm

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/Syscall.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/Syscall.pm b/src/PVE/Syscall.pm index 516e408..2d5019f 100644 --- a/src/PVE/Syscall.pm +++ b/src/PVE/Syscall.pm @@ -90,3 +90,5 @@ sub file_handle_result($) { return $fh; }

[pve-devel] [PATCH common 3/5] PVE::Syscall: add new mount api constants

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/Syscall.pm | 69 +- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/src/PVE/Syscall.pm b/src/PVE/Syscall.pm index 99e43e7..516e408 100644 --- a/src/PVE/Syscall.pm +++ b/src/PVE/Syscall.pm @@ -1,

[pve-devel] [PATCH common 1/5] ProcFSTools: include ppid in read_proc_pid_stat

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/ProcFSTools.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index 40e4063..14c1d6e 100644 --- a/src/PVE/ProcFSTools.pm +++ b/src/PVE/ProcFSTools.pm @@ -150,6 +150,7 @@ sub read_proc_pid_stat {

[pve-devel] [PATCH container 7/8] config: vmconfig_apply_pending_mountpoint helper

2019-11-08 Thread Wolfgang Bumiller
for reuse in hotplug code Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC/Config.pm | 65 ++- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 39de691..44d7f93 100644 --- a/src/PVE/LXC/Con

[pve-devel] [PATCH common 2/5] tools: add AT_FDCWD and extend exports

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/Tools.pm | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 076c18a..801977d 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -50,6 +50,14 @@ file_copy get_host_arch O_PATH

[pve-devel] [PATCH container 6/8] prestart-hook: use staged mountpoints on newer kernels

2019-11-08 Thread Wolfgang Bumiller
This way we operate on defined paths in the monitor namespace (/run/pve/mountpoint/{rootfs,mp0,mp1,...}) while performing the mount, and can use `move_mount()` without passing the MOVE_MOUNT_T_SYMLINKS flag when putting the hierarchy in place. Signed-off-by: Wolfgang Bumiller --- src/lxc-pve-pre

[pve-devel] [PATCH ct/common] mount point hotplugging & new mount api

2019-11-08 Thread Wolfgang Bumiller
The pve-common path of this patch set should be straight forward: minor additions to ProcFSTools and Tools, as well as the new mount api constants added to Syscall.pm. The container part then makes use of the new mount api in case the currently running kernel supports it. The hope for the future w

[pve-devel] [PATCH container 3/8] split open_namespace out of enter_namespace

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 3bbaa36..d40f490 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1032,12 +1032,18 @@ sub update_ipconfig { } +my

[pve-devel] [PATCH container 8/8] implement mountpoint hotplugging

2019-11-08 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm| 44 +++ src/PVE/LXC/Config.pm | 24 ++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index eb4313d..d59ae22 100644 --- a/src/P

Re: [pve-devel] [PATCH access-control 07/13] ticket: use clinfo to get cluster name

2019-11-08 Thread Thomas Lamprecht
On 11/6/19 1:36 PM, Fabian Grünbichler wrote: > instead of parsing corosync.conf, and avoid coupling the access-control > API with PVE::Corosync. if corosync.conf and pmxcfs don't agree on how > the cluster is called, there is a bigger issue anyway.. hmm, but that's really not an excuse? Exactly a

Re: [pve-devel] [PATCHSET] pve-cluster split

2019-11-08 Thread Thomas Lamprecht
On 11/6/19 1:36 PM, Fabian Grünbichler wrote: > some other cleanups / cruft removal / missing control metadata / etc.pp. is > also > included. I tried to keep general cleanups up-front, as always. > Applied those and other unproblematic ones, i.e.: common 1/2 cluster 02/16 cluster 03/16 cluster

Re: [pve-devel] [PATCH v3 kernel-meta] fix #2403: exclude initrd entries from /proc/cmdline

2019-11-08 Thread Oguz Bektas
On Thu, Nov 07, 2019 at 08:43:17PM +0100, Thomas Lamprecht wrote: > On 10/16/19 1:17 PM, Oguz Bektas wrote: > > if we fallback to /proc/cmdline, it can include the booted initrd. > > > > to avoid loader entries with initrd 'options' lines, we have to parse > > them out. > > > > Signed-off-by: Ogu

Re: [pve-devel] [PATCH v3 kernel-meta] fix #2403: exclude initrd entries from /proc/cmdline

2019-11-08 Thread Thomas Lamprecht
On 11/8/19 1:20 PM, Oguz Bektas wrote: > On Thu, Nov 07, 2019 at 08:43:17PM +0100, Thomas Lamprecht wrote: >> On 10/16/19 1:17 PM, Oguz Bektas wrote: >>> + CMDLINE="$(awk '{gsub(/\yinitrd=([0-9a-zA-Z\/\\._-])*\s*/,x)}1' >>> /proc/cmdline)" >> >> sooo, this does not works at all with the

[pve-devel] [PATCH kernel-meta] use perl instead of (g)awk to clean /proc/cmdline

2019-11-08 Thread Oguz Bektas
this awk line only works with gawk because of implementation differences between awk alternatives. debian has mawk installed by default, and mawk does not implement word boundary regex. to avoid having to depend on gawk, we can just use perl instead. Signed-off-by: Oguz Bektas --- efiboot/zz-pve

[pve-devel] applied: [PATCH kernel-meta] use perl instead of (g)awk to clean /proc/cmdline

2019-11-08 Thread Thomas Lamprecht
On 11/8/19 1:47 PM, Oguz Bektas wrote: > this awk line only works with gawk because of implementation differences > between awk alternatives. > debian has mawk installed by default, and mawk does not implement word > boundary regex. to avoid having to depend on gawk, we can just use perl > instead.

[pve-devel] applied: [PATCH kernel-meta] efiboot/autorm functions: ignore running kernel if it was removed

2019-11-08 Thread Thomas Lamprecht
On 11/7/19 8:46 PM, Thomas Lamprecht wrote: > In the case were someone removes the current kernel we do not can > "keep" it anymore. While this was obviously no issue for the > autoremoval logic, it is an issue for the pve-efiboot-tool refresh > command, which reuses this helper to see which kernel

[pve-devel] applied: [PATCH v3 docs] Add section for ZFS Special Device

2019-11-08 Thread Thomas Lamprecht
On 11/7/19 12:06 PM, Fabian Ebner wrote: > Signed-off-by: Fabian Ebner > --- > > Changes from v2: > * Better example of when a special device is useful > * Don't mention special_small_blocks property in the first section, so it > is explained right when we use it for the first time