mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-14 08:59:10 +00:00
Consistently use format determined in 'PVE::Storage::foreach_volid'
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com> LGTM-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
5eca0c3643
commit
0ad295f9fb
@ -319,6 +319,7 @@ sub sync_disks {
|
|||||||
# a raw+size stream, but on-the-fly conversion from qcow2 to raw+size
|
# a raw+size stream, but on-the-fly conversion from qcow2 to raw+size
|
||||||
# back to qcow2 is currently not possible.
|
# back to qcow2 is currently not possible.
|
||||||
$local_volumes->{$volid}->{snapshots} = ($volinfo->{format} =~ /^(?:qcow2|vmdk)$/);
|
$local_volumes->{$volid}->{snapshots} = ($volinfo->{format} =~ /^(?:qcow2|vmdk)$/);
|
||||||
|
$local_volumes->{$volid}->{format} = $volinfo->{format};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +371,6 @@ sub sync_disks {
|
|||||||
die "owned by other VM (owner = VM $owner)\n"
|
die "owned by other VM (owner = VM $owner)\n"
|
||||||
if !$owner || ($owner != $self->{vmid});
|
if !$owner || ($owner != $self->{vmid});
|
||||||
|
|
||||||
my $format = PVE::QemuServer::qemu_img_format($scfg, $volname);
|
|
||||||
if (defined($snaprefs)) {
|
if (defined($snaprefs)) {
|
||||||
$local_volumes->{$volid}->{snapshots} = 1;
|
$local_volumes->{$volid}->{snapshots} = 1;
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ sub sync_disks {
|
|||||||
# exceptions: 'zfspool' or 'qcow2' files (on directory storage)
|
# exceptions: 'zfspool' or 'qcow2' files (on directory storage)
|
||||||
|
|
||||||
die "online storage migration not possible if snapshot exists\n" if $self->{running};
|
die "online storage migration not possible if snapshot exists\n" if $self->{running};
|
||||||
if (!($scfg->{type} eq 'zfspool' || $format eq 'qcow2')) {
|
if (!($scfg->{type} eq 'zfspool' || $local_volumes->{$volid}->{format} eq 'qcow2')) {
|
||||||
die "non-migratable snapshot exists\n";
|
die "non-migratable snapshot exists\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user