From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id DFCCA1FF16F
	for <inbox@lore.proxmox.com>; Tue, 27 May 2025 10:48:58 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id DDB4DF239;
	Tue, 27 May 2025 10:49:05 +0200 (CEST)
Message-ID: <c61c6d1c-6976-40ec-9a1e-d560120b6e57@proxmox.com>
Date: Tue, 27 May 2025 10:49:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20250522135304.2513284-1-alexandre.derumier@groupe-cyllene.com>
 <mailman.559.1747921998.394.pve-devel@lists.proxmox.com>
Content-Language: en-US
From: Fiona Ebner <f.ebner@proxmox.com>
In-Reply-To: <mailman.559.1747921998.394.pve-devel@lists.proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.033 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 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
Subject: Re: [pve-devel] [PATCH pve-storage 1/2] common: add qemu_img_create
 an preallocation_cmd_option
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

Yes, this is a better place for such helpers :)

Am 22.05.25 um 15:53 schrieb Alexandre Derumier via pve-devel:
> Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
> ---
>  src/PVE/Storage/Common.pm          | 53 ++++++++++++++++++++++++++++++
>  src/PVE/Storage/GlusterfsPlugin.pm |  2 +-
>  src/PVE/Storage/Plugin.pm          | 47 +-------------------------
>  3 files changed, 55 insertions(+), 47 deletions(-)
> 
> diff --git a/src/PVE/Storage/Common.pm b/src/PVE/Storage/Common.pm
> index bd9c951..0770d70 100644
> --- a/src/PVE/Storage/Common.pm
> +++ b/src/PVE/Storage/Common.pm
> @@ -5,12 +5,26 @@ use warnings;
>  
>  use PVE::JSONSchema;
>  use PVE::Syscall;
> +use PVE::Tools qw(run_command);
>  
>  use constant {
>      FALLOC_FL_KEEP_SIZE => 0x01, # see linux/falloc.h
>      FALLOC_FL_PUNCH_HOLE => 0x02, # see linux/falloc.h
>  };
>  
> +our $QCOW2_PREALLOCATION = {

Should be made private with 'my' instead of 'our', as it's not (intended
to be) used anywhere else.

> +    off => 1,
> +    metadata => 1,
> +    falloc => 1,
> +    full => 1,
> +};
> +
> +our $RAW_PREALLOCATION = {

Same.

> +    off => 1,
> +    falloc => 1,
> +    full => 1,
> +};
> +
>  =pod
>  
>  =head1 NAME
> @@ -107,4 +121,43 @@ sub deallocate : prototype($$$) {
>      }
>  }
>  
> +
> +sub preallocation_cmd_option {

All functions added to the common module should have a documentation
with POD, see existing functions in the module.


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