5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-08 21:18:03 +03:00

Fix test_volid call for vmstate and fix check for snapshots on migration

by excluding vmstate. It is referenced by snapshots, but
is not a volume containing a snapshot.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2020-04-16 14:54:42 +02:00 committed by Thomas Lamprecht
parent 5364990d26
commit b24f07d406
2 changed files with 3 additions and 1 deletions

View File

@ -404,6 +404,8 @@ sub sync_disks {
die "owned by other VM (owner = VM $owner)\n"
if !$owner || ($owner != $vmid);
return if $attr->{is_vmstate};
if (defined($snaprefs)) {
$local_volumes->{$volid}->{snapshots} = 1;

View File

@ -4331,7 +4331,7 @@ sub foreach_volid {
foreach my $snapname (keys %{$conf->{snapshots}}) {
my $snap = $conf->{snapshots}->{$snapname};
$test_volid->($snap->{vmstate}, 0, 1, $snapname);
$test_volid->($snap->{vmstate}, 0, 1, 0, $snapname);
$volhash->{$snap->{vmstate}}->{is_vmstate} = 1 if $snap->{vmstate};
PVE::QemuConfig->foreach_volume($snap, sub {
my ($ds, $drive) = @_;