From 02daf96a156d93850afcddec8f1049392b42e808 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 6 Oct 2016 11:56:00 +0200 Subject: [PATCH] fix #1131: activate volume before copying efidisk before copying the efidisk image to a storage, we first have to activate the volume also, add the -n flag to qemu-img convert (prevents creation of the target volume) Signed-off-by: Dominik Csapak --- PVE/API2/Qemu.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 482b8cd2..21fbebb4 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -137,9 +137,12 @@ my $create_disks = sub { my $scfg = PVE::Storage::storage_config($storecfg, $storeid); my $qemufmt = PVE::QemuServer::qemu_img_format($scfg, $volname); my $path = PVE::Storage::path($storecfg, $volid); - my $efidiskcmd = ['/usr/bin/qemu-img', 'convert', '-f', 'raw', '-O', $qemufmt]; + my $efidiskcmd = ['/usr/bin/qemu-img', 'convert', '-n', '-f', 'raw', '-O', $qemufmt]; push @$efidiskcmd, $ovmfvars; push @$efidiskcmd, $path; + + PVE::Storage::activate_volumes($storecfg, [$volid]); + eval { PVE::Tools::run_command($efidiskcmd); }; my $err = $@; die "Copying of EFI Vars image failed: $err" if $err;