vsh: Refactor store of command help and description

Store the pointers to 'help' and 'description' information in the struct
directly rather than in a key-value list.

The generic approach never got any extra use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-03-04 13:21:50 +01:00
parent 7df38644bc
commit 465091d2b8
18 changed files with 1238 additions and 2724 deletions

View File

@ -24,15 +24,10 @@
/* /*
* "backup-begin" command * "backup-begin" command
*/ */
static const vshCmdInfo info_backup_begin[] = { static const vshCmdInfo info_backup_begin = {
{.name = "help", .help = N_("Start a disk backup of a live domain"),
.data = N_("Start a disk backup of a live domain") .desc = N_("Use XML to start a full or incremental disk backup of a live "
}, "domain, optionally creating a checkpoint"),
{.name = "desc",
.data = N_("Use XML to start a full or incremental disk backup of a live "
"domain, optionally creating a checkpoint")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_backup_begin[] = { static const vshCmdOptDef opts_backup_begin[] = {
@ -103,14 +98,9 @@ cmdBackupBegin(vshControl *ctl,
/* /*
* "backup-dumpxml" command * "backup-dumpxml" command
*/ */
static const vshCmdInfo info_backup_dumpxml[] = { static const vshCmdInfo info_backup_dumpxml = {
{.name = "help", .help = N_("Dump XML for an ongoing domain block backup job"),
.data = N_("Dump XML for an ongoing domain block backup job") .desc = N_("Backup Dump XML"),
},
{.name = "desc",
.data = N_("Backup Dump XML")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_backup_dumpxml[] = { static const vshCmdOptDef opts_backup_dumpxml[] = {
@ -154,13 +144,13 @@ const vshCmdDef backupCmds[] = {
{.name = "backup-begin", {.name = "backup-begin",
.handler = cmdBackupBegin, .handler = cmdBackupBegin,
.opts = opts_backup_begin, .opts = opts_backup_begin,
.info = info_backup_begin, .info = &info_backup_begin,
.flags = 0 .flags = 0
}, },
{.name = "backup-dumpxml", {.name = "backup-dumpxml",
.handler = cmdBackupDumpXML, .handler = cmdBackupDumpXML,
.opts = opts_backup_dumpxml, .opts = opts_backup_dumpxml,
.info = info_backup_dumpxml, .info = &info_backup_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -71,15 +71,10 @@ virshCheckpointCreate(vshControl *ctl,
/* /*
* "checkpoint-create" command * "checkpoint-create" command
*/ */
static const vshCmdInfo info_checkpoint_create[] = { static const vshCmdInfo info_checkpoint_create = {
{.name = "help", .help = N_("Create a checkpoint from XML"),
.data = N_("Create a checkpoint from XML") .desc = N_("Create a checkpoint from XML for use in "
}, "future incremental backups"),
{.name = "desc",
.data = N_("Create a checkpoint from XML for use in "
"future incremental backups")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_create[] = { static const vshCmdOptDef opts_checkpoint_create[] = {
@ -183,15 +178,10 @@ virshParseCheckpointDiskspec(vshControl *ctl,
return ret; return ret;
} }
static const vshCmdInfo info_checkpoint_create_as[] = { static const vshCmdInfo info_checkpoint_create_as = {
{.name = "help", .help = N_("Create a checkpoint from a set of args"),
.data = N_("Create a checkpoint from a set of args") .desc = N_("Create a checkpoint from arguments for use in "
}, "future incremental backups"),
{.name = "desc",
.data = N_("Create a checkpoint from arguments for use in "
"future incremental backups")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_create_as[] = { static const vshCmdOptDef opts_checkpoint_create_as[] = {
@ -309,14 +299,9 @@ virshLookupCheckpoint(vshControl *ctl,
/* /*
* "checkpoint-edit" command * "checkpoint-edit" command
*/ */
static const vshCmdInfo info_checkpoint_edit[] = { static const vshCmdInfo info_checkpoint_edit = {
{.name = "help", .help = N_("edit XML for a checkpoint"),
.data = N_("edit XML for a checkpoint") .desc = N_("Edit the domain checkpoint XML for a named checkpoint"),
},
{.name = "desc",
.data = N_("Edit the domain checkpoint XML for a named checkpoint")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_edit[] = { static const vshCmdOptDef opts_checkpoint_edit[] = {
@ -425,14 +410,9 @@ virshGetCheckpointParent(vshControl *ctl,
/* /*
* "checkpoint-info" command * "checkpoint-info" command
*/ */
static const vshCmdInfo info_checkpoint_info[] = { static const vshCmdInfo info_checkpoint_info = {
{.name = "help", .help = N_("checkpoint information"),
.data = N_("checkpoint information") .desc = N_("Returns basic information about a checkpoint."),
},
{.name = "desc",
.data = N_("Returns basic information about a checkpoint.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_info[] = { static const vshCmdOptDef opts_checkpoint_info[] = {
@ -623,14 +603,9 @@ virshCheckpointListLookup(int id,
/* /*
* "checkpoint-list" command * "checkpoint-list" command
*/ */
static const vshCmdInfo info_checkpoint_list[] = { static const vshCmdInfo info_checkpoint_list = {
{.name = "help", .help = N_("List checkpoints for a domain"),
.data = N_("List checkpoints for a domain") .desc = N_("Checkpoint List"),
},
{.name = "desc",
.data = N_("Checkpoint List")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_list[] = { static const vshCmdOptDef opts_checkpoint_list[] = {
@ -825,14 +800,9 @@ cmdCheckpointList(vshControl *ctl,
/* /*
* "checkpoint-dumpxml" command * "checkpoint-dumpxml" command
*/ */
static const vshCmdInfo info_checkpoint_dumpxml[] = { static const vshCmdInfo info_checkpoint_dumpxml = {
{.name = "help", .help = N_("Dump XML for a domain checkpoint"),
.data = N_("Dump XML for a domain checkpoint") .desc = N_("Checkpoint Dump XML"),
},
{.name = "desc",
.data = N_("Checkpoint Dump XML")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_dumpxml[] = { static const vshCmdOptDef opts_checkpoint_dumpxml[] = {
@ -906,14 +876,9 @@ cmdCheckpointDumpXML(vshControl *ctl,
/* /*
* "checkpoint-parent" command * "checkpoint-parent" command
*/ */
static const vshCmdInfo info_checkpoint_parent[] = { static const vshCmdInfo info_checkpoint_parent = {
{.name = "help", .help = N_("Get the name of the parent of a checkpoint"),
.data = N_("Get the name of the parent of a checkpoint") .desc = N_("Extract the checkpoint's parent, if any"),
},
{.name = "desc",
.data = N_("Extract the checkpoint's parent, if any")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_parent[] = { static const vshCmdOptDef opts_checkpoint_parent[] = {
@ -959,14 +924,9 @@ cmdCheckpointParent(vshControl *ctl,
/* /*
* "checkpoint-delete" command * "checkpoint-delete" command
*/ */
static const vshCmdInfo info_checkpoint_delete[] = { static const vshCmdInfo info_checkpoint_delete = {
{.name = "help", .help = N_("Delete a domain checkpoint"),
.data = N_("Delete a domain checkpoint") .desc = N_("Checkpoint Delete"),
},
{.name = "desc",
.data = N_("Checkpoint Delete")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_checkpoint_delete[] = { static const vshCmdOptDef opts_checkpoint_delete[] = {
@ -1034,49 +994,49 @@ const vshCmdDef checkpointCmds[] = {
{.name = "checkpoint-create", {.name = "checkpoint-create",
.handler = cmdCheckpointCreate, .handler = cmdCheckpointCreate,
.opts = opts_checkpoint_create, .opts = opts_checkpoint_create,
.info = info_checkpoint_create, .info = &info_checkpoint_create,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-create-as", {.name = "checkpoint-create-as",
.handler = cmdCheckpointCreateAs, .handler = cmdCheckpointCreateAs,
.opts = opts_checkpoint_create_as, .opts = opts_checkpoint_create_as,
.info = info_checkpoint_create_as, .info = &info_checkpoint_create_as,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-delete", {.name = "checkpoint-delete",
.handler = cmdCheckpointDelete, .handler = cmdCheckpointDelete,
.opts = opts_checkpoint_delete, .opts = opts_checkpoint_delete,
.info = info_checkpoint_delete, .info = &info_checkpoint_delete,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-dumpxml", {.name = "checkpoint-dumpxml",
.handler = cmdCheckpointDumpXML, .handler = cmdCheckpointDumpXML,
.opts = opts_checkpoint_dumpxml, .opts = opts_checkpoint_dumpxml,
.info = info_checkpoint_dumpxml, .info = &info_checkpoint_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-edit", {.name = "checkpoint-edit",
.handler = cmdCheckpointEdit, .handler = cmdCheckpointEdit,
.opts = opts_checkpoint_edit, .opts = opts_checkpoint_edit,
.info = info_checkpoint_edit, .info = &info_checkpoint_edit,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-info", {.name = "checkpoint-info",
.handler = cmdCheckpointInfo, .handler = cmdCheckpointInfo,
.opts = opts_checkpoint_info, .opts = opts_checkpoint_info,
.info = info_checkpoint_info, .info = &info_checkpoint_info,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-list", {.name = "checkpoint-list",
.handler = cmdCheckpointList, .handler = cmdCheckpointList,
.opts = opts_checkpoint_list, .opts = opts_checkpoint_list,
.info = info_checkpoint_list, .info = &info_checkpoint_list,
.flags = 0 .flags = 0
}, },
{.name = "checkpoint-parent", {.name = "checkpoint-parent",
.handler = cmdCheckpointParent, .handler = cmdCheckpointParent,
.opts = opts_checkpoint_parent, .opts = opts_checkpoint_parent,
.info = info_checkpoint_parent, .info = &info_checkpoint_parent,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -859,14 +859,9 @@ virshDomainEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
} }
static const vshCmdInfo info_event[] = { static const vshCmdInfo info_event = {
{.name = "help", .help = N_("Domain Events"),
.data = N_("Domain Events") .desc = N_("List event types, or wait for domain events to occur"),
},
{.name = "desc",
.data = N_("List event types, or wait for domain events to occur")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_event[] = { static const vshCmdOptDef opts_event[] = {
@ -1017,7 +1012,7 @@ const vshCmdDef domEventCmds[] = {
{.name = "event", {.name = "event",
.handler = cmdEvent, .handler = cmdEvent,
.opts = opts_event, .opts = opts_event,
.info = info_event, .info = &info_event,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -268,14 +268,9 @@ virshDomainStateReasonToString(int state, int reason)
/* /*
* "dommemstat" command * "dommemstat" command
*/ */
static const vshCmdInfo info_dommemstat[] = { static const vshCmdInfo info_dommemstat = {
{.name = "help", .help = N_("get memory statistics for a domain"),
.data = N_("get memory statistics for a domain") .desc = N_("Get memory statistics for a running domain."),
},
{.name = "desc",
.data = N_("Get memory statistics for a running domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_dommemstat[] = { static const vshCmdOptDef opts_dommemstat[] = {
@ -381,14 +376,9 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domblkinfo" command * "domblkinfo" command
*/ */
static const vshCmdInfo info_domblkinfo[] = { static const vshCmdInfo info_domblkinfo = {
{.name = "help", .help = N_("domain block device size information"),
.data = N_("domain block device size information") .desc = N_("Get block device size info for a domain."),
},
{.name = "desc",
.data = N_("Get block device size info for a domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domblkinfo[] = { static const vshCmdOptDef opts_domblkinfo[] = {
@ -545,14 +535,9 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domblklist" command * "domblklist" command
*/ */
static const vshCmdInfo info_domblklist[] = { static const vshCmdInfo info_domblklist = {
{.name = "help", .help = N_("list all domain blocks"),
.data = N_("list all domain blocks") .desc = N_("Get the summary of block devices for a domain."),
},
{.name = "desc",
.data = N_("Get the summary of block devices for a domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domblklist[] = { static const vshCmdOptDef opts_domblklist[] = {
@ -666,10 +651,9 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domiflist" command * "domiflist" command
*/ */
static const vshCmdInfo info_domiflist[] = { static const vshCmdInfo info_domiflist = {
{"help", N_("list all domain virtual interfaces")}, .help = N_("list all domain virtual interfaces"),
{"desc", N_("Get the summary of virtual interfaces for a domain.")}, .desc = N_("Get the summary of virtual interfaces for a domain."),
{NULL, NULL}
}; };
static const vshCmdOptDef opts_domiflist[] = { static const vshCmdOptDef opts_domiflist[] = {
@ -745,14 +729,9 @@ cmdDomiflist(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domif-getlink" command * "domif-getlink" command
*/ */
static const vshCmdInfo info_domif_getlink[] = { static const vshCmdInfo info_domif_getlink = {
{.name = "help", .help = N_("get link state of a virtual interface"),
.data = N_("get link state of a virtual interface") .desc = N_("Get link state of a domain's virtual interface."),
},
{.name = "desc",
.data = N_("Get link state of a domain's virtual interface.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domif_getlink[] = { static const vshCmdOptDef opts_domif_getlink[] = {
@ -832,14 +811,9 @@ cmdDomIfGetLink(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domcontrol" command * "domcontrol" command
*/ */
static const vshCmdInfo info_domcontrol[] = { static const vshCmdInfo info_domcontrol = {
{.name = "help", .help = N_("domain control interface state"),
.data = N_("domain control interface state") .desc = N_("Returns state of a control interface to the domain."),
},
{.name = "desc",
.data = N_("Returns state of a control interface to the domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domcontrol[] = { static const vshCmdOptDef opts_domcontrol[] = {
@ -879,15 +853,10 @@ cmdDomControl(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domblkstat" command * "domblkstat" command
*/ */
static const vshCmdInfo info_domblkstat[] = { static const vshCmdInfo info_domblkstat = {
{.name = "help", .help = N_("get device block stats for a domain"),
.data = N_("get device block stats for a domain") .desc = N_("Get device block stats for a running domain. See man page or "
}, "use --human for explanation of fields"),
{.name = "desc",
.data = N_("Get device block stats for a running domain. See man page or "
"use --human for explanation of fields")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domblkstat[] = { static const vshCmdOptDef opts_domblkstat[] = {
@ -1060,14 +1029,9 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domifstat" command * "domifstat" command
*/ */
static const vshCmdInfo info_domifstat[] = { static const vshCmdInfo info_domifstat = {
{.name = "help", .help = N_("get network interface stats for a domain"),
.data = N_("get network interface stats for a domain") .desc = N_("Get network interface stats for a running domain."),
},
{.name = "desc",
.data = N_("Get network interface stats for a running domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domifstat[] = { static const vshCmdOptDef opts_domifstat[] = {
@ -1129,14 +1093,9 @@ cmdDomIfstat(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domblkerror" command * "domblkerror" command
*/ */
static const vshCmdInfo info_domblkerror[] = { static const vshCmdInfo info_domblkerror = {
{.name = "help", .help = N_("Show errors on block devices"),
.data = N_("Show errors on block devices") .desc = N_("Show block device errors"),
},
{.name = "desc",
.data = N_("Show block device errors")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domblkerror[] = { static const vshCmdOptDef opts_domblkerror[] = {
@ -1190,14 +1149,9 @@ cmdDomBlkError(vshControl *ctl, const vshCmd *cmd)
/* /*
* "dominfo" command * "dominfo" command
*/ */
static const vshCmdInfo info_dominfo[] = { static const vshCmdInfo info_dominfo = {
{.name = "help", .help = N_("domain information"),
.data = N_("domain information") .desc = N_("Returns basic information about the domain."),
},
{.name = "desc",
.data = N_("Returns basic information about the domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_dominfo[] = { static const vshCmdOptDef opts_dominfo[] = {
@ -1328,14 +1282,9 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domstate" command * "domstate" command
*/ */
static const vshCmdInfo info_domstate[] = { static const vshCmdInfo info_domstate = {
{.name = "help", .help = N_("domain state"),
.data = N_("domain state") .desc = N_("Returns state about a domain."),
},
{.name = "desc",
.data = N_("Returns state about a domain.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domstate[] = { static const vshCmdOptDef opts_domstate[] = {
@ -1375,14 +1324,9 @@ cmdDomstate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domtime" command * "domtime" command
*/ */
static const vshCmdInfo info_domtime[] = { static const vshCmdInfo info_domtime = {
{.name = "help", .help = N_("domain time"),
.data = N_("domain time") .desc = N_("Gets or sets the domain's system time"),
},
{.name = "desc",
.data = N_("Gets or sets the domain's system time")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domtime[] = { static const vshCmdOptDef opts_domtime[] = {
@ -1471,14 +1415,9 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd)
/* /*
* "list" command * "list" command
*/ */
static const vshCmdInfo info_list[] = { static const vshCmdInfo info_list = {
{.name = "help", .help = N_("list domains"),
.data = N_("list domains") .desc = N_("Returns list of domains."),
},
{.name = "desc",
.data = N_("Returns list of domains.")
},
{.name = NULL}
}; };
/* compare domains, pack NULLed ones at the end */ /* compare domains, pack NULLed ones at the end */
@ -2011,14 +1950,9 @@ cmdList(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domstats" command * "domstats" command
*/ */
static const vshCmdInfo info_domstats[] = { static const vshCmdInfo info_domstats = {
{.name = "help", .help = N_("get statistics about one or multiple domains"),
.data = N_("get statistics about one or multiple domains") .desc = N_("Gets statistics about one or more (or all) domains"),
},
{.name = "desc",
.data = N_("Gets statistics about one or more (or all) domains")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domstats[] = { static const vshCmdOptDef opts_domstats[] = {
@ -2269,10 +2203,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd)
/* "domifaddr" command /* "domifaddr" command
*/ */
static const vshCmdInfo info_domifaddr[] = { static const vshCmdInfo info_domifaddr = {
{"help", N_("Get network interfaces' addresses for a running domain")}, .help = N_("Get network interfaces' addresses for a running domain"),
{"desc", N_("Get network interfaces' addresses for a running domain")}, .desc = N_("Get network interfaces' addresses for a running domain"),
{NULL, NULL}
}; };
static const vshCmdOptDef opts_domifaddr[] = { static const vshCmdOptDef opts_domifaddr[] = {
@ -2401,91 +2334,91 @@ const vshCmdDef domMonitoringCmds[] = {
{.name = "domblkerror", {.name = "domblkerror",
.handler = cmdDomBlkError, .handler = cmdDomBlkError,
.opts = opts_domblkerror, .opts = opts_domblkerror,
.info = info_domblkerror, .info = &info_domblkerror,
.flags = 0 .flags = 0
}, },
{.name = "domblkinfo", {.name = "domblkinfo",
.handler = cmdDomblkinfo, .handler = cmdDomblkinfo,
.opts = opts_domblkinfo, .opts = opts_domblkinfo,
.info = info_domblkinfo, .info = &info_domblkinfo,
.flags = 0 .flags = 0
}, },
{.name = "domblklist", {.name = "domblklist",
.handler = cmdDomblklist, .handler = cmdDomblklist,
.opts = opts_domblklist, .opts = opts_domblklist,
.info = info_domblklist, .info = &info_domblklist,
.flags = 0 .flags = 0
}, },
{.name = "domblkstat", {.name = "domblkstat",
.handler = cmdDomblkstat, .handler = cmdDomblkstat,
.opts = opts_domblkstat, .opts = opts_domblkstat,
.info = info_domblkstat, .info = &info_domblkstat,
.flags = 0 .flags = 0
}, },
{.name = "domcontrol", {.name = "domcontrol",
.handler = cmdDomControl, .handler = cmdDomControl,
.opts = opts_domcontrol, .opts = opts_domcontrol,
.info = info_domcontrol, .info = &info_domcontrol,
.flags = 0 .flags = 0
}, },
{.name = "domif-getlink", {.name = "domif-getlink",
.handler = cmdDomIfGetLink, .handler = cmdDomIfGetLink,
.opts = opts_domif_getlink, .opts = opts_domif_getlink,
.info = info_domif_getlink, .info = &info_domif_getlink,
.flags = 0 .flags = 0
}, },
{.name = "domifaddr", {.name = "domifaddr",
.handler = cmdDomIfAddr, .handler = cmdDomIfAddr,
.opts = opts_domifaddr, .opts = opts_domifaddr,
.info = info_domifaddr, .info = &info_domifaddr,
.flags = 0 .flags = 0
}, },
{.name = "domiflist", {.name = "domiflist",
.handler = cmdDomiflist, .handler = cmdDomiflist,
.opts = opts_domiflist, .opts = opts_domiflist,
.info = info_domiflist, .info = &info_domiflist,
.flags = 0 .flags = 0
}, },
{.name = "domifstat", {.name = "domifstat",
.handler = cmdDomIfstat, .handler = cmdDomIfstat,
.opts = opts_domifstat, .opts = opts_domifstat,
.info = info_domifstat, .info = &info_domifstat,
.flags = 0 .flags = 0
}, },
{.name = "dominfo", {.name = "dominfo",
.handler = cmdDominfo, .handler = cmdDominfo,
.opts = opts_dominfo, .opts = opts_dominfo,
.info = info_dominfo, .info = &info_dominfo,
.flags = 0 .flags = 0
}, },
{.name = "dommemstat", {.name = "dommemstat",
.handler = cmdDomMemStat, .handler = cmdDomMemStat,
.opts = opts_dommemstat, .opts = opts_dommemstat,
.info = info_dommemstat, .info = &info_dommemstat,
.flags = 0 .flags = 0
}, },
{.name = "domstate", {.name = "domstate",
.handler = cmdDomstate, .handler = cmdDomstate,
.opts = opts_domstate, .opts = opts_domstate,
.info = info_domstate, .info = &info_domstate,
.flags = 0 .flags = 0
}, },
{.name = "domstats", {.name = "domstats",
.handler = cmdDomstats, .handler = cmdDomstats,
.opts = opts_domstats, .opts = opts_domstats,
.info = info_domstats, .info = &info_domstats,
.flags = 0 .flags = 0
}, },
{.name = "domtime", {.name = "domtime",
.handler = cmdDomTime, .handler = cmdDomTime,
.opts = opts_domtime, .opts = opts_domtime,
.info = info_domtime, .info = &info_domtime,
.flags = 0 .flags = 0
}, },
{.name = "list", {.name = "list",
.handler = cmdList, .handler = cmdList,
.opts = opts_list, .opts = opts_list,
.info = info_list, .info = &info_list,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

File diff suppressed because it is too large Load Diff

View File

@ -37,14 +37,9 @@
/* /*
* "capabilities" command * "capabilities" command
*/ */
static const vshCmdInfo info_capabilities[] = { static const vshCmdInfo info_capabilities = {
{.name = "help", .help = N_("capabilities"),
.data = N_("capabilities") .desc = N_("Returns capabilities of hypervisor/driver."),
},
{.name = "desc",
.data = N_("Returns capabilities of hypervisor/driver.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_capabilities[] = { static const vshCmdOptDef opts_capabilities[] = {
@ -83,14 +78,9 @@ cmdCapabilities(vshControl *ctl, const vshCmd *cmd)
/* /*
* "domcapabilities" command * "domcapabilities" command
*/ */
static const vshCmdInfo info_domcapabilities[] = { static const vshCmdInfo info_domcapabilities = {
{.name = "help", .help = N_("domain capabilities"),
.data = N_("domain capabilities") .desc = N_("Returns capabilities of emulator with respect to host and libvirt."),
},
{.name = "desc",
.data = N_("Returns capabilities of emulator with respect to host and libvirt.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_domcapabilities[] = { static const vshCmdOptDef opts_domcapabilities[] = {
@ -158,14 +148,9 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd)
/* /*
* "freecell" command * "freecell" command
*/ */
static const vshCmdInfo info_freecell[] = { static const vshCmdInfo info_freecell = {
{.name = "help", .help = N_("NUMA free memory"),
.data = N_("NUMA free memory") .desc = N_("display available free memory for the NUMA cell."),
},
{.name = "desc",
.data = N_("display available free memory for the NUMA cell.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_freecell[] = { static const vshCmdOptDef opts_freecell[] = {
@ -271,14 +256,9 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
/* /*
* "freepages" command * "freepages" command
*/ */
static const vshCmdInfo info_freepages[] = { static const vshCmdInfo info_freepages = {
{.name = "help", .help = N_("NUMA free pages"),
.data = N_("NUMA free pages") .desc = N_("display available free pages for the NUMA cell."),
},
{.name = "desc",
.data = N_("display available free pages for the NUMA cell.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_freepages[] = { static const vshCmdOptDef opts_freepages[] = {
@ -481,14 +461,9 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
/* /*
* "allocpages" command * "allocpages" command
*/ */
static const vshCmdInfo info_allocpages[] = { static const vshCmdInfo info_allocpages = {
{.name = "help", .help = N_("Manipulate pages pool size"),
.data = N_("Manipulate pages pool size") .desc = N_("Allocate or free some pages in the pool for NUMA cell."),
},
{.name = "desc",
.data = N_("Allocate or free some pages in the pool for NUMA cell.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_allocpages[] = { static const vshCmdOptDef opts_allocpages[] = {
{.name = "pagesize", {.name = "pagesize",
@ -597,14 +572,9 @@ cmdAllocpages(vshControl *ctl, const vshCmd *cmd)
/* /*
* "maxvcpus" command * "maxvcpus" command
*/ */
static const vshCmdInfo info_maxvcpus[] = { static const vshCmdInfo info_maxvcpus = {
{.name = "help", .help = N_("connection vcpu maximum"),
.data = N_("connection vcpu maximum") .desc = N_("Show maximum number of virtual CPUs for guests on this connection."),
},
{.name = "desc",
.data = N_("Show maximum number of virtual CPUs for guests on this connection.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_maxvcpus[] = { static const vshCmdOptDef opts_maxvcpus[] = {
@ -650,14 +620,9 @@ cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodeinfo" command * "nodeinfo" command
*/ */
static const vshCmdInfo info_nodeinfo[] = { static const vshCmdInfo info_nodeinfo = {
{.name = "help", .help = N_("node information"),
.data = N_("node information") .desc = N_("Returns basic information about the node."),
},
{.name = "desc",
.data = N_("Returns basic information about the node.")
},
{.name = NULL}
}; };
static bool static bool
@ -686,15 +651,10 @@ cmdNodeinfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "nodecpumap" command * "nodecpumap" command
*/ */
static const vshCmdInfo info_node_cpumap[] = { static const vshCmdInfo info_node_cpumap = {
{.name = "help", .help = N_("node cpu map"),
.data = N_("node cpu map") .desc = N_("Displays the node's total number of CPUs, the number of"
}, " online CPUs and the list of online CPUs."),
{.name = "desc",
.data = N_("Displays the node's total number of CPUs, the number of"
" online CPUs and the list of online CPUs.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_cpumap[] = { static const vshCmdOptDef opts_node_cpumap[] = {
@ -742,14 +702,9 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "nodecpustats" command * "nodecpustats" command
*/ */
static const vshCmdInfo info_nodecpustats[] = { static const vshCmdInfo info_nodecpustats = {
{.name = "help", .help = N_("Prints cpu stats of the node."),
.data = N_("Prints cpu stats of the node.") .desc = N_("Returns cpu stats of the node, in nanoseconds."),
},
{.name = "desc",
.data = N_("Returns cpu stats of the node, in nanoseconds.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_cpustats[] = { static const vshCmdOptDef opts_node_cpustats[] = {
@ -885,14 +840,9 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodememstats" command * "nodememstats" command
*/ */
static const vshCmdInfo info_nodememstats[] = { static const vshCmdInfo info_nodememstats = {
{.name = "help", .help = N_("Prints memory stats of the node."),
.data = N_("Prints memory stats of the node.") .desc = N_("Returns memory stats of the node, in kilobytes."),
},
{.name = "desc",
.data = N_("Returns memory stats of the node, in kilobytes.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_memstats[] = { static const vshCmdOptDef opts_node_memstats[] = {
@ -943,14 +893,9 @@ cmdNodeMemStats(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodesevinfo" command * "nodesevinfo" command
*/ */
static const vshCmdInfo info_nodesevinfo[] = { static const vshCmdInfo info_nodesevinfo = {
{.name = "help", .help = N_("node SEV information"),
.data = N_("node SEV information") .desc = N_("Returns basic SEV information about the node."),
},
{.name = "desc",
.data = N_("Returns basic SEV information about the node.")
},
{.name = NULL}
}; };
static bool static bool
@ -989,15 +934,10 @@ VIR_ENUM_IMPL(virshNodeSuspendTarget,
"disk", "disk",
"hybrid"); "hybrid");
static const vshCmdInfo info_nodesuspend[] = { static const vshCmdInfo info_nodesuspend = {
{.name = "help", .help = N_("suspend the host node for a given time duration"),
.data = N_("suspend the host node for a given time duration") .desc = N_("Suspend the host node for a given time duration "
}, "and attempt to resume thereafter."),
{.name = "desc",
.data = N_("Suspend the host node for a given time duration "
"and attempt to resume thereafter.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_suspend[] = { static const vshCmdOptDef opts_node_suspend[] = {
@ -1050,14 +990,9 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
/* /*
* "sysinfo" command * "sysinfo" command
*/ */
static const vshCmdInfo info_sysinfo[] = { static const vshCmdInfo info_sysinfo = {
{.name = "help", .help = N_("print the hypervisor sysinfo"),
.data = N_("print the hypervisor sysinfo") .desc = N_("output an XML string for the hypervisor sysinfo, if available"),
},
{.name = "desc",
.data = N_("output an XML string for the hypervisor sysinfo, if available")
},
{.name = NULL}
}; };
static bool static bool
@ -1080,14 +1015,9 @@ cmdSysinfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "hostname" command * "hostname" command
*/ */
static const vshCmdInfo info_hostname[] = { static const vshCmdInfo info_hostname = {
{.name = "help", .help = N_("print the hypervisor hostname"),
.data = N_("print the hypervisor hostname") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static bool static bool
@ -1110,14 +1040,9 @@ cmdHostname(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "uri" command * "uri" command
*/ */
static const vshCmdInfo info_uri[] = { static const vshCmdInfo info_uri = {
{.name = "help", .help = N_("print the hypervisor canonical URI"),
.data = N_("print the hypervisor canonical URI") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static bool static bool
@ -1218,14 +1143,9 @@ vshExtractCPUDefXMLs(vshControl *ctl,
/* /*
* "cpu-compare" command * "cpu-compare" command
*/ */
static const vshCmdInfo info_cpu_compare[] = { static const vshCmdInfo info_cpu_compare = {
{.name = "help", .help = N_("compare host CPU with a CPU described by an XML file"),
.data = N_("compare host CPU with a CPU described by an XML file") .desc = N_("compare CPU with host CPU"),
},
{.name = "desc",
.data = N_("compare CPU with host CPU")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_cpu_compare[] = { static const vshCmdOptDef opts_cpu_compare[] = {
@ -1293,14 +1213,9 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd)
/* /*
* "cpu-baseline" command * "cpu-baseline" command
*/ */
static const vshCmdInfo info_cpu_baseline[] = { static const vshCmdInfo info_cpu_baseline = {
{.name = "help", .help = N_("compute baseline CPU"),
.data = N_("compute baseline CPU") .desc = N_("Compute baseline CPU for a set of given CPUs."),
},
{.name = "desc",
.data = N_("Compute baseline CPU for a set of given CPUs.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_cpu_baseline[] = { static const vshCmdOptDef opts_cpu_baseline[] = {
@ -1347,14 +1262,9 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd)
/* /*
* "cpu-models" command * "cpu-models" command
*/ */
static const vshCmdInfo info_cpu_models[] = { static const vshCmdInfo info_cpu_models = {
{.name = "help", .help = N_("CPU models"),
.data = N_("CPU models") .desc = N_("Get the CPU models for an arch."),
},
{.name = "desc",
.data = N_("Get the CPU models for an arch.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_cpu_models[] = { static const vshCmdOptDef opts_cpu_models[] = {
@ -1401,14 +1311,9 @@ cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd)
/* /*
* "version" command * "version" command
*/ */
static const vshCmdInfo info_version[] = { static const vshCmdInfo info_version = {
{.name = "help", .help = N_("show version"),
.data = N_("show version") .desc = N_("Display the system version information."),
},
{.name = "desc",
.data = N_("Display the system version information.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_version[] = { static const vshCmdOptDef opts_version[] = {
@ -1503,10 +1408,9 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
return true; return true;
} }
static const vshCmdInfo info_node_memory_tune[] = { static const vshCmdInfo info_node_memory_tune = {
{"help", N_("Get or set node memory parameters")}, .help = N_("Get or set node memory parameters"),
{"desc", N_("Get or set node memory parameters")}, .desc = N_("Get or set node memory parameters"),
{NULL, NULL}
}; };
static const vshCmdOptDef opts_node_memory_tune[] = { static const vshCmdOptDef opts_node_memory_tune[] = {
@ -1617,14 +1521,9 @@ cmdNodeMemoryTune(vshControl *ctl, const vshCmd *cmd)
/* /*
* "hypervisor-cpu-compare" command * "hypervisor-cpu-compare" command
*/ */
static const vshCmdInfo info_hypervisor_cpu_compare[] = { static const vshCmdInfo info_hypervisor_cpu_compare = {
{.name = "help", .help = N_("compare a CPU with the CPU created by a hypervisor on the host"),
.data = N_("compare a CPU with the CPU created by a hypervisor on the host") .desc = N_("compare CPU with hypervisor CPU"),
},
{.name = "desc",
.data = N_("compare CPU with hypervisor CPU")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_hypervisor_cpu_compare[] = { static const vshCmdOptDef opts_hypervisor_cpu_compare[] = {
@ -1724,15 +1623,10 @@ cmdHypervisorCPUCompare(vshControl *ctl,
/* /*
* "hypervisor-cpu-baseline" command * "hypervisor-cpu-baseline" command
*/ */
static const vshCmdInfo info_hypervisor_cpu_baseline[] = { static const vshCmdInfo info_hypervisor_cpu_baseline = {
{.name = "help", .help = N_("compute baseline CPU usable by a specific hypervisor"),
.data = N_("compute baseline CPU usable by a specific hypervisor") .desc = N_("Compute baseline CPU for a set of given CPUs. The result "
}, "will be tailored to the specified hypervisor."),
{.name = "desc",
.data = N_("Compute baseline CPU for a set of given CPUs. The result "
"will be tailored to the specified hypervisor.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_hypervisor_cpu_baseline[] = { static const vshCmdOptDef opts_hypervisor_cpu_baseline[] = {
@ -1831,133 +1725,133 @@ const vshCmdDef hostAndHypervisorCmds[] = {
{.name = "allocpages", {.name = "allocpages",
.handler = cmdAllocpages, .handler = cmdAllocpages,
.opts = opts_allocpages, .opts = opts_allocpages,
.info = info_allocpages, .info = &info_allocpages,
.flags = 0 .flags = 0
}, },
{.name = "capabilities", {.name = "capabilities",
.handler = cmdCapabilities, .handler = cmdCapabilities,
.opts = opts_capabilities, .opts = opts_capabilities,
.info = info_capabilities, .info = &info_capabilities,
.flags = 0 .flags = 0
}, },
{.name = "cpu-baseline", {.name = "cpu-baseline",
.handler = cmdCPUBaseline, .handler = cmdCPUBaseline,
.opts = opts_cpu_baseline, .opts = opts_cpu_baseline,
.info = info_cpu_baseline, .info = &info_cpu_baseline,
.flags = 0 .flags = 0
}, },
{.name = "cpu-compare", {.name = "cpu-compare",
.handler = cmdCPUCompare, .handler = cmdCPUCompare,
.opts = opts_cpu_compare, .opts = opts_cpu_compare,
.info = info_cpu_compare, .info = &info_cpu_compare,
.flags = 0 .flags = 0
}, },
{.name = "cpu-models", {.name = "cpu-models",
.handler = cmdCPUModelNames, .handler = cmdCPUModelNames,
.opts = opts_cpu_models, .opts = opts_cpu_models,
.info = info_cpu_models, .info = &info_cpu_models,
.flags = 0 .flags = 0
}, },
{.name = "domcapabilities", {.name = "domcapabilities",
.handler = cmdDomCapabilities, .handler = cmdDomCapabilities,
.opts = opts_domcapabilities, .opts = opts_domcapabilities,
.info = info_domcapabilities, .info = &info_domcapabilities,
.flags = 0 .flags = 0
}, },
{.name = "freecell", {.name = "freecell",
.handler = cmdFreecell, .handler = cmdFreecell,
.opts = opts_freecell, .opts = opts_freecell,
.info = info_freecell, .info = &info_freecell,
.flags = 0 .flags = 0
}, },
{.name = "freepages", {.name = "freepages",
.handler = cmdFreepages, .handler = cmdFreepages,
.opts = opts_freepages, .opts = opts_freepages,
.info = info_freepages, .info = &info_freepages,
.flags = 0 .flags = 0
}, },
{.name = "hostname", {.name = "hostname",
.handler = cmdHostname, .handler = cmdHostname,
.opts = NULL, .opts = NULL,
.info = info_hostname, .info = &info_hostname,
.flags = 0 .flags = 0
}, },
{.name = "hypervisor-cpu-baseline", {.name = "hypervisor-cpu-baseline",
.handler = cmdHypervisorCPUBaseline, .handler = cmdHypervisorCPUBaseline,
.opts = opts_hypervisor_cpu_baseline, .opts = opts_hypervisor_cpu_baseline,
.info = info_hypervisor_cpu_baseline, .info = &info_hypervisor_cpu_baseline,
.flags = 0 .flags = 0
}, },
{.name = "hypervisor-cpu-compare", {.name = "hypervisor-cpu-compare",
.handler = cmdHypervisorCPUCompare, .handler = cmdHypervisorCPUCompare,
.opts = opts_hypervisor_cpu_compare, .opts = opts_hypervisor_cpu_compare,
.info = info_hypervisor_cpu_compare, .info = &info_hypervisor_cpu_compare,
.flags = 0 .flags = 0
}, },
{.name = "maxvcpus", {.name = "maxvcpus",
.handler = cmdMaxvcpus, .handler = cmdMaxvcpus,
.opts = opts_maxvcpus, .opts = opts_maxvcpus,
.info = info_maxvcpus, .info = &info_maxvcpus,
.flags = 0 .flags = 0
}, },
{.name = "node-memory-tune", {.name = "node-memory-tune",
.handler = cmdNodeMemoryTune, .handler = cmdNodeMemoryTune,
.opts = opts_node_memory_tune, .opts = opts_node_memory_tune,
.info = info_node_memory_tune, .info = &info_node_memory_tune,
.flags = 0 .flags = 0
}, },
{.name = "nodecpumap", {.name = "nodecpumap",
.handler = cmdNodeCpuMap, .handler = cmdNodeCpuMap,
.opts = opts_node_cpumap, .opts = opts_node_cpumap,
.info = info_node_cpumap, .info = &info_node_cpumap,
.flags = 0 .flags = 0
}, },
{.name = "nodecpustats", {.name = "nodecpustats",
.handler = cmdNodeCpuStats, .handler = cmdNodeCpuStats,
.opts = opts_node_cpustats, .opts = opts_node_cpustats,
.info = info_nodecpustats, .info = &info_nodecpustats,
.flags = 0 .flags = 0
}, },
{.name = "nodeinfo", {.name = "nodeinfo",
.handler = cmdNodeinfo, .handler = cmdNodeinfo,
.opts = NULL, .opts = NULL,
.info = info_nodeinfo, .info = &info_nodeinfo,
.flags = 0 .flags = 0
}, },
{.name = "nodememstats", {.name = "nodememstats",
.handler = cmdNodeMemStats, .handler = cmdNodeMemStats,
.opts = opts_node_memstats, .opts = opts_node_memstats,
.info = info_nodememstats, .info = &info_nodememstats,
.flags = 0 .flags = 0
}, },
{.name = "nodesevinfo", {.name = "nodesevinfo",
.handler = cmdNodeSEVInfo, .handler = cmdNodeSEVInfo,
.opts = NULL, .opts = NULL,
.info = info_nodesevinfo, .info = &info_nodesevinfo,
.flags = 0 .flags = 0
}, },
{.name = "nodesuspend", {.name = "nodesuspend",
.handler = cmdNodeSuspend, .handler = cmdNodeSuspend,
.opts = opts_node_suspend, .opts = opts_node_suspend,
.info = info_nodesuspend, .info = &info_nodesuspend,
.flags = 0 .flags = 0
}, },
{.name = "sysinfo", {.name = "sysinfo",
.handler = cmdSysinfo, .handler = cmdSysinfo,
.opts = NULL, .opts = NULL,
.info = info_sysinfo, .info = &info_sysinfo,
.flags = 0 .flags = 0
}, },
{.name = "uri", {.name = "uri",
.handler = cmdURI, .handler = cmdURI,
.opts = NULL, .opts = NULL,
.info = info_uri, .info = &info_uri,
.flags = 0 .flags = 0
}, },
{.name = "version", {.name = "version",
.handler = cmdVersion, .handler = cmdVersion,
.opts = opts_version, .opts = opts_version,
.info = info_version, .info = &info_version,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -91,14 +91,9 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd,
/* /*
* "iface-edit" command * "iface-edit" command
*/ */
static const vshCmdInfo info_interface_edit[] = { static const vshCmdInfo info_interface_edit = {
{.name = "help", .help = N_("edit XML configuration for a physical host interface"),
.data = N_("edit XML configuration for a physical host interface") .desc = N_("Edit the XML configuration for a physical host interface."),
},
{.name = "desc",
.data = N_("Edit the XML configuration for a physical host interface.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_edit[] = { static const vshCmdOptDef opts_interface_edit[] = {
@ -314,14 +309,9 @@ virshInterfaceListCollect(vshControl *ctl,
/* /*
* "iface-list" command * "iface-list" command
*/ */
static const vshCmdInfo info_interface_list[] = { static const vshCmdInfo info_interface_list = {
{.name = "help", .help = N_("list physical host interfaces"),
.data = N_("list physical host interfaces") .desc = N_("Returns list of physical host interfaces."),
},
{.name = "desc",
.data = N_("Returns list of physical host interfaces.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_list[] = { static const vshCmdOptDef opts_interface_list[] = {
@ -385,14 +375,9 @@ cmdInterfaceList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "iface-name" command * "iface-name" command
*/ */
static const vshCmdInfo info_interface_name[] = { static const vshCmdInfo info_interface_name = {
{.name = "help", .help = N_("convert an interface MAC address to interface name"),
.data = N_("convert an interface MAC address to interface name") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_name[] = { static const vshCmdOptDef opts_interface_name[] = {
@ -421,14 +406,9 @@ cmdInterfaceName(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-mac" command * "iface-mac" command
*/ */
static const vshCmdInfo info_interface_mac[] = { static const vshCmdInfo info_interface_mac = {
{.name = "help", .help = N_("convert an interface name to interface MAC address"),
.data = N_("convert an interface name to interface MAC address") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_mac[] = { static const vshCmdOptDef opts_interface_mac[] = {
@ -457,14 +437,9 @@ cmdInterfaceMAC(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-dumpxml" command * "iface-dumpxml" command
*/ */
static const vshCmdInfo info_interface_dumpxml[] = { static const vshCmdInfo info_interface_dumpxml = {
{.name = "help", .help = N_("interface information in XML"),
.data = N_("interface information in XML") .desc = N_("Output the physical host interface information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the physical host interface information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_dumpxml[] = { static const vshCmdOptDef opts_interface_dumpxml[] = {
@ -514,15 +489,10 @@ cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-define" command * "iface-define" command
*/ */
static const vshCmdInfo info_interface_define[] = { static const vshCmdInfo info_interface_define = {
{.name = "help", .help = N_("define an inactive persistent physical host interface or "
.data = N_("define an inactive persistent physical host interface or " "modify an existing persistent one from an XML file"),
"modify an existing persistent one from an XML file") .desc = N_("Define or modify a persistent physical host interface."),
},
{.name = "desc",
.data = N_("Define or modify a persistent physical host interface.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_define[] = { static const vshCmdOptDef opts_interface_define[] = {
@ -565,14 +535,9 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-undefine" command * "iface-undefine" command
*/ */
static const vshCmdInfo info_interface_undefine[] = { static const vshCmdInfo info_interface_undefine = {
{.name = "help", .help = N_("undefine a physical host interface (remove it from configuration)"),
.data = N_("undefine a physical host interface (remove it from configuration)") .desc = N_("undefine an interface."),
},
{.name = "desc",
.data = N_("undefine an interface.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_undefine[] = { static const vshCmdOptDef opts_interface_undefine[] = {
@ -601,14 +566,9 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-start" command * "iface-start" command
*/ */
static const vshCmdInfo info_interface_start[] = { static const vshCmdInfo info_interface_start = {
{.name = "help", .help = N_("start a physical host interface (enable it / \"if-up\")"),
.data = N_("start a physical host interface (enable it / \"if-up\")") .desc = N_("start a physical host interface."),
},
{.name = "desc",
.data = N_("start a physical host interface.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_start[] = { static const vshCmdOptDef opts_interface_start[] = {
@ -637,14 +597,9 @@ cmdInterfaceStart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-destroy" command * "iface-destroy" command
*/ */
static const vshCmdInfo info_interface_destroy[] = { static const vshCmdInfo info_interface_destroy = {
{.name = "help", .help = N_("destroy a physical host interface (disable it / \"if-down\")"),
.data = N_("destroy a physical host interface (disable it / \"if-down\")") .desc = N_("forcefully stop a physical host interface."),
},
{.name = "desc",
.data = N_("forcefully stop a physical host interface.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_destroy[] = { static const vshCmdOptDef opts_interface_destroy[] = {
@ -673,16 +628,11 @@ cmdInterfaceDestroy(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-begin" command * "iface-begin" command
*/ */
static const vshCmdInfo info_interface_begin[] = { static const vshCmdInfo info_interface_begin = {
{.name = "help", .help = N_("create a snapshot of current interfaces settings, "
.data = N_("create a snapshot of current interfaces settings, "
"which can be later committed (iface-commit) or " "which can be later committed (iface-commit) or "
"restored (iface-rollback)") "restored (iface-rollback)"),
}, .desc = N_("Create a restore point for interfaces settings"),
{.name = "desc",
.data = N_("Create a restore point for interfaces settings")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_begin[] = { static const vshCmdOptDef opts_interface_begin[] = {
@ -706,14 +656,9 @@ cmdInterfaceBegin(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "iface-commit" command * "iface-commit" command
*/ */
static const vshCmdInfo info_interface_commit[] = { static const vshCmdInfo info_interface_commit = {
{.name = "help", .help = N_("commit changes made since iface-begin and free restore point"),
.data = N_("commit changes made since iface-begin and free restore point") .desc = N_("commit changes and free restore point"),
},
{.name = "desc",
.data = N_("commit changes and free restore point")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_commit[] = { static const vshCmdOptDef opts_interface_commit[] = {
@ -737,14 +682,9 @@ cmdInterfaceCommit(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "iface-rollback" command * "iface-rollback" command
*/ */
static const vshCmdInfo info_interface_rollback[] = { static const vshCmdInfo info_interface_rollback = {
{.name = "help", .help = N_("rollback to previous saved configuration created via iface-begin"),
.data = N_("rollback to previous saved configuration created via iface-begin") .desc = N_("rollback to previous restore point"),
},
{.name = "desc",
.data = N_("rollback to previous restore point")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_rollback[] = { static const vshCmdOptDef opts_interface_rollback[] = {
@ -768,14 +708,9 @@ cmdInterfaceRollback(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "iface-bridge" command * "iface-bridge" command
*/ */
static const vshCmdInfo info_interface_bridge[] = { static const vshCmdInfo info_interface_bridge = {
{.name = "help", .help = N_("create a bridge device and attach an existing network device to it"),
.data = N_("create a bridge device and attach an existing network device to it") .desc = N_("bridge an existing network device"),
},
{.name = "desc",
.data = N_("bridge an existing network device")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_bridge[] = { static const vshCmdOptDef opts_interface_bridge[] = {
@ -1000,14 +935,9 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd)
/* /*
* "iface-unbridge" command * "iface-unbridge" command
*/ */
static const vshCmdInfo info_interface_unbridge[] = { static const vshCmdInfo info_interface_unbridge = {
{.name = "help", .help = N_("undefine a bridge device after detaching its device(s)"),
.data = N_("undefine a bridge device after detaching its device(s)") .desc = N_("unbridge a network device"),
},
{.name = "desc",
.data = N_("unbridge a network device")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_interface_unbridge[] = { static const vshCmdOptDef opts_interface_unbridge[] = {
@ -1196,85 +1126,85 @@ const vshCmdDef ifaceCmds[] = {
{.name = "iface-begin", {.name = "iface-begin",
.handler = cmdInterfaceBegin, .handler = cmdInterfaceBegin,
.opts = opts_interface_begin, .opts = opts_interface_begin,
.info = info_interface_begin, .info = &info_interface_begin,
.flags = 0 .flags = 0
}, },
{.name = "iface-bridge", {.name = "iface-bridge",
.handler = cmdInterfaceBridge, .handler = cmdInterfaceBridge,
.opts = opts_interface_bridge, .opts = opts_interface_bridge,
.info = info_interface_bridge, .info = &info_interface_bridge,
.flags = 0 .flags = 0
}, },
{.name = "iface-commit", {.name = "iface-commit",
.handler = cmdInterfaceCommit, .handler = cmdInterfaceCommit,
.opts = opts_interface_commit, .opts = opts_interface_commit,
.info = info_interface_commit, .info = &info_interface_commit,
.flags = 0 .flags = 0
}, },
{.name = "iface-define", {.name = "iface-define",
.handler = cmdInterfaceDefine, .handler = cmdInterfaceDefine,
.opts = opts_interface_define, .opts = opts_interface_define,
.info = info_interface_define, .info = &info_interface_define,
.flags = 0 .flags = 0
}, },
{.name = "iface-destroy", {.name = "iface-destroy",
.handler = cmdInterfaceDestroy, .handler = cmdInterfaceDestroy,
.opts = opts_interface_destroy, .opts = opts_interface_destroy,
.info = info_interface_destroy, .info = &info_interface_destroy,
.flags = 0 .flags = 0
}, },
{.name = "iface-dumpxml", {.name = "iface-dumpxml",
.handler = cmdInterfaceDumpXML, .handler = cmdInterfaceDumpXML,
.opts = opts_interface_dumpxml, .opts = opts_interface_dumpxml,
.info = info_interface_dumpxml, .info = &info_interface_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "iface-edit", {.name = "iface-edit",
.handler = cmdInterfaceEdit, .handler = cmdInterfaceEdit,
.opts = opts_interface_edit, .opts = opts_interface_edit,
.info = info_interface_edit, .info = &info_interface_edit,
.flags = 0 .flags = 0
}, },
{.name = "iface-list", {.name = "iface-list",
.handler = cmdInterfaceList, .handler = cmdInterfaceList,
.opts = opts_interface_list, .opts = opts_interface_list,
.info = info_interface_list, .info = &info_interface_list,
.flags = 0 .flags = 0
}, },
{.name = "iface-mac", {.name = "iface-mac",
.handler = cmdInterfaceMAC, .handler = cmdInterfaceMAC,
.opts = opts_interface_mac, .opts = opts_interface_mac,
.info = info_interface_mac, .info = &info_interface_mac,
.flags = 0 .flags = 0
}, },
{.name = "iface-name", {.name = "iface-name",
.handler = cmdInterfaceName, .handler = cmdInterfaceName,
.opts = opts_interface_name, .opts = opts_interface_name,
.info = info_interface_name, .info = &info_interface_name,
.flags = 0 .flags = 0
}, },
{.name = "iface-rollback", {.name = "iface-rollback",
.handler = cmdInterfaceRollback, .handler = cmdInterfaceRollback,
.opts = opts_interface_rollback, .opts = opts_interface_rollback,
.info = info_interface_rollback, .info = &info_interface_rollback,
.flags = 0 .flags = 0
}, },
{.name = "iface-start", {.name = "iface-start",
.handler = cmdInterfaceStart, .handler = cmdInterfaceStart,
.opts = opts_interface_start, .opts = opts_interface_start,
.info = info_interface_start, .info = &info_interface_start,
.flags = 0 .flags = 0
}, },
{.name = "iface-unbridge", {.name = "iface-unbridge",
.handler = cmdInterfaceUnbridge, .handler = cmdInterfaceUnbridge,
.opts = opts_interface_unbridge, .opts = opts_interface_unbridge,
.info = info_interface_unbridge, .info = &info_interface_unbridge,
.flags = 0 .flags = 0
}, },
{.name = "iface-undefine", {.name = "iface-undefine",
.handler = cmdInterfaceUndefine, .handler = cmdInterfaceUndefine,
.opts = opts_interface_undefine, .opts = opts_interface_undefine,
.info = info_interface_undefine, .info = &info_interface_undefine,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -134,14 +134,9 @@ virshCommandOptNetworkPort(vshControl *ctl, const vshCmd *cmd,
/* /*
* "net-autostart" command * "net-autostart" command
*/ */
static const vshCmdInfo info_network_autostart[] = { static const vshCmdInfo info_network_autostart = {
{.name = "help", .help = N_("autostart a network"),
.data = N_("autostart a network") .desc = N_("Configure a network to be automatically started at boot."),
},
{.name = "desc",
.data = N_("Configure a network to be automatically started at boot.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_autostart[] = { static const vshCmdOptDef opts_network_autostart[] = {
@ -184,14 +179,9 @@ cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-create" command * "net-create" command
*/ */
static const vshCmdInfo info_network_create[] = { static const vshCmdInfo info_network_create = {
{.name = "help", .help = N_("create a network from an XML file"),
.data = N_("create a network from an XML file") .desc = N_("Create a network."),
},
{.name = "desc",
.data = N_("Create a network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_create[] = { static const vshCmdOptDef opts_network_create[] = {
@ -239,15 +229,10 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-define" command * "net-define" command
*/ */
static const vshCmdInfo info_network_define[] = { static const vshCmdInfo info_network_define = {
{.name = "help", .help = N_("define an inactive persistent virtual network or modify "
.data = N_("define an inactive persistent virtual network or modify " "an existing persistent one from an XML file"),
"an existing persistent one from an XML file") .desc = N_("Define or modify a persistent virtual network."),
},
{.name = "desc",
.data = N_("Define or modify a persistent virtual network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_define[] = { static const vshCmdOptDef opts_network_define[] = {
@ -295,14 +280,9 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-destroy" command * "net-destroy" command
*/ */
static const vshCmdInfo info_network_destroy[] = { static const vshCmdInfo info_network_destroy = {
{.name = "help", .help = N_("destroy (stop) a network"),
.data = N_("destroy (stop) a network") .desc = N_("Forcefully stop a given network."),
},
{.name = "desc",
.data = N_("Forcefully stop a given network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_destroy[] = { static const vshCmdOptDef opts_network_destroy[] = {
@ -333,14 +313,9 @@ cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-desc" command * "net-desc" command
*/ */
static const vshCmdInfo info_network_desc[] = { static const vshCmdInfo info_network_desc = {
{.name = "help", .help = N_("show or set network's description or title"),
.data = N_("show or set network's description or title") .desc = N_("Allows setting or modifying the description or title of a network."),
},
{.name = "desc",
.data = N_("Allows setting or modifying the description or title of a network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_desc[] = { static const vshCmdOptDef opts_network_desc[] = {
@ -518,14 +493,9 @@ cmdNetworkDesc(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-metadata" command * "net-metadata" command
*/ */
static const vshCmdInfo info_network_metadata[] = { static const vshCmdInfo info_network_metadata = {
{.name = "help", .help = N_("show or set network's custom XML metadata"),
.data = N_("show or set network's custom XML metadata") .desc = N_("Shows or modifies the XML metadata of a network."),
},
{.name = "desc",
.data = N_("Shows or modifies the XML metadata of a network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_metadata[] = { static const vshCmdOptDef opts_network_metadata[] = {
@ -661,14 +631,9 @@ cmdNetworkMetadata(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-dumpxml" command * "net-dumpxml" command
*/ */
static const vshCmdInfo info_network_dumpxml[] = { static const vshCmdInfo info_network_dumpxml = {
{.name = "help", .help = N_("network information in XML"),
.data = N_("network information in XML") .desc = N_("Output the network information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the network information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_dumpxml[] = { static const vshCmdOptDef opts_network_dumpxml[] = {
@ -717,14 +682,9 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-info" command * "net-info" command
*/ */
static const vshCmdInfo info_network_info[] = { static const vshCmdInfo info_network_info = {
{.name = "help", .help = N_("network information"),
.data = N_("network information") .desc = N_("Returns basic information about the network"),
},
{.name = "desc",
.data = N_("Returns basic information about the network")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_info[] = { static const vshCmdOptDef opts_network_info[] = {
@ -992,14 +952,9 @@ virshNetworkListCollect(vshControl *ctl,
/* /*
* "net-list" command * "net-list" command
*/ */
static const vshCmdInfo info_network_list[] = { static const vshCmdInfo info_network_list = {
{.name = "help", .help = N_("list networks"),
.data = N_("list networks") .desc = N_("Returns list of networks."),
},
{.name = "desc",
.data = N_("Returns list of networks.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_list[] = { static const vshCmdOptDef opts_network_list[] = {
@ -1164,14 +1119,9 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "net-name" command * "net-name" command
*/ */
static const vshCmdInfo info_network_name[] = { static const vshCmdInfo info_network_name = {
{.name = "help", .help = N_("convert a network UUID to network name"),
.data = N_("convert a network UUID to network name") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_name[] = { static const vshCmdOptDef opts_network_name[] = {
@ -1200,14 +1150,9 @@ cmdNetworkName(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-start" command * "net-start" command
*/ */
static const vshCmdInfo info_network_start[] = { static const vshCmdInfo info_network_start = {
{.name = "help", .help = N_("start a (previously defined) inactive network"),
.data = N_("start a (previously defined) inactive network") .desc = N_("Start a network."),
},
{.name = "desc",
.data = N_("Start a network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_start[] = { static const vshCmdOptDef opts_network_start[] = {
@ -1237,14 +1182,9 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-undefine" command * "net-undefine" command
*/ */
static const vshCmdInfo info_network_undefine[] = { static const vshCmdInfo info_network_undefine = {
{.name = "help", .help = N_("undefine a persistent network"),
.data = N_("undefine a persistent network") .desc = N_("Undefine the configuration for a persistent network."),
},
{.name = "desc",
.data = N_("Undefine the configuration for a persistent network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_undefine[] = { static const vshCmdOptDef opts_network_undefine[] = {
@ -1275,14 +1215,9 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-update" command * "net-update" command
*/ */
static const vshCmdInfo info_network_update[] = { static const vshCmdInfo info_network_update = {
{.name = "help", .help = N_("update parts of an existing network's configuration"),
.data = N_("update parts of an existing network's configuration") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_update[] = { static const vshCmdOptDef opts_network_update[] = {
@ -1435,14 +1370,9 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-uuid" command * "net-uuid" command
*/ */
static const vshCmdInfo info_network_uuid[] = { static const vshCmdInfo info_network_uuid = {
{.name = "help", .help = N_("convert a network name to network UUID"),
.data = N_("convert a network name to network UUID") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_uuid[] = { static const vshCmdOptDef opts_network_uuid[] = {
@ -1471,14 +1401,9 @@ cmdNetworkUuid(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-edit" command * "net-edit" command
*/ */
static const vshCmdInfo info_network_edit[] = { static const vshCmdInfo info_network_edit = {
{.name = "help", .help = N_("edit XML configuration for a network"),
.data = N_("edit XML configuration for a network") .desc = N_("Edit the XML configuration for a network."),
},
{.name = "desc",
.data = N_("Edit the XML configuration for a network.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_edit[] = { static const vshCmdOptDef opts_network_edit[] = {
@ -1649,14 +1574,9 @@ virshNetworkEventCallback virshNetworkEventCallbacks[] = {
}; };
G_STATIC_ASSERT(VIR_NETWORK_EVENT_ID_LAST == G_N_ELEMENTS(virshNetworkEventCallbacks)); G_STATIC_ASSERT(VIR_NETWORK_EVENT_ID_LAST == G_N_ELEMENTS(virshNetworkEventCallbacks));
static const vshCmdInfo info_network_event[] = { static const vshCmdInfo info_network_event = {
{.name = "help", .help = N_("Network Events"),
.data = N_("Network Events") .desc = N_("List event types, or wait for network events to occur"),
},
{.name = "desc",
.data = N_("List event types, or wait for network events to occur")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_event[] = { static const vshCmdOptDef opts_network_event[] = {
@ -1764,14 +1684,9 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-dhcp-leases" command * "net-dhcp-leases" command
*/ */
static const vshCmdInfo info_network_dhcp_leases[] = { static const vshCmdInfo info_network_dhcp_leases = {
{.name = "help", .help = N_("print lease info for a given network"),
.data = N_("print lease info for a given network") .desc = N_("Print lease info for a given network"),
},
{.name = "desc",
.data = N_("Print lease info for a given network")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_dhcp_leases[] = { static const vshCmdOptDef opts_network_dhcp_leases[] = {
@ -1879,14 +1794,9 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-port-create" command * "net-port-create" command
*/ */
static const vshCmdInfo info_network_port_create[] = { static const vshCmdInfo info_network_port_create = {
{.name = "help", .help = N_("create a network port from an XML file"),
.data = N_("create a network port from an XML file") .desc = N_("Create a network port."),
},
{.name = "desc",
.data = N_("Create a network port.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_port_create[] = { static const vshCmdOptDef opts_network_port_create[] = {
@ -1946,14 +1856,9 @@ cmdNetworkPortCreate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-port-dumpxml" command * "net-port-dumpxml" command
*/ */
static const vshCmdInfo info_network_port_dumpxml[] = { static const vshCmdInfo info_network_port_dumpxml = {
{.name = "help", .help = N_("network port information in XML"),
.data = N_("network port information in XML") .desc = N_("Output the network port information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the network port information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_port_dumpxml[] = { static const vshCmdOptDef opts_network_port_dumpxml[] = {
@ -2007,14 +1912,9 @@ cmdNetworkPortDumpXML(vshControl *ctl, const vshCmd *cmd)
/* /*
* "net-port-delete" command * "net-port-delete" command
*/ */
static const vshCmdInfo info_network_port_delete[] = { static const vshCmdInfo info_network_port_delete = {
{.name = "help", .help = N_("delete the specified network port"),
.data = N_("delete the specified network port") .desc = N_("Delete the specified network port."),
},
{.name = "desc",
.data = N_("Delete the specified network port.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_port_delete[] = { static const vshCmdOptDef opts_network_port_delete[] = {
@ -2137,14 +2037,9 @@ virshNetworkPortListCollect(vshControl *ctl,
/* /*
* "net-list" command * "net-list" command
*/ */
static const vshCmdInfo info_network_port_list[] = { static const vshCmdInfo info_network_port_list = {
{.name = "help", .help = N_("list network ports"),
.data = N_("list network ports") .desc = N_("Returns list of network ports."),
},
{.name = "desc",
.data = N_("Returns list of network ports.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_network_port_list[] = { static const vshCmdOptDef opts_network_port_list[] = {
@ -2219,127 +2114,127 @@ const vshCmdDef networkCmds[] = {
{.name = "net-autostart", {.name = "net-autostart",
.handler = cmdNetworkAutostart, .handler = cmdNetworkAutostart,
.opts = opts_network_autostart, .opts = opts_network_autostart,
.info = info_network_autostart, .info = &info_network_autostart,
.flags = 0 .flags = 0
}, },
{.name = "net-create", {.name = "net-create",
.handler = cmdNetworkCreate, .handler = cmdNetworkCreate,
.opts = opts_network_create, .opts = opts_network_create,
.info = info_network_create, .info = &info_network_create,
.flags = 0 .flags = 0
}, },
{.name = "net-define", {.name = "net-define",
.handler = cmdNetworkDefine, .handler = cmdNetworkDefine,
.opts = opts_network_define, .opts = opts_network_define,
.info = info_network_define, .info = &info_network_define,
.flags = 0 .flags = 0
}, },
{.name = "net-desc", {.name = "net-desc",
.handler = cmdNetworkDesc, .handler = cmdNetworkDesc,
.opts = opts_network_desc, .opts = opts_network_desc,
.info = info_network_desc, .info = &info_network_desc,
.flags = 0 .flags = 0
}, },
{.name = "net-destroy", {.name = "net-destroy",
.handler = cmdNetworkDestroy, .handler = cmdNetworkDestroy,
.opts = opts_network_destroy, .opts = opts_network_destroy,
.info = info_network_destroy, .info = &info_network_destroy,
.flags = 0 .flags = 0
}, },
{.name = "net-dhcp-leases", {.name = "net-dhcp-leases",
.handler = cmdNetworkDHCPLeases, .handler = cmdNetworkDHCPLeases,
.opts = opts_network_dhcp_leases, .opts = opts_network_dhcp_leases,
.info = info_network_dhcp_leases, .info = &info_network_dhcp_leases,
.flags = 0, .flags = 0,
}, },
{.name = "net-dumpxml", {.name = "net-dumpxml",
.handler = cmdNetworkDumpXML, .handler = cmdNetworkDumpXML,
.opts = opts_network_dumpxml, .opts = opts_network_dumpxml,
.info = info_network_dumpxml, .info = &info_network_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "net-edit", {.name = "net-edit",
.handler = cmdNetworkEdit, .handler = cmdNetworkEdit,
.opts = opts_network_edit, .opts = opts_network_edit,
.info = info_network_edit, .info = &info_network_edit,
.flags = 0 .flags = 0
}, },
{.name = "net-event", {.name = "net-event",
.handler = cmdNetworkEvent, .handler = cmdNetworkEvent,
.opts = opts_network_event, .opts = opts_network_event,
.info = info_network_event, .info = &info_network_event,
.flags = 0 .flags = 0
}, },
{.name = "net-info", {.name = "net-info",
.handler = cmdNetworkInfo, .handler = cmdNetworkInfo,
.opts = opts_network_info, .opts = opts_network_info,
.info = info_network_info, .info = &info_network_info,
.flags = 0 .flags = 0
}, },
{.name = "net-list", {.name = "net-list",
.handler = cmdNetworkList, .handler = cmdNetworkList,
.opts = opts_network_list, .opts = opts_network_list,
.info = info_network_list, .info = &info_network_list,
.flags = 0 .flags = 0
}, },
{.name = "net-metadata", {.name = "net-metadata",
.handler = cmdNetworkMetadata, .handler = cmdNetworkMetadata,
.opts = opts_network_metadata, .opts = opts_network_metadata,
.info = info_network_metadata, .info = &info_network_metadata,
.flags = 0 .flags = 0
}, },
{.name = "net-name", {.name = "net-name",
.handler = cmdNetworkName, .handler = cmdNetworkName,
.opts = opts_network_name, .opts = opts_network_name,
.info = info_network_name, .info = &info_network_name,
.flags = 0 .flags = 0
}, },
{.name = "net-start", {.name = "net-start",
.handler = cmdNetworkStart, .handler = cmdNetworkStart,
.opts = opts_network_start, .opts = opts_network_start,
.info = info_network_start, .info = &info_network_start,
.flags = 0 .flags = 0
}, },
{.name = "net-undefine", {.name = "net-undefine",
.handler = cmdNetworkUndefine, .handler = cmdNetworkUndefine,
.opts = opts_network_undefine, .opts = opts_network_undefine,
.info = info_network_undefine, .info = &info_network_undefine,
.flags = 0 .flags = 0
}, },
{.name = "net-update", {.name = "net-update",
.handler = cmdNetworkUpdate, .handler = cmdNetworkUpdate,
.opts = opts_network_update, .opts = opts_network_update,
.info = info_network_update, .info = &info_network_update,
.flags = 0 .flags = 0
}, },
{.name = "net-uuid", {.name = "net-uuid",
.handler = cmdNetworkUuid, .handler = cmdNetworkUuid,
.opts = opts_network_uuid, .opts = opts_network_uuid,
.info = info_network_uuid, .info = &info_network_uuid,
.flags = 0 .flags = 0
}, },
{.name = "net-port-list", {.name = "net-port-list",
.handler = cmdNetworkPortList, .handler = cmdNetworkPortList,
.opts = opts_network_port_list, .opts = opts_network_port_list,
.info = info_network_port_list, .info = &info_network_port_list,
.flags = 0 .flags = 0
}, },
{.name = "net-port-create", {.name = "net-port-create",
.handler = cmdNetworkPortCreate, .handler = cmdNetworkPortCreate,
.opts = opts_network_port_create, .opts = opts_network_port_create,
.info = info_network_port_create, .info = &info_network_port_create,
.flags = 0 .flags = 0
}, },
{.name = "net-port-dumpxml", {.name = "net-port-dumpxml",
.handler = cmdNetworkPortDumpXML, .handler = cmdNetworkPortDumpXML,
.opts = opts_network_port_dumpxml, .opts = opts_network_port_dumpxml,
.info = info_network_port_dumpxml, .info = &info_network_port_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "net-port-delete", {.name = "net-port-delete",
.handler = cmdNetworkPortDelete, .handler = cmdNetworkPortDelete,
.opts = opts_network_port_delete, .opts = opts_network_port_delete,
.info = info_network_port_delete, .info = &info_network_port_delete,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -34,17 +34,12 @@
/* /*
* "nodedev-create" command * "nodedev-create" command
*/ */
static const vshCmdInfo info_node_device_create[] = { static const vshCmdInfo info_node_device_create = {
{.name = "help", .help = N_("create a device defined "
.data = N_("create a device defined " "by an XML file on the node"),
"by an XML file on the node") .desc = N_("Create a device on the node. Note that this "
},
{.name = "desc",
.data = N_("Create a device on the node. Note that this "
"command creates devices on the physical host " "command creates devices on the physical host "
"that can then be assigned to a virtual machine.") "that can then be assigned to a virtual machine."),
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_create[] = { static const vshCmdOptDef opts_node_device_create[] = {
@ -89,15 +84,10 @@ cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-destroy" command * "nodedev-destroy" command
*/ */
static const vshCmdInfo info_node_device_destroy[] = { static const vshCmdInfo info_node_device_destroy = {
{.name = "help", .help = N_("destroy (stop) a device on the node"),
.data = N_("destroy (stop) a device on the node") .desc = N_("Destroy a device on the node. Note that this "
}, "command destroys devices on the physical host"),
{.name = "desc",
.data = N_("Destroy a device on the node. Note that this "
"command destroys devices on the physical host")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_destroy[] = { static const vshCmdOptDef opts_node_device_destroy[] = {
@ -362,14 +352,9 @@ virshNodeDeviceListCollect(vshControl *ctl,
/* /*
* "nodedev-list" command * "nodedev-list" command
*/ */
static const vshCmdInfo info_node_list_devices[] = { static const vshCmdInfo info_node_list_devices = {
{.name = "help", .help = N_("enumerate devices on this host"),
.data = N_("enumerate devices on this host") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_list_devices[] = { static const vshCmdOptDef opts_node_list_devices[] = {
@ -577,14 +562,9 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "nodedev-dumpxml" command * "nodedev-dumpxml" command
*/ */
static const vshCmdInfo info_node_device_dumpxml[] = { static const vshCmdInfo info_node_device_dumpxml = {
{.name = "help", .help = N_("node device details in XML"),
.data = N_("node device details in XML") .desc = N_("Output the node device details as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the node device details as an XML dump to stdout.")
},
{.name = NULL}
}; };
@ -645,14 +625,9 @@ cmdNodeDeviceDumpXML(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-detach" command * "nodedev-detach" command
*/ */
static const vshCmdInfo info_node_device_detach[] = { static const vshCmdInfo info_node_device_detach = {
{.name = "help", .help = N_("detach node device from its device driver"),
.data = N_("detach node device from its device driver") .desc = N_("Detach node device from its device driver before assigning to a domain."),
},
{.name = "desc",
.data = N_("Detach node device from its device driver before assigning to a domain.")
},
{.name = NULL}
}; };
@ -712,14 +687,9 @@ cmdNodeDeviceDetach(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-reattach" command * "nodedev-reattach" command
*/ */
static const vshCmdInfo info_node_device_reattach[] = { static const vshCmdInfo info_node_device_reattach = {
{.name = "help", .help = N_("reattach node device to its device driver"),
.data = N_("reattach node device to its device driver") .desc = N_("Reattach node device to its device driver once released by the domain."),
},
{.name = "desc",
.data = N_("Reattach node device to its device driver once released by the domain.")
},
{.name = NULL}
}; };
@ -762,14 +732,9 @@ cmdNodeDeviceReAttach(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-reset" command * "nodedev-reset" command
*/ */
static const vshCmdInfo info_node_device_reset[] = { static const vshCmdInfo info_node_device_reset = {
{.name = "help", .help = N_("reset node device"),
.data = N_("reset node device") .desc = N_("Reset node device before or after assigning to a domain."),
},
{.name = "desc",
.data = N_("Reset node device before or after assigning to a domain.")
},
{.name = NULL}
}; };
@ -906,14 +871,9 @@ virshNodeDeviceEventCallback virshNodeDeviceEventCallbacks[] = {
G_STATIC_ASSERT(VIR_NODE_DEVICE_EVENT_ID_LAST == G_N_ELEMENTS(virshNodeDeviceEventCallbacks)); G_STATIC_ASSERT(VIR_NODE_DEVICE_EVENT_ID_LAST == G_N_ELEMENTS(virshNodeDeviceEventCallbacks));
static const vshCmdInfo info_node_device_event[] = { static const vshCmdInfo info_node_device_event = {
{.name = "help", .help = N_("Node Device Events"),
.data = N_("Node Device Events") .desc = N_("List event types, or wait for node device events to occur"),
},
{.name = "desc",
.data = N_("List event types, or wait for node device events to occur")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_event[] = { static const vshCmdOptDef opts_node_device_event[] = {
@ -1034,14 +994,9 @@ cmdNodeDeviceEvent(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-undefine" command * "nodedev-undefine" command
*/ */
static const vshCmdInfo info_node_device_undefine[] = { static const vshCmdInfo info_node_device_undefine = {
{.name = "help", .help = N_("Undefine an inactive node device"),
.data = N_("Undefine an inactive node device") .desc = N_("Undefines the configuration for an inactive node device"),
},
{.name = "desc",
.data = N_("Undefines the configuration for an inactive node device")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_undefine[] = { static const vshCmdOptDef opts_node_device_undefine[] = {
@ -1081,16 +1036,11 @@ cmdNodeDeviceUndefine(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "nodedev-define" command * "nodedev-define" command
*/ */
static const vshCmdInfo info_node_device_define[] = { static const vshCmdInfo info_node_device_define = {
{.name = "help", .help = N_("Define or modify a device by an xml file on a node"),
.data = N_("Define or modify a device by an xml file on a node") .desc = N_("Defines or modifies a persistent device on the node that "
},
{.name = "desc",
.data = N_("Defines or modifies a persistent device on the node that "
"can be assigned to a domain. The device must be started " "can be assigned to a domain. The device must be started "
"before it can be assigned to a domain.") "before it can be assigned to a domain."),
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_define[] = { static const vshCmdOptDef opts_node_device_define[] = {
@ -1135,14 +1085,9 @@ cmdNodeDeviceDefine(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "nodedev-start" command * "nodedev-start" command
*/ */
static const vshCmdInfo info_node_device_start[] = { static const vshCmdInfo info_node_device_start = {
{.name = "help", .help = N_("Start an inactive node device"),
.data = N_("Start an inactive node device") .desc = N_("Starts an inactive node device that was previously defined"),
},
{.name = "desc",
.data = N_("Starts an inactive node device that was previously defined")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_start[] = { static const vshCmdOptDef opts_node_device_start[] = {
@ -1185,14 +1130,9 @@ cmdNodeDeviceStart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-autostart" command * "nodedev-autostart" command
*/ */
static const vshCmdInfo info_node_device_autostart[] = { static const vshCmdInfo info_node_device_autostart = {
{.name = "help", .help = N_("autostart a defined node device"),
.data = N_("autostart a defined node device") .desc = N_("Configure a node device to be automatically started at boot."),
},
{.name = "desc",
.data = N_("Configure a node device to be automatically started at boot.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_autostart[] = { static const vshCmdOptDef opts_node_device_autostart[] = {
@ -1246,14 +1186,9 @@ cmdNodeDeviceAutostart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-info" command * "nodedev-info" command
*/ */
static const vshCmdInfo info_node_device_info[] = { static const vshCmdInfo info_node_device_info = {
{.name = "help", .help = N_("node device information"),
.data = N_("node device information") .desc = N_("Returns basic information about the node device"),
},
{.name = "desc",
.data = N_("Returns basic information about the node device")
},
{.name = NULL}
}; };
@ -1302,14 +1237,9 @@ cmdNodeDeviceInfo(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nodedev-update" command * "nodedev-update" command
*/ */
static const vshCmdInfo info_node_device_update[] = { static const vshCmdInfo info_node_device_update = {
{.name = "help", .help = N_("Update a active and/or inactive node device"),
.data = N_("Update a active and/or inactive node device") .desc = N_("Updates the configuration of a node device"),
},
{.name = "desc",
.data = N_("Updates the configuration of a node device")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_node_device_update[] = { static const vshCmdOptDef opts_node_device_update[] = {
@ -1399,19 +1329,19 @@ const vshCmdDef nodedevCmds[] = {
{.name = "nodedev-create", {.name = "nodedev-create",
.handler = cmdNodeDeviceCreate, .handler = cmdNodeDeviceCreate,
.opts = opts_node_device_create, .opts = opts_node_device_create,
.info = info_node_device_create, .info = &info_node_device_create,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-destroy", {.name = "nodedev-destroy",
.handler = cmdNodeDeviceDestroy, .handler = cmdNodeDeviceDestroy,
.opts = opts_node_device_destroy, .opts = opts_node_device_destroy,
.info = info_node_device_destroy, .info = &info_node_device_destroy,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-detach", {.name = "nodedev-detach",
.handler = cmdNodeDeviceDetach, .handler = cmdNodeDeviceDetach,
.opts = opts_node_device_detach, .opts = opts_node_device_detach,
.info = info_node_device_detach, .info = &info_node_device_detach,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-dettach", {.name = "nodedev-dettach",
@ -1420,67 +1350,67 @@ const vshCmdDef nodedevCmds[] = {
{.name = "nodedev-dumpxml", {.name = "nodedev-dumpxml",
.handler = cmdNodeDeviceDumpXML, .handler = cmdNodeDeviceDumpXML,
.opts = opts_node_device_dumpxml, .opts = opts_node_device_dumpxml,
.info = info_node_device_dumpxml, .info = &info_node_device_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-list", {.name = "nodedev-list",
.handler = cmdNodeListDevices, .handler = cmdNodeListDevices,
.opts = opts_node_list_devices, .opts = opts_node_list_devices,
.info = info_node_list_devices, .info = &info_node_list_devices,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-reattach", {.name = "nodedev-reattach",
.handler = cmdNodeDeviceReAttach, .handler = cmdNodeDeviceReAttach,
.opts = opts_node_device_reattach, .opts = opts_node_device_reattach,
.info = info_node_device_reattach, .info = &info_node_device_reattach,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-reset", {.name = "nodedev-reset",
.handler = cmdNodeDeviceReset, .handler = cmdNodeDeviceReset,
.opts = opts_node_device_reset, .opts = opts_node_device_reset,
.info = info_node_device_reset, .info = &info_node_device_reset,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-event", {.name = "nodedev-event",
.handler = cmdNodeDeviceEvent, .handler = cmdNodeDeviceEvent,
.opts = opts_node_device_event, .opts = opts_node_device_event,
.info = info_node_device_event, .info = &info_node_device_event,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-define", {.name = "nodedev-define",
.handler = cmdNodeDeviceDefine, .handler = cmdNodeDeviceDefine,
.opts = opts_node_device_define, .opts = opts_node_device_define,
.info = info_node_device_define, .info = &info_node_device_define,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-undefine", {.name = "nodedev-undefine",
.handler = cmdNodeDeviceUndefine, .handler = cmdNodeDeviceUndefine,
.opts = opts_node_device_undefine, .opts = opts_node_device_undefine,
.info = info_node_device_undefine, .info = &info_node_device_undefine,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-start", {.name = "nodedev-start",
.handler = cmdNodeDeviceStart, .handler = cmdNodeDeviceStart,
.opts = opts_node_device_start, .opts = opts_node_device_start,
.info = info_node_device_start, .info = &info_node_device_start,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-autostart", {.name = "nodedev-autostart",
.handler = cmdNodeDeviceAutostart, .handler = cmdNodeDeviceAutostart,
.opts = opts_node_device_autostart, .opts = opts_node_device_autostart,
.info = info_node_device_autostart, .info = &info_node_device_autostart,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-info", {.name = "nodedev-info",
.handler = cmdNodeDeviceInfo, .handler = cmdNodeDeviceInfo,
.opts = opts_node_device_info, .opts = opts_node_device_info,
.info = info_node_device_info, .info = &info_node_device_info,
.flags = 0 .flags = 0
}, },
{.name = "nodedev-update", {.name = "nodedev-update",
.handler = cmdNodeDeviceUpdate, .handler = cmdNodeDeviceUpdate,
.opts = opts_node_device_update, .opts = opts_node_device_update,
.info = info_node_device_update, .info = &info_node_device_update,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -69,14 +69,9 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd,
/* /*
* "nwfilter-define" command * "nwfilter-define" command
*/ */
static const vshCmdInfo info_nwfilter_define[] = { static const vshCmdInfo info_nwfilter_define = {
{.name = "help", .help = N_("define or update a network filter from an XML file"),
.data = N_("define or update a network filter from an XML file") .desc = N_("Define a new network filter or update an existing one."),
},
{.name = "desc",
.data = N_("Define a new network filter or update an existing one.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_define[] = { static const vshCmdOptDef opts_nwfilter_define[] = {
@ -126,14 +121,9 @@ cmdNWFilterDefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nwfilter-undefine" command * "nwfilter-undefine" command
*/ */
static const vshCmdInfo info_nwfilter_undefine[] = { static const vshCmdInfo info_nwfilter_undefine = {
{.name = "help", .help = N_("undefine a network filter"),
.data = N_("undefine a network filter") .desc = N_("Undefine a given network filter."),
},
{.name = "desc",
.data = N_("Undefine a given network filter.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_undefine[] = { static const vshCmdOptDef opts_nwfilter_undefine[] = {
@ -169,14 +159,9 @@ cmdNWFilterUndefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nwfilter-dumpxml" command * "nwfilter-dumpxml" command
*/ */
static const vshCmdInfo info_nwfilter_dumpxml[] = { static const vshCmdInfo info_nwfilter_dumpxml = {
{.name = "help", .help = N_("network filter information in XML"),
.data = N_("network filter information in XML") .desc = N_("Output the network filter information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the network filter information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_dumpxml[] = { static const vshCmdOptDef opts_nwfilter_dumpxml[] = {
@ -351,14 +336,9 @@ virshNWFilterListCollect(vshControl *ctl,
/* /*
* "nwfilter-list" command * "nwfilter-list" command
*/ */
static const vshCmdInfo info_nwfilter_list[] = { static const vshCmdInfo info_nwfilter_list = {
{.name = "help", .help = N_("list network filters"),
.data = N_("list network filters") .desc = N_("Returns list of network filters."),
},
{.name = "desc",
.data = N_("Returns list of network filters.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_list[] = { static const vshCmdOptDef opts_nwfilter_list[] = {
@ -403,14 +383,9 @@ cmdNWFilterList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "nwfilter-edit" command * "nwfilter-edit" command
*/ */
static const vshCmdInfo info_nwfilter_edit[] = { static const vshCmdInfo info_nwfilter_edit = {
{.name = "help", .help = N_("edit XML configuration for a network filter"),
.data = N_("edit XML configuration for a network filter") .desc = N_("Edit the XML configuration for a network filter."),
},
{.name = "desc",
.data = N_("Edit the XML configuration for a network filter.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_edit[] = { static const vshCmdOptDef opts_nwfilter_edit[] = {
@ -493,14 +468,9 @@ virshCommandOptNWFilterBindingBy(vshControl *ctl,
/* /*
* "nwfilter-binding-create" command * "nwfilter-binding-create" command
*/ */
static const vshCmdInfo info_nwfilter_binding_create[] = { static const vshCmdInfo info_nwfilter_binding_create = {
{.name = "help", .help = N_("create a network filter binding from an XML file"),
.data = N_("create a network filter binding from an XML file") .desc = N_("Create a new network filter binding."),
},
{.name = "desc",
.data = N_("Create a new network filter binding.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_binding_create[] = { static const vshCmdOptDef opts_nwfilter_binding_create[] = {
@ -548,14 +518,9 @@ cmdNWFilterBindingCreate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nwfilter-binding-delete" command * "nwfilter-binding-delete" command
*/ */
static const vshCmdInfo info_nwfilter_binding_delete[] = { static const vshCmdInfo info_nwfilter_binding_delete = {
{.name = "help", .help = N_("delete a network filter binding"),
.data = N_("delete a network filter binding") .desc = N_("Delete a given network filter binding."),
},
{.name = "desc",
.data = N_("Delete a given network filter binding.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_binding_delete[] = { static const vshCmdOptDef opts_nwfilter_binding_delete[] = {
@ -593,14 +558,9 @@ cmdNWFilterBindingDelete(vshControl *ctl, const vshCmd *cmd)
/* /*
* "nwfilter-binding-dumpxml" command * "nwfilter-binding-dumpxml" command
*/ */
static const vshCmdInfo info_nwfilter_binding_dumpxml[] = { static const vshCmdInfo info_nwfilter_binding_dumpxml = {
{.name = "help", .help = N_("network filter information in XML"),
.data = N_("network filter information in XML") .desc = N_("Output the network filter information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the network filter information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_binding_dumpxml[] = { static const vshCmdOptDef opts_nwfilter_binding_dumpxml[] = {
@ -726,14 +686,9 @@ virshNWFilterBindingListCollect(vshControl *ctl,
/* /*
* "nwfilter-binding-list" command * "nwfilter-binding-list" command
*/ */
static const vshCmdInfo info_nwfilter_binding_list[] = { static const vshCmdInfo info_nwfilter_binding_list = {
{.name = "help", .help = N_("list network filter bindings"),
.data = N_("list network filter bindings") .desc = N_("Returns list of network filter bindings."),
},
{.name = "desc",
.data = N_("Returns list of network filter bindings.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_nwfilter_binding_list[] = { static const vshCmdOptDef opts_nwfilter_binding_list[] = {
@ -778,55 +733,55 @@ const vshCmdDef nwfilterCmds[] = {
{.name = "nwfilter-define", {.name = "nwfilter-define",
.handler = cmdNWFilterDefine, .handler = cmdNWFilterDefine,
.opts = opts_nwfilter_define, .opts = opts_nwfilter_define,
.info = info_nwfilter_define, .info = &info_nwfilter_define,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-dumpxml", {.name = "nwfilter-dumpxml",
.handler = cmdNWFilterDumpXML, .handler = cmdNWFilterDumpXML,
.opts = opts_nwfilter_dumpxml, .opts = opts_nwfilter_dumpxml,
.info = info_nwfilter_dumpxml, .info = &info_nwfilter_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-edit", {.name = "nwfilter-edit",
.handler = cmdNWFilterEdit, .handler = cmdNWFilterEdit,
.opts = opts_nwfilter_edit, .opts = opts_nwfilter_edit,
.info = info_nwfilter_edit, .info = &info_nwfilter_edit,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-list", {.name = "nwfilter-list",
.handler = cmdNWFilterList, .handler = cmdNWFilterList,
.opts = opts_nwfilter_list, .opts = opts_nwfilter_list,
.info = info_nwfilter_list, .info = &info_nwfilter_list,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-undefine", {.name = "nwfilter-undefine",
.handler = cmdNWFilterUndefine, .handler = cmdNWFilterUndefine,
.opts = opts_nwfilter_undefine, .opts = opts_nwfilter_undefine,
.info = info_nwfilter_undefine, .info = &info_nwfilter_undefine,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-binding-create", {.name = "nwfilter-binding-create",
.handler = cmdNWFilterBindingCreate, .handler = cmdNWFilterBindingCreate,
.opts = opts_nwfilter_binding_create, .opts = opts_nwfilter_binding_create,
.info = info_nwfilter_binding_create, .info = &info_nwfilter_binding_create,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-binding-delete", {.name = "nwfilter-binding-delete",
.handler = cmdNWFilterBindingDelete, .handler = cmdNWFilterBindingDelete,
.opts = opts_nwfilter_binding_delete, .opts = opts_nwfilter_binding_delete,
.info = info_nwfilter_binding_delete, .info = &info_nwfilter_binding_delete,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-binding-dumpxml", {.name = "nwfilter-binding-dumpxml",
.handler = cmdNWFilterBindingDumpXML, .handler = cmdNWFilterBindingDumpXML,
.opts = opts_nwfilter_binding_dumpxml, .opts = opts_nwfilter_binding_dumpxml,
.info = info_nwfilter_binding_dumpxml, .info = &info_nwfilter_binding_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "nwfilter-binding-list", {.name = "nwfilter-binding-list",
.handler = cmdNWFilterBindingList, .handler = cmdNWFilterBindingList,
.opts = opts_nwfilter_binding_list, .opts = opts_nwfilter_binding_list,
.info = info_nwfilter_binding_list, .info = &info_nwfilter_binding_list,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -196,14 +196,9 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
/* /*
* "pool-autostart" command * "pool-autostart" command
*/ */
static const vshCmdInfo info_pool_autostart[] = { static const vshCmdInfo info_pool_autostart = {
{.name = "help", .help = N_("autostart a pool"),
.data = N_("autostart a pool") .desc = N_("Configure a pool to be automatically started at boot."),
},
{.name = "desc",
.data = N_("Configure a pool to be automatically started at boot.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_autostart[] = { static const vshCmdOptDef opts_pool_autostart[] = {
@ -247,14 +242,9 @@ cmdPoolAutostart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-create" command * "pool-create" command
*/ */
static const vshCmdInfo info_pool_create[] = { static const vshCmdInfo info_pool_create = {
{.name = "help", .help = N_("create a pool from an XML file"),
.data = N_("create a pool from an XML file") .desc = N_("Create a pool."),
},
{.name = "desc",
.data = N_("Create a pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_create[] = { static const vshCmdOptDef opts_pool_create[] = {
@ -437,14 +427,9 @@ virshBuildPoolXML(vshControl *ctl,
/* /*
* "pool-create-as" command * "pool-create-as" command
*/ */
static const vshCmdInfo info_pool_create_as[] = { static const vshCmdInfo info_pool_create_as = {
{.name = "help", .help = N_("create a pool from a set of args"),
.data = N_("create a pool from a set of args") .desc = N_("Create a pool."),
},
{.name = "desc",
.data = N_("Create a pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_create_as[] = { static const vshCmdOptDef opts_pool_create_as[] = {
@ -503,15 +488,10 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-define" command * "pool-define" command
*/ */
static const vshCmdInfo info_pool_define[] = { static const vshCmdInfo info_pool_define = {
{.name = "help", .help = N_("define an inactive persistent storage pool or modify "
.data = N_("define an inactive persistent storage pool or modify " "an existing persistent one from an XML file"),
"an existing persistent one from an XML file") .desc = N_("Define or modify a persistent storage pool."),
},
{.name = "desc",
.data = N_("Define or modify a persistent storage pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_define[] = { static const vshCmdOptDef opts_pool_define[] = {
@ -554,14 +534,9 @@ cmdPoolDefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-define-as" command * "pool-define-as" command
*/ */
static const vshCmdInfo info_pool_define_as[] = { static const vshCmdInfo info_pool_define_as = {
{.name = "help", .help = N_("define a pool from a set of args"),
.data = N_("define a pool from a set of args") .desc = N_("Define a pool."),
},
{.name = "desc",
.data = N_("Define a pool.")
},
{.name = NULL}
}; };
static bool static bool
@ -593,14 +568,9 @@ cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-build" command * "pool-build" command
*/ */
static const vshCmdInfo info_pool_build[] = { static const vshCmdInfo info_pool_build = {
{.name = "help", .help = N_("build a pool"),
.data = N_("build a pool") .desc = N_("Build a given pool."),
},
{.name = "desc",
.data = N_("Build a given pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_build[] = { static const vshCmdOptDef opts_pool_build[] = {
@ -641,14 +611,9 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-destroy" command * "pool-destroy" command
*/ */
static const vshCmdInfo info_pool_destroy[] = { static const vshCmdInfo info_pool_destroy = {
{.name = "help", .help = N_("destroy (stop) a pool"),
.data = N_("destroy (stop) a pool") .desc = N_("Forcefully stop a given pool. Raw data in the pool is untouched"),
},
{.name = "desc",
.data = N_("Forcefully stop a given pool. Raw data in the pool is untouched")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_destroy[] = { static const vshCmdOptDef opts_pool_destroy[] = {
@ -680,14 +645,9 @@ cmdPoolDestroy(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-delete" command * "pool-delete" command
*/ */
static const vshCmdInfo info_pool_delete[] = { static const vshCmdInfo info_pool_delete = {
{.name = "help", .help = N_("delete a pool"),
.data = N_("delete a pool") .desc = N_("Delete a given pool."),
},
{.name = "desc",
.data = N_("Delete a given pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_delete[] = { static const vshCmdOptDef opts_pool_delete[] = {
@ -719,14 +679,9 @@ cmdPoolDelete(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-refresh" command * "pool-refresh" command
*/ */
static const vshCmdInfo info_pool_refresh[] = { static const vshCmdInfo info_pool_refresh = {
{.name = "help", .help = N_("refresh a pool"),
.data = N_("refresh a pool") .desc = N_("Refresh a given pool."),
},
{.name = "desc",
.data = N_("Refresh a given pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_refresh[] = { static const vshCmdOptDef opts_pool_refresh[] = {
@ -758,14 +713,9 @@ cmdPoolRefresh(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-dumpxml" command * "pool-dumpxml" command
*/ */
static const vshCmdInfo info_pool_dumpxml[] = { static const vshCmdInfo info_pool_dumpxml = {
{.name = "help", .help = N_("pool information in XML"),
.data = N_("pool information in XML") .desc = N_("Output the pool information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the pool information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_dumpxml[] = { static const vshCmdOptDef opts_pool_dumpxml[] = {
@ -1051,14 +1001,9 @@ virshStoragePoolStateToString(int state)
/* /*
* "pool-list" command * "pool-list" command
*/ */
static const vshCmdInfo info_pool_list[] = { static const vshCmdInfo info_pool_list = {
{.name = "help", .help = N_("list pools"),
.data = N_("list pools") .desc = N_("Returns list of pools."),
},
{.name = "desc",
.data = N_("Returns list of pools.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_list[] = { static const vshCmdOptDef opts_pool_list[] = {
@ -1401,14 +1346,9 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "find-storage-pool-sources-as" command * "find-storage-pool-sources-as" command
*/ */
static const vshCmdInfo info_find_storage_pool_sources_as[] = { static const vshCmdInfo info_find_storage_pool_sources_as = {
{.name = "help", .help = N_("find potential storage pool sources"),
.data = N_("find potential storage pool sources") .desc = N_("Returns XML <sources> document."),
},
{.name = "desc",
.data = N_("Returns XML <sources> document.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_find_storage_pool_sources_as[] = { static const vshCmdOptDef opts_find_storage_pool_sources_as[] = {
@ -1489,14 +1429,9 @@ cmdPoolDiscoverSourcesAs(vshControl * ctl, const vshCmd * cmd G_GNUC_UNUSED)
/* /*
* "find-storage-pool-sources" command * "find-storage-pool-sources" command
*/ */
static const vshCmdInfo info_find_storage_pool_sources[] = { static const vshCmdInfo info_find_storage_pool_sources = {
{.name = "help", .help = N_("discover potential storage pool sources"),
.data = N_("discover potential storage pool sources") .desc = N_("Returns XML <sources> document."),
},
{.name = "desc",
.data = N_("Returns XML <sources> document.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_find_storage_pool_sources[] = { static const vshCmdOptDef opts_find_storage_pool_sources[] = {
@ -1546,14 +1481,9 @@ cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd G_GNUC_UNUSED)
/* /*
* "pool-info" command * "pool-info" command
*/ */
static const vshCmdInfo info_pool_info[] = { static const vshCmdInfo info_pool_info = {
{.name = "help", .help = N_("storage pool information"),
.data = N_("storage pool information") .desc = N_("Returns basic information about the storage pool."),
},
{.name = "desc",
.data = N_("Returns basic information about the storage pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_info[] = { static const vshCmdOptDef opts_pool_info[] = {
@ -1636,14 +1566,9 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-name" command * "pool-name" command
*/ */
static const vshCmdInfo info_pool_name[] = { static const vshCmdInfo info_pool_name = {
{.name = "help", .help = N_("convert a pool UUID to pool name"),
.data = N_("convert a pool UUID to pool name") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_name[] = { static const vshCmdOptDef opts_pool_name[] = {
@ -1667,14 +1592,9 @@ cmdPoolName(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-start" command * "pool-start" command
*/ */
static const vshCmdInfo info_pool_start[] = { static const vshCmdInfo info_pool_start = {
{.name = "help", .help = N_("start a (previously defined) inactive pool"),
.data = N_("start a (previously defined) inactive pool") .desc = N_("Start a pool."),
},
{.name = "desc",
.data = N_("Start a pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_start[] = { static const vshCmdOptDef opts_pool_start[] = {
@ -1727,14 +1647,9 @@ cmdPoolStart(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-undefine" command * "pool-undefine" command
*/ */
static const vshCmdInfo info_pool_undefine[] = { static const vshCmdInfo info_pool_undefine = {
{.name = "help", .help = N_("undefine an inactive pool"),
.data = N_("undefine an inactive pool") .desc = N_("Undefine the configuration for an inactive pool."),
},
{.name = "desc",
.data = N_("Undefine the configuration for an inactive pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_undefine[] = { static const vshCmdOptDef opts_pool_undefine[] = {
@ -1766,14 +1681,9 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-uuid" command * "pool-uuid" command
*/ */
static const vshCmdInfo info_pool_uuid[] = { static const vshCmdInfo info_pool_uuid = {
{.name = "help", .help = N_("convert a pool name to pool UUID"),
.data = N_("convert a pool name to pool UUID") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_uuid[] = { static const vshCmdOptDef opts_pool_uuid[] = {
@ -1802,14 +1712,9 @@ cmdPoolUuid(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-edit" command * "pool-edit" command
*/ */
static const vshCmdInfo info_pool_edit[] = { static const vshCmdInfo info_pool_edit = {
{.name = "help", .help = N_("edit XML configuration for a storage pool"),
.data = N_("edit XML configuration for a storage pool") .desc = N_("Edit the XML configuration for a storage pool."),
},
{.name = "desc",
.data = N_("Edit the XML configuration for a storage pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_edit[] = { static const vshCmdOptDef opts_pool_edit[] = {
@ -1965,14 +1870,9 @@ virshPoolEventCallback virshPoolEventCallbacks[] = {
G_STATIC_ASSERT(VIR_STORAGE_POOL_EVENT_ID_LAST == G_N_ELEMENTS(virshPoolEventCallbacks)); G_STATIC_ASSERT(VIR_STORAGE_POOL_EVENT_ID_LAST == G_N_ELEMENTS(virshPoolEventCallbacks));
static const vshCmdInfo info_pool_event[] = { static const vshCmdInfo info_pool_event = {
{.name = "help", .help = N_("Storage Pool Events"),
.data = N_("Storage Pool Events") .desc = N_("List event types, or wait for storage pool events to occur"),
},
{.name = "desc",
.data = N_("List event types, or wait for storage pool events to occur")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_event[] = { static const vshCmdOptDef opts_pool_event[] = {
@ -2085,14 +1985,9 @@ cmdPoolEvent(vshControl *ctl, const vshCmd *cmd)
/* /*
* "pool-capabilities" command * "pool-capabilities" command
*/ */
static const vshCmdInfo info_pool_capabilities[] = { static const vshCmdInfo info_pool_capabilities = {
{.name = "help", .help = N_("storage pool capabilities"),
.data = N_("storage pool capabilities") .desc = N_("Returns capabilities of storage pool support."),
},
{.name = "desc",
.data = N_("Returns capabilities of storage pool support.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_pool_capabilities[] = { static const vshCmdOptDef opts_pool_capabilities[] = {
@ -2122,127 +2017,127 @@ const vshCmdDef storagePoolCmds[] = {
{.name = "find-storage-pool-sources-as", {.name = "find-storage-pool-sources-as",
.handler = cmdPoolDiscoverSourcesAs, .handler = cmdPoolDiscoverSourcesAs,
.opts = opts_find_storage_pool_sources_as, .opts = opts_find_storage_pool_sources_as,
.info = info_find_storage_pool_sources_as, .info = &info_find_storage_pool_sources_as,
.flags = 0 .flags = 0
}, },
{.name = "find-storage-pool-sources", {.name = "find-storage-pool-sources",
.handler = cmdPoolDiscoverSources, .handler = cmdPoolDiscoverSources,
.opts = opts_find_storage_pool_sources, .opts = opts_find_storage_pool_sources,
.info = info_find_storage_pool_sources, .info = &info_find_storage_pool_sources,
.flags = 0 .flags = 0
}, },
{.name = "pool-autostart", {.name = "pool-autostart",
.handler = cmdPoolAutostart, .handler = cmdPoolAutostart,
.opts = opts_pool_autostart, .opts = opts_pool_autostart,
.info = info_pool_autostart, .info = &info_pool_autostart,
.flags = 0 .flags = 0
}, },
{.name = "pool-build", {.name = "pool-build",
.handler = cmdPoolBuild, .handler = cmdPoolBuild,
.opts = opts_pool_build, .opts = opts_pool_build,
.info = info_pool_build, .info = &info_pool_build,
.flags = 0 .flags = 0
}, },
{.name = "pool-create-as", {.name = "pool-create-as",
.handler = cmdPoolCreateAs, .handler = cmdPoolCreateAs,
.opts = opts_pool_create_as, .opts = opts_pool_create_as,
.info = info_pool_create_as, .info = &info_pool_create_as,
.flags = 0 .flags = 0
}, },
{.name = "pool-create", {.name = "pool-create",
.handler = cmdPoolCreate, .handler = cmdPoolCreate,
.opts = opts_pool_create, .opts = opts_pool_create,
.info = info_pool_create, .info = &info_pool_create,
.flags = 0 .flags = 0
}, },
{.name = "pool-define-as", {.name = "pool-define-as",
.handler = cmdPoolDefineAs, .handler = cmdPoolDefineAs,
.opts = opts_pool_define_as, .opts = opts_pool_define_as,
.info = info_pool_define_as, .info = &info_pool_define_as,
.flags = 0 .flags = 0
}, },
{.name = "pool-define", {.name = "pool-define",
.handler = cmdPoolDefine, .handler = cmdPoolDefine,
.opts = opts_pool_define, .opts = opts_pool_define,
.info = info_pool_define, .info = &info_pool_define,
.flags = 0 .flags = 0
}, },
{.name = "pool-delete", {.name = "pool-delete",
.handler = cmdPoolDelete, .handler = cmdPoolDelete,
.opts = opts_pool_delete, .opts = opts_pool_delete,
.info = info_pool_delete, .info = &info_pool_delete,
.flags = 0 .flags = 0
}, },
{.name = "pool-destroy", {.name = "pool-destroy",
.handler = cmdPoolDestroy, .handler = cmdPoolDestroy,
.opts = opts_pool_destroy, .opts = opts_pool_destroy,
.info = info_pool_destroy, .info = &info_pool_destroy,
.flags = 0 .flags = 0
}, },
{.name = "pool-dumpxml", {.name = "pool-dumpxml",
.handler = cmdPoolDumpXML, .handler = cmdPoolDumpXML,
.opts = opts_pool_dumpxml, .opts = opts_pool_dumpxml,
.info = info_pool_dumpxml, .info = &info_pool_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "pool-edit", {.name = "pool-edit",
.handler = cmdPoolEdit, .handler = cmdPoolEdit,
.opts = opts_pool_edit, .opts = opts_pool_edit,
.info = info_pool_edit, .info = &info_pool_edit,
.flags = 0 .flags = 0
}, },
{.name = "pool-info", {.name = "pool-info",
.handler = cmdPoolInfo, .handler = cmdPoolInfo,
.opts = opts_pool_info, .opts = opts_pool_info,
.info = info_pool_info, .info = &info_pool_info,
.flags = 0 .flags = 0
}, },
{.name = "pool-list", {.name = "pool-list",
.handler = cmdPoolList, .handler = cmdPoolList,
.opts = opts_pool_list, .opts = opts_pool_list,
.info = info_pool_list, .info = &info_pool_list,
.flags = 0 .flags = 0
}, },
{.name = "pool-name", {.name = "pool-name",
.handler = cmdPoolName, .handler = cmdPoolName,
.opts = opts_pool_name, .opts = opts_pool_name,
.info = info_pool_name, .info = &info_pool_name,
.flags = 0 .flags = 0
}, },
{.name = "pool-refresh", {.name = "pool-refresh",
.handler = cmdPoolRefresh, .handler = cmdPoolRefresh,
.opts = opts_pool_refresh, .opts = opts_pool_refresh,
.info = info_pool_refresh, .info = &info_pool_refresh,
.flags = 0 .flags = 0
}, },
{.name = "pool-start", {.name = "pool-start",
.handler = cmdPoolStart, .handler = cmdPoolStart,
.opts = opts_pool_start, .opts = opts_pool_start,
.info = info_pool_start, .info = &info_pool_start,
.flags = 0 .flags = 0
}, },
{.name = "pool-undefine", {.name = "pool-undefine",
.handler = cmdPoolUndefine, .handler = cmdPoolUndefine,
.opts = opts_pool_undefine, .opts = opts_pool_undefine,
.info = info_pool_undefine, .info = &info_pool_undefine,
.flags = 0 .flags = 0
}, },
{.name = "pool-uuid", {.name = "pool-uuid",
.handler = cmdPoolUuid, .handler = cmdPoolUuid,
.opts = opts_pool_uuid, .opts = opts_pool_uuid,
.info = info_pool_uuid, .info = &info_pool_uuid,
.flags = 0 .flags = 0
}, },
{.name = "pool-event", {.name = "pool-event",
.handler = cmdPoolEvent, .handler = cmdPoolEvent,
.opts = opts_pool_event, .opts = opts_pool_event,
.info = info_pool_event, .info = &info_pool_event,
.flags = 0 .flags = 0
}, },
{.name = "pool-capabilities", {.name = "pool-capabilities",
.handler = cmdPoolCapabilities, .handler = cmdPoolCapabilities,
.opts = opts_pool_capabilities, .opts = opts_pool_capabilities,
.info = info_pool_capabilities, .info = &info_pool_capabilities,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -61,14 +61,9 @@ virshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name)
/* /*
* "secret-define" command * "secret-define" command
*/ */
static const vshCmdInfo info_secret_define[] = { static const vshCmdInfo info_secret_define = {
{.name = "help", .help = N_("define or modify a secret from an XML file"),
.data = N_("define or modify a secret from an XML file") .desc = N_("Define or modify a secret."),
},
{.name = "desc",
.data = N_("Define or modify a secret.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_define[] = { static const vshCmdOptDef opts_secret_define[] = {
@ -121,14 +116,9 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
/* /*
* "secret-dumpxml" command * "secret-dumpxml" command
*/ */
static const vshCmdInfo info_secret_dumpxml[] = { static const vshCmdInfo info_secret_dumpxml = {
{.name = "help", .help = N_("secret attributes in XML"),
.data = N_("secret attributes in XML") .desc = N_("Output attributes of a secret as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output attributes of a secret as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_dumpxml[] = { static const vshCmdOptDef opts_secret_dumpxml[] = {
@ -181,14 +171,9 @@ cmdSecretDumpXML(vshControl *ctl, const vshCmd *cmd)
/* /*
* "secret-set-value" command * "secret-set-value" command
*/ */
static const vshCmdInfo info_secret_set_value[] = { static const vshCmdInfo info_secret_set_value = {
{.name = "help", .help = N_("set a secret value"),
.data = N_("set a secret value") .desc = N_("Set a secret value."),
},
{.name = "desc",
.data = N_("Set a secret value.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_set_value[] = { static const vshCmdOptDef opts_secret_set_value[] = {
@ -297,14 +282,9 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd)
/* /*
* "secret-get-value" command * "secret-get-value" command
*/ */
static const vshCmdInfo info_secret_get_value[] = { static const vshCmdInfo info_secret_get_value = {
{.name = "help", .help = N_("Output a secret value"),
.data = N_("Output a secret value") .desc = N_("Output a secret value to stdout."),
},
{.name = "desc",
.data = N_("Output a secret value to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_get_value[] = { static const vshCmdOptDef opts_secret_get_value[] = {
@ -355,14 +335,9 @@ cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
/* /*
* "secret-undefine" command * "secret-undefine" command
*/ */
static const vshCmdInfo info_secret_undefine[] = { static const vshCmdInfo info_secret_undefine = {
{.name = "help", .help = N_("undefine a secret"),
.data = N_("undefine a secret") .desc = N_("Undefine a secret."),
},
{.name = "desc",
.data = N_("Undefine a secret.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_undefine[] = { static const vshCmdOptDef opts_secret_undefine[] = {
@ -539,14 +514,9 @@ virshSecretListCollect(vshControl *ctl,
/* /*
* "secret-list" command * "secret-list" command
*/ */
static const vshCmdInfo info_secret_list[] = { static const vshCmdInfo info_secret_list = {
{.name = "help", .help = N_("list secrets"),
.data = N_("list secrets") .desc = N_("Returns a list of secrets"),
},
{.name = "desc",
.data = N_("Returns a list of secrets")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_list[] = { static const vshCmdOptDef opts_secret_list[] = {
@ -732,14 +702,9 @@ virshSecretEventCallback virshSecretEventCallbacks[] = {
}; };
G_STATIC_ASSERT(VIR_SECRET_EVENT_ID_LAST == G_N_ELEMENTS(virshSecretEventCallbacks)); G_STATIC_ASSERT(VIR_SECRET_EVENT_ID_LAST == G_N_ELEMENTS(virshSecretEventCallbacks));
static const vshCmdInfo info_secret_event[] = { static const vshCmdInfo info_secret_event = {
{.name = "help", .help = N_("Secret Events"),
.data = N_("Secret Events") .desc = N_("List event types, or wait for secret events to occur"),
},
{.name = "desc",
.data = N_("List event types, or wait for secret events to occur")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_secret_event[] = { static const vshCmdOptDef opts_secret_event[] = {
@ -852,43 +817,43 @@ const vshCmdDef secretCmds[] = {
{.name = "secret-define", {.name = "secret-define",
.handler = cmdSecretDefine, .handler = cmdSecretDefine,
.opts = opts_secret_define, .opts = opts_secret_define,
.info = info_secret_define, .info = &info_secret_define,
.flags = 0 .flags = 0
}, },
{.name = "secret-dumpxml", {.name = "secret-dumpxml",
.handler = cmdSecretDumpXML, .handler = cmdSecretDumpXML,
.opts = opts_secret_dumpxml, .opts = opts_secret_dumpxml,
.info = info_secret_dumpxml, .info = &info_secret_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "secret-event", {.name = "secret-event",
.handler = cmdSecretEvent, .handler = cmdSecretEvent,
.opts = opts_secret_event, .opts = opts_secret_event,
.info = info_secret_event, .info = &info_secret_event,
.flags = 0 .flags = 0
}, },
{.name = "secret-get-value", {.name = "secret-get-value",
.handler = cmdSecretGetValue, .handler = cmdSecretGetValue,
.opts = opts_secret_get_value, .opts = opts_secret_get_value,
.info = info_secret_get_value, .info = &info_secret_get_value,
.flags = 0 .flags = 0
}, },
{.name = "secret-list", {.name = "secret-list",
.handler = cmdSecretList, .handler = cmdSecretList,
.opts = opts_secret_list, .opts = opts_secret_list,
.info = info_secret_list, .info = &info_secret_list,
.flags = 0 .flags = 0
}, },
{.name = "secret-set-value", {.name = "secret-set-value",
.handler = cmdSecretSetValue, .handler = cmdSecretSetValue,
.opts = opts_secret_set_value, .opts = opts_secret_set_value,
.info = info_secret_set_value, .info = &info_secret_set_value,
.flags = 0 .flags = 0
}, },
{.name = "secret-undefine", {.name = "secret-undefine",
.handler = cmdSecretUndefine, .handler = cmdSecretUndefine,
.opts = opts_secret_undefine, .opts = opts_secret_undefine,
.info = info_secret_undefine, .info = &info_secret_undefine,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -100,14 +100,9 @@ virshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
/* /*
* "snapshot-create" command * "snapshot-create" command
*/ */
static const vshCmdInfo info_snapshot_create[] = { static const vshCmdInfo info_snapshot_create = {
{.name = "help", .help = N_("Create a snapshot from XML"),
.data = N_("Create a snapshot from XML") .desc = N_("Create a snapshot (disk and RAM) from XML"),
},
{.name = "desc",
.data = N_("Create a snapshot (disk and RAM) from XML")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_create[] = { static const vshCmdOptDef opts_snapshot_create[] = {
@ -309,14 +304,9 @@ virshParseSnapshotDiskspec(vshControl *ctl, virBuffer *buf, const char *str)
return ret; return ret;
} }
static const vshCmdInfo info_snapshot_create_as[] = { static const vshCmdInfo info_snapshot_create_as = {
{.name = "help", .help = N_("Create a snapshot from a set of args"),
.data = N_("Create a snapshot from a set of args") .desc = N_("Create a snapshot (disk and RAM) from arguments"),
},
{.name = "desc",
.data = N_("Create a snapshot (disk and RAM) from arguments")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_create_as[] = { static const vshCmdOptDef opts_snapshot_create_as[] = {
@ -486,14 +476,9 @@ virshLookupSnapshot(vshControl *ctl, const vshCmd *cmd,
/* /*
* "snapshot-edit" command * "snapshot-edit" command
*/ */
static const vshCmdInfo info_snapshot_edit[] = { static const vshCmdInfo info_snapshot_edit = {
{.name = "help", .help = N_("edit XML for a snapshot"),
.data = N_("edit XML for a snapshot") .desc = N_("Edit the domain snapshot XML for a named snapshot"),
},
{.name = "desc",
.data = N_("Edit the domain snapshot XML for a named snapshot")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_edit[] = { static const vshCmdOptDef opts_snapshot_edit[] = {
@ -596,14 +581,9 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
/* /*
* "snapshot-current" command * "snapshot-current" command
*/ */
static const vshCmdInfo info_snapshot_current[] = { static const vshCmdInfo info_snapshot_current = {
{.name = "help", .help = N_("Get or set the current snapshot"),
.data = N_("Get or set the current snapshot") .desc = N_("Get or set the current snapshot"),
},
{.name = "desc",
.data = N_("Get or set the current snapshot")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_current[] = { static const vshCmdOptDef opts_snapshot_current[] = {
@ -808,14 +788,9 @@ virshSnapshotFilter(vshControl *ctl, virDomainSnapshotPtr snapshot,
/* /*
* "snapshot-info" command * "snapshot-info" command
*/ */
static const vshCmdInfo info_snapshot_info[] = { static const vshCmdInfo info_snapshot_info = {
{.name = "help", .help = N_("snapshot information"),
.data = N_("snapshot information") .desc = N_("Returns basic information about a snapshot."),
},
{.name = "desc",
.data = N_("Returns basic information about a snapshot.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_info[] = { static const vshCmdOptDef opts_snapshot_info[] = {
@ -1342,14 +1317,9 @@ virshSnapshotListLookup(int id, bool parent, void *opaque)
/* /*
* "snapshot-list" command * "snapshot-list" command
*/ */
static const vshCmdInfo info_snapshot_list[] = { static const vshCmdInfo info_snapshot_list = {
{.name = "help", .help = N_("List snapshots for a domain"),
.data = N_("List snapshots for a domain") .desc = N_("Snapshot List"),
},
{.name = "desc",
.data = N_("Snapshot List")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_list[] = { static const vshCmdOptDef opts_snapshot_list[] = {
@ -1589,14 +1559,9 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
/* /*
* "snapshot-dumpxml" command * "snapshot-dumpxml" command
*/ */
static const vshCmdInfo info_snapshot_dumpxml[] = { static const vshCmdInfo info_snapshot_dumpxml = {
{.name = "help", .help = N_("Dump XML for a domain snapshot"),
.data = N_("Dump XML for a domain snapshot") .desc = N_("Snapshot Dump XML"),
},
{.name = "desc",
.data = N_("Snapshot Dump XML")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_dumpxml[] = { static const vshCmdOptDef opts_snapshot_dumpxml[] = {
@ -1659,14 +1624,9 @@ cmdSnapshotDumpXML(vshControl *ctl, const vshCmd *cmd)
/* /*
* "snapshot-parent" command * "snapshot-parent" command
*/ */
static const vshCmdInfo info_snapshot_parent[] = { static const vshCmdInfo info_snapshot_parent = {
{.name = "help", .help = N_("Get the name of the parent of a snapshot"),
.data = N_("Get the name of the parent of a snapshot") .desc = N_("Extract the snapshot's parent, if any"),
},
{.name = "desc",
.data = N_("Extract the snapshot's parent, if any")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_parent[] = { static const vshCmdOptDef opts_snapshot_parent[] = {
@ -1711,14 +1671,9 @@ cmdSnapshotParent(vshControl *ctl, const vshCmd *cmd)
/* /*
* "snapshot-revert" command * "snapshot-revert" command
*/ */
static const vshCmdInfo info_snapshot_revert[] = { static const vshCmdInfo info_snapshot_revert = {
{.name = "help", .help = N_("Revert a domain to a snapshot"),
.data = N_("Revert a domain to a snapshot") .desc = N_("Revert domain to snapshot"),
},
{.name = "desc",
.data = N_("Revert domain to snapshot")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_revert[] = { static const vshCmdOptDef opts_snapshot_revert[] = {
@ -1797,14 +1752,9 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCmd *cmd)
/* /*
* "snapshot-delete" command * "snapshot-delete" command
*/ */
static const vshCmdInfo info_snapshot_delete[] = { static const vshCmdInfo info_snapshot_delete = {
{.name = "help", .help = N_("Delete a domain snapshot"),
.data = N_("Delete a domain snapshot") .desc = N_("Snapshot Delete"),
},
{.name = "desc",
.data = N_("Snapshot Delete")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_snapshot_delete[] = { static const vshCmdOptDef opts_snapshot_delete[] = {
@ -1872,61 +1822,61 @@ const vshCmdDef snapshotCmds[] = {
{.name = "snapshot-create", {.name = "snapshot-create",
.handler = cmdSnapshotCreate, .handler = cmdSnapshotCreate,
.opts = opts_snapshot_create, .opts = opts_snapshot_create,
.info = info_snapshot_create, .info = &info_snapshot_create,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-create-as", {.name = "snapshot-create-as",
.handler = cmdSnapshotCreateAs, .handler = cmdSnapshotCreateAs,
.opts = opts_snapshot_create_as, .opts = opts_snapshot_create_as,
.info = info_snapshot_create_as, .info = &info_snapshot_create_as,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-current", {.name = "snapshot-current",
.handler = cmdSnapshotCurrent, .handler = cmdSnapshotCurrent,
.opts = opts_snapshot_current, .opts = opts_snapshot_current,
.info = info_snapshot_current, .info = &info_snapshot_current,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-delete", {.name = "snapshot-delete",
.handler = cmdSnapshotDelete, .handler = cmdSnapshotDelete,
.opts = opts_snapshot_delete, .opts = opts_snapshot_delete,
.info = info_snapshot_delete, .info = &info_snapshot_delete,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-dumpxml", {.name = "snapshot-dumpxml",
.handler = cmdSnapshotDumpXML, .handler = cmdSnapshotDumpXML,
.opts = opts_snapshot_dumpxml, .opts = opts_snapshot_dumpxml,
.info = info_snapshot_dumpxml, .info = &info_snapshot_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-edit", {.name = "snapshot-edit",
.handler = cmdSnapshotEdit, .handler = cmdSnapshotEdit,
.opts = opts_snapshot_edit, .opts = opts_snapshot_edit,
.info = info_snapshot_edit, .info = &info_snapshot_edit,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-info", {.name = "snapshot-info",
.handler = cmdSnapshotInfo, .handler = cmdSnapshotInfo,
.opts = opts_snapshot_info, .opts = opts_snapshot_info,
.info = info_snapshot_info, .info = &info_snapshot_info,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-list", {.name = "snapshot-list",
.handler = cmdSnapshotList, .handler = cmdSnapshotList,
.opts = opts_snapshot_list, .opts = opts_snapshot_list,
.info = info_snapshot_list, .info = &info_snapshot_list,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-parent", {.name = "snapshot-parent",
.handler = cmdSnapshotParent, .handler = cmdSnapshotParent,
.opts = opts_snapshot_parent, .opts = opts_snapshot_parent,
.info = info_snapshot_parent, .info = &info_snapshot_parent,
.flags = 0 .flags = 0
}, },
{.name = "snapshot-revert", {.name = "snapshot-revert",
.handler = cmdDomainSnapshotRevert, .handler = cmdDomainSnapshotRevert,
.opts = opts_snapshot_revert, .opts = opts_snapshot_revert,
.info = info_snapshot_revert, .info = &info_snapshot_revert,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -164,14 +164,9 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
/* /*
* "vol-create-as" command * "vol-create-as" command
*/ */
static const vshCmdInfo info_vol_create_as[] = { static const vshCmdInfo info_vol_create_as = {
{.name = "help", .help = N_("create a volume from a set of args"),
.data = N_("create a volume from a set of args") .desc = N_("Create a vol."),
},
{.name = "desc",
.data = N_("Create a vol.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_create_as[] = { static const vshCmdOptDef opts_vol_create_as[] = {
@ -363,14 +358,9 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-create" command * "vol-create" command
*/ */
static const vshCmdInfo info_vol_create[] = { static const vshCmdInfo info_vol_create = {
{.name = "help", .help = N_("create a vol from an XML file"),
.data = N_("create a vol from an XML file") .desc = N_("Create a vol."),
},
{.name = "desc",
.data = N_("Create a vol.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_create[] = { static const vshCmdOptDef opts_vol_create[] = {
@ -426,14 +416,9 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-create-from" command * "vol-create-from" command
*/ */
static const vshCmdInfo info_vol_create_from[] = { static const vshCmdInfo info_vol_create_from = {
{.name = "help", .help = N_("create a vol, using another volume as input"),
.data = N_("create a vol, using another volume as input") .desc = N_("Create a vol from an existing volume."),
},
{.name = "desc",
.data = N_("Create a vol from an existing volume.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_create_from[] = { static const vshCmdOptDef opts_vol_create_from[] = {
@ -526,14 +511,9 @@ virshMakeCloneXML(const char *origxml, const char *newname)
/* /*
* "vol-clone" command * "vol-clone" command
*/ */
static const vshCmdInfo info_vol_clone[] = { static const vshCmdInfo info_vol_clone = {
{.name = "help", .help = N_("clone a volume."),
.data = N_("clone a volume.") .desc = N_("Clone an existing volume within the parent pool."),
},
{.name = "desc",
.data = N_("Clone an existing volume within the parent pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_clone[] = { static const vshCmdOptDef opts_vol_clone[] = {
@ -616,14 +596,9 @@ cmdVolClone(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-upload" command * "vol-upload" command
*/ */
static const vshCmdInfo info_vol_upload[] = { static const vshCmdInfo info_vol_upload = {
{.name = "help", .help = N_("upload file contents to a volume"),
.data = N_("upload file contents to a volume") .desc = N_("Upload file contents to a volume"),
},
{.name = "desc",
.data = N_("Upload file contents to a volume")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_upload[] = { static const vshCmdOptDef opts_vol_upload[] = {
@ -729,14 +704,9 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-download" command * "vol-download" command
*/ */
static const vshCmdInfo info_vol_download[] = { static const vshCmdInfo info_vol_download = {
{.name = "help", .help = N_("download volume contents to a file"),
.data = N_("download volume contents to a file") .desc = N_("Download volume contents to a file"),
},
{.name = "desc",
.data = N_("Download volume contents to a file")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_download[] = { static const vshCmdOptDef opts_vol_download[] = {
@ -845,14 +815,9 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-delete" command * "vol-delete" command
*/ */
static const vshCmdInfo info_vol_delete[] = { static const vshCmdInfo info_vol_delete = {
{.name = "help", .help = N_("delete a vol"),
.data = N_("delete a vol") .desc = N_("Delete a given vol."),
},
{.name = "desc",
.data = N_("Delete a given vol.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_delete[] = { static const vshCmdOptDef opts_vol_delete[] = {
@ -894,14 +859,9 @@ cmdVolDelete(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-wipe" command * "vol-wipe" command
*/ */
static const vshCmdInfo info_vol_wipe[] = { static const vshCmdInfo info_vol_wipe = {
{.name = "help", .help = N_("wipe a vol"),
.data = N_("wipe a vol") .desc = N_("Ensure data previously on a volume is not accessible to future reads"),
},
{.name = "desc",
.data = N_("Ensure data previously on a volume is not accessible to future reads")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_wipe[] = { static const vshCmdOptDef opts_vol_wipe[] = {
@ -978,14 +938,9 @@ virshVolumeTypeToString(int type)
/* /*
* "vol-info" command * "vol-info" command
*/ */
static const vshCmdInfo info_vol_info[] = { static const vshCmdInfo info_vol_info = {
{.name = "help", .help = N_("storage vol information"),
.data = N_("storage vol information") .desc = N_("Returns basic information about the storage vol."),
},
{.name = "desc",
.data = N_("Returns basic information about the storage vol.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_info[] = { static const vshCmdOptDef opts_vol_info[] = {
@ -1058,16 +1013,11 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-resize" command * "vol-resize" command
*/ */
static const vshCmdInfo info_vol_resize[] = { static const vshCmdInfo info_vol_resize = {
{.name = "help", .help = N_("resize a vol"),
.data = N_("resize a vol") .desc = N_("Resizes a storage volume. This is safe only for storage "
},
{.name = "desc",
.data = N_("Resizes a storage volume. This is safe only for storage "
"volumes not in use by an active guest.\n" "volumes not in use by an active guest.\n"
"See blockresize for live resizing.") "See blockresize for live resizing."),
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_resize[] = { static const vshCmdOptDef opts_vol_resize[] = {
@ -1153,14 +1103,9 @@ cmdVolResize(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-dumpxml" command * "vol-dumpxml" command
*/ */
static const vshCmdInfo info_vol_dumpxml[] = { static const vshCmdInfo info_vol_dumpxml = {
{.name = "help", .help = N_("vol information in XML"),
.data = N_("vol information in XML") .desc = N_("Output the vol information as an XML dump to stdout."),
},
{.name = "desc",
.data = N_("Output the vol information as an XML dump to stdout.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_dumpxml[] = { static const vshCmdOptDef opts_vol_dumpxml[] = {
@ -1327,14 +1272,9 @@ virshStorageVolListCollect(vshControl *ctl,
/* /*
* "vol-list" command * "vol-list" command
*/ */
static const vshCmdInfo info_vol_list[] = { static const vshCmdInfo info_vol_list = {
{.name = "help", .help = N_("list vols"),
.data = N_("list vols") .desc = N_("Returns list of vols by pool."),
},
{.name = "desc",
.data = N_("Returns list of vols by pool.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_list[] = { static const vshCmdOptDef opts_vol_list[] = {
@ -1485,14 +1425,9 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
/* /*
* "vol-name" command * "vol-name" command
*/ */
static const vshCmdInfo info_vol_name[] = { static const vshCmdInfo info_vol_name = {
{.name = "help", .help = N_("returns the volume name for a given volume key or path"),
.data = N_("returns the volume name for a given volume key or path") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_name[] = { static const vshCmdOptDef opts_vol_name[] = {
@ -1516,14 +1451,9 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-pool" command * "vol-pool" command
*/ */
static const vshCmdInfo info_vol_pool[] = { static const vshCmdInfo info_vol_pool = {
{.name = "help", .help = N_("returns the storage pool for a given volume key or path"),
.data = N_("returns the storage pool for a given volume key or path") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_pool[] = { static const vshCmdOptDef opts_vol_pool[] = {
@ -1571,14 +1501,9 @@ cmdVolPool(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-key" command * "vol-key" command
*/ */
static const vshCmdInfo info_vol_key[] = { static const vshCmdInfo info_vol_key = {
{.name = "help", .help = N_("returns the volume key for a given volume name or path"),
.data = N_("returns the volume key for a given volume name or path") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_key[] = { static const vshCmdOptDef opts_vol_key[] = {
@ -1602,14 +1527,9 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd)
/* /*
* "vol-path" command * "vol-path" command
*/ */
static const vshCmdInfo info_vol_path[] = { static const vshCmdInfo info_vol_path = {
{.name = "help", .help = N_("returns the volume path for a given volume name or key"),
.data = N_("returns the volume path for a given volume name or key") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_vol_path[] = { static const vshCmdOptDef opts_vol_path[] = {
@ -1639,97 +1559,97 @@ const vshCmdDef storageVolCmds[] = {
{.name = "vol-clone", {.name = "vol-clone",
.handler = cmdVolClone, .handler = cmdVolClone,
.opts = opts_vol_clone, .opts = opts_vol_clone,
.info = info_vol_clone, .info = &info_vol_clone,
.flags = 0 .flags = 0
}, },
{.name = "vol-create-as", {.name = "vol-create-as",
.handler = cmdVolCreateAs, .handler = cmdVolCreateAs,
.opts = opts_vol_create_as, .opts = opts_vol_create_as,
.info = info_vol_create_as, .info = &info_vol_create_as,
.flags = 0 .flags = 0
}, },
{.name = "vol-create", {.name = "vol-create",
.handler = cmdVolCreate, .handler = cmdVolCreate,
.opts = opts_vol_create, .opts = opts_vol_create,
.info = info_vol_create, .info = &info_vol_create,
.flags = 0 .flags = 0
}, },
{.name = "vol-create-from", {.name = "vol-create-from",
.handler = cmdVolCreateFrom, .handler = cmdVolCreateFrom,
.opts = opts_vol_create_from, .opts = opts_vol_create_from,
.info = info_vol_create_from, .info = &info_vol_create_from,
.flags = 0 .flags = 0
}, },
{.name = "vol-delete", {.name = "vol-delete",
.handler = cmdVolDelete, .handler = cmdVolDelete,
.opts = opts_vol_delete, .opts = opts_vol_delete,
.info = info_vol_delete, .info = &info_vol_delete,
.flags = 0 .flags = 0
}, },
{.name = "vol-download", {.name = "vol-download",
.handler = cmdVolDownload, .handler = cmdVolDownload,
.opts = opts_vol_download, .opts = opts_vol_download,
.info = info_vol_download, .info = &info_vol_download,
.flags = 0 .flags = 0
}, },
{.name = "vol-dumpxml", {.name = "vol-dumpxml",
.handler = cmdVolDumpXML, .handler = cmdVolDumpXML,
.opts = opts_vol_dumpxml, .opts = opts_vol_dumpxml,
.info = info_vol_dumpxml, .info = &info_vol_dumpxml,
.flags = 0 .flags = 0
}, },
{.name = "vol-info", {.name = "vol-info",
.handler = cmdVolInfo, .handler = cmdVolInfo,
.opts = opts_vol_info, .opts = opts_vol_info,
.info = info_vol_info, .info = &info_vol_info,
.flags = 0 .flags = 0
}, },
{.name = "vol-key", {.name = "vol-key",
.handler = cmdVolKey, .handler = cmdVolKey,
.opts = opts_vol_key, .opts = opts_vol_key,
.info = info_vol_key, .info = &info_vol_key,
.flags = 0 .flags = 0
}, },
{.name = "vol-list", {.name = "vol-list",
.handler = cmdVolList, .handler = cmdVolList,
.opts = opts_vol_list, .opts = opts_vol_list,
.info = info_vol_list, .info = &info_vol_list,
.flags = 0 .flags = 0
}, },
{.name = "vol-name", {.name = "vol-name",
.handler = cmdVolName, .handler = cmdVolName,
.opts = opts_vol_name, .opts = opts_vol_name,
.info = info_vol_name, .info = &info_vol_name,
.flags = 0 .flags = 0
}, },
{.name = "vol-path", {.name = "vol-path",
.handler = cmdVolPath, .handler = cmdVolPath,
.opts = opts_vol_path, .opts = opts_vol_path,
.info = info_vol_path, .info = &info_vol_path,
.flags = 0 .flags = 0
}, },
{.name = "vol-pool", {.name = "vol-pool",
.handler = cmdVolPool, .handler = cmdVolPool,
.opts = opts_vol_pool, .opts = opts_vol_pool,
.info = info_vol_pool, .info = &info_vol_pool,
.flags = 0 .flags = 0
}, },
{.name = "vol-resize", {.name = "vol-resize",
.handler = cmdVolResize, .handler = cmdVolResize,
.opts = opts_vol_resize, .opts = opts_vol_resize,
.info = info_vol_resize, .info = &info_vol_resize,
.flags = 0 .flags = 0
}, },
{.name = "vol-upload", {.name = "vol-upload",
.handler = cmdVolUpload, .handler = cmdVolUpload,
.opts = opts_vol_upload, .opts = opts_vol_upload,
.info = info_vol_upload, .info = &info_vol_upload,
.flags = 0 .flags = 0
}, },
{.name = "vol-wipe", {.name = "vol-wipe",
.handler = cmdVolWipe, .handler = cmdVolWipe,
.opts = opts_vol_wipe, .opts = opts_vol_wipe,
.info = info_vol_wipe, .info = &info_vol_wipe,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -256,15 +256,10 @@ static const vshCmdOptDef opts_connect[] = {
{.name = NULL} {.name = NULL}
}; };
static const vshCmdInfo info_connect[] = { static const vshCmdInfo info_connect = {
{.name = "help", .help = N_("(re)connect to hypervisor"),
.data = N_("(re)connect to hypervisor") .desc = N_("Connect to local hypervisor. This is built-in "
}, "command after shell start up."),
{.name = "desc",
.data = N_("Connect to local hypervisor. This is built-in "
"command after shell start up.")
},
{.name = NULL}
}; };
static bool static bool
@ -464,8 +459,7 @@ virshUsage(void)
cmd->flags & VSH_CMD_FLAG_HIDDEN) cmd->flags & VSH_CMD_FLAG_HIDDEN)
continue; continue;
fprintf(stdout, fprintf(stdout,
" %-30s %s\n", cmd->name, " %-30s %s\n", cmd->name, _(cmd->info->help));
_(vshCmddefGetInfo(cmd, "help")));
} }
fprintf(stdout, "\n"); fprintf(stdout, "\n");
} }
@ -795,7 +789,7 @@ static const vshCmdDef virshCmds[] = {
{.name = "connect", {.name = "connect",
.handler = cmdConnect, .handler = cmdConnect,
.opts = opts_connect, .opts = opts_connect,
.info = info_connect, .info = &info_connect,
.flags = VSH_CMD_FLAG_NOCONNECT .flags = VSH_CMD_FLAG_NOCONNECT
}, },
{.name = NULL} {.name = NULL}

View File

@ -167,14 +167,9 @@ vshAdmReconnect(vshControl *ctl)
* 'uri' command * 'uri' command
*/ */
static const vshCmdInfo info_uri[] = { static const vshCmdInfo info_uri = {
{.name = "help", .help = N_("print the admin server URI"),
.data = N_("print the admin server URI") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
static bool static bool
@ -198,14 +193,9 @@ cmdURI(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
* "version" command * "version" command
*/ */
static const vshCmdInfo info_version[] = { static const vshCmdInfo info_version = {
{.name = "help", .help = N_("show version"),
.data = N_("show version") .desc = N_("Display the system and also the daemon version information."),
},
{.name = "desc",
.data = N_("Display the system and also the daemon version information.")
},
{.name = NULL}
}; };
static bool static bool
@ -270,14 +260,9 @@ static const vshCmdOptDef opts_connect[] = {
{.name = NULL} {.name = NULL}
}; };
static const vshCmdInfo info_connect[] = { static const vshCmdInfo info_connect = {
{.name = "help", .help = N_("connect to daemon's admin server"),
.data = N_("connect to daemon's admin server") .desc = N_("Connect to a daemon's administrating server."),
},
{.name = "desc",
.data = N_("Connect to a daemon's administrating server.")
},
{.name = NULL}
}; };
static bool static bool
@ -308,14 +293,9 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
* ------------------- * -------------------
*/ */
static const vshCmdInfo info_srv_list[] = { static const vshCmdInfo info_srv_list = {
{.name = "help", .help = N_("list available servers on a daemon"),
.data = N_("list available servers on a daemon") .desc = N_("List all manageable servers on a daemon."),
},
{.name = "desc",
.data = N_("List all manageable servers on a daemon.")
},
{.name = NULL}
}; };
static bool static bool
@ -371,14 +351,9 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
* ------------------------------ * ------------------------------
*/ */
static const vshCmdInfo info_srv_threadpool_info[] = { static const vshCmdInfo info_srv_threadpool_info = {
{.name = "help", .help = N_("get server workerpool parameters"),
.data = N_("get server workerpool parameters") .desc = N_("Retrieve threadpool attributes from a server."),
},
{.name = "desc",
.data = N_("Retrieve threadpool attributes from a server.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_srv_threadpool_info[] = { static const vshCmdOptDef opts_srv_threadpool_info[] = {
@ -432,15 +407,10 @@ cmdSrvThreadpoolInfo(vshControl *ctl, const vshCmd *cmd)
* ----------------------------- * -----------------------------
*/ */
static const vshCmdInfo info_srv_threadpool_set[] = { static const vshCmdInfo info_srv_threadpool_set = {
{.name = "help", .help = N_("set server workerpool parameters"),
.data = N_("set server workerpool parameters") .desc = N_("Tune threadpool attributes on a server. See OPTIONS for "
}, "currently supported attributes."),
{.name = "desc",
.data = N_("Tune threadpool attributes on a server. See OPTIONS for "
"currently supported attributes.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_srv_threadpool_set[] = { static const vshCmdOptDef opts_srv_threadpool_set[] = {
@ -539,14 +509,9 @@ cmdSrvThreadpoolSet(vshControl *ctl, const vshCmd *cmd)
* --------------------------- * ---------------------------
*/ */
static const vshCmdInfo info_srv_clients_list[] = { static const vshCmdInfo info_srv_clients_list = {
{.name = "help", .help = N_("list clients connected to <server>"),
.data = N_("list clients connected to <server>") .desc = N_("List all manageable clients connected to <server>."),
},
{.name = "desc",
.data = N_("List all manageable clients connected to <server>.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_srv_clients_list[] = { static const vshCmdOptDef opts_srv_clients_list[] = {
@ -626,14 +591,9 @@ cmdSrvClientsList(vshControl *ctl, const vshCmd *cmd)
* ------------------- * -------------------
*/ */
static const vshCmdInfo info_client_info[] = { static const vshCmdInfo info_client_info = {
{.name = "help", .help = N_("retrieve client's identity info from server"),
.data = N_("retrieve client's identity info from server") .desc = N_("Retrieve identity details about <client> from <server>"),
},
{.name = "desc",
.data = N_("Retrieve identity details about <client> from <server>")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_client_info[] = { static const vshCmdOptDef opts_client_info[] = {
@ -712,15 +672,10 @@ cmdClientInfo(vshControl *ctl, const vshCmd *cmd)
* ------------------------- * -------------------------
*/ */
static const vshCmdInfo info_client_disconnect[] = { static const vshCmdInfo info_client_disconnect = {
{.name = "help", .help = N_("force disconnect a client from the given server"),
.data = N_("force disconnect a client from the given server") .desc = N_("Force close a specific client's connection to the given "
}, "server."),
{.name = "desc",
.data = N_("Force close a specific client's connection to the given "
"server.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_client_disconnect[] = { static const vshCmdOptDef opts_client_disconnect[] = {
@ -779,14 +734,9 @@ cmdClientDisconnect(vshControl *ctl, const vshCmd *cmd)
* --------------------------- * ---------------------------
*/ */
static const vshCmdInfo info_srv_clients_info[] = { static const vshCmdInfo info_srv_clients_info = {
{.name = "help", .help = N_("get server's client-related configuration limits"),
.data = N_("get server's client-related configuration limits") .desc = N_("Retrieve server's client-related configuration limits"),
},
{.name = "desc",
.data = N_("Retrieve server's client-related configuration limits")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_srv_clients_info[] = { static const vshCmdOptDef opts_srv_clients_info[] = {
@ -837,15 +787,10 @@ cmdSrvClientsInfo(vshControl *ctl, const vshCmd *cmd)
* -------------------------- * --------------------------
*/ */
static const vshCmdInfo info_srv_clients_set[] = { static const vshCmdInfo info_srv_clients_set = {
{.name = "help", .help = N_("set server's client-related configuration limits"),
.data = N_("set server's client-related configuration limits") .desc = N_("Tune server's client-related configuration limits. "
}, "See OPTIONS for currently supported attributes."),
{.name = "desc",
.data = N_("Tune server's client-related configuration limits. "
"See OPTIONS for currently supported attributes.")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_srv_clients_set[] = { static const vshCmdOptDef opts_srv_clients_set[] = {
@ -938,16 +883,11 @@ cmdSrvClientsSet(vshControl *ctl, const vshCmd *cmd)
* Command server-update-tls * Command server-update-tls
* -------------------------- * --------------------------
*/ */
static const vshCmdInfo info_srv_update_tls_file[] = { static const vshCmdInfo info_srv_update_tls_file = {
{.name = "help", .help = N_("notify server to update TLS related files online."),
.data = N_("notify server to update TLS related files online.") .desc = N_("notify server to update the CA cert, "
},
{.name = "desc",
.data = N_("notify server to update the CA cert, "
"CA CRL, server cert / key without restarts. " "CA CRL, server cert / key without restarts. "
"See OPTIONS for currently supported attributes.") "See OPTIONS for currently supported attributes."),
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_srv_update_tls_file[] = { static const vshCmdOptDef opts_srv_update_tls_file[] = {
@ -992,17 +932,12 @@ cmdSrvUpdateTlsFiles(vshControl *ctl, const vshCmd *cmd)
* Command daemon-log-filters * Command daemon-log-filters
* -------------------------- * --------------------------
*/ */
static const vshCmdInfo info_daemon_log_filters[] = { static const vshCmdInfo info_daemon_log_filters = {
{.name = "help", .help = N_("fetch or set the currently defined set of logging filters on "
.data = N_("fetch or set the currently defined set of logging filters on " "daemon"),
"daemon") .desc = N_("Depending on whether run with or without options, the command "
},
{.name = "desc",
.data = N_("Depending on whether run with or without options, the command "
"fetches or redefines the existing active set of filters on " "fetches or redefines the existing active set of filters on "
"daemon.") "daemon."),
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_daemon_log_filters[] = { static const vshCmdOptDef opts_daemon_log_filters[] = {
@ -1045,17 +980,12 @@ cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd)
* Command daemon-log-outputs * Command daemon-log-outputs
* -------------------------- * --------------------------
*/ */
static const vshCmdInfo info_daemon_log_outputs[] = { static const vshCmdInfo info_daemon_log_outputs = {
{.name = "help", .help = N_("fetch or set the currently defined set of logging outputs on "
.data = N_("fetch or set the currently defined set of logging outputs on " "daemon"),
"daemon") .desc = N_("Depending on whether run with or without options, the command "
},
{.name = "desc",
.data = N_("Depending on whether run with or without options, the command "
"fetches or redefines the existing active set of outputs on " "fetches or redefines the existing active set of outputs on "
"daemon.") "daemon."),
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_daemon_timeout[] = { static const vshCmdOptDef opts_daemon_timeout[] = {
@ -1087,14 +1017,9 @@ cmdDaemonTimeout(vshControl *ctl, const vshCmd *cmd)
* Command daemon-timeout * Command daemon-timeout
* -------------------------- * --------------------------
*/ */
static const vshCmdInfo info_daemon_timeout[] = { static const vshCmdInfo info_daemon_timeout = {
{.name = "help", .help = N_("set the auto shutdown timeout of the daemon"),
.data = N_("set the auto shutdown timeout of the daemon") .desc = N_("set the auto shutdown timeout of the daemon"),
},
{.name = "desc",
.data = N_("set the auto shutdown timeout of the daemon")
},
{.name = NULL}
}; };
static const vshCmdOptDef opts_daemon_log_outputs[] = { static const vshCmdOptDef opts_daemon_log_outputs[] = {
@ -1266,8 +1191,7 @@ vshAdmUsage(void)
cmd->flags & VSH_CMD_FLAG_HIDDEN) cmd->flags & VSH_CMD_FLAG_HIDDEN)
continue; continue;
fprintf(stdout, fprintf(stdout,
" %-30s %s\n", cmd->name, " %-30s %s\n", cmd->name, _(cmd->info->help));
_(vshCmddefGetInfo(cmd, "help")));
} }
fprintf(stdout, "\n"); fprintf(stdout, "\n");
} }
@ -1409,19 +1333,19 @@ static const vshCmdDef vshAdmCmds[] = {
{.name = "uri", {.name = "uri",
.handler = cmdURI, .handler = cmdURI,
.opts = NULL, .opts = NULL,
.info = info_uri, .info = &info_uri,
.flags = 0 .flags = 0
}, },
{.name = "version", {.name = "version",
.handler = cmdVersion, .handler = cmdVersion,
.opts = NULL, .opts = NULL,
.info = info_version, .info = &info_version,
.flags = 0 .flags = 0
}, },
{.name = "connect", {.name = "connect",
.handler = cmdConnect, .handler = cmdConnect,
.opts = opts_connect, .opts = opts_connect,
.info = info_connect, .info = &info_connect,
.flags = VSH_CMD_FLAG_NOCONNECT .flags = VSH_CMD_FLAG_NOCONNECT
}, },
{.name = NULL} {.name = NULL}
@ -1434,7 +1358,7 @@ static const vshCmdDef monitoringCmds[] = {
{.name = "server-list", {.name = "server-list",
.handler = cmdSrvList, .handler = cmdSrvList,
.opts = NULL, .opts = NULL,
.info = info_srv_list, .info = &info_srv_list,
.flags = 0 .flags = 0
}, },
{.name = "srv-threadpool-info", {.name = "srv-threadpool-info",
@ -1443,7 +1367,7 @@ static const vshCmdDef monitoringCmds[] = {
{.name = "server-threadpool-info", {.name = "server-threadpool-info",
.handler = cmdSrvThreadpoolInfo, .handler = cmdSrvThreadpoolInfo,
.opts = opts_srv_threadpool_info, .opts = opts_srv_threadpool_info,
.info = info_srv_threadpool_info, .info = &info_srv_threadpool_info,
.flags = 0 .flags = 0
}, },
{.name = "srv-clients-list", {.name = "srv-clients-list",
@ -1452,13 +1376,13 @@ static const vshCmdDef monitoringCmds[] = {
{.name = "client-list", {.name = "client-list",
.handler = cmdSrvClientsList, .handler = cmdSrvClientsList,
.opts = opts_srv_clients_list, .opts = opts_srv_clients_list,
.info = info_srv_clients_list, .info = &info_srv_clients_list,
.flags = 0 .flags = 0
}, },
{.name = "client-info", {.name = "client-info",
.handler = cmdClientInfo, .handler = cmdClientInfo,
.opts = opts_client_info, .opts = opts_client_info,
.info = info_client_info, .info = &info_client_info,
.flags = 0 .flags = 0
}, },
{.name = "srv-clients-info", {.name = "srv-clients-info",
@ -1467,7 +1391,7 @@ static const vshCmdDef monitoringCmds[] = {
{.name = "server-clients-info", {.name = "server-clients-info",
.handler = cmdSrvClientsInfo, .handler = cmdSrvClientsInfo,
.opts = opts_srv_clients_info, .opts = opts_srv_clients_info,
.info = info_srv_clients_info, .info = &info_srv_clients_info,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}
@ -1480,13 +1404,13 @@ static const vshCmdDef managementCmds[] = {
{.name = "server-threadpool-set", {.name = "server-threadpool-set",
.handler = cmdSrvThreadpoolSet, .handler = cmdSrvThreadpoolSet,
.opts = opts_srv_threadpool_set, .opts = opts_srv_threadpool_set,
.info = info_srv_threadpool_set, .info = &info_srv_threadpool_set,
.flags = 0 .flags = 0
}, },
{.name = "client-disconnect", {.name = "client-disconnect",
.handler = cmdClientDisconnect, .handler = cmdClientDisconnect,
.opts = opts_client_disconnect, .opts = opts_client_disconnect,
.info = info_client_disconnect, .info = &info_client_disconnect,
.flags = 0 .flags = 0
}, },
{.name = "srv-clients-set", {.name = "srv-clients-set",
@ -1495,7 +1419,7 @@ static const vshCmdDef managementCmds[] = {
{.name = "server-clients-set", {.name = "server-clients-set",
.handler = cmdSrvClientsSet, .handler = cmdSrvClientsSet,
.opts = opts_srv_clients_set, .opts = opts_srv_clients_set,
.info = info_srv_clients_set, .info = &info_srv_clients_set,
.flags = 0 .flags = 0
}, },
{.name = "srv-update-tls", {.name = "srv-update-tls",
@ -1504,25 +1428,25 @@ static const vshCmdDef managementCmds[] = {
{.name = "server-update-tls", {.name = "server-update-tls",
.handler = cmdSrvUpdateTlsFiles, .handler = cmdSrvUpdateTlsFiles,
.opts = opts_srv_update_tls_file, .opts = opts_srv_update_tls_file,
.info = info_srv_update_tls_file, .info = &info_srv_update_tls_file,
.flags = 0 .flags = 0
}, },
{.name = "daemon-log-filters", {.name = "daemon-log-filters",
.handler = cmdDaemonLogFilters, .handler = cmdDaemonLogFilters,
.opts = opts_daemon_log_filters, .opts = opts_daemon_log_filters,
.info = info_daemon_log_filters, .info = &info_daemon_log_filters,
.flags = 0 .flags = 0
}, },
{.name = "daemon-log-outputs", {.name = "daemon-log-outputs",
.handler = cmdDaemonLogOutputs, .handler = cmdDaemonLogOutputs,
.opts = opts_daemon_log_outputs, .opts = opts_daemon_log_outputs,
.info = info_daemon_log_outputs, .info = &info_daemon_log_outputs,
.flags = 0 .flags = 0
}, },
{.name = "daemon-timeout", {.name = "daemon-timeout",
.handler = cmdDaemonTimeout, .handler = cmdDaemonTimeout,
.opts = opts_daemon_timeout, .opts = opts_daemon_timeout,
.info = info_daemon_timeout, .info = &info_daemon_timeout,
.flags = 0 .flags = 0
}, },
{.name = NULL} {.name = NULL}

View File

@ -239,22 +239,6 @@ vshReportError(vshControl *ctl)
*/ */
static int disconnected; /* we may have been disconnected */ static int disconnected; /* we may have been disconnected */
/* ---------------
* Utils for work with command definition
* ---------------
*/
const char *
vshCmddefGetInfo(const vshCmdDef * cmd, const char *name)
{
const vshCmdInfo *info;
for (info = cmd->info; info && info->name; info++) {
if (STREQ(info->name, name))
return info->data;
}
return NULL;
}
/* Check if the internal command definitions are correct. /* Check if the internal command definitions are correct.
* None of the errors are to be marked as translatable. */ * None of the errors are to be marked as translatable. */
static int static int
@ -263,7 +247,6 @@ vshCmddefCheckInternals(vshControl *ctl,
bool missingCompleters) bool missingCompleters)
{ {
size_t i; size_t i;
const char *help = NULL;
bool seenOptionalOption = false; bool seenOptionalOption = false;
g_auto(virBuffer) complbuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) complbuf = VIR_BUFFER_INITIALIZER;
@ -308,7 +291,7 @@ vshCmddefCheckInternals(vshControl *ctl,
} }
/* Each command has to provide a non-empty help string. */ /* Each command has to provide a non-empty help string. */
if (!(help = vshCmddefGetInfo(cmd, "help")) || !*help) { if (!cmd->info || !cmd->info->help || !*cmd->info->help) {
vshError(ctl, "command '%s' lacks help", cmd->name); vshError(ctl, "command '%s' lacks help", cmd->name);
return -1; return -1;
} }
@ -627,8 +610,7 @@ vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp)
if (cmd->alias || if (cmd->alias ||
cmd->flags & VSH_CMD_FLAG_HIDDEN) cmd->flags & VSH_CMD_FLAG_HIDDEN)
continue; continue;
vshPrint(ctl, " %-30s %s\n", cmd->name, vshPrint(ctl, " %-30s %s\n", cmd->name, _(cmd->info->help));
_(vshCmddefGetInfo(cmd, "help")));
} }
return true; return true;
@ -637,13 +619,11 @@ vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp)
static bool static bool
vshCmddefHelp(const vshCmdDef *def) vshCmddefHelp(const vshCmdDef *def)
{ {
const char *desc = NULL;
char buf[256]; char buf[256];
bool shortopt = false; /* true if 'arg' works instead of '--opt arg' */ bool shortopt = false; /* true if 'arg' works instead of '--opt arg' */
fputs(_(" NAME\n"), stdout); fputs(_(" NAME\n"), stdout);
fprintf(stdout, " %s - %s\n", def->name, fprintf(stdout, " %s - %s\n", def->name, _(def->info->help));
_(vshCmddefGetInfo(def, "help")));
fputs(_("\n SYNOPSIS\n"), stdout); fputs(_("\n SYNOPSIS\n"), stdout);
fprintf(stdout, " %s", def->name); fprintf(stdout, " %s", def->name);
@ -695,11 +675,10 @@ vshCmddefHelp(const vshCmdDef *def)
} }
fputc('\n', stdout); fputc('\n', stdout);
desc = vshCmddefGetInfo(def, "desc"); if (def->info->desc && *def->info->desc) {
if (desc && *desc) {
/* Print the description only if it's not empty. */ /* Print the description only if it's not empty. */
fputs(_("\n DESCRIPTION\n"), stdout); fputs(_("\n DESCRIPTION\n"), stdout);
fprintf(stdout, " %s\n", _(desc)); fprintf(stdout, " %s\n", _(def->info->desc));
} }
if (def->opts && def->opts->name) { if (def->opts && def->opts->name) {
@ -3114,15 +3093,10 @@ const vshCmdOptDef opts_help[] = {
{.name = NULL} {.name = NULL}
}; };
const vshCmdInfo info_help[] = { const vshCmdInfo info_help = {
{.name = "help", .help = N_("print help"),
.data = N_("print help") .desc = N_("Prints global help, command specific help, or help for a\n"
}, " group of related commands"),
{.name = "desc",
.data = N_("Prints global help, command specific help, or help for a\n"
" group of related commands")
},
{.name = NULL}
}; };
bool bool
@ -3143,8 +3117,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
if (def->alias || if (def->alias ||
def->flags & VSH_CMD_FLAG_HIDDEN) def->flags & VSH_CMD_FLAG_HIDDEN)
continue; continue;
vshPrint(ctl, " %-30s %s\n", def->name, vshPrint(ctl, " %-30s %s\n", def->name, _(def->info->help));
_(vshCmddefGetInfo(def, "help")));
} }
vshPrint(ctl, "\n"); vshPrint(ctl, "\n");
@ -3176,14 +3149,9 @@ const vshCmdOptDef opts_cd[] = {
{.name = NULL} {.name = NULL}
}; };
const vshCmdInfo info_cd[] = { const vshCmdInfo info_cd = {
{.name = "help", .help = N_("change the current directory"),
.data = N_("change the current directory") .desc = N_("Change the current directory."),
},
{.name = "desc",
.data = N_("Change the current directory.")
},
{.name = NULL}
}; };
bool bool
@ -3243,14 +3211,9 @@ const vshCmdOptDef opts_echo[] = {
{.name = NULL} {.name = NULL}
}; };
const vshCmdInfo info_echo[] = { const vshCmdInfo info_echo = {
{.name = "help", .help = N_("echo arguments. Used for internal testing."),
.data = N_("echo arguments. Used for internal testing.") .desc = N_("Echo back arguments, possibly with quoting. Used for internal testing."),
},
{.name = "desc",
.data = N_("Echo back arguments, possibly with quoting. Used for internal testing.")
},
{.name = NULL}
}; };
/* Exists mainly for debugging virsh, but also handy for adding back /* Exists mainly for debugging virsh, but also handy for adding back
@ -3305,14 +3268,9 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd)
return true; return true;
} }
const vshCmdInfo info_pwd[] = { const vshCmdInfo info_pwd = {
{.name = "help", .help = N_("print the current directory"),
.data = N_("print the current directory") .desc = N_("Print the current directory."),
},
{.name = "desc",
.data = N_("Print the current directory.")
},
{.name = NULL}
}; };
bool bool
@ -3325,14 +3283,9 @@ cmdPwd(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
return true; return true;
} }
const vshCmdInfo info_quit[] = { const vshCmdInfo info_quit = {
{.name = "help", .help = N_("quit this interactive terminal"),
.data = N_("quit this interactive terminal") .desc = "",
},
{.name = "desc",
.data = ""
},
{.name = NULL}
}; };
bool bool
@ -3357,14 +3310,9 @@ const vshCmdOptDef opts_selftest[] = {
}, },
{.name = NULL} {.name = NULL}
}; };
const vshCmdInfo info_selftest[] = { const vshCmdInfo info_selftest = {
{.name = "help", .help = N_("internal command for testing virt shells"),
.data = N_("internal command for testing virt shells") .desc = N_("internal use only"),
},
{.name = "desc",
.data = N_("internal use only")
},
{.name = NULL}
}; };
bool bool
@ -3402,14 +3350,9 @@ const vshCmdOptDef opts_complete[] = {
{.name = NULL} {.name = NULL}
}; };
const vshCmdInfo info_complete[] = { const vshCmdInfo info_complete = {
{.name = "help", .help = N_("internal command for autocompletion"),
.data = N_("internal command for autocompletion") .desc = N_("internal use only"),
},
{.name = "desc",
.data = N_("internal use only")
},
{.name = NULL}
}; };

View File

@ -119,15 +119,12 @@ typedef char **(*vshCompleter)(vshControl *ctl,
unsigned int flags); unsigned int flags);
/* /*
* vshCmdInfo -- name/value pair for information about command
*
* Commands should have at least the following names:
* "help" - short description of command * "help" - short description of command
* "desc" - description of command, or empty string * "desc" - description of command, or empty string
*/ */
struct _vshCmdInfo { struct _vshCmdInfo {
const char *name; /* name of information, or NULL for list end */ const char *help; /* short description of command */
const char *data; /* non-NULL information */ const char *desc; /* description of command */
}; };
/* /*
@ -248,7 +245,6 @@ void vshOutputLogFile(vshControl *ctl, int log_level, const char *format,
G_GNUC_PRINTF(3, 0); G_GNUC_PRINTF(3, 0);
void vshCloseLogFile(vshControl *ctl); void vshCloseLogFile(vshControl *ctl);
const char *vshCmddefGetInfo(const vshCmdDef *cmd, const char *info);
const vshCmdDef *vshCmddefSearch(const char *cmdname); const vshCmdDef *vshCmddefSearch(const char *cmdname);
const vshCmdGrp *vshCmdGrpSearch(const char *grpname); const vshCmdGrp *vshCmdGrpSearch(const char *grpname);
bool vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp); bool vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp);
@ -375,17 +371,17 @@ int vshEventWait(vshControl *ctl);
/* generic commands */ /* generic commands */
extern const vshCmdOptDef opts_help[]; extern const vshCmdOptDef opts_help[];
extern const vshCmdInfo info_help[]; extern const vshCmdInfo info_help;
extern const vshCmdOptDef opts_cd[]; extern const vshCmdOptDef opts_cd[];
extern const vshCmdInfo info_cd[]; extern const vshCmdInfo info_cd;
extern const vshCmdOptDef opts_echo[]; extern const vshCmdOptDef opts_echo[];
extern const vshCmdInfo info_echo[]; extern const vshCmdInfo info_echo;
extern const vshCmdInfo info_pwd[]; extern const vshCmdInfo info_pwd;
extern const vshCmdInfo info_quit[]; extern const vshCmdInfo info_quit;
extern const vshCmdOptDef opts_selftest[]; extern const vshCmdOptDef opts_selftest[];
extern const vshCmdInfo info_selftest[]; extern const vshCmdInfo info_selftest;
extern const vshCmdOptDef opts_complete[]; extern const vshCmdOptDef opts_complete[];
extern const vshCmdInfo info_complete[]; extern const vshCmdInfo info_complete;
bool cmdHelp(vshControl *ctl, const vshCmd *cmd); bool cmdHelp(vshControl *ctl, const vshCmd *cmd);
bool cmdCd(vshControl *ctl, const vshCmd *cmd); bool cmdCd(vshControl *ctl, const vshCmd *cmd);
@ -400,7 +396,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "cd", \ .name = "cd", \
.handler = cmdCd, \ .handler = cmdCd, \
.opts = opts_cd, \ .opts = opts_cd, \
.info = info_cd, \ .info = &info_cd, \
.flags = VSH_CMD_FLAG_NOCONNECT \ .flags = VSH_CMD_FLAG_NOCONNECT \
} }
@ -409,7 +405,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "echo", \ .name = "echo", \
.handler = cmdEcho, \ .handler = cmdEcho, \
.opts = opts_echo, \ .opts = opts_echo, \
.info = info_echo, \ .info = &info_echo, \
.flags = VSH_CMD_FLAG_NOCONNECT \ .flags = VSH_CMD_FLAG_NOCONNECT \
} }
@ -418,7 +414,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "exit", \ .name = "exit", \
.handler = cmdQuit, \ .handler = cmdQuit, \
.opts = NULL, \ .opts = NULL, \
.info = info_quit, \ .info = &info_quit, \
.flags = VSH_CMD_FLAG_NOCONNECT \ .flags = VSH_CMD_FLAG_NOCONNECT \
} }
@ -427,7 +423,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "help", \ .name = "help", \
.handler = cmdHelp, \ .handler = cmdHelp, \
.opts = opts_help, \ .opts = opts_help, \
.info = info_help, \ .info = &info_help, \
.flags = VSH_CMD_FLAG_NOCONNECT \ .flags = VSH_CMD_FLAG_NOCONNECT \
} }
@ -436,7 +432,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "pwd", \ .name = "pwd", \
.handler = cmdPwd, \ .handler = cmdPwd, \
.opts = NULL, \ .opts = NULL, \
.info = info_pwd, \ .info = &info_pwd, \
.flags = VSH_CMD_FLAG_NOCONNECT \ .flags = VSH_CMD_FLAG_NOCONNECT \
} }
@ -445,7 +441,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "quit", \ .name = "quit", \
.handler = cmdQuit, \ .handler = cmdQuit, \
.opts = NULL, \ .opts = NULL, \
.info = info_quit, \ .info = &info_quit, \
.flags = VSH_CMD_FLAG_NOCONNECT \ .flags = VSH_CMD_FLAG_NOCONNECT \
} }
@ -454,7 +450,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "self-test", \ .name = "self-test", \
.handler = cmdSelfTest, \ .handler = cmdSelfTest, \
.opts = opts_selftest, \ .opts = opts_selftest, \
.info = info_selftest, \ .info = &info_selftest, \
.flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_HIDDEN, \ .flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_HIDDEN, \
} }
@ -463,7 +459,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
.name = "complete", \ .name = "complete", \
.handler = cmdComplete, \ .handler = cmdComplete, \
.opts = opts_complete, \ .opts = opts_complete, \
.info = info_complete, \ .info = &info_complete, \
.flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_HIDDEN, \ .flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_HIDDEN, \
} }