Re: [pve-devel] [PATCH guest-common 1/2] move pending changes related functions into AbstractConfig

2019-09-11 Thread Fabian Grünbichler
meta: please send v2 together with v2 of pve-container (and future) patches. On September 4, 2019 6:00 pm, Oguz Bektas wrote: > some functions from Qemu w.r.t. pending changes can be moved to > AbstractConfig, in order to make them available for both QemuConfig and > LXC::Config. > >

Re: [pve-devel] [PATCH container 2/9] adapt config GET call for taking pending changes

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > the default behaviour is the same as in Qemu, so without the 'current' > flag set, current values will be replaced with their respective pending > counterparts. > > Signed-off-by: Oguz Bektas > --- > src/PVE/API2/LXC/Config.pm | 23

Re: [pve-devel] [PATCH container 1/9] add pending section to lxc config parser/writer

2019-09-11 Thread Fabian Grünbichler
NAK, this breaks existing configs with a snapshot called pending (which is an allowed snapshot name, and not such an uncommon word that we can confidently say that noone would be affected). we could do _PENDING_ or __PENDING__ (similar to what we do with __base__ and __replicate__ and

Re: [pve-devel] [PATCH container 3/9] adapt config PUT to use 'revert' and 'force' parameters

2019-09-11 Thread Fabian Grünbichler
the commit message is misleading - this just adds two parameters, but no code that handles them? the code/change that adds handling only comes in patch #8. either merge these two, or put this one after the other please. On September 5, 2019 4:11 pm, Oguz Bektas wrote: > Signed-off-by: Oguz

Re: [pve-devel] [PATCH container 5/9] add 'pending' API method to LXC

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > analog to Qemu, it returns an array of elements, which shows the > current value, pending value, and delete requests. and again, this is completely identical to the Qemu API path (modulo comments, one superfluous next statement) except for the

Re: [pve-devel] [PATCH container 6/9] add 'pct pending' command

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > analog to 'qm pending', it shows a list of keys and values defined in > configuration. copied verbatim from qm.pm, maybe we could move this code to GuestHelpers.pm (format_pending)? > > cur: current change > new: pending change > del: pending

Re: [pve-devel] [PATCH container 9/9] apply pending changes when container is started

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > Signed-off-by: Oguz Bektas > --- > src/PVE/LXC.pm | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm > index 475d9be..9dd5bc9 100644 > --- a/src/PVE/LXC.pm > +++ b/src/PVE/LXC.pm > @@ -1939,6

Re: [pve-devel] [PATCH container 0/9] lxc pending changes

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > this series makes it possible to add/revert/delete pending changes in > the backend. > > it depends on my previous patch for pve-guest-common, for enabling > inheritance of pending changes related methods into PVE::LXC::Config thanks for these

Re: [pve-devel] [PATCH container 8/9] rework update_pct_config to write and apply pending changes

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > use vmconfig_hotplug_pending (when ct up) and vmconfig_apply_pending > (when ct down) to apply or write pending changes. > > Signed-off-by: Oguz Bektas > --- > src/PVE/API2/LXC/Config.pm | 52 +- > src/PVE/LXC/Config.pm | 328

Re: [pve-devel] [PATCH container 7/9] add vmconfig_hotplug_pending and vmconfig_apply_pending

2019-09-11 Thread Fabian Grünbichler
On September 5, 2019 4:11 pm, Oguz Bektas wrote: > vmconfig_hotplug_pending is responsible for checking if a key in the > pending section is hotpluggable, if yes; perform a generic config value > replace or perform specific actions if a special case. > > vmconfig_apply_pending is only supposed to

[pve-devel] [PATCH storage] Actually use target_volid

2019-09-11 Thread Fabian Ebner
Migration with --targetstorage was broken because of this. Signed-off-by: Fabian Ebner --- PVE/Storage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 755eca8..31eeb21 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -586,7

[pve-devel] [PATCH qemu-server] fix #2367: disallow 'PENDING' as snapshot name

2019-09-11 Thread Dominik Csapak
this conflicts with our syntax of pending changes, so we have to forbid it the check must be case-insensitive since we parse it that way from the config this may be reverted again sometime with 7.0 if we decide to change the name of the pending section Signed-off-by: Dominik Csapak ---

Re: [pve-devel] [PATCH storage] Actually use target_volid

2019-09-11 Thread Thomas Lamprecht
On 11.09.19 11:46, Fabian Ebner wrote: > Migration with --targetstorage was broken because of this. > > Signed-off-by: Fabian Ebner > --- > PVE/Storage.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/PVE/Storage.pm b/PVE/Storage.pm > index 755eca8..31eeb21

Re: [pve-devel] [PATCH container 1/9] add pending section to lxc config parser/writer

2019-09-11 Thread Thomas Lamprecht
On 11.09.19 09:39, Fabian Grünbichler wrote: > NAK, this breaks existing configs with a snapshot called pending (which > is an allowed snapshot name, and not such an uncommon word that we can > confidently say that noone would be affected). we could do _PENDING_ or naming it pending for VMs

[pve-devel] [PATCH v4 qemu-server 1/4] usb: Cleanup redundant if condition

2019-09-11 Thread Aaron Lauterer
Signed-off-by: Aaron Lauterer --- PVE/QemuServer/USB.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm index a2097b9..2c09490 100644 --- a/PVE/QemuServer/USB.pm +++ b/PVE/QemuServer/USB.pm @@ -86,7 +86,7 @@ sub get_usb_devices {

[pve-devel] [PATCH v4 0/4] Fix #2343 Spice USB3 support

2019-09-11 Thread Aaron Lauterer
This patch series enables USB3 for the passthrough / redirection of USB devices via the Spice client. v3 -> v4: * cleanup of redundant if condition * avoiding cyclic module dependency from USB.pm to QemuServer.pm * fixing regex check for migration to match if spice is at beginning alone or with

[pve-devel] [PATCH v4 qemu-server 2/4] usb: Add USB3 capabilities to Spice USB devices

2019-09-11 Thread Aaron Lauterer
To not change current behaviour and thus breaking live migration USB3 for a Spice USB device requires Qemu v4.1. The old behavior was that even though technically it was possible to the set `usb3=1` setting, it was ignored. The bus was hardcoded to ehci. If another USB2 device was added or the

[pve-devel] [PATCH v4 qemu-server 3/4] usb: Fix local resource check of Spice USB devices

2019-09-11 Thread Aaron Lauterer
The check relied on the fact that in a regular use case a usb device of type spice would not have any other settings like `usb3=1`. An exact match worked fine for this. This patch changes the behaviour and makes it possible to migrate VMs with Spice USB devices that have additional usb options

[pve-devel] [PATCH v4 manager 4/4] usb: Enable USB3 for Spice USB passthrough

2019-09-11 Thread Aaron Lauterer
Instead of having two times the check if the USB3 setting needs to be added to the config string it is now checked at one place only. If USB3 is checked for a non USB3 device it will be attached to the USB2 root hub of the xhci controller. Signed-off-by: Aaron Lauterer ---

[pve-devel] applied-series: [PATCH qemu-server v4 0/4] add reboot api

2019-09-11 Thread Thomas Lamprecht
On 11.09.19 14:07, Dominik Csapak wrote: > this adds a reboot api call for vms, which uses a reboot request file > that gets detected by the qm cleanup call to start the vm again > > this api call is useful when users want to apply pending hardware changes > without waiting for the vm to shutdown

Re: [pve-devel] [PATCH container 2/9] adapt config GET call for taking pending changes

2019-09-11 Thread Thomas Lamprecht
On 11.09.19 09:39, Fabian Grünbichler wrote: > On September 5, 2019 4:11 pm, Oguz Bektas wrote: >> +# take pending changes in >> +if (!$param->{current}) { >> +foreach my $opt (keys %{$conf->{pending}}) { >> +next if $opt eq 'delete'; >> +my $value =

[pve-devel] [PATCH qemu-server v4 3/4] refactor vm_stop locked code

2019-09-11 Thread Dominik Csapak
we want to reuse most of the code in the locked context of vm_stop for vm_reboot (since it really is just a vm_stop with a create_reboot_request in there) so we factor that out into _do_vm_stop and note that it has to be called in a locked context Signed-off-by: Dominik Csapak --- new in v4

[pve-devel] [PATCH qemu-server v4 0/4] add reboot api

2019-09-11 Thread Dominik Csapak
this adds a reboot api call for vms, which uses a reboot request file that gets detected by the qm cleanup call to start the vm again this api call is useful when users want to apply pending hardware changes without waiting for the vm to shutdown changes from v3: * rebased on master * used

[pve-devel] [PATCH qemu-server v4 2/4] qm: cleanup: detect and handle reboot trigger

2019-09-11 Thread Dominik Csapak
if the reboot trigger file was set, start the vm again also cleanup the reboot trigger on vm startup, to prevent leftover files to trigger a reboot at the next shutdown Signed-off-by: Dominik Csapak --- changes from v3: * use shorter eval and warn PVE/CLI/qm.pm | 12

[pve-devel] [PATCH qemu-server v4 4/4] api: add reboot api call

2019-09-11 Thread Dominik Csapak
this creates a reboot request file (inspired by pve-container) and relies on the 'qm cleanup' call by the qmeventd to detect and restart the vm afterwards Signed-off-by: Dominik Csapak --- changes from v3: * add note about pending changes in api description * move storecfg into vm_reboot *

[pve-devel] applied: [PATCH container 4/9] remove trailing whitespace

2019-09-11 Thread Thomas Lamprecht
On 05.09.19 16:11, Oguz Bektas wrote: > Signed-off-by: Oguz Bektas > --- > src/PVE/API2/LXC.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm > index 6ddff9c..9ddaf58 100644 > --- a/src/PVE/API2/LXC.pm > +++

[pve-devel] [PATCH qemu-server v4 1/4] add create and remove reboot trigger subs

2019-09-11 Thread Dominik Csapak
Signed-off-by: Dominik Csapak --- changes from v3: * use ENOENT to check for existance PVE/QemuServer.pm | 19 +++ 1 file changed, 19 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 7128723..367d080 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@

Re: [pve-devel] [PATCH qemu-server] fix #2367: disallow 'PENDING' as snapshot name

2019-09-11 Thread Thomas Lamprecht
On 11.09.19 12:14, Dominik Csapak wrote: > this conflicts with our syntax of pending changes, so we have to forbid it > the check must be case-insensitive since we parse it that way from the config > > this may be reverted again sometime with 7.0 if we decide to change the > name of the pending

Re: [pve-devel] [PATCH qemu-server] fix #2367: disallow 'PENDING' as snapshot name

2019-09-11 Thread Dominik Csapak
On 9/11/19 1:26 PM, Thomas Lamprecht wrote: On 11.09.19 12:14, Dominik Csapak wrote: this conflicts with our syntax of pending changes, so we have to forbid it the check must be case-insensitive since we parse it that way from the config this may be reverted again sometime with 7.0 if we