[pve-devel] [PATCH] qcow2 : preallocate metadatas at file creation

Dietmar Maurer dietmar at proxmox.com
Thu Sep 20 07:21:50 CEST 2012


applied, thanks

> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Alexandre Derumier
> Sent: Mittwoch, 19. September 2012 12:20
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH] qcow2 : preallocate metadatas at file creation
> 
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  PVE/Storage/Plugin.pm |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index
> 92a5978..4e6cac7 100644
> --- a/PVE/Storage/Plugin.pm
> +++ b/PVE/Storage/Plugin.pm
> @@ -427,7 +427,10 @@ sub alloc_image {
> 
>      die "disk image '$path' already exists\n" if -e $path;
> 
> -    run_command("/usr/bin/qemu-img create -f $fmt '$path' ${size}K",
> +    my $options = "";
> +    $options = "-o preallocation=metadata" if $fmt eq 'qcow2';
> +
> +    run_command("/usr/bin/qemu-img create $options -f $fmt '$path'
> + ${size}K",
>  		errmsg => "unable to create image");
> 
>      return "$vmid/$name";
> --
> 1.7.10
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list