From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A08CD6C586 for ; Fri, 6 Aug 2021 15:47:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C7939E547 for ; Fri, 6 Aug 2021 15:46:55 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 675D0E45E for ; Fri, 6 Aug 2021 15:46:49 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3EF7142F57 for ; Fri, 6 Aug 2021 15:46:49 +0200 (CEST) From: Aaron Lauterer To: pve-devel@lists.proxmox.com Date: Fri, 6 Aug 2021 15:46:47 +0200 Message-Id: <20210806134647.632054-10-a.lauterer@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210806134647.632054-1-a.lauterer@proxmox.com> References: <20210806134647.632054-1-a.lauterer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.335 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lxc.pm] Subject: [pve-devel] [PATCH v2 container 9/9] api: move-volume: cleanup very long lines X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 13:47:28 -0000 Signed-off-by: Aaron Lauterer --- src/PVE/API2/LXC.pm | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 89f9de8..88388b5 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1818,13 +1818,15 @@ __PACKAGE__->register_method({ }), delete => { type => 'boolean', - description => "Delete the original volume after successful copy. By default the original is kept as an unused volume entry.", + description => "Delete the original volume after successful copy. By default the " . + "original is kept as an unused volume entry.", optional => 1, default => 0, }, digest => { type => 'string', - description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.', + description => 'Prevent changes if current configuration file has different SHA1 " . + "digest. This can be used to prevent concurrent modifications.', maxLength => 40, optional => 1, }, @@ -1906,7 +1908,11 @@ __PACKAGE__->register_method({ my $storage_realcmd = sub { eval { - PVE::Cluster::log_msg('info', $authuser, "move volume CT $vmid: move --volume $mpkey --storage $storage"); + PVE::Cluster::log_msg( + 'info', + $authuser, + "move volume CT $vmid: move --volume $mpkey --storage $storage" + ); my $conf = PVE::LXC::Config->load_config($vmid); my $storage_cfg = PVE::Storage::config(); @@ -1917,8 +1923,20 @@ __PACKAGE__->register_method({ PVE::Storage::activate_volumes($storage_cfg, [ $old_volid ]); my $bwlimit = extract_param($param, 'bwlimit'); my $source_storage = PVE::Storage::parse_volume_id($old_volid); - my $movelimit = PVE::Storage::get_bandwidth_limit('move', [$source_storage, $storage], $bwlimit); - $new_volid = PVE::LXC::copy_volume($mpdata, $vmid, $storage, $storage_cfg, $conf, undef, $movelimit); + my $movelimit = PVE::Storage::get_bandwidth_limit( + 'move', + [$source_storage, $storage], + $bwlimit + ); + $new_volid = PVE::LXC::copy_volume( + $mpdata, + $vmid, + $storage, + $storage_cfg, + $conf, + undef, + $movelimit + ); if (PVE::LXC::Config->is_template($conf)) { PVE::Storage::activate_volumes($storage_cfg, [ $new_volid ]); my $template_volid = PVE::Storage::vdisk_create_base($storage_cfg, $new_volid); @@ -1932,7 +1950,10 @@ __PACKAGE__->register_method({ $conf = PVE::LXC::Config->load_config($vmid); PVE::Tools::assert_if_modified($digest, $conf->{digest}); - $conf->{$mpkey} = PVE::LXC::Config->print_ct_mountpoint($mpdata, $mpkey eq 'rootfs'); + $conf->{$mpkey} = PVE::LXC::Config->print_ct_mountpoint( + $mpdata, + $mpkey eq 'rootfs' + ); PVE::LXC::Config->add_unused_volume($conf, $old_volid) if !$param->{delete}; -- 2.30.2