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

Dominik Csapak d.csapak at proxmox.com
Fri Oct 4 10:55:54 CEST 2019


otherwise qemu-img uses its default intiator id which may not have access

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





More information about the pve-devel mailing list