提交 20b19324 编写于 作者: M Michal Privoznik

virsh-pool.c: Switch to C99 initialization of vshCmdOptDef

上级 7b48d692
...@@ -85,9 +85,17 @@ static const vshCmdInfo info_pool_autostart[] = { ...@@ -85,9 +85,17 @@ static const vshCmdInfo info_pool_autostart[] = {
}; };
static const vshCmdOptDef opts_pool_autostart[] = { static const vshCmdOptDef opts_pool_autostart[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = "disable",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("disable autostarting")
},
{.name = NULL}
}; };
static bool static bool
...@@ -130,9 +138,12 @@ static const vshCmdInfo info_pool_create[] = { ...@@ -130,9 +138,12 @@ static const vshCmdInfo info_pool_create[] = {
}; };
static const vshCmdOptDef opts_pool_create[] = { static const vshCmdOptDef opts_pool_create[] = {
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, {.name = "file",
N_("file containing an XML pool description")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML pool description")
},
{.name = NULL}
}; };
static bool static bool
...@@ -167,16 +178,52 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd) ...@@ -167,16 +178,52 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd)
* XML Building helper for pool-define-as and pool-create-as * XML Building helper for pool-define-as and pool-create-as
*/ */
static const vshCmdOptDef opts_pool_X_as[] = { static const vshCmdOptDef opts_pool_X_as[] = {
{"name", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the pool")}, {.name = "name",
{"print-xml", VSH_OT_BOOL, 0, N_("print XML document, but don't define/create")}, .type = VSH_OT_DATA,
{"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("type of the pool")}, .flags = VSH_OFLAG_REQ,
{"source-host", VSH_OT_DATA, 0, N_("source-host for underlying storage")}, .help = N_("name of the pool")
{"source-path", VSH_OT_DATA, 0, N_("source path for underlying storage")}, },
{"source-dev", VSH_OT_DATA, 0, N_("source device for underlying storage")}, {.name = "print-xml",
{"source-name", VSH_OT_DATA, 0, N_("source name for underlying storage")}, .type = VSH_OT_BOOL,
{"target", VSH_OT_DATA, 0, N_("target for underlying storage")}, .flags = 0,
{"source-format", VSH_OT_STRING, 0, N_("format for underlying storage")}, .help = N_("print XML document, but don't define/create")
{NULL, 0, 0, NULL} },
{.name = "type",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("type of the pool")
},
{.name = "source-host",
.type = VSH_OT_DATA,
.flags = 0,
.help = N_("source-host for underlying storage")
},
{.name = "source-path",
.type = VSH_OT_DATA,
.flags = 0,
.help = N_("source path for underlying storage")
},
{.name = "source-dev",
.type = VSH_OT_DATA,
.flags = 0,
.help = N_("source device for underlying storage")
},
{.name = "source-name",
.type = VSH_OT_DATA,
.flags = 0,
.help = N_("source name for underlying storage")
},
{.name = "target",
.type = VSH_OT_DATA,
.flags = 0,
.help = N_("target for underlying storage")
},
{.name = "source-format",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("format for underlying storage")
},
{.name = NULL}
}; };
static int buildPoolXML(const vshCmd *cmd, const char **retname, char **xml) { static int buildPoolXML(const vshCmd *cmd, const char **retname, char **xml) {
...@@ -287,8 +334,12 @@ static const vshCmdInfo info_pool_define[] = { ...@@ -287,8 +334,12 @@ static const vshCmdInfo info_pool_define[] = {
}; };
static const vshCmdOptDef opts_pool_define[] = { static const vshCmdOptDef opts_pool_define[] = {
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML pool description")}, {.name = "file",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML pool description")
},
{.name = NULL}
}; };
static bool static bool
...@@ -367,10 +418,22 @@ static const vshCmdInfo info_pool_build[] = { ...@@ -367,10 +418,22 @@ static const vshCmdInfo info_pool_build[] = {
}; };
static const vshCmdOptDef opts_pool_build[] = { static const vshCmdOptDef opts_pool_build[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{"no-overwrite", VSH_OT_BOOL, 0, N_("do not overwrite an existing pool of this type")}, .type = VSH_OT_DATA,
{"overwrite", VSH_OT_BOOL, 0, N_("overwrite any existing data")}, .flags = VSH_OFLAG_REQ,
{NULL, 0, 0, NULL} .help = N_("pool name or uuid")
},
{.name = "no-overwrite",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("do not overwrite an existing pool of this type")
},
{.name = "overwrite",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("overwrite any existing data")
},
{.name = NULL}
}; };
static bool static bool
...@@ -415,8 +478,12 @@ static const vshCmdInfo info_pool_destroy[] = { ...@@ -415,8 +478,12 @@ static const vshCmdInfo info_pool_destroy[] = {
}; };
static const vshCmdOptDef opts_pool_destroy[] = { static const vshCmdOptDef opts_pool_destroy[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
...@@ -450,8 +517,12 @@ static const vshCmdInfo info_pool_delete[] = { ...@@ -450,8 +517,12 @@ static const vshCmdInfo info_pool_delete[] = {
}; };
static const vshCmdOptDef opts_pool_delete[] = { static const vshCmdOptDef opts_pool_delete[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
...@@ -485,8 +556,12 @@ static const vshCmdInfo info_pool_refresh[] = { ...@@ -485,8 +556,12 @@ static const vshCmdInfo info_pool_refresh[] = {
}; };
static const vshCmdOptDef opts_pool_refresh[] = { static const vshCmdOptDef opts_pool_refresh[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
...@@ -520,9 +595,17 @@ static const vshCmdInfo info_pool_dumpxml[] = { ...@@ -520,9 +595,17 @@ static const vshCmdInfo info_pool_dumpxml[] = {
}; };
static const vshCmdOptDef opts_pool_dumpxml[] = { static const vshCmdOptDef opts_pool_dumpxml[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = "inactive",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("show inactive defined XML")
},
{.name = NULL}
}; };
static bool static bool
...@@ -786,15 +869,47 @@ static const vshCmdInfo info_pool_list[] = { ...@@ -786,15 +869,47 @@ static const vshCmdInfo info_pool_list[] = {
}; };
static const vshCmdOptDef opts_pool_list[] = { static const vshCmdOptDef opts_pool_list[] = {
{"inactive", VSH_OT_BOOL, 0, N_("list inactive pools")}, {.name = "inactive",
{"all", VSH_OT_BOOL, 0, N_("list inactive & active pools")}, .type = VSH_OT_BOOL,
{"transient", VSH_OT_BOOL, 0, N_("list transient pools")}, .flags = 0,
{"persistent", VSH_OT_BOOL, 0, N_("list persistent pools")}, .help = N_("list inactive pools")
{"autostart", VSH_OT_BOOL, 0, N_("list pools with autostart enabled")}, },
{"no-autostart", VSH_OT_BOOL, 0, N_("list pools with autostart disabled")}, {.name = "all",
{"type", VSH_OT_STRING, 0, N_("only list pool of specified type(s) (if supported)")}, .type = VSH_OT_BOOL,
{"details", VSH_OT_BOOL, 0, N_("display extended details for pools")}, .flags = 0,
{NULL, 0, 0, NULL} .help = N_("list inactive & active pools")
},
{.name = "transient",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list transient pools")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list persistent pools")
},
{.name = "autostart",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list pools with autostart enabled")
},
{.name = "no-autostart",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list pools with autostart disabled")
},
{.name = "type",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("only list pool of specified type(s) (if supported)")
},
{.name = "details",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("display extended details for pools")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1206,12 +1321,27 @@ static const vshCmdInfo info_find_storage_pool_sources_as[] = { ...@@ -1206,12 +1321,27 @@ static const vshCmdInfo info_find_storage_pool_sources_as[] = {
}; };
static const vshCmdOptDef opts_find_storage_pool_sources_as[] = { static const vshCmdOptDef opts_find_storage_pool_sources_as[] = {
{"type", VSH_OT_DATA, VSH_OFLAG_REQ, {.name = "type",
N_("type of storage pool sources to find")}, .type = VSH_OT_DATA,
{"host", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional host to query")}, .flags = VSH_OFLAG_REQ,
{"port", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional port to query")}, .help = N_("type of storage pool sources to find")
{"initiator", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional initiator IQN to use for query")}, },
{NULL, 0, 0, NULL} {.name = "host",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_NONE,
.help = N_("optional host to query")
},
{.name = "port",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_NONE,
.help = N_("optional port to query")
},
{.name = "initiator",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_NONE,
.help = N_("optional initiator IQN to use for query")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1278,11 +1408,17 @@ static const vshCmdInfo info_find_storage_pool_sources[] = { ...@@ -1278,11 +1408,17 @@ static const vshCmdInfo info_find_storage_pool_sources[] = {
}; };
static const vshCmdOptDef opts_find_storage_pool_sources[] = { static const vshCmdOptDef opts_find_storage_pool_sources[] = {
{"type", VSH_OT_DATA, VSH_OFLAG_REQ, {.name = "type",
N_("type of storage pool sources to discover")}, .type = VSH_OT_DATA,
{"srcSpec", VSH_OT_DATA, VSH_OFLAG_NONE, .flags = VSH_OFLAG_REQ,
N_("optional file of source xml to query for pools")}, .help = N_("type of storage pool sources to discover")
{NULL, 0, 0, NULL} },
{.name = "srcSpec",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_NONE,
.help = N_("optional file of source xml to query for pools")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1325,8 +1461,12 @@ static const vshCmdInfo info_pool_info[] = { ...@@ -1325,8 +1461,12 @@ static const vshCmdInfo info_pool_info[] = {
}; };
static const vshCmdOptDef opts_pool_info[] = { static const vshCmdOptDef opts_pool_info[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1417,8 +1557,12 @@ static const vshCmdInfo info_pool_name[] = { ...@@ -1417,8 +1557,12 @@ static const vshCmdInfo info_pool_name[] = {
}; };
static const vshCmdOptDef opts_pool_name[] = { static const vshCmdOptDef opts_pool_name[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool uuid")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1445,8 +1589,12 @@ static const vshCmdInfo info_pool_start[] = { ...@@ -1445,8 +1589,12 @@ static const vshCmdInfo info_pool_start[] = {
}; };
static const vshCmdOptDef opts_pool_start[] = { static const vshCmdOptDef opts_pool_start[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name or uuid of the inactive pool")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("name or uuid of the inactive pool")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1480,8 +1628,12 @@ static const vshCmdInfo info_pool_undefine[] = { ...@@ -1480,8 +1628,12 @@ static const vshCmdInfo info_pool_undefine[] = {
}; };
static const vshCmdOptDef opts_pool_undefine[] = { static const vshCmdOptDef opts_pool_undefine[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1515,8 +1667,12 @@ static const vshCmdInfo info_pool_uuid[] = { ...@@ -1515,8 +1667,12 @@ static const vshCmdInfo info_pool_uuid[] = {
}; };
static const vshCmdOptDef opts_pool_uuid[] = { static const vshCmdOptDef opts_pool_uuid[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name")
},
{.name = NULL}
}; };
static bool static bool
...@@ -1548,8 +1704,12 @@ static const vshCmdInfo info_pool_edit[] = { ...@@ -1548,8 +1704,12 @@ static const vshCmdInfo info_pool_edit[] = {
}; };
static const vshCmdOptDef opts_pool_edit[] = { static const vshCmdOptDef opts_pool_edit[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册