]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2774: add early check for non-managed volumes
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 2 Jun 2020 08:46:27 +0000 (10:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 2 Jun 2020 09:46:08 +0000 (11:46 +0200)
when checking whether a to-be-added drive's and the VM's replication
status are matching. otherwise, we end up in a failing generic
'parse_volume_id' with no mention of the actual reason.

adding 'replicate=0' to the new drive string fixes the underlying issue
with and without this patch, so this is just a cosmetic/usability
improvement.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/API2/Qemu.pm

index 5e6fd42513dbaf509e9ae128c85a6eab84276018..974ee3b1e0b41259a5b605c15c060217d317df3e 100644 (file)
@@ -1095,6 +1095,9 @@ my $update_vm_api  = sub {
        return if PVE::QemuServer::drive_is_cdrom($drive);
 
        my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
+       die "cannot add non-managed/pass-through volume to a replicated VM\n"
+           if !defined($storeid);
+
        return if defined($volname) && $volname eq 'cloudinit';
 
        my $format;