[pve-devel] [PATCH qemu-server] Fix #1417: verify is the target storage allows disk images before important

Dietmar Maurer dietmar at proxmox.com
Wed Jul 12 17:50:43 CEST 2017


I do not understand the subject??

> On July 12, 2017 at 4:25 PM Emmanuel Kasper <e.kasper at proxmox.com> wrote:
> 
> 
> This was fixed in c46366fd494c7dd0cd46bf133146e6f7a98e32a4
> for 'qm create', but 'qm importdisk' has the same issue
> ---
>  PVE/CLI/qm.pm | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
> index f6fe4a2..e192153 100755
> --- a/PVE/CLI/qm.pm
> +++ b/PVE/CLI/qm.pm
> @@ -420,9 +420,15 @@ __PACKAGE__->register_method ({
>  	my $vm_conf = PVE::QemuConfig->load_config($vmid);
>  	PVE::QemuConfig->check_lock($vm_conf);
>  	die "$source: non-existent or non-regular file\n" if (! -f $source);
> +
>  	my $storecfg = PVE::Storage::config();
>  	PVE::Storage::storage_check_enabled($storecfg, $storeid);
>  
> +	my $target_storage_config =
> +	    PVE::Storage::storage_config($storecfg, $storeid);
> +	die "storage $storeid does not support vm images\n"
> +	    if !$target_storage_config->{content}->{images};
> +
>  	PVE::QemuServer::ImportDisk::do_import($source, $vmid, $storeid, { format =>
> $format });
>  
>  	return undef;
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list