[pve-devel] [PATCH v2 qemu-server 3/5] rename foreach_writable_storage to foreach_storage_used_by_vm

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue May 16 14:29:25 CEST 2017


On Mon, May 15, 2017 at 05:30:08PM +0200, Dietmar Maurer wrote:
> Are you sure this name is better? The function does not really
> return all storages used by the VM, because it skips storages
> used in 'read-only' mode (CD roms). AFAIK that is why it's called
> 'foreach_writable_storage'.
> 
> 
> > -sub foreach_writable_storage {
> > +sub foreach_storage_used_by_vm {

foreach_writable_storage sounded like "iterate over ALL storages which
are writable" to me, which does not make much sense. we don't use
"writable" as a storage property anywhere else in the code.

in fact, this method is also only used exactly these two times (or one
time, after this series) - maybe we should just inline it? open for
other naming suggestions as well.. foreach_vdisk_storage? I can also
live with leaving the name as is - maybe I am the only one who did not
understand the current name without looking at the implementation..




More information about the pve-devel mailing list