5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-02-03 13:47:16 +03:00

rbd: get path: allow fake override of fsid in scfg for some regression tests

to avoid calls into RADOS connect, that trigger RPCEnv not
initialized breakage in regression tests, but wouldn't really work
otherwise either

in the future the RBD $scfg could actually support this (or similarly
named) property, to safe on storage addition and then avoid frequent
mon commands

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-04-28 18:17:56 +02:00
parent cd58a69125
commit 78638b3dea

View File

@ -45,7 +45,10 @@ my sub get_rbd_dev_path {
my ($scfg, $storeid, $volume) = @_;
my $cluster_id = '';
if ($scfg->{monhost}) {
if ($scfg->{fsid}) {
# NOTE: the config doesn't support this currently (but it could!), hack for qemu-server tests
$cluster_id = $scfg->{fsid};
} elsif ($scfg->{monhost}) {
my $rados = $librados_connect->($scfg, $storeid);
$cluster_id = $rados->mon_command({ prefix => 'fsid', format => 'json' })->{fsid};
} else {