[pve-devel] [RFC cloudinit] delete cloudinit images as if they weren't cdroms

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Aug 5 08:03:46 CEST 2015


On Tue, Aug 04, 2015 at 04:43:48PM +0200, Alexandre DERUMIER wrote:
> +    return 0 if $exclude_cloudinit && $drive->{file} =~ m@[:/]vm-\d+-cloudinit\.$QEMU_FORMAT_RE@;
> 
> I think this will not match disks on block storage ? 
> 
> file sample  : 100/vm-100-cloudinit.raw
> block sample : vm-100-cloudinit

Ah yes, the extension should to be optional, so

-    return 0 if $exclude_cloudinit && $drive->{file} =~ m@[:/]vm-\d+-cloudinit\.$QEMU_FORMAT_RE@;
+    return 0 if $exclude_cloudinit && $drive->{file} =~ m@[:/]vm-\d+-cloudinit(?:\.$QEMU_FORMAT_RE)?$@;

> ----- Mail original -----
> De: "Wolfgang Bumiller" <w.bumiller at proxmox.com>
> À: "pve-devel" <pve-devel at pve.proxmox.com>
> Envoyé: Mardi 4 Août 2015 14:47:40
> Objet: [pve-devel] [RFC cloudinit] delete cloudinit images as if they	weren't cdroms
> 
> To be applied to the v8 series. 
> 
> I gave drive_is_cdrom a flag for whether to treat cloudinit images as 
> cdrom drive (which it now does by default), in order to easily be able 
> to exclude it in places where it makes sense. $test_deallocate_storage 
> for instance now doesn't treat cloudinit images as cdrom which means 
> deletion works like with other disks: first they become unused, then 
> they can be deleted which will also delete the associated files. 
> (I also used the occasion to deduplicate the format extension regex a 
> little.) 
> 
> I hope it's okay that I haven't reposted the entire series this time. 
> 
> Wolfgang Bumiller (1): 
> delete cloudinit images as if they weren't cdroms 
> 
> PVE/API2/Qemu.pm | 2 +- 
> PVE/QemuServer.pm | 14 +++++++++----- 
> 2 files changed, 10 insertions(+), 6 deletions(-) 
> 
> -- 
> 2.1.4 
> 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
> 




More information about the pve-devel mailing list