Use §Restrict in loadmasters

parent 5ca01e46
......@@ -1073,8 +1073,11 @@ the same backend momentarily. This effect should average out.
VOID xloadmaster_rr.add_storage(STEVEDORE)
------------------------------------------
Add a storage to the loadmaster. May only be called from ``vcl_init
{}``.
Add a storage to the loadmaster.
Restricted to: ``vcl_init``.
.. _xloadmaster_rr.storage():
......@@ -1103,6 +1106,10 @@ VOID xloadmaster_hash.add_storage(STEVEDORE)
Same as `xloadmaster_rr.add_storage()`_.
Restricted to: ``vcl_init``.
.. _xloadmaster_hash.storage():
STEVEDORE xloadmaster_hash.storage()
......
......@@ -982,8 +982,9 @@ the same backend momentarily. This effect should average out.
$Method VOID .add_storage(STEVEDORE)
Add a storage to the loadmaster. May only be called from ``vcl_init
{}``.
Add a storage to the loadmaster.
$Restrict vcl_init
$Method STEVEDORE .storage()
......@@ -1003,6 +1004,8 @@ $Method VOID .add_storage(STEVEDORE)
Same as `xloadmaster_rr.add_storage()`_.
$Restrict vcl_init
$Method STEVEDORE .storage()
Same as `xloadmaster_rr.storage()`_.
......
......@@ -234,11 +234,7 @@ vmod_loadmaster_ ## ll ## _add_storage(VRT_CTX, \
lc = lm->lc; \
CHECK_OBJ_NOTNULL(lc, LOADMASTER_COMMON_MAGIC); \
\
if (ctx->method != VCL_MET_INIT) { \
VRT_fail(ctx, "%s.add_storage() " \
"can only be called from vcl_init{}", lc_name(lc)); \
return; \
} \
assert(ctx->method == VCL_MET_INIT); \
\
if (stv == NULL) { \
VRT_fail(ctx, "%s.add_storage() can not be used " \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment