From a23d57d5966d98fd98cf89afcf7151b3d1ed9557 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Wed, 9 Mar 2022 11:09:14 +0100 Subject: [PATCH] image convert: allow block device as source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Necessary to import from an existing storage using block-device volumes like ZFS. Signed-off-by: Dominic Jäger [split into its own patch] Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 33f226e6..6a9f6b31 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -7280,7 +7280,7 @@ sub qemu_img_convert { $src_path = PVE::Storage::path($storecfg, $src_volid, $snapname); $src_is_iscsi = ($src_path =~ m|^iscsi://|); $cachemode = 'none' if $src_scfg->{type} eq 'zfspool'; - } elsif (-f $src_volid) { + } elsif (-f $src_volid || -b $src_volid) { $src_path = $src_volid; if ($src_path =~ m/\.($PVE::QemuServer::Drive::QEMU_FORMAT_RE)$/) { $src_format = $1;