]> git.proxmox.com Git - qemu-server.git/commitdiff
get_replicatable_volumes: skip volumes if we do not 'own' them
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 13 Jun 2017 07:55:36 +0000 (09:55 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 13 Jun 2017 09:26:47 +0000 (11:26 +0200)
And add and additional check for vtype 'images'.

PVE/QemuConfig.pm

index 1ea975d157dc6155d17af1233efe746ebe968bca..f79097a81700aabd87861a0a978aaa761459f2e7 100644 (file)
@@ -77,8 +77,13 @@ sub get_replicatable_volumes {
        my $scfg = storage_config($storecfg, $storeid);
        return if $scfg->{shared};
 
+       my ($path, $owner, $vtype) = PVE::Storage::path($storecfg, $volid);
+       return if !$owner || ($owner != $vmid);
+
        return if $attr->{cdrom};
 
+       die "unable to replicate volume '$volid', type '$vtype'\n" if $vtype ne 'images';
+
        return if !$cleanup && !$attr->{replicate};
 
        if (!PVE::Storage::volume_has_feature($storecfg, 'replicate', $volid)) {