[pve-devel] [PATCH storage 0/2] unify generating disknames finding in all plugins

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Aug 24 17:07:10 CEST 2018


On 8/22/18 3:41 PM, Stoiko Ivanov wrote:
> This patchset is a follow up to the fix for #1858, in order to avoid
> similar bugs in the future, by generating the next diskname at one place
> (Plugin.pm) for all plugins.
> 
> 
> 
> Stoiko Ivanov (2):
>   add generic get_next_vm_diskname sub
>   refactor finding next diskname for all plugins
> 
>  PVE/Storage/DRBDPlugin.pm      | 15 ++------------
>  PVE/Storage/GlusterfsPlugin.pm | 27 +++++++++-----------------
>  PVE/Storage/LVMPlugin.pm       | 20 ++++---------------
>  PVE/Storage/LvmThinPlugin.pm   |  4 ++--
>  PVE/Storage/Plugin.pm          | 44 +++++++++++++++++++++++++++++++-----------
>  PVE/Storage/RBDPlugin.pm       | 15 +++-----------
>  PVE/Storage/SheepdogPlugin.pm  | 17 ++--------------
>  PVE/Storage/ZFSPoolPlugin.pm   | 16 ++-------------
>  8 files changed, 57 insertions(+), 101 deletions(-)
> 

looks OK in general, such cleanups are nice.
Please send a v2 with my comments/nits addressed.

bonus: maybe add a few simple tests?
Maybe alloc_image with mocked run_command (the produced command could be
the test verification), if we have it for one or two plugins adding the
others could be easy - but just an idea :)




More information about the pve-devel mailing list