]> git.proxmox.com Git - pve-storage.git/commit
rbd: centralize rbd path concatenation
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 7 Apr 2021 14:22:16 +0000 (16:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Apr 2021 10:56:21 +0000 (12:56 +0200)
commitaeb007cb760896dc0115c801d3c1a719f85e61fc
tree87097d547fb26e894de39343e7f7ecc01b18ded8
parentcba2b7c1d4b8cf58c5ec570e5fbf13a454d062a9
rbd: centralize rbd path concatenation

The <pool>/<image> paths are needed in quite a lot of places. Having one
single place where they are created helps to reduce duplicate code and
makes it easier to introduce new features.

The 'add_pool_to_disk' sub was already doing that but the name was not
really fitting. This commit renames it to the more general
'get_rbd_path' and changes the second parameter to the more widely used
$volume instead of $disk.

Furthermore, all occurences where "$pool/$volume" has been concatenated
have been replaced with a call to get_rbd_path.

Plus some minor code style cleanups for long function calls that were
touched.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
PVE/Storage/RBDPlugin.pm