Commit 46b0d2d2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move mgt cli stuff to _mgt.c file

parent 919696b0
......@@ -39,7 +39,6 @@
#include "cache/cache.h"
#include "storage/storage.h"
#include "vcli_priv.h"
#include "vrt.h"
#include "vrt_obj.h"
......@@ -422,30 +421,6 @@ STV_close(void)
stv->close(stv);
}
/*--------------------------------------------------------------------*/
static void
stv_cli_list(struct cli *cli, const char * const *av, void *priv)
{
struct stevedore *stv;
ASSERT_MGT();
(void)av;
(void)priv;
VCLI_Out(cli, "Storage devices:\n");
stv = stv_transient;
VCLI_Out(cli, "\tstorage.%s = %s\n", stv->ident, stv->name);
VTAILQ_FOREACH(stv, &stv_stevedores, list)
VCLI_Out(cli, "\tstorage.%s = %s\n", stv->ident, stv->name);
}
/*--------------------------------------------------------------------*/
struct cli_proto cli_stv[] = {
{ "storage.list", "storage.list", "List storage devices\n",
0, 0, "", stv_cli_list },
{ NULL}
};
/*--------------------------------------------------------------------
* VRT functions for stevedores
......
......@@ -42,12 +42,37 @@
#include "storage/storage.h"
#include "vav.h"
#include "vcli_priv.h"
struct stevedore_head stv_stevedores =
VTAILQ_HEAD_INITIALIZER(stv_stevedores);
struct stevedore *stv_transient;
/*--------------------------------------------------------------------*/
static void
stv_cli_list(struct cli *cli, const char * const *av, void *priv)
{
struct stevedore *stv;
ASSERT_MGT();
(void)av;
(void)priv;
VCLI_Out(cli, "Storage devices:\n");
stv = stv_transient;
VCLI_Out(cli, "\tstorage.%s = %s\n", stv->ident, stv->name);
VTAILQ_FOREACH(stv, &stv_stevedores, list)
VCLI_Out(cli, "\tstorage.%s = %s\n", stv->ident, stv->name);
}
/*--------------------------------------------------------------------*/
struct cli_proto cli_stv[] = {
{ "storage.list", "storage.list", "List storage devices\n",
0, 0, "", stv_cli_list },
{ NULL}
};
/*--------------------------------------------------------------------
* Parse a stevedore argument on the form:
* [ name '=' ] strategy [ ',' arg ] *
......
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