]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1131: activate volume before copying efidisk
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 6 Oct 2016 09:56:00 +0000 (11:56 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 7 Oct 2016 06:20:51 +0000 (08:20 +0200)
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 <d.csapak@proxmox.com>
PVE/API2/Qemu.pm

index 482b8cd23509b5f692d243f2714d34b718af624a..21fbebb4bdf6b9836b2aca97f87631a615a6fb8f 100644 (file)
@@ -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;