From 4ab3bcc82a4c9023eb6fd0c09cf96184c0e7e01b Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 14 Jun 2017 07:01:36 +0200 Subject: [PATCH] get_replicatable_volumes: fix CDROM and local file/device handling --- PVE/QemuConfig.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm index 2c82b2b5..d2828876 100644 --- a/PVE/QemuConfig.pm +++ b/PVE/QemuConfig.pm @@ -71,6 +71,13 @@ sub get_replicatable_volumes { my $test_volid = sub { my ($volid, $attr) = @_; + if ($volid =~ m|^/|) { + return if !$attr->{replicate}; + die "unable to replicate local file/device '$volid'\n"; + } + + return if $attr->{cdrom}; + my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, $noerr); return if !$storeid; @@ -80,8 +87,6 @@ sub get_replicatable_volumes { 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};