[pve-devel] applied-series: Re: [PATCH-SERIES proxmox-apt/pve-rs] better detection of standard repositories

2021-07-30 Thread Thomas Lamprecht
On 29/07/2021 14:25, Fabian Ebner wrote:
> I'll send the corresponding patches for pmg-rs and proxmox-backup
> separately.

pmg-rs and pve-rs really need to merge, at least into one repo, could be
a workspace with a common, pmg and pve subcrates that produces two binary
packages, just one package and no subscrates will just bring us the linkage
hell again, so I'D like to avoid making the same mistakes we made in pbs.

> proxmox-apt:
> 
> Fabian Ebner (5):
>   standard repos: add suite parameter for stricter detection
>   repo: make suite_variant helper more general
>   check repos: have caller specify the current suite
>   repo: remove has_suite_variant helper
>   add type DebianCodename
> 
>  src/repositories/file.rs   |  84 ++-
>  src/repositories/mod.rs|  31 +-
>  src/repositories/release.rs| 103 ++---
>  src/repositories/repository.rs |  33 ---
>  tests/repositories.rs  |  27 ++---
>  5 files changed, 171 insertions(+), 107 deletions(-)
> 
> 
> pve-rs:
> 
> Fabian Ebner (2):
>   apt: repos: adapt to back-end changes
>   apt: repos: adapt to further back-end changes
> 
>  src/apt/repositories.rs | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 


applied series, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH pve-storage] fix #3555: BTRFSPlugin: call free_image correctly

2021-07-30 Thread Hannes Laimer
Signed-off-by: Hannes Laimer 
---
 PVE/Storage/BTRFSPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/BTRFSPlugin.pm b/PVE/Storage/BTRFSPlugin.pm
index 4596b30..411cab9 100644
--- a/PVE/Storage/BTRFSPlugin.pm
+++ b/PVE/Storage/BTRFSPlugin.pm
@@ -410,7 +410,7 @@ sub free_image {
$class->parse_volname($volname);
 
 if ($format ne 'subvol' && $format ne 'raw') {
-   return PVE::Storage::DirPlugin::free_image(@_);
+   return PVE::Storage::DirPlugin->free_image($storeid, $scfg, $volname, 
$isBase, $_format);
 }
 
 my $path = $class->filesystem_path($scfg, $volname);
-- 
2.30.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH qemu-server] bootorder: fix double entry on cdrom edit

2021-07-30 Thread Dominik Csapak
We unconditionally added an entry into the bootorder whenever we
edited the drive, even if it was already in there. Instead we only want to do
that if the bootorder list does not contain it already.

Signed-off-by: Dominik Csapak 
---
 PVE/API2/Qemu.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 6038b28..94cc0d2 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1360,7 +1360,7 @@ my $update_vm_api  = sub {
 
# append new CD drives to bootorder to mark them bootable
my $drive = PVE::QemuServer::parse_drive($opt, 
$param->{$opt});
-   if (PVE::QemuServer::drive_is_cdrom($drive, 1)) {
+   if (PVE::QemuServer::drive_is_cdrom($drive, 1) && 
!grep(/^$opt$/, @bootorder)) {
push @bootorder, $opt;
$conf->{pending}->{boot} = 
PVE::QemuServer::print_bootorder(\@bootorder);
$modified->{boot} = 1;
-- 
2.30.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH manager 1/1] ui: node/ZFS: add zstd to possible compression methods

2021-07-30 Thread Dominik Csapak
Signed-off-by: Dominik Csapak 
---
 www/manager6/node/ZFS.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/www/manager6/node/ZFS.js b/www/manager6/node/ZFS.js
index 515a19e9..8ea364bf 100644
--- a/www/manager6/node/ZFS.js
+++ b/www/manager6/node/ZFS.js
@@ -85,6 +85,7 @@ Ext.define('PVE.node.CreateZFS', {
['lz4', 'lz4'],
['lzjb', 'lzjb'],
['zle', 'zle'],
+   ['zstd', 'zstd'],
],
},
{
-- 
2.30.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH storage/manager] allow zstd compression for new zpools

2021-07-30 Thread Dominik Csapak
pve-storage:

Dominik Csapak (1):
  api: disks: allow zstd compression for zfs pools

 PVE/API2/Disks/ZFS.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

pve-manager:

Dominik Csapak (1):
  ui: node/ZFS: add zstd to possible compression methods

 www/manager6/node/ZFS.js | 1 +
 1 file changed, 1 insertion(+)

-- 
2.30.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH storage 1/1] api: disks: allow zstd compression for zfs pools

2021-07-30 Thread Dominik Csapak
Signed-off-by: Dominik Csapak 
---
 PVE/API2/Disks/ZFS.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Disks/ZFS.pm b/PVE/API2/Disks/ZFS.pm
index b815ee7..0418794 100644
--- a/PVE/API2/Disks/ZFS.pm
+++ b/PVE/API2/Disks/ZFS.pm
@@ -316,7 +316,7 @@ __PACKAGE__->register_method ({
compression => {
type => 'string',
description => 'The compression algorithm to use.',
-   enum => ['on', 'off', 'gzip', 'lz4', 'lzjb', 'zle'],
+   enum => ['on', 'off', 'gzip', 'lz4', 'lzjb', 'zle', 'zstd'],
optional => 1,
default => 'on',
},
-- 
2.30.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH docs] fix #3557: qm/pci-passthrouh: add note about the 'All Functions' checkbox

2021-07-30 Thread Thomas Lamprecht
On 30/07/2021 08:38, Dominik Csapak wrote:
> So that a user coming from the web-interface can see what the checkbox does.
> 
> Signed-off-by: Dominik Csapak 
> ---
>  qm-pci-passthrough.adoc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
>

applied, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH manager] ui: qemu/PCIEdit: change onlineHelp link to vm config section

2021-07-30 Thread Thomas Lamprecht
On 30/07/2021 08:40, Dominik Csapak wrote:
> link the user directly to the vm config section of the pci
> passthrough docs, since that is whats happening on that panel.
> 
> It still is on the same page as the whole passthrough docs, so
> the remaining info is still there.
> 
> Signed-off-by: Dominik Csapak 
> ---
>  www/manager6/qemu/PCIEdit.js | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH pve-storage] fix #3555: BTRFSPlugin: call free_image correctly

2021-07-30 Thread Thomas Lamprecht
On 30/07/2021 13:04, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer 
> ---
>  PVE/Storage/BTRFSPlugin.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks! Albeit the commit message was lacking background, so I amended
it with:

> The method is only derived in the DirPlugin module from the base
> Plugin, so we do not have it available there through a static module
> method call using ::, but only when using a class dereference.
> 
> Other fix options would have been:
> 
>   PVE::Storage::Plugin::free_image(@_);
> 
> or:
>   $class->SUPER::free_image($storeid, ...);

IMO, always helpful to have some background, it can help others learn something 
or
jump start such lousy brains like mine if they come over this in a few months 
again,
maybe even want to "optimize it back"; at least that's my experience with ours 
and
other projects source control trees, I never thought "wow, too much related 
info there
in the commit message" ;-)


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH qemu-server] bootorder: fix double entry on cdrom edit

2021-07-30 Thread Thomas Lamprecht
On 30/07/2021 13:28, Dominik Csapak wrote:
> We unconditionally added an entry into the bootorder whenever we
> edited the drive, even if it was already in there.

argh.

> Instead we only want to do
> that if the bootorder list does not contain it already.
> 
> Signed-off-by: Dominik Csapak 
> ---
>  PVE/API2/Qemu.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v2 storage 1/3] status: move unlink from http-server to enpoint

2021-07-30 Thread Thomas Lamprecht
On 22/07/2021 15:06, Lorenz Stechauner wrote:
> this is the first step in which not the http server removes the
> temporary file, but the worker itself.
> 
> Signed-off-by: Lorenz Stechauner 
> ---
>  PVE/API2/Storage/Status.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
> index 16581aa..fcf9720 100644
> --- a/PVE/API2/Storage/Status.pm
> +++ b/PVE/API2/Storage/Status.pm
> @@ -480,6 +480,7 @@ __PACKAGE__->register_method ({
>   print "command: " . join(' ', @$cmd) . "\n";
>  
>   eval { PVE::Tools::run_command($cmd, errmsg => 'import failed'); };
> + unlink $tmpfilename or warn "unable to clean up temporory file 
> '$tmpfilename' - $!";

s/temporory/temporary/

>   if (my $err = $@) {
>   unlink $dest;
>   die $err;
> 



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v2 storage 1/1] status: add checksum and algorithm to file upload

2021-07-30 Thread Thomas Lamprecht
Missing prefix "fix #3505: "

On 22/07/2021 15:06, Lorenz Stechauner wrote:
> Signed-off-by: Lorenz Stechauner 
> ---
>  PVE/API2/Storage/Status.pm | 34 ++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
> index 9cf6e40..4b9fda5 100644
> --- a/PVE/API2/Storage/Status.pm
> +++ b/PVE/API2/Storage/Status.pm
> @@ -385,6 +385,19 @@ __PACKAGE__->register_method ({
>   maxLength => 255,
>   type => 'string',
>   },
> + checksum => {
> + description => "The expected checksum of the file.",
> + type => 'string',
> + requires => 'checksum-algorithm',
> + optional => 1,
> + },
> + 'checksum-algorithm' => {
> + description => "The algorithm to calculate the checksum of the 
> file.",
> + type => 'string',
> + enum => ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'],
> + requires => 'checksum',
> + optional => 1,
> + },
>   tmpfilename => {
>   description => "The source file name. This parameter is usually 
> set by the REST handler. You can only overwrite it when connecting to the 
> trusted port on localhost.",
>   type => 'string',
> @@ -474,6 +487,27 @@ __PACKAGE__->register_method ({
>   my $upid = shift;
>  
>   print "starting file import from: $tmpfilename\n";
> +
> + eval {
> + my ($checksum, $checksum_algorithm) = $param->@{'checksum', 
> 'checksum-algorithm'};
> + if ($checksum_algorithm) {
> + print "calculating checksum...";
> +
> + my $checksum_got = 
> PVE::Tools::get_file_hash($checksum_algorithm, $tmpfilename);
> +
> + if (lc($checksum_got) eq lc($checksum)) {
> + print "OK, checksum verified\n";
> + } else {
> + print "\n";  # the front end expects the error to 
> reside at the last line without any noise
> + die "checksum mismatch: got '$checksum_got' != expect 
> '$checksum'\n";
> + }
> + }
> + };
> + if (my $err = $@) {
> + unlink $tmpfilename or warn "unable to clean up temporory file 
> '$tmpfilename' - $!";
> + die $err;
> + }
> +
>   print "target node: $node\n";
>   print "target file: $dest\n";
>   print "file size is: $size\n";
> 



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH-SERIES v2 http-server/storage/manager] add checksum and algorithm to iso upload

2021-07-30 Thread Thomas Lamprecht
On 22/07/2021 15:06, Lorenz Stechauner wrote:
> changes to v1:
> * dropped commits, that were already applied in the mean time
> * better commit messages
> * dropped the 'new-filename' - using 'filename' instead
> * error handling for unlink
> * dropped check for `new FormData()` in pve-manager
> * fixed commit for pve-http-server (deleting temp file on errors)
> * check file extention in front end too
> 
> note: two commits in total state, that they break/require some 
> versions of other repos. please do not forget to bump those and
> create the accoring 'breaks' or 'requires'.
> 
> 
> pve-http-server:
> Lorenz Stechauner (1):
>   anyevent: move unlink from http-server to endpoint
> 
>  src/PVE/APIServer/AnyEvent.pm | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 
> pve-storage:
> Lorenz Stechauner (3):
>   status: move unlink from http-server to enpoint
>   status: remove sleep(1) in file upload
>   status: add checksum and algorithm to file upload
> 
>  PVE/API2/Storage/Status.pm | 44 +++---
>  1 file changed, 36 insertions(+), 8 deletions(-)
> 
> 
> pve-manager:
> Lorenz Stechauner (5):
>   ui: move upload window into UploadToStorage.js
>   ui: refactor UploadToStorage.js
>   ui/UploadToStorage: add checksum and algorithm
>   ui/UploadToStorage: add TaskViewer
>   ui/UplaodToStorage: check file extension
> 
>  www/manager6/Makefile  |   1 +
>  www/manager6/storage/ContentView.js| 197 +---
>  www/manager6/window/UploadToStorage.js | 311 +
>  3 files changed, 314 insertions(+), 195 deletions(-)
>  create mode 100644 www/manager6/window/UploadToStorage.js
> 

Two small nits I found when doing a shallow "smell test" review, else the 
direction
looks OK. I do not want to tackle a in-depth review/test _and_ the two breaks in
dependencies a day before my vacation, so I'm letting Fabian handle this, which 
has
a better eye for those dependencies most of the time any way. The GUI can be 
reviewed
by Dominik.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage 2/2] Ceph: add keyring parameter for external clusters

2021-07-30 Thread Thomas Lamprecht
On 21/07/2021 17:13, Aaron Lauterer wrote:
> By adding the keyring for RBD storage or the secret for CephFS ones, it
> is possible to add an external Ceph cluster with only one API call.
> 
> Previously the keyring / secret file needed to be placed in
> /etc/pve/priv/ceph/$storeID.{keyring,secret} manually.
> 
> Signed-off-by: Aaron Lauterer 
> ---
>  PVE/API2/Storage/Config.pm  |  2 +-
>  PVE/CLI/pvesm.pm| 12 ++--
>  PVE/Storage/CephFSPlugin.pm | 20 ++--
>  PVE/Storage/RBDPlugin.pm| 24 ++--
>  4 files changed, 43 insertions(+), 15 deletions(-)
> 

> diff --git a/PVE/Storage/CephFSPlugin.pm b/PVE/Storage/CephFSPlugin.pm
> index 2aaa450..ae02cb8 100644
> --- a/PVE/Storage/CephFSPlugin.pm
> +++ b/PVE/Storage/CephFSPlugin.pm

> @@ -163,20 +164,27 @@ sub check_config {
>  sub on_add_hook {
>  my ($class, $storeid, $scfg, %param) = @_;
>  
> -return if defined($scfg->{monhost}); # nothing to do if not pve managed 
> ceph
> +my $secret = $param{keyring} if defined $param{keyring} // undef;
> +PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid, $secret);
>  
> -PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid);
> +return;
> +}
> +
> +sub on_update_hook {
> +my ($class, $storeid, $scfg, %param) = @_;
> +
> +if (defined($param{keyring})) {
> + PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid, 
> $param{keyring});
> +} else {
> + PVE::CephConfig::ceph_remove_keyfile($scfg->{type}, $storeid);
> +}

this is dangerous, you will always delete the key on any update that did not
provided a new one.

Please look in other plugins about how one must handle this, e.g., PBS

if (exists($param{password})) {
if (defined($param{password})) {
pbs_set_password($scfg, $storeid, $param{password});
} else {
pbs_delete_password($scfg, $storeid);
}
}

iow, first check if the param is set and only then you can deduct that undefined
means "must be deleted".


> @@ -327,20 +332,27 @@ sub options {
>  sub on_add_hook {
>  my ($class, $storeid, $scfg, %param) = @_;
>  
> -return if defined($scfg->{monhost}); # nothing to do if not pve managed 
> ceph
> +my $secret = $param{keyring} if defined $param{keyring} // undef;
> +PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid, $secret);
> +
> +return;
> +}
> +
> +sub on_update_hook {
> +my ($class, $storeid, $scfg, %param) = @_;
>  
> -PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid);
> +if (defined($param{keyring})) {
> + PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid, 
> $param{keyring});
> +} else {
> + PVE::CephConfig::ceph_remove_keyfile($scfg->{type}, $storeid);
> +}

same here.



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH storage 1/1] api: disks: allow zstd compression for zfs pools

2021-07-30 Thread Thomas Lamprecht
On 30/07/2021 13:34, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak 
> ---
>  PVE/API2/Disks/ZFS.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH manager 1/1] ui: node/ZFS: add zstd to possible compression methods

2021-07-30 Thread Thomas Lamprecht
On 30/07/2021 13:34, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak 
> ---
>  www/manager6/node/ZFS.js | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied, with d/control version bump for storage as follow up, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: Re: [PATCH v2 manager] vzdump: allow backups from plugins

2021-07-30 Thread Thomas Lamprecht
On 19/07/2021 15:07, Oguz Bektas wrote:
> remove type check for the specific plugins, instead we can deduce it
> from the supported content type in config (this can only be set on
> storages that declare to support backups). should also work with
> external storage plugins.
> 
> Signed-off-by: Oguz Bektas 
> ---
> v1->v2:
> * remove type check instead of adding btrfs to it
> 
>  PVE/VZDump.pm | 3 ---
>  1 file changed, 3 deletions(-)
> 
>

applied, thanks!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel