[pve-devel] [PATCH qemu-server] fix #2395: check for iscsi on efidisk creation

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Oct 7 08:15:55 CEST 2019


On October 4, 2019 10:55 am, Dominik Csapak wrote:
> otherwise qemu-img uses its default intiator id which may not have access

isn't this also missing from

PVE/QemuServer/Cloudinit.pm
PVE/QemuServer/ImportDisk.pm

and isn't the 'cache=none' addition for ZFS missing from all three?

maybe it would make sense to have a 'convert volume to qemu-img options' 
helper that does all of that correctly in one place?

> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/QemuServer.pm | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 8376260..2267a3a 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -7277,8 +7277,18 @@ sub create_efidisk($$$$$) {
>      PVE::Storage::activate_volumes($storecfg, [$volid]);
>  
>      my $path = PVE::Storage::path($storecfg, $volid);
> +
> +    my $targetopts = ['-O', $fmt];
> +    if ($path =~ m|^iscsi://|) {
> +	$targetopts = ['--target-image-opts'];
> +	$path = convert_iscsi_path($path);
> +    }
> +
> +    my $cmd = ['/usr/bin/qemu-img', 'convert', '-n', '-f', 'raw' ];
> +    push @$cmd, @$targetopts, $ovmf_vars, $path;
> +
>      eval {
> -	run_command(['/usr/bin/qemu-img', 'convert', '-n', '-f', 'raw', '-O', $fmt, $ovmf_vars, $path]);
> +	run_command($cmd);
>      };
>      die "Copying EFI vars image failed: $@" if $@;
>  
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> 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