Part of the issue in bug #7554 is that an offline volume migration
will continue even if the size and format cannot be determined. Not
having the format would lead to the 'with-snapshots' parameter not
being set, despite the format being qcow2 and so the migration would
wrongly continue with raw+size as the stream format. If
'with-snapshots' were set, the plugin would correctly report that
there is no possible transfer format (the same restriction is present
in file-based storages with snapshot-as-volume-chain currently).

Signed-off-by: Fiona Ebner <[email protected]>
---
 src/PVE/QemuMigrate.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index d4de9f87..6b563343 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -451,6 +451,10 @@ sub scan_local_volumes {
 
             $local_volumes->{$volid}->@{qw(size format)} =
                 PVE::Storage::volume_size_info($storecfg, $volid);
+            die "unable to determine size for volume '$volid'\n"
+                if !defined($local_volumes->{$volid}->{size});
+            die "unable to determine format for volume '$volid'\n"
+                if !defined($local_volumes->{$volid}->{format});
 
             $local_volumes->{$volid}->{is_vmstate} = $attr->{is_vmstate} ? 1 : 
0;
             $local_volumes->{$volid}->{is_cloudinit} = $attr->{is_cloudinit} ? 
1 : 0;
-- 
2.47.3




Reply via email to