]> git.proxmox.com Git - qemu-server.git/commitdiff
migration: fix false-positive log for copying local images
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 15:01:33 +0000 (16:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 15:01:35 +0000 (16:01 +0100)
Only log that if we actually have local disks.
Add also an explicit log for replication.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuMigrate.pm

index 626b83759317591c77d411c48ac15add1a472cc3..ffb781a4652b88b683a15cd52a60381a3ced0dbd 100644 (file)
@@ -436,21 +436,18 @@ sub sync_disks {
            }
        }
 
-       my $rep_volumes;
-
-       $self->log('info', "copying disk images");
-
        my $rep_cfg = PVE::ReplicationConfig->new();
-
        if (my $jobcfg = $rep_cfg->find_local_replication_job($vmid, $self->{node})) {
            die "can't live migrate VM with replicated volumes\n" if $self->{running};
+           $self->log('info', "replicating disk images");
            my $start_time = time();
-           my $logfunc = sub { my ($msg) = @_;  $self->log('info', $msg); };
-           $rep_volumes = PVE::Replication::run_replication(
+           my $logfunc = sub { $self->log('info', shift) };
+           $self->{replicated_volumes} = PVE::Replication::run_replication(
               'PVE::QemuConfig', $jobcfg, $start_time, $start_time, $logfunc);
-           $self->{replicated_volumes} = $rep_volumes;
        }
 
+       $self->log('info', "copying local disk images") if scalar(%$local_volumes);
+
        foreach my $volid (keys %$local_volumes) {
            my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
            my $targetsid = $override_targetsid // $sid;
@@ -463,7 +460,7 @@ sub sync_disks {
                push @{$self->{volumes}}, $volid;
                next;
            } else {
-               next if $rep_volumes->{$volid};
+               next if $self->{replicated_volumes}->{$volid};
                push @{$self->{volumes}}, $volid;
                my $opts = $self->{opts};
                my $insecure = $opts->{migration_type} eq 'insecure';