]> git.proxmox.com Git - qemu-server.git/commitdiff
cloudinit: use detected format in volname parsing
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Apr 2019 13:24:53 +0000 (13:24 +0000)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Apr 2019 13:24:56 +0000 (13:24 +0000)
keep the ?, as format is raw if no file ending is there, which we
want to handle too.

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

index 6b99b462894975c99c7296a6d8ad6136393160f3..f46f7fdec65271fcc141dcb08c41545075223dc9 100644 (file)
@@ -34,7 +34,7 @@ sub commit_cloudinit_disk {
 
     my $size = eval { PVE::Storage::file_size_info($iso_path) };
     if ($size <= 0) {
-       $volname =~ m/(vm-$vmid-cloudinit(.(qcow2|raw))?)/;
+       $volname =~ m/(vm-$vmid-cloudinit(.\Q$format\E)?)/;
        my $name = $1;
        $size = 4 * 1024;
        PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, $size);