[pve-devel] [PATCH manager] status/graphite: fix memory leak, avoid cyclic closure reference

2019-11-19 Thread Thomas Lamprecht
The data passed to this closure was never free'd, depending on the count of VM/CTs one could get >1 MB of RSS (!) memory leaked per statd status cycle update run... We could also use Scalar::Util's weaken, to weak a copy of this variable, but as a simple undef works lets do that with a comment..

[pve-devel] applied: [PATCH manager] status/graphite: fix memory leak, avoid cyclic closure reference

2019-11-19 Thread Thomas Lamprecht
On 11/19/19 9:14 AM, Thomas Lamprecht wrote: > The data passed to this closure was never free'd, depending on the > count of VM/CTs one could get >1 MB of RSS (!) memory leaked per > statd status cycle update run... > > We could also use Scalar::Util's weaken, to weak a copy of this > variable, bu

[pve-devel] [PATCH storage] Do not include a volume more than once in list_volumes

2019-11-19 Thread Fabian Ebner
When 'content_types' included both 'images' and 'rootdir', a single volume could appear twice in the volume list. This also fixes the same kind of duplication in 'pvesm list'. Signed-off-by: Fabian Ebner --- PVE/Storage/Plugin.pm | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) dif

[pve-devel] [PATCH v2 cluster 2/3] pvecm: move assert_joinable to avoid double call

2019-11-19 Thread Stefan Reiter
PVE::Cluster::Setup::join already calls assert_joinable, we only need the explicit call in pvecm if we fall back to SSH. Signed-off-by: Stefan Reiter --- data/PVE/CLI/pvecm.pm | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/

[pve-devel] [PATCH v2 cluster 3/3] corosync: die in check_conf_exists if !$noerr

2019-11-19 Thread Stefan Reiter
...and change $silent to $noerr for consistency. Commit 3df092f9 (fix #1380: pvecm status: add general cluster information) broke "pvecm status" on non-cluster nodes (well, it made the error look worse, ofc it didn't "work" before either) because it tries to access a totem that cannot exist withou

[pve-devel] [PATCH v2 cluster 1/3] pvecm: fix weirdly spaced double-prompt for password on join

2019-11-19 Thread Stefan Reiter
Not only did it display two prompts with identical meaning, the second was indented to the end of the first in my terminal for some reason. Signed-off-by: Stefan Reiter --- Series is already based on Fabian's refactoring (i.e. latest master). v2: * Move variable definitons with assert_joinable

Re: [pve-devel] [PATCH v3 qemu-server 1/8] refactor: create QemuServer::Helpers and move file/dir code

2019-11-19 Thread Fabian Grünbichler
On November 4, 2019 2:57 pm, Stefan Reiter wrote: > Also merge the 'mkdir's from QemuServer and QemuConfig to reduce > duplication (both modules depend on Helpers anyway). > > nodename() is still called in multiple places, but since it's cached by > INotify it doesn't really matter. > > Signed-of

Re: [pve-devel] [PATCH v3 qemu-server 2/8] Change check_cmdline to parse_cmdline

2019-11-19 Thread Fabian Grünbichler
On November 4, 2019 2:57 pm, Stefan Reiter wrote: > parse_cmdline is required for upcoming changes related to custom CPU > types and live migration, and this way we can re-use existing code. > > Provides the necessary infrastructure to parse QEMU /proc/.../cmdline. > Changing the single user (chec

Re: [pve-devel] [PATCH v3 0/8] Refactor QemuServer to avoid dependency cycles

2019-11-19 Thread Fabian Grünbichler
On November 4, 2019 2:57 pm, Stefan Reiter wrote: > This series refactors QemuServer and creates three new packages: > * 'PVE::QemuServer::Helpers' for general purpose helpers > * 'PVE::QemuServer::Monitor' for higher-level QMP functions > * 'PVE::QemuServer::Machine' for QEMU machine-type related

Re: [pve-devel] [PATCH v3 qemu-server 3/8] refactor: split check_running into _exists_ and _running_

2019-11-19 Thread Fabian Grünbichler
On November 4, 2019 2:57 pm, Stefan Reiter wrote: > vm_exists_on_node in PVE::QemuConfig checks if a config file for a vmid > exists > > vm_running_locally in PVE::QemuServer::Helpers checks if a VM is running > on the local machine by probing its pidfile and checking /proc/.../cmdline > > check_

Re: [pve-devel] [PATCH v3 qemu-server 4/8] refactor: create QemuServer::Monitor for high-level QMP access

2019-11-19 Thread Fabian Grünbichler
On November 4, 2019 2:57 pm, Stefan Reiter wrote: > QMP and monitor helpers are moved from QemuServer.pm. > > By using only vm_running_locally instead of check_running, a cyclic > dependency to QemuConfig is avoided. This also means that the $nocheck > parameter serves no more purpose, and has thu

Re: [pve-devel] [PATCH v3 qemu-server 5/8] refactor: extract QEMU machine related helpers to package

2019-11-19 Thread Fabian Grünbichler
one probably leftover wrong use, see inline On November 4, 2019 2:57 pm, Stefan Reiter wrote: > ...PVE::QemuServer::Machine. > > qemu_machine_feature_enabled is exported since it has a *lot* of users > in PVE::QemuServer and a long enough name as it is. > > Signed-off-by: Stefan Reiter > --- >

[pve-devel] applied: [PATCH qemu-server] clone: pre-create cloud-init disk for destination

2019-11-19 Thread Thomas Lamprecht
While we may not want to copy the cloudinit disk/drive, we still need to create+allocate the volume, else the next start complains about a missing CI drive.. fixes commit 7d6c99f0a0026ce07fa0eb858db7b6b7756ae021. Signed-off-by: Thomas Lamprecht --- PVE/API2/Qemu.pm | 4 ++-- PVE/QemuServer.pm

[pve-devel] [PATCH v3 container 01/12] tools: add can_use_new_mount_api helper

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- Changes to v2: use move_mount() instead of fsopen() src/PVE/LXC/Tools.pm | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/PVE/LXC/Tools.pm b/src/PVE/LXC/Tools.pm index bebd7d8..ce37cee 100644 --- a/src/PVE/LXC/Tools.pm +++ b/src/PVE

[pve-devel] [PATCH v3 container 02/12] split walk_tree_nofollow to allow a start fd

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- New in v3 src/PVE/LXC.pm | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 61f9bae..866b456 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1262,13 +1262,21 @@ sub run_with_loo

[pve-devel] [PATCH v3 container 08/12] add mount stage directory helpers

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- No changes to v2. 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 3ad807d..70a3b0a 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -11,7 +11,7 @@ use Fi

[pve-devel] [PATCH v3 ct 00/12] mount hotplugging & new mount api

2019-11-19 Thread Wolfgang Bumiller
Changes to v2: * Factor `walk_tree_nofollow` to be usable with fds as starting point. * Create destination directory entries (this was completely missing in the staged code path api). * Test for new kernel api with `move_mount` instead of `fsopen` since we don't actually use `fsopen` currently.

[pve-devel] [PATCH v3 container 07/12] add get_container_namespace helper

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- No changes to v2. src/PVE/LXC.pm | 13 + 1 file changed, 13 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 2a79327..3ad807d 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1044,6 +1044,19 @@ my $enter_namespace = sub {

[pve-devel] [PATCH v3 container 04/12] add mountpoint_insert_staged helper

2019-11-19 Thread Wolfgang Bumiller
This takes care of creating the directories on the fly before issuing the move_mount() syscall. Signed-off-by: Wolfgang Bumiller --- New in v3: To make sure both users of this also create the destination directories. src/PVE/LXC.pm | 19 +++ 1 file changed, 19 insertions(+) dif

[pve-devel] [PATCH v3 container 12/12] use lxc-start apparmor profile for mount hotplugging

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- New in v3 src/PVE/LXC.pm | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index a7a9817..e055c26 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -10,7 +10,7 @@ use Socket; use

[pve-devel] [PATCH v3 container 05/12] add open_pid_fd, open_lxc_pid, open_ppid helpers

2019-11-19 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 --- No changes to v2. src/PVE/LXC.pm | 38 ++ 1 file changed, 38 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index d747039..e5b765

[pve-devel] [PATCH v3 container 03/12] implement "staged mountpoints"

2019-11-19 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 v3 container 06/12] split open_namespace out of enter_namespace

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- No changes to v2. 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 e5b765a..2a79327 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1029,12 +1029,18 @@ sub update_ipc

[pve-devel] [PATCH v3 container 09/12] prestart-hook: use staged mountpoints on newer kernels

2019-11-19 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 --- Changes to v2: u

[pve-devel] [PATCH v3 container 10/12] config: apply_pending_mountpoint helper

2019-11-19 Thread Wolfgang Bumiller
for reuse in hotplug code Signed-off-by: Wolfgang Bumiller --- Changes to v2: rename vmconfig_apply_pending_mountpoint to just apply_pending_mountpoint src/PVE/LXC/Config.pm | 65 ++- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/P

[pve-devel] [PATCH v3 container 11/12] implement mountpoint hotplugging

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- Changes to v2: use mountpoint_insert_staged() helper src/PVE/LXC.pm| 38 ++ src/PVE/LXC/Config.pm | 31 ++- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC.pm

Re: [pve-devel] [PATCH v3 qemu-server 3/8] refactor: split check_running into _exists_ and _running_

2019-11-19 Thread Thomas Lamprecht
On 11/19/19 10:30 AM, Fabian Grünbichler wrote: >> + >> # BEGIN implemented abstract methods from PVE::AbstractConfig > IMHO, vm_exists_on_node is a prime candidate for being put into > AbstractConfig - it's not qemu-specific at all, we probably want to do a > similar split for pve-container as

Re: [pve-devel] [PATCH v3 qemu-server 3/8] refactor: split check_running into _exists_ and _running_

2019-11-19 Thread Stefan Reiter
On 11/19/19 10:59 AM, Thomas Lamprecht wrote: On 11/19/19 10:30 AM, Fabian Grünbichler wrote: + # BEGIN implemented abstract methods from PVE::AbstractConfig IMHO, vm_exists_on_node is a prime candidate for being put into AbstractConfig - it's not qemu-specific at all, we probably want to do

Re: [pve-devel] [PATCH v3 qemu-server 3/8] refactor: split check_running into _exists_ and _running_

2019-11-19 Thread Thomas Lamprecht
On 11/19/19 11:54 AM, Stefan Reiter wrote: > On 11/19/19 10:59 AM, Thomas Lamprecht wrote: >> On 11/19/19 10:30 AM, Fabian Grünbichler wrote: +   # BEGIN implemented abstract methods from PVE::AbstractConfig >>> IMHO, vm_exists_on_node is a prime candidate for being put into >>> AbstractC

[pve-devel] [PATCH storage] fix #2467 remove duplicate volumes & tag with correct content type

2019-11-19 Thread Tim Marx
The bugfix for #2317 introduced a kind of odd api behavior, where each volume was returned twice from our api if a storage has both 'rootdir' & 'images' content types enabled. To give the content type of the volume an actual meaning, it is now inferred form the associated guest (qemu/lxc) and we n

[pve-devel] [PATCH v4 qemu-server 3/8] refactor: split check_running into _exists_ and _running_

2019-11-19 Thread Stefan Reiter
vm_exists_on_node in PVE::QemuConfig checks if a config file for a vmid exists vm_running_locally in PVE::QemuServer::Helpers checks if a VM is running on the local machine by probing its pidfile and checking /proc/.../cmdline check_running is left in QemuServer for compatibility, but changed to

[pve-devel] [PATCH v4 manager 8/8] refactor: vm_mon_cmd is now Monitor::mon_cmd

2019-11-19 Thread Stefan Reiter
Signed-off-by: Stefan Reiter --- Requires a depends on qemu-server. PVE/Service/pvestatd.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 7243702f..92d94809 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pve

[pve-devel] [PATCH v4 qemu-server 2/8] Change check_cmdline to parse_cmdline

2019-11-19 Thread Stefan Reiter
parse_cmdline is required for upcoming changes related to custom CPU types and live migration, and this way we can re-use existing code. Provides the necessary infrastructure to parse QEMU /proc/.../cmdline. Changing the single user (check_running) is trivial too. Signed-off-by: Stefan Reiter --

[pve-devel] [PATCH v4 ha-manager 7/8] refactor: vm_qmp_command was moved to PVE::QemuServer::Monitor

2019-11-19 Thread Stefan Reiter
Also change to mon_cmd helper, avoid calling qmp_cmd directly. Signed-off-by: Stefan Reiter --- Requires a depends on qemu-server. src/PVE/HA/Resources/PVEVM.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PVE/HA/Resources/PVEVM.pm b/src/PVE/HA/Resources/PVEVM.pm

[pve-devel] [PATCH v4 qemu-server 1/8] refactor: create QemuServer::Helpers and move file/dir code

2019-11-19 Thread Stefan Reiter
Also remove unused $confdir variable in QemuConfig, but leave it and $lock_dir there, since those paths should only be used with cfs_config_path anyway. nodename() is still called in multiple places, but since it's cached by INotify it doesn't really matter. Signed-off-by: Stefan Reiter --- PVE

[pve-devel] [PATCH v4 0/8] Refactor QemuServer to avoid dependency cycles

2019-11-19 Thread Stefan Reiter
This series refactors QemuServer and creates three new packages: * 'PVE::QemuServer::Helpers' for general purpose helpers * 'PVE::QemuServer::Monitor' for higher-level QMP functions * 'PVE::QemuServer::Machine' for QEMU machine-type related helpers This refactoring came along because qemu_machine_

[pve-devel] [PATCH v4 qemu-server 5/8] refactor: extract QEMU machine related helpers to package

2019-11-19 Thread Stefan Reiter
...PVE::QemuServer::Machine. qemu_machine_feature_enabled is exported since it has a *lot* of users in PVE::QemuServer and a long enough name as it is. Signed-off-by: Stefan Reiter --- I left the code exporting qemu_machine_feature_enabled from v2 and only remove it in the next patch, just to m

[pve-devel] [PATCH v4 qemu-server 6/8] refactor: split qemu_machine_feature_enabled

2019-11-19 Thread Stefan Reiter
...into: * PVE::QemuServer::Helpers::min_version: check a major.minor version string with a given major/minor version (this is equivalent to calling the old qemu_machine_feature_enabled with only $kvmver) * PVE::QemuServer::Machine::extract_version: get major.minor version string from arbitr

[pve-devel] [PATCH v4 qemu-server 4/8] refactor: create QemuServer::Monitor for high-level QMP access

2019-11-19 Thread Stefan Reiter
QMP and monitor helpers are moved from QemuServer.pm. By using only vm_running_locally instead of check_running, a cyclic dependency to QemuConfig is avoided. This also means that the $nocheck parameter serves no more purpose, and has thus been removed along with vm_mon_cmd_nocheck. Care has been

Re: [pve-devel] [PATCH v4 0/8] Refactor QemuServer to avoid dependency cycles

2019-11-19 Thread Thomas Lamprecht
On 11/19/19 12:23 PM, Stefan Reiter wrote: > * fix and improve parse_cmdline (differentiate parameter '--foo' and '--foo > 1', > no ordering for now, I don't know if that ever makes in difference in QEMU?) QEMU's command line is highly order-dependent of arguments, thus I explicitly do *not* so

[pve-devel] [PATCH manager] fix #844: allow to pre-delay start-all-marked guests on boot

2019-11-19 Thread Thomas Lamprecht
Add a simple ExecStartPre command which reads the local node config, and if a delay is set the helper sleeps that long then exists. The systemd-unit approach was chosen as this ensures that we really only delay when doing the startall on node boot. The pve-guests service does not allows manual sto

[pve-devel] [PATCH manager v2] fix #844: allow to pre-delay start-all-marked guests on boot

2019-11-19 Thread Thomas Lamprecht
Add a simple ExecStartPre command which reads the local node config, and if a delay is set the helper sleeps that long then exists. The systemd-unit approach was chosen as this ensures that we really only delay when doing the startall on node boot. The pve-guests service does not allows manual sto

Re: [pve-devel] [PATCH v4 0/8] Refactor QemuServer to avoid dependency cycles

2019-11-19 Thread Stefan Reiter
On 11/19/19 12:34 PM, Thomas Lamprecht wrote: On 11/19/19 12:23 PM, Stefan Reiter wrote: * fix and improve parse_cmdline (differentiate parameter '--foo' and '--foo 1', no ordering for now, I don't know if that ever makes in difference in QEMU?) QEMU's command line is highly order-dependent

[pve-devel] applied: [PATCH manager v2] Fix #352: Limit the length of backup logs for mails

2019-11-19 Thread Thomas Lamprecht
On 5/21/19 1:16 PM, Dominic Jäger wrote: > When creating a backup the log part can make the mail too big to be > transferred. To ensure delivery, two measures are taken: > 1. Always omit the status lines > 2. Omit the whole log part if a mail becomes (too) big > > Additionally, add a check for mis

[pve-devel] [PATCH v2 manager 1/1] Add 'type' option to AgentFeatureSelector

2019-11-19 Thread Matt Dunwoodie
This adds an extra field to the AgentFeatureSelector that reflects the change in qemu-server. Changes since previous version: * Use map rather than if/else if/else for type display string. * Use Proxmox.Utils.unknownText for unknown type (should not occur with regular use). * Keep existing

[pve-devel] [PATCH v2 0/5] implement container reboot

2019-11-19 Thread Oguz Bektas
i'm omitting the widget-toolkit patch since that one is already applied. pve-container: v1->v2: * removed helpers for reboot triggers, because reboot triggers are not needed - we just do vm_stop and vm_start * also apply pending changes in prestart hook - check for pending section

[pve-devel] [PATCH v2 manager 5/5] add reboot button for containers

2019-11-19 Thread Oguz Bektas
also use the opportunity to refactor the shutdown button code into the menu. Signed-off-by: Oguz Bektas --- no changes. www/manager6/lxc/Config.js | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/www/manager6/lxc/Config.js b/www/manager6

[pve-devel] [PATCH v2 container 2/5] add vm_reboot api call

2019-11-19 Thread Oguz Bektas
Signed-off-by: Oguz Bektas --- src/PVE/API2/LXC/Status.pm | 52 ++ 1 file changed, 52 insertions(+) diff --git a/src/PVE/API2/LXC/Status.pm b/src/PVE/API2/LXC/Status.pm index 166c731..41f1f4f 100644 --- a/src/PVE/API2/LXC/Status.pm +++ b/src/PVE/API2/LXC/Statu

[pve-devel] [PATCH v2 container 4/5] apply pending changes in lxc prestart hook

2019-11-19 Thread Oguz Bektas
this allows pending changes to be applied when a reboot is issued inside the container. Signed-off-by: Oguz Bektas --- src/lxc-pve-prestart-hook | 9 + 1 file changed, 9 insertions(+) diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook index c0965ab..516217f 100755 --- a/

[pve-devel] [PATCH v2 container 3/5] add 'pct reboot'

2019-11-19 Thread Oguz Bektas
Signed-off-by: Oguz Bektas --- src/PVE/CLI/pct.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm index 3a32de4..98e2c6e 100755 --- a/src/PVE/CLI/pct.pm +++ b/src/PVE/CLI/pct.pm @@ -836,7 +836,8 @@ our $cmddef = { resume => [ 'PVE

[pve-devel] [PATCH v2 container 1/5] add vm_reboot sub to later use in api

2019-11-19 Thread Oguz Bektas
Signed-off-by: Oguz Bektas --- src/PVE/LXC.pm | 13 + 1 file changed, 13 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 61f9bae..c400f21 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2009,6 +2009,19 @@ sub vm_stop { die "container did not stop\n"; } +

[pve-devel] [PATCH qemu-server] print_vga_device: fix qxl displays on Linux guests

2019-11-19 Thread Aaron Lauterer
with pve-qemu-4.0.1-3 or higher it was not possible in a spice remote session to enable more displays on the fly in linux guests. Adding the `max_outputs` parameter to the qxl device manually restores the functionality. Signed-off-by: Aaron Lauterer --- PVE/QemuServer.pm| 10 +++

Re: [pve-devel] [PATCH qemu-server] print_vga_device: fix qxl displays on Linux guests

2019-11-19 Thread Thomas Lamprecht
On 11/19/19 4:01 PM, Aaron Lauterer wrote: > with pve-qemu-4.0.1-3 or higher it was not possible in a spice remote > session to enable more displays on the fly in linux guests. > > Adding the `max_outputs` parameter to the qxl device manually restores > the functionality. > > Signed-off-by: Aaron

Re: [pve-devel] [PATCH qemu-server] print_vga_device: fix qxl displays on Linux guests

2019-11-19 Thread Aaron Lauterer
On 11/19/19 4:13 PM, Thomas Lamprecht wrote: On 11/19/19 4:01 PM, Aaron Lauterer wrote: with pve-qemu-4.0.1-3 or higher it was not possible in a spice remote session to enable more displays on the fly in linux guests. Adding the `max_outputs` parameter to the qxl device manually restores the

[pve-devel] [PATCH v2 qemu-server] print_vga_device: fix qxl displays on Linux guests

2019-11-19 Thread Aaron Lauterer
with pve-qemu-4.0.1-3 or higher it was not possible in a spice remote session to enable more displays on the fly in linux guests. Adding the `max_outputs` parameter to the qxl device manually restores the functionality. Signed-off-by: Aaron Lauterer --- v1 -> v2: change `my $max_outputs` from un

Re: [pve-devel] [PATCH v2 container 4/5] apply pending changes in lxc prestart hook

2019-11-19 Thread Fabian Grünbichler
On November 19, 2019 3:53 pm, Oguz Bektas wrote: > this allows pending changes to be applied when a reboot is issued inside > the container. > > Signed-off-by: Oguz Bektas > --- > src/lxc-pve-prestart-hook | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/src/lxc-pve-prestart-ho

Re: [pve-devel] [PATCH v3 ct 00/12] mount hotplugging & new mount api

2019-11-19 Thread Oguz Bektas
hi, this breaks mounting with mountopts. (hotplug and normal mount) reproduce: - install new kernel - make a CT - run it - try to hotplug a mp with any mountoption (ro, noatime, nosuid, noexec, nodev) - mount will fail with exit code 32 - shutdown CT - boot CT - mp will be created, it will fail t

Re: [pve-devel] [PATCH v2 qemu-server] print_vga_device: fix qxl displays on Linux guests

2019-11-19 Thread Thomas Lamprecht
On 11/19/19 4:18 PM, Aaron Lauterer wrote: > with pve-qemu-4.0.1-3 or higher it was not possible in a spice remote > session to enable more displays on the fly in linux guests. > > Adding the `max_outputs` parameter to the qxl device manually restores > the functionality. > > Signed-off-by: Aaron

Re: [pve-devel] [PATCH v3 ct 00/12] mount hotplugging & new mount api

2019-11-19 Thread Oguz Bektas
On Tue, Nov 19, 2019 at 04:56:55PM +0100, Oguz Bektas wrote: > hi, > > this breaks mounting with mountopts. (hotplug and normal mount) testing with the older kernel now. hotplugging isn't supported because of the old version, but we can actually mount mps with mountoptions with the older kernel.

[pve-devel] [PATCH v3 container 1/5] add vm_reboot sub to later use in api

2019-11-19 Thread Oguz Bektas
Signed-off-by: Oguz Bektas --- src/PVE/LXC.pm | 13 + 1 file changed, 13 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 61f9bae..c400f21 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2009,6 +2009,19 @@ sub vm_stop { die "container did not stop\n"; } +

[pve-devel] [PATCH v3 container 2/5] add vm_reboot api call

2019-11-19 Thread Oguz Bektas
Signed-off-by: Oguz Bektas --- src/PVE/API2/LXC/Status.pm | 52 ++ 1 file changed, 52 insertions(+) diff --git a/src/PVE/API2/LXC/Status.pm b/src/PVE/API2/LXC/Status.pm index 166c731..41f1f4f 100644 --- a/src/PVE/API2/LXC/Status.pm +++ b/src/PVE/API2/LXC/Statu

[pve-devel] [PATCH v3 container 4/5] apply pending changes in lxc prestart hook

2019-11-19 Thread Oguz Bektas
this allows pending changes to be applied when a reboot is issued inside the container. Signed-off-by: Oguz Bektas --- src/lxc-pve-prestart-hook | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook index c0965ab..b44b69

[pve-devel] [PATCH v3 container 3/5] add 'pct reboot'

2019-11-19 Thread Oguz Bektas
Signed-off-by: Oguz Bektas --- src/PVE/CLI/pct.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm index 3a32de4..98e2c6e 100755 --- a/src/PVE/CLI/pct.pm +++ b/src/PVE/CLI/pct.pm @@ -836,7 +836,8 @@ our $cmddef = { resume => [ 'PVE

[pve-devel] [PATCH v3 manager 5/5] add reboot button for containers

2019-11-19 Thread Oguz Bektas
also use the opportunity to refactor the shutdown button code into the menu. Signed-off-by: Oguz Bektas --- v2->v3: no changes. www/manager6/lxc/Config.js | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/www/manager6/lxc/Config.js b/www/

[pve-devel] [PATCH v3 0/5] implement container reboot

2019-11-19 Thread Oguz Bektas
i'm omitting the widget-toolkit patch since that one is already applied. pve-container: v2->v3: * use vmconfig_apply_pending() in prestart hook instead of calling update_pct_config and update_lxc_config Oguz Bektas (4): add vm_reboot sub to later use in api add vm_reboot api call add 'pct

Re: [pve-devel] [PATCH v3 ct 00/12] mount hotplugging & new mount api

2019-11-19 Thread Wolfgang Bumiller
On Tue, Nov 19, 2019 at 04:56:55PM +0100, Oguz Bektas wrote: > hi, > > this breaks mounting with mountopts. (hotplug and normal mount) > > reproduce: > - install new kernel > - make a CT > - run it > - try to hotplug a mp with any mountoption (ro, noatime, nosuid, noexec, > nodev) I was a bit co

[pve-devel] [PATCH v4 container 03/12] implement "staged mountpoints"

2019-11-19 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 v4 container 07/12] add get_container_namespace helper

2019-11-19 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 2a79327..3ad807d 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1044,6 +1044,19 @@ my $enter_namespace = sub { close $fd; }; +

[pve-devel] [PATCH v4 ct 00/12] mount hotplugging & new mount api

2019-11-19 Thread Wolfgang Bumiller
Changes to v3: * Change mount point staging directory from /run/pve/mountpoints to /var/lib/lxc/.pve-staged-mounts due to allowed mount paths being restricted by the lxc-start apparmor profile. (Only affects path 8, the remaining patches are unchanged) Changes to v2: * Factor `walk_tree_nofo

[pve-devel] [PATCH v4 container 05/12] add open_pid_fd, open_lxc_pid, open_ppid helpers

2019-11-19 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 d747039..e5b765a 100644 --- a/src/

[pve-devel] [PATCH v4 container 08/12] add mount stage directory helpers

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- Changes to v3: Changed the staging path from /run/pve/mountpoints to /var/lib/lxc/.pve-staged-mounts due to the lxc-start apparmor profile. src/PVE/LXC.pm | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/s

[pve-devel] [PATCH v4 container 01/12] tools: add can_use_new_mount_api helper

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC/Tools.pm | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/PVE/LXC/Tools.pm b/src/PVE/LXC/Tools.pm index bebd7d8..ce37cee 100644 --- a/src/PVE/LXC/Tools.pm +++ b/src/PVE/LXC/Tools.pm @@ -2,6 +2,8 @@ package PVE::LXC::To

[pve-devel] [PATCH v4 container 04/12] add mountpoint_insert_staged helper

2019-11-19 Thread Wolfgang Bumiller
This takes care of creating the directories on the fly before issuing the move_mount() syscall. Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 77679fa..d747039 100644 --- a/src/PVE

[pve-devel] [PATCH v4 container 06/12] split open_namespace out of enter_namespace

2019-11-19 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 e5b765a..2a79327 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1029,12 +1029,18 @@ sub update_ipconfig { } +my

[pve-devel] [PATCH v4 container 09/12] prestart-hook: use staged mountpoints on newer kernels

2019-11-19 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 v4 container 12/12] use lxc-start apparmor profile for mount hotplugging

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 431f6cd..d27140f 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -10,7 +10,7 @@ use Socket; use File::Path;

[pve-devel] [PATCH v4 container 10/12] config: apply_pending_mountpoint helper

2019-11-19 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 6203c42..573eaff 100644 --- a/src/PVE/LXC/Con

[pve-devel] [PATCH v4 container 02/12] split walk_tree_nofollow to allow a start fd

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 61f9bae..866b456 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1262,13 +1262,21 @@ sub run_with_loopdev { sub

[pve-devel] [PATCH v4 container 11/12] implement mountpoint hotplugging

2019-11-19 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm| 38 ++ src/PVE/LXC/Config.pm | 31 ++- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 26c03f7..431f6cd 100644 --- a/sr

Re: [pve-devel] [PATCH storage] Do not include a volume more than once in list_volumes

2019-11-19 Thread Fabian Ebner
On 11/19/19 10:13 AM, Fabian Ebner wrote: When 'content_types' included both 'images' and 'rootdir', a single volume could appear twice in the volume list. This also fixes the same kind of duplication in 'pvesm list'. Signed-off-by: Fabian Ebner --- PVE/Storage/Plugin.pm | 8 ++-- 1 file