[pve-devel] [PATCH pve-client] cleanup: use nested CLIHandler command definitions

2018-06-12 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer --- PVE/APIClient/Helpers.pm | 44 +- pveclient| 208 --- 2 files changed, 165 insertions(+), 87 deletions(-) diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm index

Re: [pve-devel] [PATCH common 1/2] remove read_password_func from cli handler

2018-06-12 Thread Thomas Lamprecht
On 6/12/18 12:33 PM, Dominik Csapak wrote: > we have a param_mapping now, with which we can impement that > > e.g. instead of using: > > sub read_password { > # read password > } > > we can do: > > sub param_mapping { > my ($name) = @_; > > my $password_map = ['password', sub{ >

[pve-devel] applied: [PATCH access-control 1/2] fix typo in change_passsword

2018-06-12 Thread Thomas Lamprecht
On 6/12/18 12:33 PM, Dominik Csapak wrote: > s/passsword/password/ > > Signed-off-by: Dominik Csapak > --- > PVE/API2/AccessControl.pm | 2 +- > PVE/CLI/pveum.pm | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/PVE/API2/AccessControl.pm

[pve-devel] applied: [PATCH common 2/2] add a generalized 'read and confirm password' sub

2018-06-12 Thread Thomas Lamprecht
On 6/12/18 12:33 PM, Dominik Csapak wrote: > to use everywhere we read two passwords and compare them > > Signed-off-by: Dominik Csapak > --- > src/PVE/PTY.pm | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/src/PVE/PTY.pm b/src/PVE/PTY.pm > index 23d76c0..e433c4e 100644 > ---

Re: [pve-devel] [PATCH storage v3 2/5] Cephfs storage plugin

2018-06-12 Thread Thomas Lamprecht
On 6/11/18 11:31 AM, Alwin Antreich wrote: > - ability to mount through kernel and fuse client > - allow mount options > - get MONs from ceph config if not in storage.cfg > - allow the use of ceph config with fuse client > > Signed-off-by: Alwin Antreich > --- > PVE/API2/Storage/Config.pm

[pve-devel] [PATCH pve-client v2] Add start command

2018-06-12 Thread René Jochum
I've added the logic to poll the task given by status/start until its "stopped", this enables an usage like: pveclient lxc create 999 && pveclient start 999 && pveclient enter 999 Signed-off-by: René Jochum --- v2 is a rebase on master and I added the wait logic.

[pve-devel] [PATCH manager] replace read_password with param_mapping in pvesh

2018-06-12 Thread Dominik Csapak
Signed-off-by: Dominik Csapak --- this belongs to my series for removing 'read_password' we also have to do the same in pmgsh if the patches get applied to pve-common bin/pvesh | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/bin/pvesh

[pve-devel] [PATCH v3] Add list and dump commands to pveum, refactor API

2018-06-12 Thread Stoiko Ivanov
changes from v2 (sent as two separate threads for pve-common and pve-access-control on 29.05.2018): * only changed the coderef invocation syntax in the areas I touched anyways (to keep the git history) * incorporated Thomas feedback (thanks!) * added another property to the JSONSchema for

[pve-devel] [PATCH access-control v3 1/2] refactor API by unifying duplicate properties

2018-06-12 Thread Stoiko Ivanov
* The JSONSchema for most API calls share some properties, which this refactoring pulls out in a common_$type_properties hashref in order to minimize code duplication (All parameters, which are thus added to the API calls were optional) * Additionally for some fields the title property is added

[pve-devel] [PATCH common v3 1/3] add print_width property to JSONSchema definition

2018-06-12 Thread Stoiko Ivanov
used to define the maximal width of the respective column in the CLI Signed-off-by: Stoiko Ivanov --- src/PVE/JSONSchema.pm | 5 + 1 file changed, 5 insertions(+) diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index f014dc3..2865d1a 100644 --- a/src/PVE/JSONSchema.pm +++

[pve-devel] [PATCH access-control v3 2/2] pveum: add list and dump commands

2018-06-12 Thread Stoiko Ivanov
* Adds list for all objects currently handled in the CLI * Adds dump for User and Group * Uses print_api_list and print_entry from PVE::CLIHandler Signed-off-by: Stoiko Ivanov --- PVE/CLI/pveum.pm | 20 1 file changed, 20 insertions(+) diff --git a/PVE/CLI/pveum.pm

[pve-devel] [PATCH common v3 2/3] add print_text_table, print_entry to CLIHandler

2018-06-12 Thread Stoiko Ivanov
These two function could serve as a generic output sub for various CLI utilities * print_text_table prints an array of objects in a tabular fashion, the formating is passed as an array containg hashes with titles, maximal lengths and default values. This way we can stay extensible, by

[pve-devel] [PATCH storage 1/1] replace read_password with param_mapping

2018-06-12 Thread Dominik Csapak
we only need this for cifs as this is the only type of storage where we expect a password Signed-off-by: Dominik Csapak --- PVE/CLI/pvesm.pm | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm index 5774364..5113715 100755 ---

[pve-devel] [PATCH container 1/1] replace read_password with param_mapping

2018-06-12 Thread Dominik Csapak
and replace Term::ReadLine with PVE::PTY Signed-off-by: Dominik Csapak --- src/PVE/CLI/pct.pm | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm index 897d595..84560b5 100755 --- a/src/PVE/CLI/pct.pm +++

[pve-devel] [PATCH access-control 1/2] fix typo in change_passsword

2018-06-12 Thread Dominik Csapak
s/passsword/password/ Signed-off-by: Dominik Csapak --- PVE/API2/AccessControl.pm | 2 +- PVE/CLI/pveum.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/API2/AccessControl.pm b/PVE/API2/AccessControl.pm index e48f0cb..afcd2fa 100644 ---

[pve-devel] [PATCH] remove read_password from CLIHandler

2018-06-12 Thread Dominik Csapak
and replace it with param_mapping, since that implements a very similar, but more general behaviour also introduce a get_confirmed_password, as suggested by Thomas[1] [1]: https://pve.proxmox.com/pipermail/pve-devel/2018-June/032338.html pve-common: Dominik Csapak (2): remove

[pve-devel] [PATCH common 2/2] add a generalized 'read and confirm password' sub

2018-06-12 Thread Dominik Csapak
to use everywhere we read two passwords and compare them Signed-off-by: Dominik Csapak --- src/PVE/PTY.pm | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/PVE/PTY.pm b/src/PVE/PTY.pm index 23d76c0..e433c4e 100644 --- a/src/PVE/PTY.pm +++ b/src/PVE/PTY.pm @@ -228,6 +228,13 @@ sub

[pve-devel] [PATCH common 1/2] remove read_password_func from cli handler

2018-06-12 Thread Dominik Csapak
we have a param_mapping now, with which we can impement that e.g. instead of using: sub read_password { # read password } we can do: sub param_mapping { my ($name) = @_; my $password_map = ['password', sub{ # read password }, ' [$password_map], 'apicall2' =>

[pve-devel] [PATCH access-control 2/2] replace read_password with param_mapping

2018-06-12 Thread Dominik Csapak
during this change, replace Term::ReadLine with PVE::PTY we use this to only ask for the password once on 'pveum ticket' Signed-off-by: Dominik Csapak --- PVE/CLI/pveum.pm | 30 -- debian/control| 1 - test/auth-test.pl | 12 ++-- 3 files changed, 22

[pve-devel] [PATCH qemu-server 1/1] use get_confirmed_password

2018-06-12 Thread Dominik Csapak
Signed-off-by: Dominik Csapak --- PVE/CLI/qm.pm | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index c017a59..fe8981f 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -674,11 +674,7 @@ sub param_mapping { my $cipassword_map =

[pve-devel] applied: [PATCH firewall] fixup active_chains distinction when deleting chains

2018-06-12 Thread Wolfgang Bumiller
Signed-off-by: Wolfgang Bumiller --- With the last ebtables rule merge patches this ebtables/iptables distinction was missing causing the disabling of a VM's firewall to produce invalid hash accesses causing this to not be detected as a change... src/PVE/Firewall.pm | 3 ++- 1 file changed, 2

[pve-devel] [PATCH pve-client 1/2] Use get_standard_option for vmid in enter

2018-06-12 Thread René Jochum
Signed-off-by: René Jochum --- PVE/APIClient/Commands/lxc.pm | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/PVE/APIClient/Commands/lxc.pm b/PVE/APIClient/Commands/lxc.pm index 66ad704..4e76f70 100644 --- a/PVE/APIClient/Commands/lxc.pm +++ b/PVE/APIClient/Commands/lxc.pm

[pve-devel] [PATCH pve-client 2/2] Add start command

2018-06-12 Thread René Jochum
--- PVE/APIClient/Commands/help.pm | 2 ++ PVE/APIClient/Commands/start.pm | 39 +++ PVE/APIClient/Helpers.pm| 20 pveclient | 2 ++ 4 files changed, 63 insertions(+) create mode 100644

[pve-devel] applied: [PATCH pve-common] CLIHandler.pm: fix command line completion for simple commands

2018-06-12 Thread Thomas Lamprecht
On 6/12/18 10:57 AM, Dietmar Maurer wrote: > You can simply test behavior using 'qmrestore' ... > > Signed-off-by: Dietmar Maurer > --- > src/PVE/CLIHandler.pm | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm > index 8c911b2..316d29d 100644

[pve-devel] applied: [PATCH pve-common] api_dump: add $raw_dump options

2018-06-12 Thread Thomas Lamprecht
On 6/11/18 11:23 AM, Dietmar Maurer wrote: > Allow to return the original tree with all refs. We use this > with our new pveclient which needs the full api definition. > Keeping refs makes it possible to store the tree more efficiently. > > Signed-off-by: Dietmar Maurer > --- >

Re: [pve-devel] [PATCH manager v3 2/2] Add cephfs to allowed storages for vzdump backup

2018-06-12 Thread Thomas Lamprecht
On 6/11/18 11:31 AM, Alwin Antreich wrote: > Signed-off-by: Alwin Antreich > --- > PVE/VZDump.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm > index a0376ef9..7fc69f98 100644 > --- a/PVE/VZDump.pm > +++ b/PVE/VZDump.pm > @@ -223,7

[pve-devel] [PATCH pve-common] CLIHandler.pm: fix command line completion for simple commands

2018-06-12 Thread Dietmar Maurer
You can simply test behavior using 'qmrestore' ... Signed-off-by: Dietmar Maurer --- src/PVE/CLIHandler.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index 8c911b2..316d29d 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@

[pve-devel] applied: [PATCH qemu-server] api create: cleanup the new config log on error

2018-06-12 Thread Thomas Lamprecht
On 6/12/18 10:50 AM, Wolfgang Bumiller wrote: > Otherwise cases like trying to restore a protected VM would > leave a lock in the config. > thanks for the followup, applied > Signed-off-by: Wolfgang Bumiller > --- > PVE/API2/Qemu.pm | 36 > 1 file changed,

[pve-devel] [PATCH qemu-server] api create: cleanup the new config log on error

2018-06-12 Thread Wolfgang Bumiller
Otherwise cases like trying to restore a protected VM would leave a lock in the config. Signed-off-by: Wolfgang Bumiller --- PVE/API2/Qemu.pm | 36 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index

[pve-devel] applied: [PATCH] add create_and_lock_config and use it to implement autostart after create

2018-06-12 Thread Wolfgang Bumiller
applied series, and sending a followup commit... On Fri, Jun 01, 2018 at 04:37:37PM +0200, Thomas Lamprecht wrote: > This aligns the VM creation code more with the CT one. > We to not lock and then execute a worker but rather fork the worker > first and lock there then, which allows nested

Re: [pve-devel] [PATCH pve-client] Config.pm: add new defaults sections

2018-06-12 Thread René Jochum
LGTM On 2018-06-12 06:24, Dietmar Maurer wrote: > And implement a new command to setup defaults. > > Signed-off-by: Dietmar Maurer > --- > PVE/APIClient/Commands/help.pm | 2 + > PVE/APIClient/Commands/remote.pm | 11 +-- > PVE/APIClient/Config.pm | 189 >

[pve-devel] applied: [PATCH storage v3 1/5] Add missing dependency to ceph-common

2018-06-12 Thread Thomas Lamprecht
On 6/11/18 11:31 AM, Alwin Antreich wrote: > Signed-off-by: Alwin Antreich > --- > debian/control | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/debian/control b/debian/control > index 2cf585a..908dd24 100644 > --- a/debian/control > +++ b/debian/control > @@ -27,6 +27,7 @@ Depends:

Re: [pve-devel] Make check for linked clones more nuanced

2018-06-12 Thread Thomas Lamprecht
On 6/7/18 2:34 PM, Wolfgang Link wrote: > Qemu can use qcow2 format to make linked clones. > LXC we do not have this, and so there is no way to make > linked clone on directory storage. > > With the 'lxc_clone' feature property we can distinguish between > LXC and QEMU. > I'm objecting calling

Re: [pve-devel] [PATCH client 2/3] config: use more xdg compliant search path

2018-06-12 Thread Wolfgang Bumiller
On Tue, Jun 12, 2018 at 06:34:54AM +0200, Dietmar Maurer wrote: > I don't really like the idea to use different file names: > > .config > client > .pveclient > > ??? It's just two, not 3 ;-) In case we ever add more tools I didn't want to recreate the mess in /run ;-) (/run/pve-cluster/ as