mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-08 21:18:06 +03:00
RBD plugin: path: conditionalize get_rbd_dev_path() call
The return value of get_rbd_dev_path() is only used when $scfg->{krbd} evaluates to true and the function shouldn't have any side effects that are needed later, so the call can be avoided otherwise. This also saves a RADOS connection and command with configurations for external clusters with krbd disabled. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
c560cb58a5
commit
e8e477112f
@ -417,8 +417,10 @@ sub path {
|
||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||
$name .= '@'.$snapname if $snapname;
|
||||
|
||||
if ($scfg->{krbd}) {
|
||||
my $rbd_dev_path = get_rbd_dev_path($scfg, $storeid, $name);
|
||||
return ($rbd_dev_path, $vmid, $vtype) if $scfg->{krbd};
|
||||
return ($rbd_dev_path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
my $rbd_path = get_rbd_path($scfg, $name);
|
||||
my $path = "rbd:${rbd_path}";
|
||||
|
Loading…
Reference in New Issue
Block a user