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

This commit is contained in:
Michal Privoznik 2013-01-14 15:28:17 +01:00
parent d54384187b
commit b2621046c2

View File

@ -89,9 +89,17 @@ static const vshCmdInfo info_network_autostart[] = {
}; };
static const vshCmdOptDef opts_network_autostart[] = { static const vshCmdOptDef opts_network_autostart[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = "disable",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("disable autostarting")
},
{.name = NULL}
}; };
static bool static bool
@ -134,8 +142,12 @@ static const vshCmdInfo info_network_create[] = {
}; };
static const vshCmdOptDef opts_network_create[] = { static const vshCmdOptDef opts_network_create[] = {
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML network description")}, {.name = "file",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML network description")
},
{.name = NULL}
}; };
static bool static bool
@ -176,8 +188,12 @@ static const vshCmdInfo info_network_define[] = {
}; };
static const vshCmdOptDef opts_network_define[] = { static const vshCmdOptDef opts_network_define[] = {
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML network description")}, {.name = "file",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML network description")
},
{.name = NULL}
}; };
static bool static bool
@ -218,8 +234,12 @@ static const vshCmdInfo info_network_destroy[] = {
}; };
static const vshCmdOptDef opts_network_destroy[] = { static const vshCmdOptDef opts_network_destroy[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -253,9 +273,17 @@ static const vshCmdInfo info_network_dumpxml[] = {
}; };
static const vshCmdOptDef opts_network_dumpxml[] = { static const vshCmdOptDef opts_network_dumpxml[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{"inactive", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("network information of an inactive domain")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = "inactive",
.type = VSH_OT_BOOL,
.flags = VSH_OFLAG_NONE,
.help = N_("network information of an inactive domain")
},
{.name = NULL}
}; };
static bool static bool
@ -297,8 +325,12 @@ static const vshCmdInfo info_network_info[] = {
}; };
static const vshCmdOptDef opts_network_info[] = { static const vshCmdOptDef opts_network_info[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -570,13 +602,37 @@ static const vshCmdInfo info_network_list[] = {
}; };
static const vshCmdOptDef opts_network_list[] = { static const vshCmdOptDef opts_network_list[] = {
{"inactive", VSH_OT_BOOL, 0, N_("list inactive networks")}, {.name = "inactive",
{"all", VSH_OT_BOOL, 0, N_("list inactive & active networks")}, .type = VSH_OT_BOOL,
{"persistent", VSH_OT_BOOL, 0, N_("list persistent networks")}, .flags = 0,
{"transient", VSH_OT_BOOL, 0, N_("list transient networks")}, .help = N_("list inactive networks")
{"autostart", VSH_OT_BOOL, 0, N_("list networks with autostart enabled")}, },
{"no-autostart", VSH_OT_BOOL, 0, N_("list networks with autostart disabled")}, {.name = "all",
{NULL, 0, 0, NULL} .type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list inactive & active networks")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list persistent networks")
},
{.name = "transient",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list transient networks")
},
{.name = "autostart",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list networks with autostart enabled")
},
{.name = "no-autostart",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("list networks with autostart disabled")
},
{.name = NULL}
}; };
static bool static bool
@ -650,8 +706,12 @@ static const vshCmdInfo info_network_name[] = {
}; };
static const vshCmdOptDef opts_network_name[] = { static const vshCmdOptDef opts_network_name[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network uuid")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -678,8 +738,12 @@ static const vshCmdInfo info_network_start[] = {
}; };
static const vshCmdOptDef opts_network_start[] = { static const vshCmdOptDef opts_network_start[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -712,8 +776,12 @@ static const vshCmdInfo info_network_undefine[] = {
}; };
static const vshCmdOptDef opts_network_undefine[] = { static const vshCmdOptDef opts_network_undefine[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -747,19 +815,48 @@ static const vshCmdInfo info_network_update[] = {
}; };
static const vshCmdOptDef opts_network_update[] = { static const vshCmdOptDef opts_network_update[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{"command", VSH_OT_DATA, VSH_OFLAG_REQ, .type = VSH_OT_DATA,
N_("type of update (add-first, add-last (add), delete, or modify)")}, .flags = VSH_OFLAG_REQ,
{"section", VSH_OT_DATA, VSH_OFLAG_REQ, .help = N_("network name or uuid")
N_("which section of network configuration to update")}, },
{"xml", VSH_OT_DATA, VSH_OFLAG_REQ, {.name = "command",
N_("name of file containing xml (or, if it starts with '<', the complete " .type = VSH_OT_DATA,
"xml element itself) to add/modify, or to be matched for search")}, .flags = VSH_OFLAG_REQ,
{"parent-index", VSH_OT_INT, 0, N_("which parent object to search through")}, .help = N_("type of update (add-first, add-last (add), delete, or modify)")
{"config", VSH_OT_BOOL, 0, N_("affect next network startup")}, },
{"live", VSH_OT_BOOL, 0, N_("affect running network")}, {.name = "section",
{"current", VSH_OT_BOOL, 0, N_("affect current state of network")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("which section of network configuration to update")
},
{.name = "xml",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("name of file containing xml (or, if it starts with '<', the complete "
"xml element itself) to add/modify, or to be matched for search")
},
{.name = "parent-index",
.type = VSH_OT_INT,
.flags = 0,
.help = N_("which parent object to search through")
},
{.name = "config",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("affect next network startup")
},
{.name = "live",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("affect running network")
},
{.name = "current",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("affect current state of network")
},
{.name = NULL}
}; };
VIR_ENUM_DECL(virNetworkUpdateCommand) VIR_ENUM_DECL(virNetworkUpdateCommand)
@ -901,8 +998,12 @@ static const vshCmdInfo info_network_uuid[] = {
}; };
static const vshCmdOptDef opts_network_uuid[] = { static const vshCmdOptDef opts_network_uuid[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network name")
},
{.name = NULL}
}; };
static bool static bool
@ -934,8 +1035,12 @@ static const vshCmdInfo info_network_edit[] = {
}; };
static const vshCmdOptDef opts_network_edit[] = { static const vshCmdOptDef opts_network_edit[] = {
{"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, {.name = "network",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("network name or uuid")
},
{.name = NULL}
}; };
static char *vshNetworkGetXMLDesc(virNetworkPtr network) static char *vshNetworkGetXMLDesc(virNetworkPtr network)