From 465091d2b852d4da80f89b6bcfcaaa031d88306d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 4 Mar 2024 13:21:50 +0100 Subject: [PATCH] vsh: Refactor store of command help and description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- tools/virsh-backup.c | 28 +- tools/virsh-checkpoint.c | 108 +-- tools/virsh-domain-event.c | 13 +- tools/virsh-domain-monitor.c | 189 ++--- tools/virsh-domain.c | 1479 +++++++++++----------------------- tools/virsh-host.c | 288 +++---- tools/virsh-interface.c | 186 ++--- tools/virsh-network.c | 275 ++----- tools/virsh-nodedev.c | 190 ++--- tools/virsh-nwfilter.c | 117 +-- tools/virsh-pool.c | 275 ++----- tools/virsh-secret.c | 91 +-- tools/virsh-snapshot.c | 130 +-- tools/virsh-volume.c | 210 ++--- tools/virsh.c | 18 +- tools/virt-admin.c | 214 ++--- tools/vsh.c | 113 +-- tools/vsh.h | 38 +- 18 files changed, 1238 insertions(+), 2724 deletions(-) diff --git a/tools/virsh-backup.c b/tools/virsh-backup.c index 1bb2c63113..7a7834d7ff 100644 --- a/tools/virsh-backup.c +++ b/tools/virsh-backup.c @@ -24,15 +24,10 @@ /* * "backup-begin" command */ -static const vshCmdInfo info_backup_begin[] = { - {.name = "help", - .data = N_("Start a disk backup of a live domain") - }, - {.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 vshCmdInfo info_backup_begin = { + .help = 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"), }; static const vshCmdOptDef opts_backup_begin[] = { @@ -103,14 +98,9 @@ cmdBackupBegin(vshControl *ctl, /* * "backup-dumpxml" command */ -static const vshCmdInfo info_backup_dumpxml[] = { - {.name = "help", - .data = N_("Dump XML for an ongoing domain block backup job") - }, - {.name = "desc", - .data = N_("Backup Dump XML") - }, - {.name = NULL} +static const vshCmdInfo info_backup_dumpxml = { + .help = N_("Dump XML for an ongoing domain block backup job"), + .desc = N_("Backup Dump XML"), }; static const vshCmdOptDef opts_backup_dumpxml[] = { @@ -154,13 +144,13 @@ const vshCmdDef backupCmds[] = { {.name = "backup-begin", .handler = cmdBackupBegin, .opts = opts_backup_begin, - .info = info_backup_begin, + .info = &info_backup_begin, .flags = 0 }, {.name = "backup-dumpxml", .handler = cmdBackupDumpXML, .opts = opts_backup_dumpxml, - .info = info_backup_dumpxml, + .info = &info_backup_dumpxml, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 34bae34f9a..869c071700 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -71,15 +71,10 @@ virshCheckpointCreate(vshControl *ctl, /* * "checkpoint-create" command */ -static const vshCmdInfo info_checkpoint_create[] = { - {.name = "help", - .data = N_("Create a checkpoint from XML") - }, - {.name = "desc", - .data = N_("Create a checkpoint from XML for use in " - "future incremental backups") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_create = { + .help = N_("Create a checkpoint from XML"), + .desc = N_("Create a checkpoint from XML for use in " + "future incremental backups"), }; static const vshCmdOptDef opts_checkpoint_create[] = { @@ -183,15 +178,10 @@ virshParseCheckpointDiskspec(vshControl *ctl, return ret; } -static const vshCmdInfo info_checkpoint_create_as[] = { - {.name = "help", - .data = N_("Create a checkpoint from a set of args") - }, - {.name = "desc", - .data = N_("Create a checkpoint from arguments for use in " - "future incremental backups") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_create_as = { + .help = N_("Create a checkpoint from a set of args"), + .desc = N_("Create a checkpoint from arguments for use in " + "future incremental backups"), }; static const vshCmdOptDef opts_checkpoint_create_as[] = { @@ -309,14 +299,9 @@ virshLookupCheckpoint(vshControl *ctl, /* * "checkpoint-edit" command */ -static const vshCmdInfo info_checkpoint_edit[] = { - {.name = "help", - .data = N_("edit XML for a checkpoint") - }, - {.name = "desc", - .data = N_("Edit the domain checkpoint XML for a named checkpoint") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_edit = { + .help = N_("edit XML for a checkpoint"), + .desc = N_("Edit the domain checkpoint XML for a named checkpoint"), }; static const vshCmdOptDef opts_checkpoint_edit[] = { @@ -425,14 +410,9 @@ virshGetCheckpointParent(vshControl *ctl, /* * "checkpoint-info" command */ -static const vshCmdInfo info_checkpoint_info[] = { - {.name = "help", - .data = N_("checkpoint information") - }, - {.name = "desc", - .data = N_("Returns basic information about a checkpoint.") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_info = { + .help = N_("checkpoint information"), + .desc = N_("Returns basic information about a checkpoint."), }; static const vshCmdOptDef opts_checkpoint_info[] = { @@ -623,14 +603,9 @@ virshCheckpointListLookup(int id, /* * "checkpoint-list" command */ -static const vshCmdInfo info_checkpoint_list[] = { - {.name = "help", - .data = N_("List checkpoints for a domain") - }, - {.name = "desc", - .data = N_("Checkpoint List") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_list = { + .help = N_("List checkpoints for a domain"), + .desc = N_("Checkpoint List"), }; static const vshCmdOptDef opts_checkpoint_list[] = { @@ -825,14 +800,9 @@ cmdCheckpointList(vshControl *ctl, /* * "checkpoint-dumpxml" command */ -static const vshCmdInfo info_checkpoint_dumpxml[] = { - {.name = "help", - .data = N_("Dump XML for a domain checkpoint") - }, - {.name = "desc", - .data = N_("Checkpoint Dump XML") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_dumpxml = { + .help = N_("Dump XML for a domain checkpoint"), + .desc = N_("Checkpoint Dump XML"), }; static const vshCmdOptDef opts_checkpoint_dumpxml[] = { @@ -906,14 +876,9 @@ cmdCheckpointDumpXML(vshControl *ctl, /* * "checkpoint-parent" command */ -static const vshCmdInfo info_checkpoint_parent[] = { - {.name = "help", - .data = N_("Get the name of the parent of a checkpoint") - }, - {.name = "desc", - .data = N_("Extract the checkpoint's parent, if any") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_parent = { + .help = N_("Get the name of the parent of a checkpoint"), + .desc = N_("Extract the checkpoint's parent, if any"), }; static const vshCmdOptDef opts_checkpoint_parent[] = { @@ -959,14 +924,9 @@ cmdCheckpointParent(vshControl *ctl, /* * "checkpoint-delete" command */ -static const vshCmdInfo info_checkpoint_delete[] = { - {.name = "help", - .data = N_("Delete a domain checkpoint") - }, - {.name = "desc", - .data = N_("Checkpoint Delete") - }, - {.name = NULL} +static const vshCmdInfo info_checkpoint_delete = { + .help = N_("Delete a domain checkpoint"), + .desc = N_("Checkpoint Delete"), }; static const vshCmdOptDef opts_checkpoint_delete[] = { @@ -1034,49 +994,49 @@ const vshCmdDef checkpointCmds[] = { {.name = "checkpoint-create", .handler = cmdCheckpointCreate, .opts = opts_checkpoint_create, - .info = info_checkpoint_create, + .info = &info_checkpoint_create, .flags = 0 }, {.name = "checkpoint-create-as", .handler = cmdCheckpointCreateAs, .opts = opts_checkpoint_create_as, - .info = info_checkpoint_create_as, + .info = &info_checkpoint_create_as, .flags = 0 }, {.name = "checkpoint-delete", .handler = cmdCheckpointDelete, .opts = opts_checkpoint_delete, - .info = info_checkpoint_delete, + .info = &info_checkpoint_delete, .flags = 0 }, {.name = "checkpoint-dumpxml", .handler = cmdCheckpointDumpXML, .opts = opts_checkpoint_dumpxml, - .info = info_checkpoint_dumpxml, + .info = &info_checkpoint_dumpxml, .flags = 0 }, {.name = "checkpoint-edit", .handler = cmdCheckpointEdit, .opts = opts_checkpoint_edit, - .info = info_checkpoint_edit, + .info = &info_checkpoint_edit, .flags = 0 }, {.name = "checkpoint-info", .handler = cmdCheckpointInfo, .opts = opts_checkpoint_info, - .info = info_checkpoint_info, + .info = &info_checkpoint_info, .flags = 0 }, {.name = "checkpoint-list", .handler = cmdCheckpointList, .opts = opts_checkpoint_list, - .info = info_checkpoint_list, + .info = &info_checkpoint_list, .flags = 0 }, {.name = "checkpoint-parent", .handler = cmdCheckpointParent, .opts = opts_checkpoint_parent, - .info = info_checkpoint_parent, + .info = &info_checkpoint_parent, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-domain-event.c b/tools/virsh-domain-event.c index 6887c195a0..2ff7f7b81c 100644 --- a/tools/virsh-domain-event.c +++ b/tools/virsh-domain-event.c @@ -859,14 +859,9 @@ virshDomainEventNameCompleter(vshControl *ctl G_GNUC_UNUSED, } -static const vshCmdInfo info_event[] = { - {.name = "help", - .data = N_("Domain Events") - }, - {.name = "desc", - .data = N_("List event types, or wait for domain events to occur") - }, - {.name = NULL} +static const vshCmdInfo info_event = { + .help = N_("Domain Events"), + .desc = N_("List event types, or wait for domain events to occur"), }; static const vshCmdOptDef opts_event[] = { @@ -1017,7 +1012,7 @@ const vshCmdDef domEventCmds[] = { {.name = "event", .handler = cmdEvent, .opts = opts_event, - .info = info_event, + .info = &info_event, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index a2c56fc090..277eb71342 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -268,14 +268,9 @@ virshDomainStateReasonToString(int state, int reason) /* * "dommemstat" command */ -static const vshCmdInfo info_dommemstat[] = { - {.name = "help", - .data = N_("get memory statistics for a domain") - }, - {.name = "desc", - .data = N_("Get memory statistics for a running domain.") - }, - {.name = NULL} +static const vshCmdInfo info_dommemstat = { + .help = N_("get memory statistics for a domain"), + .desc = N_("Get memory statistics for a running domain."), }; static const vshCmdOptDef opts_dommemstat[] = { @@ -381,14 +376,9 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) /* * "domblkinfo" command */ -static const vshCmdInfo info_domblkinfo[] = { - {.name = "help", - .data = N_("domain block device size information") - }, - {.name = "desc", - .data = N_("Get block device size info for a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_domblkinfo = { + .help = N_("domain block device size information"), + .desc = N_("Get block device size info for a domain."), }; static const vshCmdOptDef opts_domblkinfo[] = { @@ -545,14 +535,9 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) /* * "domblklist" command */ -static const vshCmdInfo info_domblklist[] = { - {.name = "help", - .data = N_("list all domain blocks") - }, - {.name = "desc", - .data = N_("Get the summary of block devices for a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_domblklist = { + .help = N_("list all domain blocks"), + .desc = N_("Get the summary of block devices for a domain."), }; static const vshCmdOptDef opts_domblklist[] = { @@ -666,10 +651,9 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd) /* * "domiflist" command */ -static const vshCmdInfo info_domiflist[] = { - {"help", N_("list all domain virtual interfaces")}, - {"desc", N_("Get the summary of virtual interfaces for a domain.")}, - {NULL, NULL} +static const vshCmdInfo info_domiflist = { + .help = N_("list all domain virtual interfaces"), + .desc = N_("Get the summary of virtual interfaces for a domain."), }; static const vshCmdOptDef opts_domiflist[] = { @@ -745,14 +729,9 @@ cmdDomiflist(vshControl *ctl, const vshCmd *cmd) /* * "domif-getlink" command */ -static const vshCmdInfo info_domif_getlink[] = { - {.name = "help", - .data = N_("get link state of a virtual interface") - }, - {.name = "desc", - .data = N_("Get link state of a domain's virtual interface.") - }, - {.name = NULL} +static const vshCmdInfo info_domif_getlink = { + .help = N_("get link state of a virtual interface"), + .desc = N_("Get link state of a domain's virtual interface."), }; static const vshCmdOptDef opts_domif_getlink[] = { @@ -832,14 +811,9 @@ cmdDomIfGetLink(vshControl *ctl, const vshCmd *cmd) /* * "domcontrol" command */ -static const vshCmdInfo info_domcontrol[] = { - {.name = "help", - .data = N_("domain control interface state") - }, - {.name = "desc", - .data = N_("Returns state of a control interface to the domain.") - }, - {.name = NULL} +static const vshCmdInfo info_domcontrol = { + .help = N_("domain control interface state"), + .desc = N_("Returns state of a control interface to the domain."), }; static const vshCmdOptDef opts_domcontrol[] = { @@ -879,15 +853,10 @@ cmdDomControl(vshControl *ctl, const vshCmd *cmd) /* * "domblkstat" command */ -static const vshCmdInfo info_domblkstat[] = { - {.name = "help", - .data = N_("get device block stats for a domain") - }, - {.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 vshCmdInfo info_domblkstat = { + .help = 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"), }; static const vshCmdOptDef opts_domblkstat[] = { @@ -1060,14 +1029,9 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd) /* * "domifstat" command */ -static const vshCmdInfo info_domifstat[] = { - {.name = "help", - .data = N_("get network interface stats for a domain") - }, - {.name = "desc", - .data = N_("Get network interface stats for a running domain.") - }, - {.name = NULL} +static const vshCmdInfo info_domifstat = { + .help = N_("get network interface stats for a domain"), + .desc = N_("Get network interface stats for a running domain."), }; static const vshCmdOptDef opts_domifstat[] = { @@ -1129,14 +1093,9 @@ cmdDomIfstat(vshControl *ctl, const vshCmd *cmd) /* * "domblkerror" command */ -static const vshCmdInfo info_domblkerror[] = { - {.name = "help", - .data = N_("Show errors on block devices") - }, - {.name = "desc", - .data = N_("Show block device errors") - }, - {.name = NULL} +static const vshCmdInfo info_domblkerror = { + .help = N_("Show errors on block devices"), + .desc = N_("Show block device errors"), }; static const vshCmdOptDef opts_domblkerror[] = { @@ -1190,14 +1149,9 @@ cmdDomBlkError(vshControl *ctl, const vshCmd *cmd) /* * "dominfo" command */ -static const vshCmdInfo info_dominfo[] = { - {.name = "help", - .data = N_("domain information") - }, - {.name = "desc", - .data = N_("Returns basic information about the domain.") - }, - {.name = NULL} +static const vshCmdInfo info_dominfo = { + .help = N_("domain information"), + .desc = N_("Returns basic information about the domain."), }; static const vshCmdOptDef opts_dominfo[] = { @@ -1328,14 +1282,9 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) /* * "domstate" command */ -static const vshCmdInfo info_domstate[] = { - {.name = "help", - .data = N_("domain state") - }, - {.name = "desc", - .data = N_("Returns state about a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_domstate = { + .help = N_("domain state"), + .desc = N_("Returns state about a domain."), }; static const vshCmdOptDef opts_domstate[] = { @@ -1375,14 +1324,9 @@ cmdDomstate(vshControl *ctl, const vshCmd *cmd) /* * "domtime" command */ -static const vshCmdInfo info_domtime[] = { - {.name = "help", - .data = N_("domain time") - }, - {.name = "desc", - .data = N_("Gets or sets the domain's system time") - }, - {.name = NULL} +static const vshCmdInfo info_domtime = { + .help = N_("domain time"), + .desc = N_("Gets or sets the domain's system time"), }; static const vshCmdOptDef opts_domtime[] = { @@ -1471,14 +1415,9 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd) /* * "list" command */ -static const vshCmdInfo info_list[] = { - {.name = "help", - .data = N_("list domains") - }, - {.name = "desc", - .data = N_("Returns list of domains.") - }, - {.name = NULL} +static const vshCmdInfo info_list = { + .help = N_("list domains"), + .desc = N_("Returns list of domains."), }; /* compare domains, pack NULLed ones at the end */ @@ -2011,14 +1950,9 @@ cmdList(vshControl *ctl, const vshCmd *cmd) /* * "domstats" command */ -static const vshCmdInfo info_domstats[] = { - {.name = "help", - .data = N_("get statistics about one or multiple domains") - }, - {.name = "desc", - .data = N_("Gets statistics about one or more (or all) domains") - }, - {.name = NULL} +static const vshCmdInfo info_domstats = { + .help = N_("get statistics about one or multiple domains"), + .desc = N_("Gets statistics about one or more (or all) domains"), }; static const vshCmdOptDef opts_domstats[] = { @@ -2269,10 +2203,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd) /* "domifaddr" command */ -static const vshCmdInfo info_domifaddr[] = { - {"help", N_("Get network interfaces' addresses for a running domain")}, - {"desc", N_("Get network interfaces' addresses for a running domain")}, - {NULL, NULL} +static const vshCmdInfo info_domifaddr = { + .help = N_("Get network interfaces' addresses for a running domain"), + .desc = N_("Get network interfaces' addresses for a running domain"), }; static const vshCmdOptDef opts_domifaddr[] = { @@ -2401,91 +2334,91 @@ const vshCmdDef domMonitoringCmds[] = { {.name = "domblkerror", .handler = cmdDomBlkError, .opts = opts_domblkerror, - .info = info_domblkerror, + .info = &info_domblkerror, .flags = 0 }, {.name = "domblkinfo", .handler = cmdDomblkinfo, .opts = opts_domblkinfo, - .info = info_domblkinfo, + .info = &info_domblkinfo, .flags = 0 }, {.name = "domblklist", .handler = cmdDomblklist, .opts = opts_domblklist, - .info = info_domblklist, + .info = &info_domblklist, .flags = 0 }, {.name = "domblkstat", .handler = cmdDomblkstat, .opts = opts_domblkstat, - .info = info_domblkstat, + .info = &info_domblkstat, .flags = 0 }, {.name = "domcontrol", .handler = cmdDomControl, .opts = opts_domcontrol, - .info = info_domcontrol, + .info = &info_domcontrol, .flags = 0 }, {.name = "domif-getlink", .handler = cmdDomIfGetLink, .opts = opts_domif_getlink, - .info = info_domif_getlink, + .info = &info_domif_getlink, .flags = 0 }, {.name = "domifaddr", .handler = cmdDomIfAddr, .opts = opts_domifaddr, - .info = info_domifaddr, + .info = &info_domifaddr, .flags = 0 }, {.name = "domiflist", .handler = cmdDomiflist, .opts = opts_domiflist, - .info = info_domiflist, + .info = &info_domiflist, .flags = 0 }, {.name = "domifstat", .handler = cmdDomIfstat, .opts = opts_domifstat, - .info = info_domifstat, + .info = &info_domifstat, .flags = 0 }, {.name = "dominfo", .handler = cmdDominfo, .opts = opts_dominfo, - .info = info_dominfo, + .info = &info_dominfo, .flags = 0 }, {.name = "dommemstat", .handler = cmdDomMemStat, .opts = opts_dommemstat, - .info = info_dommemstat, + .info = &info_dommemstat, .flags = 0 }, {.name = "domstate", .handler = cmdDomstate, .opts = opts_domstate, - .info = info_domstate, + .info = &info_domstate, .flags = 0 }, {.name = "domstats", .handler = cmdDomstats, .opts = opts_domstats, - .info = info_domstats, + .info = &info_domstats, .flags = 0 }, {.name = "domtime", .handler = cmdDomTime, .opts = opts_domtime, - .info = info_domtime, + .info = &info_domtime, .flags = 0 }, {.name = "list", .handler = cmdList, .opts = opts_list, - .info = info_list, + .info = &info_list, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 3c88da05b9..bbad264053 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -341,14 +341,9 @@ virshNodeGetCPUCount(virConnectPtr conn) /* * "attach-device" command */ -static const vshCmdInfo info_attach_device[] = { - {.name = "help", - .data = N_("attach device from an XML file") - }, - {.name = "desc", - .data = N_("Attach device from an XML .") - }, - {.name = NULL} +static const vshCmdInfo info_attach_device = { + .help = N_("attach device from an XML file"), + .desc = N_("Attach device from an XML ."), }; static const vshCmdOptDef opts_attach_device[] = { @@ -416,14 +411,9 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd) /* * "attach-disk" command */ -static const vshCmdInfo info_attach_disk[] = { - {.name = "help", - .data = N_("attach disk device") - }, - {.name = "desc", - .data = N_("Attach new disk device.") - }, - {.name = NULL} +static const vshCmdInfo info_attach_disk = { + .help = N_("attach disk device"), + .desc = N_("Attach new disk device."), }; static const vshCmdOptDef opts_attach_disk[] = { @@ -813,14 +803,9 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) /* * "attach-interface" command */ -static const vshCmdInfo info_attach_interface[] = { - {.name = "help", - .data = N_("attach network interface") - }, - {.name = "desc", - .data = N_("Attach new network interface.") - }, - {.name = NULL} +static const vshCmdInfo info_attach_interface = { + .help = N_("attach network interface"), + .desc = N_("Attach new network interface."), }; static const vshCmdOptDef opts_attach_interface[] = { @@ -1149,14 +1134,9 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) /* * "autostart" command */ -static const vshCmdInfo info_autostart[] = { - {.name = "help", - .data = N_("autostart a domain") - }, - {.name = "desc", - .data = N_("Configure a domain to be automatically started at boot.") - }, - {.name = NULL} +static const vshCmdInfo info_autostart = { + .help = N_("autostart a domain"), + .desc = N_("Configure a domain to be automatically started at boot."), }; static const vshCmdOptDef opts_autostart[] = { @@ -1199,14 +1179,9 @@ cmdAutostart(vshControl *ctl, const vshCmd *cmd) /* * "blkdeviotune" command */ -static const vshCmdInfo info_blkdeviotune[] = { - {.name = "help", - .data = N_("Set or query a block device I/O tuning parameters.") - }, - {.name = "desc", - .data = N_("Set or query disk I/O parameters such as block throttling.") - }, - {.name = NULL} +static const vshCmdInfo info_blkdeviotune = { + .help = N_("Set or query a block device I/O tuning parameters."), + .desc = N_("Set or query disk I/O parameters such as block throttling."), }; static const vshCmdOptDef opts_blkdeviotune[] = { @@ -1523,14 +1498,9 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd) /* * "blkiotune" command */ -static const vshCmdInfo info_blkiotune[] = { - {.name = "help", - .data = N_("Get or set blkio parameters") - }, - {.name = "desc", - .data = N_("Get or set the current blkio parameters for a guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_blkiotune = { + .help = N_("Get or set blkio parameters"), + .desc = N_("Get or set the current blkio parameters for a guest domain."), }; static const vshCmdOptDef opts_blkiotune[] = { @@ -2002,14 +1972,9 @@ virshBlockJobWait(virshBlockJobWaitData *data) /* * "blockcommit" command */ -static const vshCmdInfo info_blockcommit[] = { - {.name = "help", - .data = N_("Start a block commit operation.") - }, - {.name = "desc", - .data = N_("Commit changes from a snapshot down to its backing image.") - }, - {.name = NULL} +static const vshCmdInfo info_blockcommit = { + .help = N_("Start a block commit operation."), + .desc = N_("Commit changes from a snapshot down to its backing image."), }; static const vshCmdOptDef opts_blockcommit[] = { @@ -2226,14 +2191,9 @@ cmdBlockcommit(vshControl *ctl, const vshCmd *cmd) /* * "blockcopy" command */ -static const vshCmdInfo info_blockcopy[] = { - {.name = "help", - .data = N_("Start a block copy operation.") - }, - {.name = "desc", - .data = N_("Copy a disk backing image chain to dest.") - }, - {.name = NULL} +static const vshCmdInfo info_blockcopy = { + .help = N_("Start a block copy operation."), + .desc = N_("Copy a disk backing image chain to dest."), }; static const vshCmdOptDef opts_blockcopy[] = { @@ -2563,14 +2523,9 @@ cmdBlockcopy(vshControl *ctl, const vshCmd *cmd) /* * "blockjob" command */ -static const vshCmdInfo info_blockjob[] = { - {.name = "help", - .data = N_("Manage active block operations") - }, - {.name = "desc", - .data = N_("Query, adjust speed, or cancel active block operations.") - }, - {.name = NULL} +static const vshCmdInfo info_blockjob = { + .help = N_("Manage active block operations"), + .desc = N_("Query, adjust speed, or cancel active block operations."), }; static const vshCmdOptDef opts_blockjob[] = { @@ -2779,14 +2734,9 @@ cmdBlockjob(vshControl *ctl, const vshCmd *cmd) /* * "blockpull" command */ -static const vshCmdInfo info_blockpull[] = { - {.name = "help", - .data = N_("Populate a disk from its backing image.") - }, - {.name = "desc", - .data = N_("Populate a disk from its backing image.") - }, - {.name = NULL} +static const vshCmdInfo info_blockpull = { + .help = N_("Populate a disk from its backing image."), + .desc = N_("Populate a disk from its backing image."), }; static const vshCmdOptDef opts_blockpull[] = { @@ -2926,14 +2876,9 @@ cmdBlockpull(vshControl *ctl, const vshCmd *cmd) /* * "blockresize" command */ -static const vshCmdInfo info_blockresize[] = { - {.name = "help", - .data = N_("Resize block device of domain.") - }, - {.name = "desc", - .data = N_("Resize block device of domain.") - }, - {.name = NULL} +static const vshCmdInfo info_blockresize = { + .help = N_("Resize block device of domain."), + .desc = N_("Resize block device of domain."), }; static const vshCmdOptDef opts_blockresize[] = { @@ -2997,14 +2942,9 @@ cmdBlockresize(vshControl *ctl, const vshCmd *cmd) /* * "console" command */ -static const vshCmdInfo info_console[] = { - {.name = "help", - .data = N_("connect to the guest console") - }, - {.name = "desc", - .data = N_("Connect the virtual serial console for the guest") - }, - {.name = NULL} +static const vshCmdInfo info_console = { + .help = N_("connect to the guest console"), + .desc = N_("Connect the virtual serial console for the guest"), }; static const vshCmdOptDef opts_console[] = { @@ -3092,15 +3032,10 @@ cmdConsole(vshControl *ctl, const vshCmd *cmd) /* "domif-setlink" command */ -static const vshCmdInfo info_domif_setlink[] = { - {.name = "help", - .data = N_("set link state of a virtual interface") - }, - {.name = "desc", - .data = N_("Set link state of a domain's virtual interface. This command " - "wraps usage of update-device command.") - }, - {.name = NULL} +static const vshCmdInfo info_domif_setlink = { + .help = N_("set link state of a virtual interface"), + .desc = N_("Set link state of a domain's virtual interface. This command " + "wraps usage of update-device command."), }; static const vshCmdOptDef opts_domif_setlink[] = { @@ -3244,14 +3179,9 @@ cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd) /* "domiftune" command */ -static const vshCmdInfo info_domiftune[] = { - {.name = "help", - .data = N_("get/set parameters of a virtual interface") - }, - {.name = "desc", - .data = N_("Get/set parameters of a domain's virtual interface.") - }, - {.name = NULL} +static const vshCmdInfo info_domiftune = { + .help = N_("get/set parameters of a virtual interface"), + .desc = N_("Get/set parameters of a domain's virtual interface."), }; static const vshCmdOptDef opts_domiftune[] = { @@ -3440,14 +3370,9 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd) /* * "suspend" command */ -static const vshCmdInfo info_suspend[] = { - {.name = "help", - .data = N_("suspend a domain") - }, - {.name = "desc", - .data = N_("Suspend a running domain.") - }, - {.name = NULL} +static const vshCmdInfo info_suspend = { + .help = N_("suspend a domain"), + .desc = N_("Suspend a running domain."), }; static const vshCmdOptDef opts_suspend[] = { @@ -3476,17 +3401,12 @@ cmdSuspend(vshControl *ctl, const vshCmd *cmd) /* * "dompmsuspend" command */ -static const vshCmdInfo info_dom_pm_suspend[] = { - {.name = "help", - .data = N_("suspend a domain gracefully using power management " - "functions") - }, - {.name = "desc", - .data = N_("Suspends a running domain using guest OS's power management. " +static const vshCmdInfo info_dom_pm_suspend = { + .help = N_("suspend a domain gracefully using power management " + "functions"), + .desc = N_("Suspends a running domain using guest OS's power management. " "(Note: This requires a guest agent configured and running in " - "the guest OS).") - }, - {.name = NULL} + "the guest OS)."), }; static const vshCmdOptDef opts_dom_pm_suspend[] = { @@ -3546,15 +3466,10 @@ cmdDomPMSuspend(vshControl *ctl, const vshCmd *cmd) * "dompmwakeup" command */ -static const vshCmdInfo info_dom_pm_wakeup[] = { - {.name = "help", - .data = N_("wakeup a domain from pmsuspended state") - }, - {.name = "desc", - .data = N_("Wakeup a domain that was previously suspended " - "by power management.") - }, - {.name = NULL} +static const vshCmdInfo info_dom_pm_wakeup = { + .help = N_("wakeup a domain from pmsuspended state"), + .desc = N_("Wakeup a domain that was previously suspended " + "by power management."), }; static const vshCmdOptDef opts_dom_pm_wakeup[] = { @@ -3587,14 +3502,9 @@ cmdDomPMWakeup(vshControl *ctl, const vshCmd *cmd) /* * "undefine" command */ -static const vshCmdInfo info_undefine[] = { - {.name = "help", - .data = N_("undefine a domain") - }, - {.name = "desc", - .data = N_("Undefine an inactive domain, or convert persistent to transient.") - }, - {.name = NULL} +static const vshCmdInfo info_undefine = { + .help = N_("undefine a domain"), + .desc = N_("Undefine an inactive domain, or convert persistent to transient."), }; static const vshCmdOptDef opts_undefine[] = { @@ -4016,16 +3926,11 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) /* * "start" command */ -static const vshCmdInfo info_start[] = { - {.name = "help", - .data = N_("start a (previously defined) inactive domain") - }, - {.name = "desc", - .data = N_("Start a domain, either from the last managedsave\n" +static const vshCmdInfo info_start = { + .help = N_("start a (previously defined) inactive domain"), + .desc = N_("Start a domain, either from the last managedsave\n" " state, or via a fresh boot if no managedsave state\n" - " is present.") - }, - {.name = NULL} + " is present."), }; static const vshCmdOptDef opts_start[] = { @@ -4182,14 +4087,9 @@ cmdStart(vshControl *ctl, const vshCmd *cmd) /* * "save" command */ -static const vshCmdInfo info_save[] = { - {.name = "help", - .data = N_("save a domain state to a file") - }, - {.name = "desc", - .data = N_("Save the RAM state of a running domain.") - }, - {.name = NULL} +static const vshCmdInfo info_save = { + .help = N_("save a domain state to a file"), + .desc = N_("Save the RAM state of a running domain."), }; static const vshCmdOptDef opts_save[] = { @@ -4537,14 +4437,9 @@ cmdSave(vshControl *ctl, const vshCmd *cmd) /* * "save-image-dumpxml" command */ -static const vshCmdInfo info_save_image_dumpxml[] = { - {.name = "help", - .data = N_("saved state domain information in XML") - }, - {.name = "desc", - .data = N_("Dump XML of domain information for a saved state file to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_save_image_dumpxml = { + .help = N_("saved state domain information in XML"), + .desc = N_("Dump XML of domain information for a saved state file to stdout."), }; static const vshCmdOptDef opts_save_image_dumpxml[] = { @@ -4599,14 +4494,9 @@ cmdSaveImageDumpxml(vshControl *ctl, const vshCmd *cmd) /* * "save-image-define" command */ -static const vshCmdInfo info_save_image_define[] = { - {.name = "help", - .data = N_("redefine the XML for a domain's saved state file") - }, - {.name = "desc", - .data = N_("Replace the domain XML associated with a saved state file") - }, - {.name = NULL} +static const vshCmdInfo info_save_image_define = { + .help = N_("redefine the XML for a domain's saved state file"), + .desc = N_("Replace the domain XML associated with a saved state file"), }; static const vshCmdOptDef opts_save_image_define[] = { @@ -4667,14 +4557,9 @@ cmdSaveImageDefine(vshControl *ctl, const vshCmd *cmd) /* * "save-image-edit" command */ -static const vshCmdInfo info_save_image_edit[] = { - {.name = "help", - .data = N_("edit XML for a domain's saved state file") - }, - {.name = "desc", - .data = N_("Edit the domain XML associated with a saved state file") - }, - {.name = NULL} +static const vshCmdInfo info_save_image_edit = { + .help = N_("edit XML for a domain's saved state file"), + .desc = N_("Edit the domain XML associated with a saved state file"), }; static const vshCmdOptDef opts_save_image_edit[] = { @@ -4740,17 +4625,12 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd) /* * "managedsave" command */ -static const vshCmdInfo info_managedsave[] = { - {.name = "help", - .data = N_("managed save of a domain state") - }, - {.name = "desc", - .data = N_("Save and destroy a running domain, so it can be restarted from\n" +static const vshCmdInfo info_managedsave = { + .help = N_("managed save of a domain state"), + .desc = N_("Save and destroy a running domain, so it can be restarted from\n" " the same state at a later time. When the virsh 'start'\n" " command is next run for the domain, it will automatically\n" - " be started from this saved state.") - }, - {.name = NULL} + " be started from this saved state."), }; static const vshCmdOptDef opts_managedsave[] = { @@ -4858,14 +4738,9 @@ cmdManagedSave(vshControl *ctl, const vshCmd *cmd) /* * "managedsave-remove" command */ -static const vshCmdInfo info_managedsaveremove[] = { - {.name = "help", - .data = N_("Remove managed save of a domain") - }, - {.name = "desc", - .data = N_("Remove an existing managed save state file from a domain") - }, - {.name = NULL} +static const vshCmdInfo info_managedsaveremove = { + .help = N_("Remove managed save of a domain"), + .desc = N_("Remove an existing managed save state file from a domain"), }; static const vshCmdOptDef opts_managedsaveremove[] = { @@ -4909,14 +4784,9 @@ cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd) /* * "managedsave-edit" command */ -static const vshCmdInfo info_managed_save_edit[] = { - {.name = "help", - .data = N_("edit XML for a domain's managed save state file") - }, - {.name = "desc", - .data = N_("Edit the domain XML associated with the managed save state file") - }, - {.name = NULL} +static const vshCmdInfo info_managed_save_edit = { + .help = N_("edit XML for a domain's managed save state file"), + .desc = N_("Edit the domain XML associated with the managed save state file"), }; static const vshCmdOptDef opts_managed_save_edit[] = { @@ -4974,14 +4844,9 @@ cmdManagedSaveEdit(vshControl *ctl, const vshCmd *cmd) /* * "managedsave-dumpxml" command */ -static const vshCmdInfo info_managed_save_dumpxml[] = { - {.name = "help", - .data = N_("Domain information of managed save state file in XML") - }, - {.name = "desc", - .data = N_("Dump XML of domain information for a managed save state file to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_managed_save_dumpxml = { + .help = N_("Domain information of managed save state file in XML"), + .desc = N_("Dump XML of domain information for a managed save state file to stdout."), }; static const vshCmdOptDef opts_managed_save_dumpxml[] = { @@ -5030,14 +4895,9 @@ cmdManagedSaveDumpxml(vshControl *ctl, const vshCmd *cmd) /* * "managedsave-define" command */ -static const vshCmdInfo info_managed_save_define[] = { - {.name = "help", - .data = N_("redefine the XML for a domain's managed save state file") - }, - {.name = "desc", - .data = N_("Replace the domain XML associated with a managed save state file") - }, - {.name = NULL} +static const vshCmdInfo info_managed_save_define = { + .help = N_("redefine the XML for a domain's managed save state file"), + .desc = N_("Replace the domain XML associated with a managed save state file"), }; static const vshCmdOptDef opts_managed_save_define[] = { @@ -5097,14 +4957,9 @@ cmdManagedSaveDefine(vshControl *ctl, const vshCmd *cmd) /* * "schedinfo" command */ -static const vshCmdInfo info_schedinfo[] = { - {.name = "help", - .data = N_("show/set scheduler parameters") - }, - {.name = "desc", - .data = N_("Show/Set scheduler parameters.") - }, - {.name = NULL} +static const vshCmdInfo info_schedinfo = { + .help = N_("show/set scheduler parameters"), + .desc = N_("Show/Set scheduler parameters."), }; static const vshCmdOptDef opts_schedinfo[] = { @@ -5317,14 +5172,9 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd) /* * "restore" command */ -static const vshCmdInfo info_restore[] = { - {.name = "help", - .data = N_("restore a domain from a saved state in a file") - }, - {.name = "desc", - .data = N_("Restore a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_restore = { + .help = N_("restore a domain from a saved state in a file"), + .desc = N_("Restore a domain."), }; static const vshCmdOptDef opts_restore[] = { @@ -5404,14 +5254,9 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd) /* * "dump" command */ -static const vshCmdInfo info_dump[] = { - {.name = "help", - .data = N_("dump the core of a domain to a file for analysis") - }, - {.name = "desc", - .data = N_("Core dump a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_dump = { + .help = N_("dump the core of a domain to a file for analysis"), + .desc = N_("Core dump a domain."), }; static const vshCmdOptDef opts_dump[] = { @@ -5578,15 +5423,10 @@ cmdDump(vshControl *ctl, const vshCmd *cmd) return true; } -static const vshCmdInfo info_screenshot[] = { - {.name = "help", - .data = N_("take a screenshot of a current domain console and store it " - "into a file") - }, - {.name = "desc", - .data = N_("screenshot of a current domain console") - }, - {.name = NULL} +static const vshCmdInfo info_screenshot = { + .help = N_("take a screenshot of a current domain console and store it " + "into a file"), + .desc = N_("screenshot of a current domain console"), }; static const vshCmdOptDef opts_screenshot[] = { @@ -5713,14 +5553,9 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd) /* * "set-lifecycle-action" command */ -static const vshCmdInfo info_setLifecycleAction[] = { - {.name = "help", - .data = N_("change lifecycle actions") - }, - {.name = "desc", - .data = N_("Change lifecycle actions for the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_setLifecycleAction = { + .help = N_("change lifecycle actions"), + .desc = N_("Change lifecycle actions for the guest domain."), }; static const vshCmdOptDef opts_setLifecycleAction[] = { @@ -5810,14 +5645,9 @@ cmdSetLifecycleAction(vshControl *ctl, const vshCmd *cmd) /* * "set-user-password" command */ -static const vshCmdInfo info_set_user_password[] = { - {.name = "help", - .data = N_("set the user password inside the domain") - }, - {.name = "desc", - .data = N_("changes the password of the specified user inside the domain") - }, - {.name = NULL} +static const vshCmdInfo info_set_user_password = { + .help = N_("set the user password inside the domain"), + .desc = N_("changes the password of the specified user inside the domain"), }; static const vshCmdOptDef opts_set_user_password[] = { @@ -5870,14 +5700,9 @@ cmdSetUserPassword(vshControl *ctl, const vshCmd *cmd) /* * "resume" command */ -static const vshCmdInfo info_resume[] = { - {.name = "help", - .data = N_("resume a domain") - }, - {.name = "desc", - .data = N_("Resume a previously suspended domain.") - }, - {.name = NULL} +static const vshCmdInfo info_resume = { + .help = N_("resume a domain"), + .desc = N_("Resume a previously suspended domain."), }; static const vshCmdOptDef opts_resume[] = { @@ -5906,14 +5731,9 @@ cmdResume(vshControl *ctl, const vshCmd *cmd) /* * "shutdown" command */ -static const vshCmdInfo info_shutdown[] = { - {.name = "help", - .data = N_("gracefully shutdown a domain") - }, - {.name = "desc", - .data = N_("Run shutdown in the target domain.") - }, - {.name = NULL} +static const vshCmdInfo info_shutdown = { + .help = N_("gracefully shutdown a domain"), + .desc = N_("Run shutdown in the target domain."), }; static const vshCmdOptDef opts_shutdown[] = { @@ -5986,14 +5806,9 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd) /* * "reboot" command */ -static const vshCmdInfo info_reboot[] = { - {.name = "help", - .data = N_("reboot a domain") - }, - {.name = "desc", - .data = N_("Run a reboot command in the target domain.") - }, - {.name = NULL} +static const vshCmdInfo info_reboot = { + .help = N_("reboot a domain"), + .desc = N_("Run a reboot command in the target domain."), }; static const vshCmdOptDef opts_reboot[] = { @@ -6060,14 +5875,9 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd) /* * "reset" command */ -static const vshCmdInfo info_reset[] = { - {.name = "help", - .data = N_("reset a domain") - }, - {.name = "desc", - .data = N_("Reset the target domain as if by power button") - }, - {.name = NULL} +static const vshCmdInfo info_reset = { + .help = N_("reset a domain"), + .desc = N_("Reset the target domain as if by power button"), }; static const vshCmdOptDef opts_reset[] = { @@ -6096,14 +5906,9 @@ cmdReset(vshControl *ctl, const vshCmd *cmd) /* * "domjobinfo" command */ -static const vshCmdInfo info_domjobinfo[] = { - {.name = "help", - .data = N_("domain job information") - }, - {.name = "desc", - .data = N_("Returns information about jobs running on a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_domjobinfo = { + .help = N_("domain job information"), + .desc = N_("Returns information about jobs running on a domain."), }; static const vshCmdOptDef opts_domjobinfo[] = { @@ -6516,14 +6321,9 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) /* * "domjobabort" command */ -static const vshCmdInfo info_domjobabort[] = { - {.name = "help", - .data = N_("abort active domain job") - }, - {.name = "desc", - .data = N_("Aborts the currently running domain job") - }, - {.name = NULL} +static const vshCmdInfo info_domjobabort = { + .help = N_("abort active domain job"), + .desc = N_("Aborts the currently running domain job"), }; static const vshCmdOptDef opts_domjobabort[] = { @@ -6562,14 +6362,9 @@ cmdDomjobabort(vshControl *ctl, const vshCmd *cmd) /* * "vcpucount" command */ -static const vshCmdInfo info_vcpucount[] = { - {.name = "help", - .data = N_("domain vcpu counts") - }, - {.name = "desc", - .data = N_("Returns the number of virtual CPUs used by the domain.") - }, - {.name = NULL} +static const vshCmdInfo info_vcpucount = { + .help = N_("domain vcpu counts"), + .desc = N_("Returns the number of virtual CPUs used by the domain."), }; static const vshCmdOptDef opts_vcpucount[] = { @@ -6747,14 +6542,9 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd) /* * "vcpuinfo" command */ -static const vshCmdInfo info_vcpuinfo[] = { - {.name = "help", - .data = N_("detailed domain vcpu information") - }, - {.name = "desc", - .data = N_("Returns basic information about the domain virtual CPUs.") - }, - {.name = NULL} +static const vshCmdInfo info_vcpuinfo = { + .help = N_("detailed domain vcpu information"), + .desc = N_("Returns basic information about the domain virtual CPUs."), }; static const vshCmdOptDef opts_vcpuinfo[] = { @@ -6967,14 +6757,9 @@ cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd) /* * "vcpupin" command */ -static const vshCmdInfo info_vcpupin[] = { - {.name = "help", - .data = N_("control or query domain vcpu affinity") - }, - {.name = "desc", - .data = N_("Pin domain VCPUs to host physical CPUs.") - }, - {.name = NULL} +static const vshCmdInfo info_vcpupin = { + .help = N_("control or query domain vcpu affinity"), + .desc = N_("Pin domain VCPUs to host physical CPUs."), }; static const vshCmdOptDef opts_vcpupin[] = { @@ -7185,14 +6970,9 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd) /* * "emulatorpin" command */ -static const vshCmdInfo info_emulatorpin[] = { - {.name = "help", - .data = N_("control or query domain emulator affinity") - }, - {.name = "desc", - .data = N_("Pin domain emulator threads to host physical CPUs.") - }, - {.name = NULL} +static const vshCmdInfo info_emulatorpin = { + .help = N_("control or query domain emulator affinity"), + .desc = N_("Pin domain emulator threads to host physical CPUs."), }; static const vshCmdOptDef opts_emulatorpin[] = { @@ -7285,14 +7065,9 @@ cmdEmulatorPin(vshControl *ctl, const vshCmd *cmd) /* * "setvcpus" command */ -static const vshCmdInfo info_setvcpus[] = { - {.name = "help", - .data = N_("change number of virtual CPUs") - }, - {.name = "desc", - .data = N_("Change the number of virtual CPUs in the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_setvcpus = { + .help = N_("change number of virtual CPUs"), + .desc = N_("Change the number of virtual CPUs in the guest domain."), }; static const vshCmdOptDef opts_setvcpus[] = { @@ -7377,15 +7152,10 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd) /* * "guestvcpus" command */ -static const vshCmdInfo info_guestvcpus[] = { - {.name = "help", - .data = N_("query or modify state of vcpu in the guest (via agent)") - }, - {.name = "desc", - .data = N_("Use the guest agent to query or set cpu state from guest's " - "point of view") - }, - {.name = NULL} +static const vshCmdInfo info_guestvcpus = { + .help = N_("query or modify state of vcpu in the guest (via agent)"), + .desc = N_("Use the guest agent to query or set cpu state from guest's " + "point of view"), }; static const vshCmdOptDef opts_guestvcpus[] = { @@ -7461,14 +7231,9 @@ cmdGuestvcpus(vshControl *ctl, const vshCmd *cmd) /* * "setvcpu" command */ -static const vshCmdInfo info_setvcpu[] = { - {.name = "help", - .data = N_("attach/detach vcpu or groups of threads") - }, - {.name = "desc", - .data = N_("Add or remove vcpus") - }, - {.name = NULL} +static const vshCmdInfo info_setvcpu = { + .help = N_("attach/detach vcpu or groups of threads"), + .desc = N_("Add or remove vcpus"), }; static const vshCmdOptDef opts_setvcpu[] = { @@ -7539,15 +7304,10 @@ cmdSetvcpu(vshControl *ctl, const vshCmd *cmd) /* * "domblkthreshold" command */ -static const vshCmdInfo info_domblkthreshold[] = { - {.name = "help", - .data = N_("set the threshold for block-threshold event for a given block " - "device or it's backing chain element") - }, - {.name = "desc", - .data = N_("set threshold for block-threshold event for a block device") - }, - {.name = NULL} +static const vshCmdInfo info_domblkthreshold = { + .help = N_("set the threshold for block-threshold event for a given block " + "device or it's backing chain element"), + .desc = N_("set threshold for block-threshold event for a block device"), }; static const vshCmdOptDef opts_domblkthreshold[] = { @@ -7593,14 +7353,9 @@ cmdDomblkthreshold(vshControl *ctl, const vshCmd *cmd) /* * "iothreadinfo" command */ -static const vshCmdInfo info_iothreadinfo[] = { - {.name = "help", - .data = N_("view domain IOThreads") - }, - {.name = "desc", - .data = N_("Returns basic information about the domain IOThreads.") - }, - {.name = NULL} +static const vshCmdInfo info_iothreadinfo = { + .help = N_("view domain IOThreads"), + .desc = N_("Returns basic information about the domain IOThreads."), }; static const vshCmdOptDef opts_iothreadinfo[] = { VIRSH_COMMON_OPT_DOMAIN_FULL(0), @@ -7678,14 +7433,9 @@ cmdIOThreadInfo(vshControl *ctl, const vshCmd *cmd) /* * "iothreadpin" command */ -static const vshCmdInfo info_iothreadpin[] = { - {.name = "help", - .data = N_("control domain IOThread affinity") - }, - {.name = "desc", - .data = N_("Pin domain IOThreads to host physical CPUs.") - }, - {.name = NULL} +static const vshCmdInfo info_iothreadpin = { + .help = N_("control domain IOThread affinity"), + .desc = N_("Pin domain IOThreads to host physical CPUs."), }; static const vshCmdOptDef opts_iothreadpin[] = { @@ -7756,14 +7506,9 @@ cmdIOThreadPin(vshControl *ctl, const vshCmd *cmd) /* * "iothreadadd" command */ -static const vshCmdInfo info_iothreadadd[] = { - {.name = "help", - .data = N_("add an IOThread to the guest domain") - }, - {.name = "desc", - .data = N_("Add an IOThread to the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_iothreadadd = { + .help = N_("add an IOThread to the guest domain"), + .desc = N_("Add an IOThread to the guest domain."), }; static const vshCmdOptDef opts_iothreadadd[] = { @@ -7817,14 +7562,9 @@ cmdIOThreadAdd(vshControl *ctl, const vshCmd *cmd) /* * "iothreadset" command */ -static const vshCmdInfo info_iothreadset[] = { - {.name = "help", - .data = N_("modifies an existing IOThread of the guest domain") - }, - {.name = "desc", - .data = N_("Modifies an existing IOThread of the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_iothreadset = { + .help = N_("modifies an existing IOThread of the guest domain"), + .desc = N_("Modifies an existing IOThread of the guest domain."), }; static const vshCmdOptDef opts_iothreadset[] = { @@ -7938,14 +7678,9 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) /* * "iothreaddel" command */ -static const vshCmdInfo info_iothreaddel[] = { - {.name = "help", - .data = N_("delete an IOThread from the guest domain") - }, - {.name = "desc", - .data = N_("Delete an IOThread from the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_iothreaddel = { + .help = N_("delete an IOThread from the guest domain"), + .desc = N_("Delete an IOThread from the guest domain."), }; static const vshCmdOptDef opts_iothreaddel[] = { @@ -7999,14 +7734,9 @@ cmdIOThreadDel(vshControl *ctl, const vshCmd *cmd) /* * "cpu-stats" command */ -static const vshCmdInfo info_cpu_stats[] = { - {.name = "help", - .data = N_("show domain cpu statistics") - }, - {.name = "desc", - .data = N_("Display per-CPU and total statistics about the domain's CPUs") - }, - {.name = NULL} +static const vshCmdInfo info_cpu_stats = { + .help = N_("show domain cpu statistics"), + .desc = N_("Display per-CPU and total statistics about the domain's CPUs"), }; static const vshCmdOptDef opts_cpu_stats[] = { @@ -8180,14 +7910,9 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd) /* * "create" command */ -static const vshCmdInfo info_create[] = { - {.name = "help", - .data = N_("create a domain from an XML file") - }, - {.name = "desc", - .data = N_("Create a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_create = { + .help = N_("create a domain from an XML file"), + .desc = N_("Create a domain."), }; static const vshCmdOptDef opts_create[] = { @@ -8305,14 +8030,9 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd) /* * "define" command */ -static const vshCmdInfo info_define[] = { - {.name = "help", - .data = N_("define (but don't start) a domain from an XML file") - }, - {.name = "desc", - .data = N_("Define a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_define = { + .help = N_("define (but don't start) a domain from an XML file"), + .desc = N_("Define a domain."), }; static const vshCmdOptDef opts_define[] = { @@ -8360,14 +8080,9 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd) /* * "destroy" command */ -static const vshCmdInfo info_destroy[] = { - {.name = "help", - .data = N_("destroy (stop) a domain") - }, - {.name = "desc", - .data = N_("Forcefully stop a given domain, but leave its resources intact.") - }, - {.name = NULL} +static const vshCmdInfo info_destroy = { + .help = N_("destroy (stop) a domain"), + .desc = N_("Forcefully stop a given domain, but leave its resources intact."), }; static const vshCmdOptDef opts_destroy[] = { @@ -8416,15 +8131,10 @@ cmdDestroy(vshControl *ctl, const vshCmd *cmd) /* * "desc" command for managing domain description and title */ -static const vshCmdInfo info_desc[] = { - {.name = "help", - .data = N_("show or set domain's description or title") - }, - {.name = "desc", - .data = N_("Allows setting or modifying the description or title of " - "a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_desc = { + .help = N_("show or set domain's description or title"), + .desc = N_("Allows setting or modifying the description or title of " + "a domain."), }; static const vshCmdOptDef opts_desc[] = { @@ -8558,14 +8268,9 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) } -static const vshCmdInfo info_metadata[] = { - {.name = "help", - .data = N_("show or set domain's custom XML metadata") - }, - {.name = "desc", - .data = N_("Shows or modifies the XML metadata of a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_metadata = { + .help = N_("show or set domain's custom XML metadata"), + .desc = N_("Shows or modifies the XML metadata of a domain."), }; static const vshCmdOptDef opts_metadata[] = { @@ -8703,14 +8408,9 @@ cmdMetadata(vshControl *ctl, const vshCmd *cmd) /* * "inject-nmi" command */ -static const vshCmdInfo info_inject_nmi[] = { - {.name = "help", - .data = N_("Inject NMI to the guest") - }, - {.name = "desc", - .data = N_("Inject NMI to the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_inject_nmi = { + .help = N_("Inject NMI to the guest"), + .desc = N_("Inject NMI to the guest domain."), }; static const vshCmdOptDef opts_inject_nmi[] = { @@ -8735,14 +8435,9 @@ cmdInjectNMI(vshControl *ctl, const vshCmd *cmd) /* * "send-key" command */ -static const vshCmdInfo info_send_key[] = { - {.name = "help", - .data = N_("Send keycodes to the guest") - }, - {.name = "desc", - .data = N_("Send keycodes (integers or symbolic names) to the guest") - }, - {.name = NULL} +static const vshCmdInfo info_send_key = { + .help = N_("Send keycodes to the guest"), + .desc = N_("Send keycodes (integers or symbolic names) to the guest"), }; static const vshCmdOptDef opts_send_key[] = { @@ -8835,14 +8530,9 @@ cmdSendKey(vshControl *ctl, const vshCmd *cmd) /* * "send-process-signal" command */ -static const vshCmdInfo info_send_process_signal[] = { - {.name = "help", - .data = N_("Send signals to processes") - }, - {.name = "desc", - .data = N_("Send signals to processes in the guest") - }, - {.name = NULL} +static const vshCmdInfo info_send_process_signal = { + .help = N_("Send signals to processes"), + .desc = N_("Send signals to processes in the guest"), }; static const vshCmdOptDef opts_send_process_signal[] = { @@ -8930,14 +8620,9 @@ cmdSendProcessSignal(vshControl *ctl, const vshCmd *cmd) /* * "setmem" command */ -static const vshCmdInfo info_setmem[] = { - {.name = "help", - .data = N_("change memory allocation") - }, - {.name = "desc", - .data = N_("Change the current memory allocation in the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_setmem = { + .help = N_("change memory allocation"), + .desc = N_("Change the current memory allocation in the guest domain."), }; static const vshCmdOptDef opts_setmem[] = { @@ -9004,14 +8689,9 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd) /* * "setmaxmem" command */ -static const vshCmdInfo info_setmaxmem[] = { - {.name = "help", - .data = N_("change maximum memory limit") - }, - {.name = "desc", - .data = N_("Change the maximum memory allocation limit in the guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_setmaxmem = { + .help = N_("change maximum memory limit"), + .desc = N_("Change the maximum memory allocation limit in the guest domain."), }; static const vshCmdOptDef opts_setmaxmem[] = { @@ -9076,14 +8756,9 @@ cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd) /* * "update-memory-device" command */ -static const vshCmdInfo info_update_memory_device[] = { - {.name = "help", - .data = N_("update memory device of a domain") - }, - {.name = "desc", - .data = N_("Update values of a memory device of a domain") - }, - {.name = NULL} +static const vshCmdInfo info_update_memory_device = { + .help = N_("update memory device of a domain"), + .desc = N_("Update values of a memory device of a domain"), }; static const vshCmdOptDef opts_update_memory_device[] = { @@ -9230,14 +8905,9 @@ cmdUpdateMemoryDevice(vshControl *ctl, const vshCmd *cmd) /* * "memtune" command */ -static const vshCmdInfo info_memtune[] = { - {.name = "help", - .data = N_("Get or set memory parameters") - }, - {.name = "desc", - .data = N_("Get or set the current memory parameters for a guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_memtune = { + .help = N_("Get or set memory parameters"), + .desc = N_("Get or set the current memory parameters for a guest domain."), }; static const vshCmdOptDef opts_memtune[] = { @@ -9402,14 +9072,9 @@ cmdMemtune(vshControl *ctl, const vshCmd *cmd) /* * "perf" command */ -static const vshCmdInfo info_perf[] = { - {.name = "help", - .data = N_("Get or set perf event") - }, - {.name = "desc", - .data = N_("Get or set the current perf events for a guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_perf = { + .help = N_("Get or set perf event"), + .desc = N_("Get or set the current perf events for a guest domain."), }; static const vshCmdOptDef opts_perf[] = { @@ -9531,14 +9196,9 @@ cmdPerf(vshControl *ctl, const vshCmd *cmd) /* * "numatune" command */ -static const vshCmdInfo info_numatune[] = { - {.name = "help", - .data = N_("Get or set numa parameters") - }, - {.name = "desc", - .data = N_("Get or set the current numa parameters for a guest domain.") - }, - {.name = NULL} +static const vshCmdInfo info_numatune = { + .help = N_("Get or set numa parameters"), + .desc = N_("Get or set the current numa parameters for a guest domain."), }; static const vshCmdOptDef opts_numatune[] = { @@ -9665,14 +9325,9 @@ cmdNumatune(vshControl * ctl, const vshCmd * cmd) /* * "domlaunchsecinfo" command */ -static const vshCmdInfo info_domlaunchsecinfo[] = { - {.name = "help", - .data = N_("Get domain launch security info") - }, - {.name = "desc", - .data = N_("Get the launch security parameters for a guest domain") - }, - {.name = NULL} +static const vshCmdInfo info_domlaunchsecinfo = { + .help = N_("Get domain launch security info"), + .desc = N_("Get the launch security parameters for a guest domain"), }; static const vshCmdOptDef opts_domlaunchsecinfo[] = { @@ -9712,14 +9367,9 @@ cmdDomLaunchSecInfo(vshControl * ctl, const vshCmd * cmd) /* * "domsetlaunchsecstate" command */ -static const vshCmdInfo info_domsetlaunchsecstate[] = { - {.name = "help", - .data = N_("Set domain launch security state") - }, - {.name = "desc", - .data = N_("Set a secret in the guest domain's memory") - }, - {.name = NULL} +static const vshCmdInfo info_domsetlaunchsecstate = { + .help = N_("Set domain launch security state"), + .desc = N_("Set a secret in the guest domain's memory"), }; static const vshCmdOptDef opts_domsetlaunchsecstate[] = { @@ -9816,14 +9466,9 @@ cmdDomSetLaunchSecState(vshControl * ctl, const vshCmd * cmd) /* * "dom-fd-associate" command */ -static const vshCmdInfo info_dom_fd_associate[] = { - {.name = "help", - .data = N_("associate a FD with a domain") - }, - {.name = "desc", - .data = N_("associate a FD with a domain") - }, - {.name = NULL} +static const vshCmdInfo info_dom_fd_associate = { + .help = N_("associate a FD with a domain"), + .desc = N_("associate a FD with a domain"), }; static const vshCmdOptDef opts_dom_fd_associate[] = { @@ -9885,14 +9530,9 @@ cmdDomFdAssociate(vshControl *ctl, const vshCmd *cmd) /* * "qemu-monitor-command" command */ -static const vshCmdInfo info_qemu_monitor_command[] = { - {.name = "help", - .data = N_("QEMU Monitor Command") - }, - {.name = "desc", - .data = N_("QEMU Monitor Command") - }, - {.name = NULL} +static const vshCmdInfo info_qemu_monitor_command = { + .help = N_("QEMU Monitor Command"), + .desc = N_("QEMU Monitor Command"), }; static const vshCmdOptDef opts_qemu_monitor_command[] = { @@ -10137,14 +9777,9 @@ virshEventQemuPrint(virConnectPtr conn G_GNUC_UNUSED, vshEventDone(data->ctl); } -static const vshCmdInfo info_qemu_monitor_event[] = { - {.name = "help", - .data = N_("QEMU Monitor Events") - }, - {.name = "desc", - .data = N_("Listen for QEMU Monitor Events") - }, - {.name = NULL} +static const vshCmdInfo info_qemu_monitor_event = { + .help = N_("QEMU Monitor Events"), + .desc = N_("Listen for QEMU Monitor Events"), }; static const vshCmdOptDef opts_qemu_monitor_event[] = { @@ -10249,14 +9884,9 @@ cmdQemuMonitorEvent(vshControl *ctl, const vshCmd *cmd) /* * "qemu-attach" command */ -static const vshCmdInfo info_qemu_attach[] = { - {.name = "help", - .data = N_("QEMU Attach") - }, - {.name = "desc", - .data = N_("QEMU Attach") - }, - {.name = NULL} +static const vshCmdInfo info_qemu_attach = { + .help = N_("QEMU Attach"), + .desc = N_("QEMU Attach"), }; static const vshCmdOptDef opts_qemu_attach[] = { @@ -10293,14 +9923,9 @@ cmdQemuAttach(vshControl *ctl, const vshCmd *cmd) /* * "qemu-agent-command" command */ -static const vshCmdInfo info_qemu_agent_command[] = { - {.name = "help", - .data = N_("QEMU Guest Agent Command") - }, - {.name = "desc", - .data = N_("Run an arbitrary qemu guest agent command; use at your own risk") - }, - {.name = NULL} +static const vshCmdInfo info_qemu_agent_command = { + .help = N_("QEMU Guest Agent Command"), + .desc = N_("Run an arbitrary qemu guest agent command; use at your own risk"), }; static const vshCmdOptDef opts_qemu_agent_command[] = { @@ -10407,14 +10032,9 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd) /* * "lxc-enter-namespace" namespace */ -static const vshCmdInfo info_lxc_enter_namespace[] = { - {.name = "help", - .data = N_("LXC Guest Enter Namespace") - }, - {.name = "desc", - .data = N_("Run an arbitrary command in a lxc guest namespace; use at your own risk") - }, - {.name = NULL} +static const vshCmdInfo info_lxc_enter_namespace = { + .help = N_("LXC Guest Enter Namespace"), + .desc = N_("Run an arbitrary command in a lxc guest namespace; use at your own risk"), }; static const vshCmdOptDef opts_lxc_enter_namespace[] = { @@ -10523,14 +10143,9 @@ cmdLxcEnterNamespace(vshControl *ctl, const vshCmd *cmd) /* * "dumpxml" command */ -static const vshCmdInfo info_dumpxml[] = { - {.name = "help", - .data = N_("domain information in XML") - }, - {.name = "desc", - .data = N_("Output the domain information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_dumpxml = { + .help = N_("domain information in XML"), + .desc = N_("Output the domain information as an XML dump to stdout."), }; static const vshCmdOptDef opts_dumpxml[] = { @@ -10601,14 +10216,9 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "domxml-from-native" command */ -static const vshCmdInfo info_domxmlfromnative[] = { - {.name = "help", - .data = N_("Convert native config to domain XML") - }, - {.name = "desc", - .data = N_("Convert native guest configuration format to domain XML format.") - }, - {.name = NULL} +static const vshCmdInfo info_domxmlfromnative = { + .help = N_("Convert native config to domain XML"), + .desc = N_("Convert native guest configuration format to domain XML format."), }; static const vshCmdOptDef opts_domxmlfromnative[] = { @@ -10654,14 +10264,9 @@ cmdDomXMLFromNative(vshControl *ctl, const vshCmd *cmd) /* * "domxml-to-native" command */ -static const vshCmdInfo info_domxmltonative[] = { - {.name = "help", - .data = N_("Convert domain XML to native config") - }, - {.name = "desc", - .data = N_("Convert domain XML config to a native guest configuration format.") - }, - {.name = NULL} +static const vshCmdInfo info_domxmltonative = { + .help = N_("Convert domain XML to native config"), + .desc = N_("Convert domain XML config to a native guest configuration format."), }; static const vshCmdOptDef opts_domxmltonative[] = { @@ -10726,14 +10331,9 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd) /* * "domname" command */ -static const vshCmdInfo info_domname[] = { - {.name = "help", - .data = N_("convert a domain id or UUID to domain name") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_domname = { + .help = N_("convert a domain id or UUID to domain name"), + .desc = "", }; static const vshCmdOptDef opts_domname[] = { @@ -10762,14 +10362,9 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd) /* * "domrename" command */ -static const vshCmdInfo info_domrename[] = { - {.name = "help", - .data = N_("rename a domain") - }, - {.name = "desc", - .data = "Rename an inactive domain." - }, - {.name = NULL} +static const vshCmdInfo info_domrename = { + .help = N_("rename a domain"), + .desc = "Rename an inactive domain.", }; static const vshCmdOptDef opts_domrename[] = { @@ -10807,14 +10402,9 @@ cmdDomrename(vshControl *ctl, const vshCmd *cmd) /* * "domid" command */ -static const vshCmdInfo info_domid[] = { - {.name = "help", - .data = N_("convert a domain name or UUID to domain id") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_domid = { + .help = N_("convert a domain name or UUID to domain id"), + .desc = "", }; static const vshCmdOptDef opts_domid[] = { @@ -10844,14 +10434,9 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd) /* * "domuuid" command */ -static const vshCmdInfo info_domuuid[] = { - {.name = "help", - .data = N_("convert a domain name or id to domain UUID") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_domuuid = { + .help = N_("convert a domain name or id to domain UUID"), + .desc = "", }; static const vshCmdOptDef opts_domuuid[] = { @@ -10880,14 +10465,9 @@ cmdDomuuid(vshControl *ctl, const vshCmd *cmd) /* * "migrate" command */ -static const vshCmdInfo info_migrate[] = { - {.name = "help", - .data = N_("migrate domain to another host") - }, - {.name = "desc", - .data = N_("Migrate domain to another host. Add --live for live migration.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate = { + .help = N_("migrate domain to another host"), + .desc = N_("Migrate domain to another host. Add --live for live migration."), }; static const vshCmdOptDef opts_migrate[] = { @@ -11582,14 +11162,9 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd) /* * "migrate-setmaxdowntime" command */ -static const vshCmdInfo info_migrate_setmaxdowntime[] = { - {.name = "help", - .data = N_("set maximum tolerable downtime") - }, - {.name = "desc", - .data = N_("Set maximum tolerable downtime of a domain which is being live-migrated to another host.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate_setmaxdowntime = { + .help = N_("set maximum tolerable downtime"), + .desc = N_("Set maximum tolerable downtime of a domain which is being live-migrated to another host."), }; static const vshCmdOptDef opts_migrate_setmaxdowntime[] = { @@ -11626,14 +11201,9 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd) /* * "migrate-getmaxdowntime" command */ -static const vshCmdInfo info_migrate_getmaxdowntime[] = { - {.name = "help", - .data = N_("get maximum tolerable downtime") - }, - {.name = "desc", - .data = N_("Get maximum tolerable downtime of a domain which is being live-migrated to another host.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate_getmaxdowntime = { + .help = N_("get maximum tolerable downtime"), + .desc = N_("Get maximum tolerable downtime of a domain which is being live-migrated to another host."), }; static const vshCmdOptDef opts_migrate_getmaxdowntime[] = { @@ -11661,15 +11231,10 @@ cmdMigrateGetMaxDowntime(vshControl *ctl, const vshCmd *cmd) /* * "migrate-compcache" command */ -static const vshCmdInfo info_migrate_compcache[] = { - {.name = "help", - .data = N_("get/set compression cache size") - }, - {.name = "desc", - .data = N_("Get/set size of the cache (in bytes) used for compressing " - "repeatedly transferred memory pages during live migration.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate_compcache = { + .help = N_("get/set compression cache size"), + .desc = N_("Get/set size of the cache (in bytes) used for compressing " + "repeatedly transferred memory pages during live migration."), }; static const vshCmdOptDef opts_migrate_compcache[] = { @@ -11714,15 +11279,10 @@ cmdMigrateCompCache(vshControl *ctl, const vshCmd *cmd) /* * "migrate-setspeed" command */ -static const vshCmdInfo info_migrate_setspeed[] = { - {.name = "help", - .data = N_("Set the maximum migration bandwidth") - }, - {.name = "desc", - .data = N_("Set the maximum migration bandwidth (in MiB/s) for a domain " - "which is being migrated to another host.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate_setspeed = { + .help = N_("Set the maximum migration bandwidth"), + .desc = N_("Set the maximum migration bandwidth (in MiB/s) for a domain " + "which is being migrated to another host."), }; static const vshCmdOptDef opts_migrate_setspeed[] = { @@ -11764,14 +11324,9 @@ cmdMigrateSetMaxSpeed(vshControl *ctl, const vshCmd *cmd) /* * "migrate-getspeed" command */ -static const vshCmdInfo info_migrate_getspeed[] = { - {.name = "help", - .data = N_("Get the maximum migration bandwidth") - }, - {.name = "desc", - .data = N_("Get the maximum migration bandwidth (in MiB/s) for a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate_getspeed = { + .help = N_("Get the maximum migration bandwidth"), + .desc = N_("Get the maximum migration bandwidth (in MiB/s) for a domain."), }; static const vshCmdOptDef opts_migrate_getspeed[] = { @@ -11807,15 +11362,10 @@ cmdMigrateGetMaxSpeed(vshControl *ctl, const vshCmd *cmd) /* * "migrate-postcopy" command */ -static const vshCmdInfo info_migrate_postcopy[] = { - {.name = "help", - .data = N_("Switch running migration from pre-copy to post-copy") - }, - {.name = "desc", - .data = N_("Switch running migration from pre-copy to post-copy. " - "The migration must have been started with --postcopy option.") - }, - {.name = NULL} +static const vshCmdInfo info_migrate_postcopy = { + .help = N_("Switch running migration from pre-copy to post-copy"), + .desc = N_("Switch running migration from pre-copy to post-copy. " + "The migration must have been started with --postcopy option."), }; static const vshCmdOptDef opts_migrate_postcopy[] = { @@ -11840,15 +11390,10 @@ cmdMigratePostCopy(vshControl *ctl, const vshCmd *cmd) /* * "domdisplay" command */ -static const vshCmdInfo info_domdisplay[] = { - {.name = "help", - .data = N_("domain display connection URI") - }, - {.name = "desc", - .data = N_("Output the IP address and port number " - "for the graphical display.") - }, - {.name = NULL} +static const vshCmdInfo info_domdisplay = { + .help = N_("domain display connection URI"), + .desc = N_("Output the IP address and port number " + "for the graphical display."), }; static const vshCmdOptDef opts_domdisplay[] = { @@ -12093,14 +11638,9 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd) /* * "vncdisplay" command */ -static const vshCmdInfo info_vncdisplay[] = { - {.name = "help", - .data = N_("vnc display") - }, - {.name = "desc", - .data = N_("Output the IP address and port number for the VNC display.") - }, - {.name = NULL} +static const vshCmdInfo info_vncdisplay = { + .help = N_("vnc display"), + .desc = N_("Output the IP address and port number for the VNC display."), }; static const vshCmdOptDef opts_vncdisplay[] = { @@ -12161,14 +11701,9 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd) /* * "ttyconsole" command */ -static const vshCmdInfo info_ttyconsole[] = { - {.name = "help", - .data = N_("tty console") - }, - {.name = "desc", - .data = N_("Output the device for the TTY console.") - }, - {.name = NULL} +static const vshCmdInfo info_ttyconsole = { + .help = N_("tty console"), + .desc = N_("Output the device for the TTY console."), }; static const vshCmdOptDef opts_ttyconsole[] = { @@ -12196,14 +11731,9 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd) /* * "domhostname" command */ -static const vshCmdInfo info_domhostname[] = { - {.name = "help", - .data = N_("print the domain's hostname") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_domhostname = { + .help = N_("print the domain's hostname"), + .desc = "", }; static const vshCmdOptDef opts_domhostname[] = { @@ -12268,14 +11798,9 @@ cmdDomHostname(vshControl *ctl, const vshCmd *cmd) /* * "detach-device" command */ -static const vshCmdInfo info_detach_device[] = { - {.name = "help", - .data = N_("detach device from an XML file") - }, - {.name = "desc", - .data = N_("Detach device from an XML ") - }, - {.name = NULL} +static const vshCmdInfo info_detach_device = { + .help = N_("detach device from an XML file"), + .desc = N_("Detach device from an XML "), }; static const vshCmdOptDef opts_detach_device[] = { @@ -12344,14 +11869,9 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd) /* * "detach-device-alias" command */ -static const vshCmdInfo info_detach_device_alias[] = { - {.name = "help", - .data = N_("detach device from an alias") - }, - {.name = "desc", - .data = N_("Detach device identified by the given alias from a domain") - }, - {.name = NULL} +static const vshCmdInfo info_detach_device_alias = { + .help = N_("detach device from an alias"), + .desc = N_("Detach device identified by the given alias from a domain"), }; static const vshCmdOptDef opts_detach_device_alias[] = { @@ -12405,14 +11925,9 @@ cmdDetachDeviceAlias(vshControl *ctl, const vshCmd *cmd) /* * "update-device" command */ -static const vshCmdInfo info_update_device[] = { - {.name = "help", - .data = N_("update device from an XML file") - }, - {.name = "desc", - .data = N_("Update device from an XML .") - }, - {.name = NULL} +static const vshCmdInfo info_update_device = { + .help = N_("update device from an XML file"), + .desc = N_("Update device from an XML ."), }; static const vshCmdOptDef opts_update_device[] = { @@ -12482,14 +11997,9 @@ cmdUpdateDevice(vshControl *ctl, const vshCmd *cmd) /* * "detach-interface" command */ -static const vshCmdInfo info_detach_interface[] = { - {.name = "help", - .data = N_("detach network interface") - }, - {.name = "desc", - .data = N_("Detach network interface.") - }, - {.name = NULL} +static const vshCmdInfo info_detach_interface = { + .help = N_("detach network interface"), + .desc = N_("Detach network interface."), }; static const vshCmdOptDef opts_detach_interface[] = { @@ -12859,14 +12369,9 @@ virshUpdateDiskXML(xmlNodePtr disk_node, /* * "detach-disk" command */ -static const vshCmdInfo info_detach_disk[] = { - {.name = "help", - .data = N_("detach disk device") - }, - {.name = "desc", - .data = N_("Detach disk device.") - }, - {.name = NULL} +static const vshCmdInfo info_detach_disk = { + .help = N_("detach disk device"), + .desc = N_("Detach disk device."), }; static const vshCmdOptDef opts_detach_disk[] = { @@ -12961,14 +12466,9 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd) /* * "edit" command */ -static const vshCmdInfo info_edit[] = { - {.name = "help", - .data = N_("edit XML configuration for a domain") - }, - {.name = "desc", - .data = N_("Edit the XML configuration for a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_edit = { + .help = N_("edit XML configuration for a domain"), + .desc = N_("Edit the XML configuration for a domain."), }; static const vshCmdOptDef opts_edit[] = { @@ -13029,14 +12529,9 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) /* * "change-media" command */ -static const vshCmdInfo info_change_media[] = { - {.name = "help", - .data = N_("Change media of CD or floppy drive") - }, - {.name = "desc", - .data = N_("Change media of CD or floppy drive.") - }, - {.name = NULL} +static const vshCmdInfo info_change_media = { + .help = N_("Change media of CD or floppy drive"), + .desc = N_("Change media of CD or floppy drive."), }; static const vshCmdOptDef opts_change_media[] = { @@ -13183,14 +12678,9 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd) return true; } -static const vshCmdInfo info_domfstrim[] = { - {.name = "help", - .data = N_("Invoke fstrim on domain's mounted filesystems.") - }, - {.name = "desc", - .data = N_("Invoke fstrim on domain's mounted filesystems.") - }, - {.name = NULL} +static const vshCmdInfo info_domfstrim = { + .help = N_("Invoke fstrim on domain's mounted filesystems."), + .desc = N_("Invoke fstrim on domain's mounted filesystems."), }; static const vshCmdOptDef opts_domfstrim[] = { @@ -13232,14 +12722,9 @@ cmdDomFSTrim(vshControl *ctl, const vshCmd *cmd) return true; } -static const vshCmdInfo info_domfsfreeze[] = { - {.name = "help", - .data = N_("Freeze domain's mounted filesystems.") - }, - {.name = "desc", - .data = N_("Freeze domain's mounted filesystems.") - }, - {.name = NULL} +static const vshCmdInfo info_domfsfreeze = { + .help = N_("Freeze domain's mounted filesystems."), + .desc = N_("Freeze domain's mounted filesystems."), }; static const vshCmdOptDef opts_domfsfreeze[] = { @@ -13277,14 +12762,9 @@ cmdDomFSFreeze(vshControl *ctl, const vshCmd *cmd) return true; } -static const vshCmdInfo info_domfsthaw[] = { - {.name = "help", - .data = N_("Thaw domain's mounted filesystems.") - }, - {.name = "desc", - .data = N_("Thaw domain's mounted filesystems.") - }, - {.name = NULL} +static const vshCmdInfo info_domfsthaw = { + .help = N_("Thaw domain's mounted filesystems."), + .desc = N_("Thaw domain's mounted filesystems."), }; static const vshCmdOptDef opts_domfsthaw[] = { @@ -13322,14 +12802,9 @@ cmdDomFSThaw(vshControl *ctl, const vshCmd *cmd) return true; } -static const vshCmdInfo info_domfsinfo[] = { - {.name = "help", - .data = N_("Get information of domain's mounted filesystems.") - }, - {.name = "desc", - .data = N_("Get information of domain's mounted filesystems.") - }, - {.name = NULL} +static const vshCmdInfo info_domfsinfo = { + .help = N_("Get information of domain's mounted filesystems."), + .desc = N_("Get information of domain's mounted filesystems."), }; static const vshCmdOptDef opts_domfsinfo[] = { @@ -13405,14 +12880,9 @@ cmdDomFSInfo(vshControl *ctl, const vshCmd *cmd) /* * "guest-agent-timeout" command */ -static const vshCmdInfo info_guest_agent_timeout[] = { - {.name = "help", - .data = N_("Set the guest agent timeout") - }, - {.name = "desc", - .data = N_("Set the number of seconds to wait for a response from the guest agent.") - }, - {.name = NULL} +static const vshCmdInfo info_guest_agent_timeout = { + .help = N_("Set the guest agent timeout"), + .desc = N_("Set the number of seconds to wait for a response from the guest agent."), }; static const vshCmdOptDef opts_guest_agent_timeout[] = { @@ -13447,15 +12917,10 @@ cmdGuestAgentTimeout(vshControl *ctl, const vshCmd *cmd) /* * "guestinfo" command */ -static const vshCmdInfo info_guestinfo[] = { - {.name = "help", - .data = N_("query information about the guest (via agent)") - }, - {.name = "desc", - .data = N_("Use the guest agent to query various information from guest's " - "point of view") - }, - {.name = NULL} +static const vshCmdInfo info_guestinfo = { + .help = N_("query information about the guest (via agent)"), + .desc = N_("Use the guest agent to query various information from guest's " + "point of view"), }; static const vshCmdOptDef opts_guestinfo[] = { @@ -13537,15 +13002,10 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd) /* * "get-user-sshkeys" command */ -static const vshCmdInfo info_get_user_sshkeys[] = { - {.name = "help", - .data = N_("list authorized SSH keys for given user (via agent)") - }, - {.name = "desc", - .data = N_("Use the guest agent to query authorized SSH keys for given " - "user") - }, - {.name = NULL} +static const vshCmdInfo info_get_user_sshkeys = { + .help = N_("list authorized SSH keys for given user (via agent)"), + .desc = N_("Use the guest agent to query authorized SSH keys for given " + "user"), }; static const vshCmdOptDef opts_get_user_sshkeys[] = { @@ -13589,15 +13049,10 @@ cmdGetUserSSHKeys(vshControl *ctl, const vshCmd *cmd) /* * "set-user-sshkeys" command */ -static const vshCmdInfo info_set_user_sshkeys[] = { - {.name = "help", - .data = N_("manipulate authorized SSH keys file for given user (via agent)") - }, - {.name = "desc", - .data = N_("Append, reset or remove specified key from the authorized " - "keys file for given user") - }, - {.name = NULL} +static const vshCmdInfo info_set_user_sshkeys = { + .help = N_("manipulate authorized SSH keys file for given user (via agent)"), + .desc = N_("Append, reset or remove specified key from the authorized " + "keys file for given user") }; static const vshCmdOptDef opts_set_user_sshkeys[] = { @@ -13687,17 +13142,12 @@ cmdSetUserSSHKeys(vshControl *ctl, const vshCmd *cmd) /* * "domdirtyrate" command */ -static const vshCmdInfo info_domdirtyrate_calc[] = { - {.name = "help", - .data = N_("Calculate a vm's memory dirty rate") - }, - {.name = "desc", - .data = N_("Calculate memory dirty rate of a domain in order to " +static const vshCmdInfo info_domdirtyrate_calc = { + .help = N_("Calculate a vm's memory dirty rate"), + .desc = N_("Calculate memory dirty rate of a domain in order to " "decide whether it's proper to be migrated out or not.\n" "The calculated dirty rate information is available by " - "calling 'domstats --dirtyrate'.") - }, - {.name = NULL} + "calling 'domstats --dirtyrate'."), }; static const vshCmdOptDef opts_domdirtyrate_calc[] = { @@ -13773,14 +13223,9 @@ cmdDomDirtyRateCalc(vshControl *ctl, const vshCmd *cmd) /** * "domdisplay-reload" command */ -static const vshCmdInfo info_domdisplay_reload[] = { - {.name = "help", - .data = N_("Reload domain's graphics display certificates") - }, - {.name = "desc", - .data = N_("Reload domain's graphics display certificates") - }, - {.name = NULL} +static const vshCmdInfo info_domdisplay_reload = { + .help = N_("Reload domain's graphics display certificates"), + .desc = N_("Reload domain's graphics display certificates"), }; static const vshCmdOptDef opts_domdisplay_reload[] = { @@ -13814,669 +13259,669 @@ const vshCmdDef domManagementCmds[] = { {.name = "attach-device", .handler = cmdAttachDevice, .opts = opts_attach_device, - .info = info_attach_device, + .info = &info_attach_device, .flags = 0 }, {.name = "attach-disk", .handler = cmdAttachDisk, .opts = opts_attach_disk, - .info = info_attach_disk, + .info = &info_attach_disk, .flags = 0 }, {.name = "attach-interface", .handler = cmdAttachInterface, .opts = opts_attach_interface, - .info = info_attach_interface, + .info = &info_attach_interface, .flags = 0 }, {.name = "autostart", .handler = cmdAutostart, .opts = opts_autostart, - .info = info_autostart, + .info = &info_autostart, .flags = 0 }, {.name = "blkdeviotune", .handler = cmdBlkdeviotune, .opts = opts_blkdeviotune, - .info = info_blkdeviotune, + .info = &info_blkdeviotune, .flags = 0 }, {.name = "blkiotune", .handler = cmdBlkiotune, .opts = opts_blkiotune, - .info = info_blkiotune, + .info = &info_blkiotune, .flags = 0 }, {.name = "blockcommit", .handler = cmdBlockcommit, .opts = opts_blockcommit, - .info = info_blockcommit, + .info = &info_blockcommit, .flags = 0 }, {.name = "blockcopy", .handler = cmdBlockcopy, .opts = opts_blockcopy, - .info = info_blockcopy, + .info = &info_blockcopy, .flags = 0 }, {.name = "blockjob", .handler = cmdBlockjob, .opts = opts_blockjob, - .info = info_blockjob, + .info = &info_blockjob, .flags = 0 }, {.name = "blockpull", .handler = cmdBlockpull, .opts = opts_blockpull, - .info = info_blockpull, + .info = &info_blockpull, .flags = 0 }, {.name = "blockresize", .handler = cmdBlockresize, .opts = opts_blockresize, - .info = info_blockresize, + .info = &info_blockresize, .flags = 0 }, {.name = "change-media", .handler = cmdChangeMedia, .opts = opts_change_media, - .info = info_change_media, + .info = &info_change_media, .flags = 0 }, #ifndef WIN32 {.name = "console", .handler = cmdConsole, .opts = opts_console, - .info = info_console, + .info = &info_console, .flags = 0 }, #endif {.name = "cpu-stats", .handler = cmdCPUStats, .opts = opts_cpu_stats, - .info = info_cpu_stats, + .info = &info_cpu_stats, .flags = 0 }, {.name = "create", .handler = cmdCreate, .opts = opts_create, - .info = info_create, + .info = &info_create, .flags = 0 }, {.name = "define", .handler = cmdDefine, .opts = opts_define, - .info = info_define, + .info = &info_define, .flags = 0 }, {.name = "desc", .handler = cmdDesc, .opts = opts_desc, - .info = info_desc, + .info = &info_desc, .flags = 0 }, {.name = "destroy", .handler = cmdDestroy, .opts = opts_destroy, - .info = info_destroy, + .info = &info_destroy, .flags = 0 }, {.name = "detach-device", .handler = cmdDetachDevice, .opts = opts_detach_device, - .info = info_detach_device, + .info = &info_detach_device, .flags = 0 }, {.name = "detach-device-alias", .handler = cmdDetachDeviceAlias, .opts = opts_detach_device_alias, - .info = info_detach_device_alias, + .info = &info_detach_device_alias, .flags = 0 }, {.name = "detach-disk", .handler = cmdDetachDisk, .opts = opts_detach_disk, - .info = info_detach_disk, + .info = &info_detach_disk, .flags = 0 }, {.name = "detach-interface", .handler = cmdDetachInterface, .opts = opts_detach_interface, - .info = info_detach_interface, + .info = &info_detach_interface, .flags = 0 }, {.name = "domdisplay", .handler = cmdDomDisplay, .opts = opts_domdisplay, - .info = info_domdisplay, + .info = &info_domdisplay, .flags = 0 }, {.name = "domfsfreeze", .handler = cmdDomFSFreeze, .opts = opts_domfsfreeze, - .info = info_domfsfreeze, + .info = &info_domfsfreeze, .flags = 0 }, {.name = "domfsthaw", .handler = cmdDomFSThaw, .opts = opts_domfsthaw, - .info = info_domfsthaw, + .info = &info_domfsthaw, .flags = 0 }, {.name = "domfsinfo", .handler = cmdDomFSInfo, .opts = opts_domfsinfo, - .info = info_domfsinfo, + .info = &info_domfsinfo, .flags = 0 }, {.name = "domfstrim", .handler = cmdDomFSTrim, .opts = opts_domfstrim, - .info = info_domfstrim, + .info = &info_domfstrim, .flags = 0 }, {.name = "domhostname", .handler = cmdDomHostname, .opts = opts_domhostname, - .info = info_domhostname, + .info = &info_domhostname, .flags = 0 }, {.name = "domid", .handler = cmdDomid, .opts = opts_domid, - .info = info_domid, + .info = &info_domid, .flags = 0 }, {.name = "domif-setlink", .handler = cmdDomIfSetLink, .opts = opts_domif_setlink, - .info = info_domif_setlink, + .info = &info_domif_setlink, .flags = 0 }, {.name = "domiftune", .handler = cmdDomIftune, .opts = opts_domiftune, - .info = info_domiftune, + .info = &info_domiftune, .flags = 0 }, {.name = "domjobabort", .handler = cmdDomjobabort, .opts = opts_domjobabort, - .info = info_domjobabort, + .info = &info_domjobabort, .flags = 0 }, {.name = "domjobinfo", .handler = cmdDomjobinfo, .opts = opts_domjobinfo, - .info = info_domjobinfo, + .info = &info_domjobinfo, .flags = 0 }, {.name = "domlaunchsecinfo", .handler = cmdDomLaunchSecInfo, .opts = opts_domlaunchsecinfo, - .info = info_domlaunchsecinfo, + .info = &info_domlaunchsecinfo, .flags = 0 }, {.name = "domsetlaunchsecstate", .handler = cmdDomSetLaunchSecState, .opts = opts_domsetlaunchsecstate, - .info = info_domsetlaunchsecstate, + .info = &info_domsetlaunchsecstate, .flags = 0 }, {.name = "domname", .handler = cmdDomname, .opts = opts_domname, - .info = info_domname, + .info = &info_domname, .flags = 0 }, {.name = "domrename", .handler = cmdDomrename, .opts = opts_domrename, - .info = info_domrename, + .info = &info_domrename, .flags = 0 }, {.name = "dompmsuspend", .handler = cmdDomPMSuspend, .opts = opts_dom_pm_suspend, - .info = info_dom_pm_suspend, + .info = &info_dom_pm_suspend, .flags = 0 }, {.name = "dompmwakeup", .handler = cmdDomPMWakeup, .opts = opts_dom_pm_wakeup, - .info = info_dom_pm_wakeup, + .info = &info_dom_pm_wakeup, .flags = 0 }, {.name = "domuuid", .handler = cmdDomuuid, .opts = opts_domuuid, - .info = info_domuuid, + .info = &info_domuuid, .flags = 0 }, {.name = "domxml-from-native", .handler = cmdDomXMLFromNative, .opts = opts_domxmlfromnative, - .info = info_domxmlfromnative, + .info = &info_domxmlfromnative, .flags = 0 }, {.name = "domxml-to-native", .handler = cmdDomXMLToNative, .opts = opts_domxmltonative, - .info = info_domxmltonative, + .info = &info_domxmltonative, .flags = 0 }, {.name = "dump", .handler = cmdDump, .opts = opts_dump, - .info = info_dump, + .info = &info_dump, .flags = 0 }, {.name = "dumpxml", .handler = cmdDumpXML, .opts = opts_dumpxml, - .info = info_dumpxml, + .info = &info_dumpxml, .flags = 0 }, {.name = "edit", .handler = cmdEdit, .opts = opts_edit, - .info = info_edit, + .info = &info_edit, .flags = 0 }, {.name = "get-user-sshkeys", .handler = cmdGetUserSSHKeys, .opts = opts_get_user_sshkeys, - .info = info_get_user_sshkeys, + .info = &info_get_user_sshkeys, .flags = 0 }, {.name = "inject-nmi", .handler = cmdInjectNMI, .opts = opts_inject_nmi, - .info = info_inject_nmi, + .info = &info_inject_nmi, .flags = 0 }, {.name = "iothreadinfo", .handler = cmdIOThreadInfo, .opts = opts_iothreadinfo, - .info = info_iothreadinfo, + .info = &info_iothreadinfo, .flags = 0 }, {.name = "iothreadpin", .handler = cmdIOThreadPin, .opts = opts_iothreadpin, - .info = info_iothreadpin, + .info = &info_iothreadpin, .flags = 0 }, {.name = "iothreadadd", .handler = cmdIOThreadAdd, .opts = opts_iothreadadd, - .info = info_iothreadadd, + .info = &info_iothreadadd, .flags = 0 }, {.name = "iothreadset", .handler = cmdIOThreadSet, .opts = opts_iothreadset, - .info = info_iothreadset, + .info = &info_iothreadset, .flags = 0 }, {.name = "iothreaddel", .handler = cmdIOThreadDel, .opts = opts_iothreaddel, - .info = info_iothreaddel, + .info = &info_iothreaddel, .flags = 0 }, {.name = "send-key", .handler = cmdSendKey, .opts = opts_send_key, - .info = info_send_key, + .info = &info_send_key, .flags = 0 }, {.name = "send-process-signal", .handler = cmdSendProcessSignal, .opts = opts_send_process_signal, - .info = info_send_process_signal, + .info = &info_send_process_signal, .flags = 0 }, {.name = "lxc-enter-namespace", .handler = cmdLxcEnterNamespace, .opts = opts_lxc_enter_namespace, - .info = info_lxc_enter_namespace, + .info = &info_lxc_enter_namespace, .flags = 0 }, {.name = "managedsave", .handler = cmdManagedSave, .opts = opts_managedsave, - .info = info_managedsave, + .info = &info_managedsave, .flags = 0 }, {.name = "managedsave-remove", .handler = cmdManagedSaveRemove, .opts = opts_managedsaveremove, - .info = info_managedsaveremove, + .info = &info_managedsaveremove, .flags = 0 }, {.name = "managedsave-edit", .handler = cmdManagedSaveEdit, .opts = opts_managed_save_edit, - .info = info_managed_save_edit, + .info = &info_managed_save_edit, .flags = 0 }, {.name = "managedsave-dumpxml", .handler = cmdManagedSaveDumpxml, .opts = opts_managed_save_dumpxml, - .info = info_managed_save_dumpxml, + .info = &info_managed_save_dumpxml, .flags = 0 }, {.name = "managedsave-define", .handler = cmdManagedSaveDefine, .opts = opts_managed_save_define, - .info = info_managed_save_define, + .info = &info_managed_save_define, .flags = 0 }, {.name = "memtune", .handler = cmdMemtune, .opts = opts_memtune, - .info = info_memtune, + .info = &info_memtune, .flags = 0 }, {.name = "perf", .handler = cmdPerf, .opts = opts_perf, - .info = info_perf, + .info = &info_perf, .flags = 0 }, {.name = "metadata", .handler = cmdMetadata, .opts = opts_metadata, - .info = info_metadata, + .info = &info_metadata, .flags = 0 }, {.name = "migrate", .handler = cmdMigrate, .opts = opts_migrate, - .info = info_migrate, + .info = &info_migrate, .flags = 0 }, {.name = "migrate-setmaxdowntime", .handler = cmdMigrateSetMaxDowntime, .opts = opts_migrate_setmaxdowntime, - .info = info_migrate_setmaxdowntime, + .info = &info_migrate_setmaxdowntime, .flags = 0 }, {.name = "migrate-getmaxdowntime", .handler = cmdMigrateGetMaxDowntime, .opts = opts_migrate_getmaxdowntime, - .info = info_migrate_getmaxdowntime, + .info = &info_migrate_getmaxdowntime, .flags = 0 }, {.name = "migrate-compcache", .handler = cmdMigrateCompCache, .opts = opts_migrate_compcache, - .info = info_migrate_compcache, + .info = &info_migrate_compcache, .flags = 0 }, {.name = "migrate-setspeed", .handler = cmdMigrateSetMaxSpeed, .opts = opts_migrate_setspeed, - .info = info_migrate_setspeed, + .info = &info_migrate_setspeed, .flags = 0 }, {.name = "migrate-getspeed", .handler = cmdMigrateGetMaxSpeed, .opts = opts_migrate_getspeed, - .info = info_migrate_getspeed, + .info = &info_migrate_getspeed, .flags = 0 }, {.name = "migrate-postcopy", .handler = cmdMigratePostCopy, .opts = opts_migrate_postcopy, - .info = info_migrate_postcopy, + .info = &info_migrate_postcopy, .flags = 0 }, {.name = "numatune", .handler = cmdNumatune, .opts = opts_numatune, - .info = info_numatune, + .info = &info_numatune, .flags = 0 }, {.name = "qemu-attach", .handler = cmdQemuAttach, .opts = opts_qemu_attach, - .info = info_qemu_attach, + .info = &info_qemu_attach, .flags = 0 }, {.name = "qemu-monitor-command", .handler = cmdQemuMonitorCommand, .opts = opts_qemu_monitor_command, - .info = info_qemu_monitor_command, + .info = &info_qemu_monitor_command, .flags = 0 }, {.name = "qemu-monitor-event", .handler = cmdQemuMonitorEvent, .opts = opts_qemu_monitor_event, - .info = info_qemu_monitor_event, + .info = &info_qemu_monitor_event, .flags = 0 }, {.name = "qemu-agent-command", .handler = cmdQemuAgentCommand, .opts = opts_qemu_agent_command, - .info = info_qemu_agent_command, + .info = &info_qemu_agent_command, .flags = 0 }, {.name = "guest-agent-timeout", .handler = cmdGuestAgentTimeout, .opts = opts_guest_agent_timeout, - .info = info_guest_agent_timeout, + .info = &info_guest_agent_timeout, .flags = 0 }, {.name = "reboot", .handler = cmdReboot, .opts = opts_reboot, - .info = info_reboot, + .info = &info_reboot, .flags = 0 }, {.name = "reset", .handler = cmdReset, .opts = opts_reset, - .info = info_reset, + .info = &info_reset, .flags = 0 }, {.name = "restore", .handler = cmdRestore, .opts = opts_restore, - .info = info_restore, + .info = &info_restore, .flags = 0 }, {.name = "resume", .handler = cmdResume, .opts = opts_resume, - .info = info_resume, + .info = &info_resume, .flags = 0 }, {.name = "save", .handler = cmdSave, .opts = opts_save, - .info = info_save, + .info = &info_save, .flags = 0 }, {.name = "save-image-define", .handler = cmdSaveImageDefine, .opts = opts_save_image_define, - .info = info_save_image_define, + .info = &info_save_image_define, .flags = 0 }, {.name = "save-image-dumpxml", .handler = cmdSaveImageDumpxml, .opts = opts_save_image_dumpxml, - .info = info_save_image_dumpxml, + .info = &info_save_image_dumpxml, .flags = 0 }, {.name = "save-image-edit", .handler = cmdSaveImageEdit, .opts = opts_save_image_edit, - .info = info_save_image_edit, + .info = &info_save_image_edit, .flags = 0 }, {.name = "schedinfo", .handler = cmdSchedinfo, .opts = opts_schedinfo, - .info = info_schedinfo, + .info = &info_schedinfo, .flags = 0 }, {.name = "screenshot", .handler = cmdScreenshot, .opts = opts_screenshot, - .info = info_screenshot, + .info = &info_screenshot, .flags = 0 }, {.name = "set-lifecycle-action", .handler = cmdSetLifecycleAction, .opts = opts_setLifecycleAction, - .info = info_setLifecycleAction, + .info = &info_setLifecycleAction, .flags = 0 }, {.name = "set-user-sshkeys", .handler = cmdSetUserSSHKeys, .opts = opts_set_user_sshkeys, - .info = info_set_user_sshkeys, + .info = &info_set_user_sshkeys, .flags = 0 }, {.name = "set-user-password", .handler = cmdSetUserPassword, .opts = opts_set_user_password, - .info = info_set_user_password, + .info = &info_set_user_password, .flags = 0 }, {.name = "setmaxmem", .handler = cmdSetmaxmem, .opts = opts_setmaxmem, - .info = info_setmaxmem, + .info = &info_setmaxmem, .flags = 0 }, {.name = "setmem", .handler = cmdSetmem, .opts = opts_setmem, - .info = info_setmem, + .info = &info_setmem, .flags = 0 }, {.name = "setvcpus", .handler = cmdSetvcpus, .opts = opts_setvcpus, - .info = info_setvcpus, + .info = &info_setvcpus, .flags = 0 }, {.name = "shutdown", .handler = cmdShutdown, .opts = opts_shutdown, - .info = info_shutdown, + .info = &info_shutdown, .flags = 0 }, {.name = "start", .handler = cmdStart, .opts = opts_start, - .info = info_start, + .info = &info_start, .flags = 0 }, {.name = "suspend", .handler = cmdSuspend, .opts = opts_suspend, - .info = info_suspend, + .info = &info_suspend, .flags = 0 }, {.name = "ttyconsole", .handler = cmdTTYConsole, .opts = opts_ttyconsole, - .info = info_ttyconsole, + .info = &info_ttyconsole, .flags = 0 }, {.name = "undefine", .handler = cmdUndefine, .opts = opts_undefine, - .info = info_undefine, + .info = &info_undefine, .flags = 0 }, {.name = "update-device", .handler = cmdUpdateDevice, .opts = opts_update_device, - .info = info_update_device, + .info = &info_update_device, .flags = 0 }, {.name = "update-memory-device", .handler = cmdUpdateMemoryDevice, .opts = opts_update_memory_device, - .info = info_update_memory_device, + .info = &info_update_memory_device, .flags = 0 }, {.name = "vcpucount", .handler = cmdVcpucount, .opts = opts_vcpucount, - .info = info_vcpucount, + .info = &info_vcpucount, .flags = 0 }, {.name = "vcpuinfo", .handler = cmdVcpuinfo, .opts = opts_vcpuinfo, - .info = info_vcpuinfo, + .info = &info_vcpuinfo, .flags = 0 }, {.name = "vcpupin", .handler = cmdVcpuPin, .opts = opts_vcpupin, - .info = info_vcpupin, + .info = &info_vcpupin, .flags = 0 }, {.name = "emulatorpin", .handler = cmdEmulatorPin, .opts = opts_emulatorpin, - .info = info_emulatorpin, + .info = &info_emulatorpin, .flags = 0 }, {.name = "vncdisplay", .handler = cmdVNCDisplay, .opts = opts_vncdisplay, - .info = info_vncdisplay, + .info = &info_vncdisplay, .flags = 0 }, {.name = "guestvcpus", .handler = cmdGuestvcpus, .opts = opts_guestvcpus, - .info = info_guestvcpus, + .info = &info_guestvcpus, .flags = 0 }, {.name = "setvcpu", .handler = cmdSetvcpu, .opts = opts_setvcpu, - .info = info_setvcpu, + .info = &info_setvcpu, .flags = 0 }, {.name = "domblkthreshold", .handler = cmdDomblkthreshold, .opts = opts_domblkthreshold, - .info = info_domblkthreshold, + .info = &info_domblkthreshold, .flags = 0 }, {.name = "guestinfo", .handler = cmdGuestInfo, .opts = opts_guestinfo, - .info = info_guestinfo, + .info = &info_guestinfo, .flags = 0 }, {.name = "domdirtyrate-calc", .handler = cmdDomDirtyRateCalc, .opts = opts_domdirtyrate_calc, - .info = info_domdirtyrate_calc, + .info = &info_domdirtyrate_calc, .flags = 0 }, {.name = "dom-fd-associate", .handler = cmdDomFdAssociate, .opts = opts_dom_fd_associate, - .info = info_dom_fd_associate, + .info = &info_dom_fd_associate, .flags = 0 }, {.name = "domdisplay-reload", .handler = cmdDomdisplayReload, .opts = opts_domdisplay_reload, - .info = info_domdisplay_reload, + .info = &info_domdisplay_reload, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 87443220bd..1a97f4926b 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -37,14 +37,9 @@ /* * "capabilities" command */ -static const vshCmdInfo info_capabilities[] = { - {.name = "help", - .data = N_("capabilities") - }, - {.name = "desc", - .data = N_("Returns capabilities of hypervisor/driver.") - }, - {.name = NULL} +static const vshCmdInfo info_capabilities = { + .help = N_("capabilities"), + .desc = N_("Returns capabilities of hypervisor/driver."), }; static const vshCmdOptDef opts_capabilities[] = { @@ -83,14 +78,9 @@ cmdCapabilities(vshControl *ctl, const vshCmd *cmd) /* * "domcapabilities" command */ -static const vshCmdInfo info_domcapabilities[] = { - {.name = "help", - .data = N_("domain capabilities") - }, - {.name = "desc", - .data = N_("Returns capabilities of emulator with respect to host and libvirt.") - }, - {.name = NULL} +static const vshCmdInfo info_domcapabilities = { + .help = N_("domain capabilities"), + .desc = N_("Returns capabilities of emulator with respect to host and libvirt."), }; static const vshCmdOptDef opts_domcapabilities[] = { @@ -158,14 +148,9 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd) /* * "freecell" command */ -static const vshCmdInfo info_freecell[] = { - {.name = "help", - .data = N_("NUMA free memory") - }, - {.name = "desc", - .data = N_("display available free memory for the NUMA cell.") - }, - {.name = NULL} +static const vshCmdInfo info_freecell = { + .help = N_("NUMA free memory"), + .desc = N_("display available free memory for the NUMA cell."), }; static const vshCmdOptDef opts_freecell[] = { @@ -271,14 +256,9 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd) /* * "freepages" command */ -static const vshCmdInfo info_freepages[] = { - {.name = "help", - .data = N_("NUMA free pages") - }, - {.name = "desc", - .data = N_("display available free pages for the NUMA cell.") - }, - {.name = NULL} +static const vshCmdInfo info_freepages = { + .help = N_("NUMA free pages"), + .desc = N_("display available free pages for the NUMA cell."), }; static const vshCmdOptDef opts_freepages[] = { @@ -481,14 +461,9 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd) /* * "allocpages" command */ -static const vshCmdInfo info_allocpages[] = { - {.name = "help", - .data = N_("Manipulate pages pool size") - }, - {.name = "desc", - .data = N_("Allocate or free some pages in the pool for NUMA cell.") - }, - {.name = NULL} +static const vshCmdInfo info_allocpages = { + .help = N_("Manipulate pages pool size"), + .desc = N_("Allocate or free some pages in the pool for NUMA cell."), }; static const vshCmdOptDef opts_allocpages[] = { {.name = "pagesize", @@ -597,14 +572,9 @@ cmdAllocpages(vshControl *ctl, const vshCmd *cmd) /* * "maxvcpus" command */ -static const vshCmdInfo info_maxvcpus[] = { - {.name = "help", - .data = N_("connection vcpu maximum") - }, - {.name = "desc", - .data = N_("Show maximum number of virtual CPUs for guests on this connection.") - }, - {.name = NULL} +static const vshCmdInfo info_maxvcpus = { + .help = N_("connection vcpu maximum"), + .desc = N_("Show maximum number of virtual CPUs for guests on this connection."), }; static const vshCmdOptDef opts_maxvcpus[] = { @@ -650,14 +620,9 @@ cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd) /* * "nodeinfo" command */ -static const vshCmdInfo info_nodeinfo[] = { - {.name = "help", - .data = N_("node information") - }, - {.name = "desc", - .data = N_("Returns basic information about the node.") - }, - {.name = NULL} +static const vshCmdInfo info_nodeinfo = { + .help = N_("node information"), + .desc = N_("Returns basic information about the node."), }; static bool @@ -686,15 +651,10 @@ cmdNodeinfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "nodecpumap" command */ -static const vshCmdInfo info_node_cpumap[] = { - {.name = "help", - .data = N_("node cpu map") - }, - {.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 vshCmdInfo info_node_cpumap = { + .help = 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."), }; static const vshCmdOptDef opts_node_cpumap[] = { @@ -742,14 +702,9 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "nodecpustats" command */ -static const vshCmdInfo info_nodecpustats[] = { - {.name = "help", - .data = N_("Prints cpu stats of the node.") - }, - {.name = "desc", - .data = N_("Returns cpu stats of the node, in nanoseconds.") - }, - {.name = NULL} +static const vshCmdInfo info_nodecpustats = { + .help = N_("Prints cpu stats of the node."), + .desc = N_("Returns cpu stats of the node, in nanoseconds."), }; static const vshCmdOptDef opts_node_cpustats[] = { @@ -885,14 +840,9 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd) /* * "nodememstats" command */ -static const vshCmdInfo info_nodememstats[] = { - {.name = "help", - .data = N_("Prints memory stats of the node.") - }, - {.name = "desc", - .data = N_("Returns memory stats of the node, in kilobytes.") - }, - {.name = NULL} +static const vshCmdInfo info_nodememstats = { + .help = N_("Prints memory stats of the node."), + .desc = N_("Returns memory stats of the node, in kilobytes."), }; static const vshCmdOptDef opts_node_memstats[] = { @@ -943,14 +893,9 @@ cmdNodeMemStats(vshControl *ctl, const vshCmd *cmd) /* * "nodesevinfo" command */ -static const vshCmdInfo info_nodesevinfo[] = { - {.name = "help", - .data = N_("node SEV information") - }, - {.name = "desc", - .data = N_("Returns basic SEV information about the node.") - }, - {.name = NULL} +static const vshCmdInfo info_nodesevinfo = { + .help = N_("node SEV information"), + .desc = N_("Returns basic SEV information about the node."), }; static bool @@ -989,15 +934,10 @@ VIR_ENUM_IMPL(virshNodeSuspendTarget, "disk", "hybrid"); -static const vshCmdInfo info_nodesuspend[] = { - {.name = "help", - .data = N_("suspend the host node for a given time duration") - }, - {.name = "desc", - .data = N_("Suspend the host node for a given time duration " - "and attempt to resume thereafter.") - }, - {.name = NULL} +static const vshCmdInfo info_nodesuspend = { + .help = 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."), }; static const vshCmdOptDef opts_node_suspend[] = { @@ -1050,14 +990,9 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd) /* * "sysinfo" command */ -static const vshCmdInfo info_sysinfo[] = { - {.name = "help", - .data = N_("print the hypervisor sysinfo") - }, - {.name = "desc", - .data = N_("output an XML string for the hypervisor sysinfo, if available") - }, - {.name = NULL} +static const vshCmdInfo info_sysinfo = { + .help = N_("print the hypervisor sysinfo"), + .desc = N_("output an XML string for the hypervisor sysinfo, if available"), }; static bool @@ -1080,14 +1015,9 @@ cmdSysinfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "hostname" command */ -static const vshCmdInfo info_hostname[] = { - {.name = "help", - .data = N_("print the hypervisor hostname") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_hostname = { + .help = N_("print the hypervisor hostname"), + .desc = "", }; static bool @@ -1110,14 +1040,9 @@ cmdHostname(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "uri" command */ -static const vshCmdInfo info_uri[] = { - {.name = "help", - .data = N_("print the hypervisor canonical URI") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_uri = { + .help = N_("print the hypervisor canonical URI"), + .desc = "", }; static bool @@ -1218,14 +1143,9 @@ vshExtractCPUDefXMLs(vshControl *ctl, /* * "cpu-compare" command */ -static const vshCmdInfo info_cpu_compare[] = { - {.name = "help", - .data = N_("compare host CPU with a CPU described by an XML file") - }, - {.name = "desc", - .data = N_("compare CPU with host CPU") - }, - {.name = NULL} +static const vshCmdInfo info_cpu_compare = { + .help = N_("compare host CPU with a CPU described by an XML file"), + .desc = N_("compare CPU with host CPU"), }; static const vshCmdOptDef opts_cpu_compare[] = { @@ -1293,14 +1213,9 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd) /* * "cpu-baseline" command */ -static const vshCmdInfo info_cpu_baseline[] = { - {.name = "help", - .data = N_("compute baseline CPU") - }, - {.name = "desc", - .data = N_("Compute baseline CPU for a set of given CPUs.") - }, - {.name = NULL} +static const vshCmdInfo info_cpu_baseline = { + .help = N_("compute baseline CPU"), + .desc = N_("Compute baseline CPU for a set of given CPUs."), }; static const vshCmdOptDef opts_cpu_baseline[] = { @@ -1347,14 +1262,9 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd) /* * "cpu-models" command */ -static const vshCmdInfo info_cpu_models[] = { - {.name = "help", - .data = N_("CPU models") - }, - {.name = "desc", - .data = N_("Get the CPU models for an arch.") - }, - {.name = NULL} +static const vshCmdInfo info_cpu_models = { + .help = N_("CPU models"), + .desc = N_("Get the CPU models for an arch."), }; static const vshCmdOptDef opts_cpu_models[] = { @@ -1401,14 +1311,9 @@ cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd) /* * "version" command */ -static const vshCmdInfo info_version[] = { - {.name = "help", - .data = N_("show version") - }, - {.name = "desc", - .data = N_("Display the system version information.") - }, - {.name = NULL} +static const vshCmdInfo info_version = { + .help = N_("show version"), + .desc = N_("Display the system version information."), }; static const vshCmdOptDef opts_version[] = { @@ -1503,10 +1408,9 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) return true; } -static const vshCmdInfo info_node_memory_tune[] = { - {"help", N_("Get or set node memory parameters")}, - {"desc", N_("Get or set node memory parameters")}, - {NULL, NULL} +static const vshCmdInfo info_node_memory_tune = { + .help = N_("Get or set node memory parameters"), + .desc = N_("Get or set node memory parameters"), }; static const vshCmdOptDef opts_node_memory_tune[] = { @@ -1617,14 +1521,9 @@ cmdNodeMemoryTune(vshControl *ctl, const vshCmd *cmd) /* * "hypervisor-cpu-compare" command */ -static const vshCmdInfo info_hypervisor_cpu_compare[] = { - {.name = "help", - .data = N_("compare a CPU with the CPU created by a hypervisor on the host") - }, - {.name = "desc", - .data = N_("compare CPU with hypervisor CPU") - }, - {.name = NULL} +static const vshCmdInfo info_hypervisor_cpu_compare = { + .help = N_("compare a CPU with the CPU created by a hypervisor on the host"), + .desc = N_("compare CPU with hypervisor CPU"), }; static const vshCmdOptDef opts_hypervisor_cpu_compare[] = { @@ -1724,15 +1623,10 @@ cmdHypervisorCPUCompare(vshControl *ctl, /* * "hypervisor-cpu-baseline" command */ -static const vshCmdInfo info_hypervisor_cpu_baseline[] = { - {.name = "help", - .data = N_("compute baseline CPU usable by a specific 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 vshCmdInfo info_hypervisor_cpu_baseline = { + .help = 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."), }; static const vshCmdOptDef opts_hypervisor_cpu_baseline[] = { @@ -1831,133 +1725,133 @@ const vshCmdDef hostAndHypervisorCmds[] = { {.name = "allocpages", .handler = cmdAllocpages, .opts = opts_allocpages, - .info = info_allocpages, + .info = &info_allocpages, .flags = 0 }, {.name = "capabilities", .handler = cmdCapabilities, .opts = opts_capabilities, - .info = info_capabilities, + .info = &info_capabilities, .flags = 0 }, {.name = "cpu-baseline", .handler = cmdCPUBaseline, .opts = opts_cpu_baseline, - .info = info_cpu_baseline, + .info = &info_cpu_baseline, .flags = 0 }, {.name = "cpu-compare", .handler = cmdCPUCompare, .opts = opts_cpu_compare, - .info = info_cpu_compare, + .info = &info_cpu_compare, .flags = 0 }, {.name = "cpu-models", .handler = cmdCPUModelNames, .opts = opts_cpu_models, - .info = info_cpu_models, + .info = &info_cpu_models, .flags = 0 }, {.name = "domcapabilities", .handler = cmdDomCapabilities, .opts = opts_domcapabilities, - .info = info_domcapabilities, + .info = &info_domcapabilities, .flags = 0 }, {.name = "freecell", .handler = cmdFreecell, .opts = opts_freecell, - .info = info_freecell, + .info = &info_freecell, .flags = 0 }, {.name = "freepages", .handler = cmdFreepages, .opts = opts_freepages, - .info = info_freepages, + .info = &info_freepages, .flags = 0 }, {.name = "hostname", .handler = cmdHostname, .opts = NULL, - .info = info_hostname, + .info = &info_hostname, .flags = 0 }, {.name = "hypervisor-cpu-baseline", .handler = cmdHypervisorCPUBaseline, .opts = opts_hypervisor_cpu_baseline, - .info = info_hypervisor_cpu_baseline, + .info = &info_hypervisor_cpu_baseline, .flags = 0 }, {.name = "hypervisor-cpu-compare", .handler = cmdHypervisorCPUCompare, .opts = opts_hypervisor_cpu_compare, - .info = info_hypervisor_cpu_compare, + .info = &info_hypervisor_cpu_compare, .flags = 0 }, {.name = "maxvcpus", .handler = cmdMaxvcpus, .opts = opts_maxvcpus, - .info = info_maxvcpus, + .info = &info_maxvcpus, .flags = 0 }, {.name = "node-memory-tune", .handler = cmdNodeMemoryTune, .opts = opts_node_memory_tune, - .info = info_node_memory_tune, + .info = &info_node_memory_tune, .flags = 0 }, {.name = "nodecpumap", .handler = cmdNodeCpuMap, .opts = opts_node_cpumap, - .info = info_node_cpumap, + .info = &info_node_cpumap, .flags = 0 }, {.name = "nodecpustats", .handler = cmdNodeCpuStats, .opts = opts_node_cpustats, - .info = info_nodecpustats, + .info = &info_nodecpustats, .flags = 0 }, {.name = "nodeinfo", .handler = cmdNodeinfo, .opts = NULL, - .info = info_nodeinfo, + .info = &info_nodeinfo, .flags = 0 }, {.name = "nodememstats", .handler = cmdNodeMemStats, .opts = opts_node_memstats, - .info = info_nodememstats, + .info = &info_nodememstats, .flags = 0 }, {.name = "nodesevinfo", .handler = cmdNodeSEVInfo, .opts = NULL, - .info = info_nodesevinfo, + .info = &info_nodesevinfo, .flags = 0 }, {.name = "nodesuspend", .handler = cmdNodeSuspend, .opts = opts_node_suspend, - .info = info_nodesuspend, + .info = &info_nodesuspend, .flags = 0 }, {.name = "sysinfo", .handler = cmdSysinfo, .opts = NULL, - .info = info_sysinfo, + .info = &info_sysinfo, .flags = 0 }, {.name = "uri", .handler = cmdURI, .opts = NULL, - .info = info_uri, + .info = &info_uri, .flags = 0 }, {.name = "version", .handler = cmdVersion, .opts = opts_version, - .info = info_version, + .info = &info_version, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 09a3668438..5dde4f9d46 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -91,14 +91,9 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, /* * "iface-edit" command */ -static const vshCmdInfo info_interface_edit[] = { - {.name = "help", - .data = N_("edit XML configuration for a physical host interface") - }, - {.name = "desc", - .data = N_("Edit the XML configuration for a physical host interface.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_edit = { + .help = N_("edit XML configuration for a physical host interface"), + .desc = N_("Edit the XML configuration for a physical host interface."), }; static const vshCmdOptDef opts_interface_edit[] = { @@ -314,14 +309,9 @@ virshInterfaceListCollect(vshControl *ctl, /* * "iface-list" command */ -static const vshCmdInfo info_interface_list[] = { - {.name = "help", - .data = N_("list physical host interfaces") - }, - {.name = "desc", - .data = N_("Returns list of physical host interfaces.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_list = { + .help = N_("list physical host interfaces"), + .desc = N_("Returns list of physical host interfaces."), }; static const vshCmdOptDef opts_interface_list[] = { @@ -385,14 +375,9 @@ cmdInterfaceList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "iface-name" command */ -static const vshCmdInfo info_interface_name[] = { - {.name = "help", - .data = N_("convert an interface MAC address to interface name") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_interface_name = { + .help = N_("convert an interface MAC address to interface name"), + .desc = "", }; static const vshCmdOptDef opts_interface_name[] = { @@ -421,14 +406,9 @@ cmdInterfaceName(vshControl *ctl, const vshCmd *cmd) /* * "iface-mac" command */ -static const vshCmdInfo info_interface_mac[] = { - {.name = "help", - .data = N_("convert an interface name to interface MAC address") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_interface_mac = { + .help = N_("convert an interface name to interface MAC address"), + .desc = "", }; static const vshCmdOptDef opts_interface_mac[] = { @@ -457,14 +437,9 @@ cmdInterfaceMAC(vshControl *ctl, const vshCmd *cmd) /* * "iface-dumpxml" command */ -static const vshCmdInfo info_interface_dumpxml[] = { - {.name = "help", - .data = N_("interface information in XML") - }, - {.name = "desc", - .data = N_("Output the physical host interface information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_dumpxml = { + .help = N_("interface information in XML"), + .desc = N_("Output the physical host interface information as an XML dump to stdout."), }; static const vshCmdOptDef opts_interface_dumpxml[] = { @@ -514,15 +489,10 @@ cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "iface-define" command */ -static const vshCmdInfo info_interface_define[] = { - {.name = "help", - .data = N_("define an inactive persistent physical host interface or " - "modify an existing persistent one from an XML file") - }, - {.name = "desc", - .data = N_("Define or modify a persistent physical host interface.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_define = { + .help = N_("define an inactive persistent physical host interface or " + "modify an existing persistent one from an XML file"), + .desc = N_("Define or modify a persistent physical host interface."), }; static const vshCmdOptDef opts_interface_define[] = { @@ -565,14 +535,9 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd) /* * "iface-undefine" command */ -static const vshCmdInfo info_interface_undefine[] = { - {.name = "help", - .data = N_("undefine a physical host interface (remove it from configuration)") - }, - {.name = "desc", - .data = N_("undefine an interface.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_undefine = { + .help = N_("undefine a physical host interface (remove it from configuration)"), + .desc = N_("undefine an interface."), }; static const vshCmdOptDef opts_interface_undefine[] = { @@ -601,14 +566,9 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd) /* * "iface-start" command */ -static const vshCmdInfo info_interface_start[] = { - {.name = "help", - .data = N_("start a physical host interface (enable it / \"if-up\")") - }, - {.name = "desc", - .data = N_("start a physical host interface.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_start = { + .help = N_("start a physical host interface (enable it / \"if-up\")"), + .desc = N_("start a physical host interface."), }; static const vshCmdOptDef opts_interface_start[] = { @@ -637,14 +597,9 @@ cmdInterfaceStart(vshControl *ctl, const vshCmd *cmd) /* * "iface-destroy" command */ -static const vshCmdInfo info_interface_destroy[] = { - {.name = "help", - .data = N_("destroy a physical host interface (disable it / \"if-down\")") - }, - {.name = "desc", - .data = N_("forcefully stop a physical host interface.") - }, - {.name = NULL} +static const vshCmdInfo info_interface_destroy = { + .help = N_("destroy a physical host interface (disable it / \"if-down\")"), + .desc = N_("forcefully stop a physical host interface."), }; static const vshCmdOptDef opts_interface_destroy[] = { @@ -673,16 +628,11 @@ cmdInterfaceDestroy(vshControl *ctl, const vshCmd *cmd) /* * "iface-begin" command */ -static const vshCmdInfo info_interface_begin[] = { - {.name = "help", - .data = N_("create a snapshot of current interfaces settings, " +static const vshCmdInfo info_interface_begin = { + .help = N_("create a snapshot of current interfaces settings, " "which can be later committed (iface-commit) or " - "restored (iface-rollback)") - }, - {.name = "desc", - .data = N_("Create a restore point for interfaces settings") - }, - {.name = NULL} + "restored (iface-rollback)"), + .desc = N_("Create a restore point for interfaces settings"), }; static const vshCmdOptDef opts_interface_begin[] = { @@ -706,14 +656,9 @@ cmdInterfaceBegin(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "iface-commit" command */ -static const vshCmdInfo info_interface_commit[] = { - {.name = "help", - .data = N_("commit changes made since iface-begin and free restore point") - }, - {.name = "desc", - .data = N_("commit changes and free restore point") - }, - {.name = NULL} +static const vshCmdInfo info_interface_commit = { + .help = N_("commit changes made since iface-begin and free restore point"), + .desc = N_("commit changes and free restore point"), }; static const vshCmdOptDef opts_interface_commit[] = { @@ -737,14 +682,9 @@ cmdInterfaceCommit(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "iface-rollback" command */ -static const vshCmdInfo info_interface_rollback[] = { - {.name = "help", - .data = N_("rollback to previous saved configuration created via iface-begin") - }, - {.name = "desc", - .data = N_("rollback to previous restore point") - }, - {.name = NULL} +static const vshCmdInfo info_interface_rollback = { + .help = N_("rollback to previous saved configuration created via iface-begin"), + .desc = N_("rollback to previous restore point"), }; static const vshCmdOptDef opts_interface_rollback[] = { @@ -768,14 +708,9 @@ cmdInterfaceRollback(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "iface-bridge" command */ -static const vshCmdInfo info_interface_bridge[] = { - {.name = "help", - .data = N_("create a bridge device and attach an existing network device to it") - }, - {.name = "desc", - .data = N_("bridge an existing network device") - }, - {.name = NULL} +static const vshCmdInfo info_interface_bridge = { + .help = N_("create a bridge device and attach an existing network device to it"), + .desc = N_("bridge an existing network device"), }; static const vshCmdOptDef opts_interface_bridge[] = { @@ -1000,14 +935,9 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) /* * "iface-unbridge" command */ -static const vshCmdInfo info_interface_unbridge[] = { - {.name = "help", - .data = N_("undefine a bridge device after detaching its device(s)") - }, - {.name = "desc", - .data = N_("unbridge a network device") - }, - {.name = NULL} +static const vshCmdInfo info_interface_unbridge = { + .help = N_("undefine a bridge device after detaching its device(s)"), + .desc = N_("unbridge a network device"), }; static const vshCmdOptDef opts_interface_unbridge[] = { @@ -1196,85 +1126,85 @@ const vshCmdDef ifaceCmds[] = { {.name = "iface-begin", .handler = cmdInterfaceBegin, .opts = opts_interface_begin, - .info = info_interface_begin, + .info = &info_interface_begin, .flags = 0 }, {.name = "iface-bridge", .handler = cmdInterfaceBridge, .opts = opts_interface_bridge, - .info = info_interface_bridge, + .info = &info_interface_bridge, .flags = 0 }, {.name = "iface-commit", .handler = cmdInterfaceCommit, .opts = opts_interface_commit, - .info = info_interface_commit, + .info = &info_interface_commit, .flags = 0 }, {.name = "iface-define", .handler = cmdInterfaceDefine, .opts = opts_interface_define, - .info = info_interface_define, + .info = &info_interface_define, .flags = 0 }, {.name = "iface-destroy", .handler = cmdInterfaceDestroy, .opts = opts_interface_destroy, - .info = info_interface_destroy, + .info = &info_interface_destroy, .flags = 0 }, {.name = "iface-dumpxml", .handler = cmdInterfaceDumpXML, .opts = opts_interface_dumpxml, - .info = info_interface_dumpxml, + .info = &info_interface_dumpxml, .flags = 0 }, {.name = "iface-edit", .handler = cmdInterfaceEdit, .opts = opts_interface_edit, - .info = info_interface_edit, + .info = &info_interface_edit, .flags = 0 }, {.name = "iface-list", .handler = cmdInterfaceList, .opts = opts_interface_list, - .info = info_interface_list, + .info = &info_interface_list, .flags = 0 }, {.name = "iface-mac", .handler = cmdInterfaceMAC, .opts = opts_interface_mac, - .info = info_interface_mac, + .info = &info_interface_mac, .flags = 0 }, {.name = "iface-name", .handler = cmdInterfaceName, .opts = opts_interface_name, - .info = info_interface_name, + .info = &info_interface_name, .flags = 0 }, {.name = "iface-rollback", .handler = cmdInterfaceRollback, .opts = opts_interface_rollback, - .info = info_interface_rollback, + .info = &info_interface_rollback, .flags = 0 }, {.name = "iface-start", .handler = cmdInterfaceStart, .opts = opts_interface_start, - .info = info_interface_start, + .info = &info_interface_start, .flags = 0 }, {.name = "iface-unbridge", .handler = cmdInterfaceUnbridge, .opts = opts_interface_unbridge, - .info = info_interface_unbridge, + .info = &info_interface_unbridge, .flags = 0 }, {.name = "iface-undefine", .handler = cmdInterfaceUndefine, .opts = opts_interface_undefine, - .info = info_interface_undefine, + .info = &info_interface_undefine, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 399035f8cf..8eca6e866c 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -134,14 +134,9 @@ virshCommandOptNetworkPort(vshControl *ctl, const vshCmd *cmd, /* * "net-autostart" command */ -static const vshCmdInfo info_network_autostart[] = { - {.name = "help", - .data = N_("autostart a network") - }, - {.name = "desc", - .data = N_("Configure a network to be automatically started at boot.") - }, - {.name = NULL} +static const vshCmdInfo info_network_autostart = { + .help = N_("autostart a network"), + .desc = N_("Configure a network to be automatically started at boot."), }; static const vshCmdOptDef opts_network_autostart[] = { @@ -184,14 +179,9 @@ cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd) /* * "net-create" command */ -static const vshCmdInfo info_network_create[] = { - {.name = "help", - .data = N_("create a network from an XML file") - }, - {.name = "desc", - .data = N_("Create a network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_create = { + .help = N_("create a network from an XML file"), + .desc = N_("Create a network."), }; static const vshCmdOptDef opts_network_create[] = { @@ -239,15 +229,10 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd) /* * "net-define" command */ -static const vshCmdInfo info_network_define[] = { - {.name = "help", - .data = N_("define an inactive persistent virtual network or modify " - "an existing persistent one from an XML file") - }, - {.name = "desc", - .data = N_("Define or modify a persistent virtual network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_define = { + .help = N_("define an inactive persistent virtual network or modify " + "an existing persistent one from an XML file"), + .desc = N_("Define or modify a persistent virtual network."), }; static const vshCmdOptDef opts_network_define[] = { @@ -295,14 +280,9 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd) /* * "net-destroy" command */ -static const vshCmdInfo info_network_destroy[] = { - {.name = "help", - .data = N_("destroy (stop) a network") - }, - {.name = "desc", - .data = N_("Forcefully stop a given network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_destroy = { + .help = N_("destroy (stop) a network"), + .desc = N_("Forcefully stop a given network."), }; static const vshCmdOptDef opts_network_destroy[] = { @@ -333,14 +313,9 @@ cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd) /* * "net-desc" command */ -static const vshCmdInfo info_network_desc[] = { - {.name = "help", - .data = N_("show or set network's description or title") - }, - {.name = "desc", - .data = N_("Allows setting or modifying the description or title of a network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_desc = { + .help = N_("show or set network's description or title"), + .desc = N_("Allows setting or modifying the description or title of a network."), }; static const vshCmdOptDef opts_network_desc[] = { @@ -518,14 +493,9 @@ cmdNetworkDesc(vshControl *ctl, const vshCmd *cmd) /* * "net-metadata" command */ -static const vshCmdInfo info_network_metadata[] = { - {.name = "help", - .data = N_("show or set network's custom XML metadata") - }, - {.name = "desc", - .data = N_("Shows or modifies the XML metadata of a network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_metadata = { + .help = N_("show or set network's custom XML metadata"), + .desc = N_("Shows or modifies the XML metadata of a network."), }; static const vshCmdOptDef opts_network_metadata[] = { @@ -661,14 +631,9 @@ cmdNetworkMetadata(vshControl *ctl, const vshCmd *cmd) /* * "net-dumpxml" command */ -static const vshCmdInfo info_network_dumpxml[] = { - {.name = "help", - .data = N_("network information in XML") - }, - {.name = "desc", - .data = N_("Output the network information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_network_dumpxml = { + .help = N_("network information in XML"), + .desc = N_("Output the network information as an XML dump to stdout."), }; static const vshCmdOptDef opts_network_dumpxml[] = { @@ -717,14 +682,9 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "net-info" command */ -static const vshCmdInfo info_network_info[] = { - {.name = "help", - .data = N_("network information") - }, - {.name = "desc", - .data = N_("Returns basic information about the network") - }, - {.name = NULL} +static const vshCmdInfo info_network_info = { + .help = N_("network information"), + .desc = N_("Returns basic information about the network"), }; static const vshCmdOptDef opts_network_info[] = { @@ -992,14 +952,9 @@ virshNetworkListCollect(vshControl *ctl, /* * "net-list" command */ -static const vshCmdInfo info_network_list[] = { - {.name = "help", - .data = N_("list networks") - }, - {.name = "desc", - .data = N_("Returns list of networks.") - }, - {.name = NULL} +static const vshCmdInfo info_network_list = { + .help = N_("list networks"), + .desc = N_("Returns list of networks."), }; static const vshCmdOptDef opts_network_list[] = { @@ -1164,14 +1119,9 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "net-name" command */ -static const vshCmdInfo info_network_name[] = { - {.name = "help", - .data = N_("convert a network UUID to network name") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_network_name = { + .help = N_("convert a network UUID to network name"), + .desc = "", }; static const vshCmdOptDef opts_network_name[] = { @@ -1200,14 +1150,9 @@ cmdNetworkName(vshControl *ctl, const vshCmd *cmd) /* * "net-start" command */ -static const vshCmdInfo info_network_start[] = { - {.name = "help", - .data = N_("start a (previously defined) inactive network") - }, - {.name = "desc", - .data = N_("Start a network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_start = { + .help = N_("start a (previously defined) inactive network"), + .desc = N_("Start a network."), }; static const vshCmdOptDef opts_network_start[] = { @@ -1237,14 +1182,9 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd) /* * "net-undefine" command */ -static const vshCmdInfo info_network_undefine[] = { - {.name = "help", - .data = N_("undefine a persistent network") - }, - {.name = "desc", - .data = N_("Undefine the configuration for a persistent network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_undefine = { + .help = N_("undefine a persistent network"), + .desc = N_("Undefine the configuration for a persistent network."), }; static const vshCmdOptDef opts_network_undefine[] = { @@ -1275,14 +1215,9 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd) /* * "net-update" command */ -static const vshCmdInfo info_network_update[] = { - {.name = "help", - .data = N_("update parts of an existing network's configuration") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_network_update = { + .help = N_("update parts of an existing network's configuration"), + .desc = "", }; static const vshCmdOptDef opts_network_update[] = { @@ -1435,14 +1370,9 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd) /* * "net-uuid" command */ -static const vshCmdInfo info_network_uuid[] = { - {.name = "help", - .data = N_("convert a network name to network UUID") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_network_uuid = { + .help = N_("convert a network name to network UUID"), + .desc = "", }; static const vshCmdOptDef opts_network_uuid[] = { @@ -1471,14 +1401,9 @@ cmdNetworkUuid(vshControl *ctl, const vshCmd *cmd) /* * "net-edit" command */ -static const vshCmdInfo info_network_edit[] = { - {.name = "help", - .data = N_("edit XML configuration for a network") - }, - {.name = "desc", - .data = N_("Edit the XML configuration for a network.") - }, - {.name = NULL} +static const vshCmdInfo info_network_edit = { + .help = N_("edit XML configuration for a network"), + .desc = N_("Edit the XML configuration for a network."), }; static const vshCmdOptDef opts_network_edit[] = { @@ -1649,14 +1574,9 @@ virshNetworkEventCallback virshNetworkEventCallbacks[] = { }; G_STATIC_ASSERT(VIR_NETWORK_EVENT_ID_LAST == G_N_ELEMENTS(virshNetworkEventCallbacks)); -static const vshCmdInfo info_network_event[] = { - {.name = "help", - .data = N_("Network Events") - }, - {.name = "desc", - .data = N_("List event types, or wait for network events to occur") - }, - {.name = NULL} +static const vshCmdInfo info_network_event = { + .help = N_("Network Events"), + .desc = N_("List event types, or wait for network events to occur"), }; static const vshCmdOptDef opts_network_event[] = { @@ -1764,14 +1684,9 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) /* * "net-dhcp-leases" command */ -static const vshCmdInfo info_network_dhcp_leases[] = { - {.name = "help", - .data = N_("print lease info for a given network") - }, - {.name = "desc", - .data = N_("Print lease info for a given network") - }, - {.name = NULL} +static const vshCmdInfo info_network_dhcp_leases = { + .help = N_("print lease info for a given network"), + .desc = N_("Print lease info for a given network"), }; static const vshCmdOptDef opts_network_dhcp_leases[] = { @@ -1879,14 +1794,9 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd) /* * "net-port-create" command */ -static const vshCmdInfo info_network_port_create[] = { - {.name = "help", - .data = N_("create a network port from an XML file") - }, - {.name = "desc", - .data = N_("Create a network port.") - }, - {.name = NULL} +static const vshCmdInfo info_network_port_create = { + .help = N_("create a network port from an XML file"), + .desc = N_("Create a network port."), }; static const vshCmdOptDef opts_network_port_create[] = { @@ -1946,14 +1856,9 @@ cmdNetworkPortCreate(vshControl *ctl, const vshCmd *cmd) /* * "net-port-dumpxml" command */ -static const vshCmdInfo info_network_port_dumpxml[] = { - {.name = "help", - .data = N_("network port information in XML") - }, - {.name = "desc", - .data = N_("Output the network port information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_network_port_dumpxml = { + .help = N_("network port information in XML"), + .desc = N_("Output the network port information as an XML dump to stdout."), }; static const vshCmdOptDef opts_network_port_dumpxml[] = { @@ -2007,14 +1912,9 @@ cmdNetworkPortDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "net-port-delete" command */ -static const vshCmdInfo info_network_port_delete[] = { - {.name = "help", - .data = N_("delete the specified network port") - }, - {.name = "desc", - .data = N_("Delete the specified network port.") - }, - {.name = NULL} +static const vshCmdInfo info_network_port_delete = { + .help = N_("delete the specified network port"), + .desc = N_("Delete the specified network port."), }; static const vshCmdOptDef opts_network_port_delete[] = { @@ -2137,14 +2037,9 @@ virshNetworkPortListCollect(vshControl *ctl, /* * "net-list" command */ -static const vshCmdInfo info_network_port_list[] = { - {.name = "help", - .data = N_("list network ports") - }, - {.name = "desc", - .data = N_("Returns list of network ports.") - }, - {.name = NULL} +static const vshCmdInfo info_network_port_list = { + .help = N_("list network ports"), + .desc = N_("Returns list of network ports."), }; static const vshCmdOptDef opts_network_port_list[] = { @@ -2219,127 +2114,127 @@ const vshCmdDef networkCmds[] = { {.name = "net-autostart", .handler = cmdNetworkAutostart, .opts = opts_network_autostart, - .info = info_network_autostart, + .info = &info_network_autostart, .flags = 0 }, {.name = "net-create", .handler = cmdNetworkCreate, .opts = opts_network_create, - .info = info_network_create, + .info = &info_network_create, .flags = 0 }, {.name = "net-define", .handler = cmdNetworkDefine, .opts = opts_network_define, - .info = info_network_define, + .info = &info_network_define, .flags = 0 }, {.name = "net-desc", .handler = cmdNetworkDesc, .opts = opts_network_desc, - .info = info_network_desc, + .info = &info_network_desc, .flags = 0 }, {.name = "net-destroy", .handler = cmdNetworkDestroy, .opts = opts_network_destroy, - .info = info_network_destroy, + .info = &info_network_destroy, .flags = 0 }, {.name = "net-dhcp-leases", .handler = cmdNetworkDHCPLeases, .opts = opts_network_dhcp_leases, - .info = info_network_dhcp_leases, + .info = &info_network_dhcp_leases, .flags = 0, }, {.name = "net-dumpxml", .handler = cmdNetworkDumpXML, .opts = opts_network_dumpxml, - .info = info_network_dumpxml, + .info = &info_network_dumpxml, .flags = 0 }, {.name = "net-edit", .handler = cmdNetworkEdit, .opts = opts_network_edit, - .info = info_network_edit, + .info = &info_network_edit, .flags = 0 }, {.name = "net-event", .handler = cmdNetworkEvent, .opts = opts_network_event, - .info = info_network_event, + .info = &info_network_event, .flags = 0 }, {.name = "net-info", .handler = cmdNetworkInfo, .opts = opts_network_info, - .info = info_network_info, + .info = &info_network_info, .flags = 0 }, {.name = "net-list", .handler = cmdNetworkList, .opts = opts_network_list, - .info = info_network_list, + .info = &info_network_list, .flags = 0 }, {.name = "net-metadata", .handler = cmdNetworkMetadata, .opts = opts_network_metadata, - .info = info_network_metadata, + .info = &info_network_metadata, .flags = 0 }, {.name = "net-name", .handler = cmdNetworkName, .opts = opts_network_name, - .info = info_network_name, + .info = &info_network_name, .flags = 0 }, {.name = "net-start", .handler = cmdNetworkStart, .opts = opts_network_start, - .info = info_network_start, + .info = &info_network_start, .flags = 0 }, {.name = "net-undefine", .handler = cmdNetworkUndefine, .opts = opts_network_undefine, - .info = info_network_undefine, + .info = &info_network_undefine, .flags = 0 }, {.name = "net-update", .handler = cmdNetworkUpdate, .opts = opts_network_update, - .info = info_network_update, + .info = &info_network_update, .flags = 0 }, {.name = "net-uuid", .handler = cmdNetworkUuid, .opts = opts_network_uuid, - .info = info_network_uuid, + .info = &info_network_uuid, .flags = 0 }, {.name = "net-port-list", .handler = cmdNetworkPortList, .opts = opts_network_port_list, - .info = info_network_port_list, + .info = &info_network_port_list, .flags = 0 }, {.name = "net-port-create", .handler = cmdNetworkPortCreate, .opts = opts_network_port_create, - .info = info_network_port_create, + .info = &info_network_port_create, .flags = 0 }, {.name = "net-port-dumpxml", .handler = cmdNetworkPortDumpXML, .opts = opts_network_port_dumpxml, - .info = info_network_port_dumpxml, + .info = &info_network_port_dumpxml, .flags = 0 }, {.name = "net-port-delete", .handler = cmdNetworkPortDelete, .opts = opts_network_port_delete, - .info = info_network_port_delete, + .info = &info_network_port_delete, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index b5a88b194f..c0fb319fa7 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -34,17 +34,12 @@ /* * "nodedev-create" command */ -static const vshCmdInfo info_node_device_create[] = { - {.name = "help", - .data = N_("create a device defined " - "by an XML file on the node") - }, - {.name = "desc", - .data = N_("Create a device on the node. Note that this " +static const vshCmdInfo info_node_device_create = { + .help = N_("create a device defined " + "by an XML file on the node"), + .desc = N_("Create a device on the node. Note that this " "command creates devices on the physical host " - "that can then be assigned to a virtual machine.") - }, - {.name = NULL} + "that can then be assigned to a virtual machine."), }; static const vshCmdOptDef opts_node_device_create[] = { @@ -89,15 +84,10 @@ cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-destroy" command */ -static const vshCmdInfo info_node_device_destroy[] = { - {.name = "help", - .data = N_("destroy (stop) a device on the node") - }, - {.name = "desc", - .data = N_("Destroy a device on the node. Note that this " - "command destroys devices on the physical host") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_destroy = { + .help = 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"), }; static const vshCmdOptDef opts_node_device_destroy[] = { @@ -362,14 +352,9 @@ virshNodeDeviceListCollect(vshControl *ctl, /* * "nodedev-list" command */ -static const vshCmdInfo info_node_list_devices[] = { - {.name = "help", - .data = N_("enumerate devices on this host") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_node_list_devices = { + .help = N_("enumerate devices on this host"), + .desc = "", }; static const vshCmdOptDef opts_node_list_devices[] = { @@ -577,14 +562,9 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "nodedev-dumpxml" command */ -static const vshCmdInfo info_node_device_dumpxml[] = { - {.name = "help", - .data = N_("node device details in XML") - }, - {.name = "desc", - .data = N_("Output the node device details as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_dumpxml = { + .help = N_("node device details in XML"), + .desc = N_("Output the node device details as an XML dump to stdout."), }; @@ -645,14 +625,9 @@ cmdNodeDeviceDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-detach" command */ -static const vshCmdInfo info_node_device_detach[] = { - {.name = "help", - .data = N_("detach node device from its device driver") - }, - {.name = "desc", - .data = N_("Detach node device from its device driver before assigning to a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_detach = { + .help = N_("detach node device from its device driver"), + .desc = N_("Detach node device from its device driver before assigning to a domain."), }; @@ -712,14 +687,9 @@ cmdNodeDeviceDetach(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-reattach" command */ -static const vshCmdInfo info_node_device_reattach[] = { - {.name = "help", - .data = N_("reattach node device to its device driver") - }, - {.name = "desc", - .data = N_("Reattach node device to its device driver once released by the domain.") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_reattach = { + .help = N_("reattach node device to its device driver"), + .desc = N_("Reattach node device to its device driver once released by the domain."), }; @@ -762,14 +732,9 @@ cmdNodeDeviceReAttach(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-reset" command */ -static const vshCmdInfo info_node_device_reset[] = { - {.name = "help", - .data = N_("reset node device") - }, - {.name = "desc", - .data = N_("Reset node device before or after assigning to a domain.") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_reset = { + .help = N_("reset node device"), + .desc = N_("Reset node device before or after assigning to a domain."), }; @@ -906,14 +871,9 @@ virshNodeDeviceEventCallback virshNodeDeviceEventCallbacks[] = { G_STATIC_ASSERT(VIR_NODE_DEVICE_EVENT_ID_LAST == G_N_ELEMENTS(virshNodeDeviceEventCallbacks)); -static const vshCmdInfo info_node_device_event[] = { - {.name = "help", - .data = N_("Node Device Events") - }, - {.name = "desc", - .data = N_("List event types, or wait for node device events to occur") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_event = { + .help = N_("Node Device Events"), + .desc = N_("List event types, or wait for node device events to occur"), }; static const vshCmdOptDef opts_node_device_event[] = { @@ -1034,14 +994,9 @@ cmdNodeDeviceEvent(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-undefine" command */ -static const vshCmdInfo info_node_device_undefine[] = { - {.name = "help", - .data = N_("Undefine an inactive node device") - }, - {.name = "desc", - .data = N_("Undefines the configuration for an inactive node device") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_undefine = { + .help = N_("Undefine an inactive node device"), + .desc = N_("Undefines the configuration for an inactive node device"), }; static const vshCmdOptDef opts_node_device_undefine[] = { @@ -1081,16 +1036,11 @@ cmdNodeDeviceUndefine(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "nodedev-define" command */ -static const vshCmdInfo info_node_device_define[] = { - {.name = "help", - .data = N_("Define or modify a device by an xml file on a node") - }, - {.name = "desc", - .data = N_("Defines or modifies a persistent device on the node that " +static const vshCmdInfo info_node_device_define = { + .help = 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 " "can be assigned to a domain. The device must be started " - "before it can be assigned to a domain.") - }, - {.name = NULL} + "before it can be assigned to a domain."), }; static const vshCmdOptDef opts_node_device_define[] = { @@ -1135,14 +1085,9 @@ cmdNodeDeviceDefine(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "nodedev-start" command */ -static const vshCmdInfo info_node_device_start[] = { - {.name = "help", - .data = N_("Start an inactive node device") - }, - {.name = "desc", - .data = N_("Starts an inactive node device that was previously defined") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_start = { + .help = N_("Start an inactive node device"), + .desc = N_("Starts an inactive node device that was previously defined"), }; static const vshCmdOptDef opts_node_device_start[] = { @@ -1185,14 +1130,9 @@ cmdNodeDeviceStart(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-autostart" command */ -static const vshCmdInfo info_node_device_autostart[] = { - {.name = "help", - .data = N_("autostart a defined node device") - }, - {.name = "desc", - .data = N_("Configure a node device to be automatically started at boot.") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_autostart = { + .help = N_("autostart a defined node device"), + .desc = N_("Configure a node device to be automatically started at boot."), }; static const vshCmdOptDef opts_node_device_autostart[] = { @@ -1246,14 +1186,9 @@ cmdNodeDeviceAutostart(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-info" command */ -static const vshCmdInfo info_node_device_info[] = { - {.name = "help", - .data = N_("node device information") - }, - {.name = "desc", - .data = N_("Returns basic information about the node device") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_info = { + .help = N_("node device information"), + .desc = N_("Returns basic information about the node device"), }; @@ -1302,14 +1237,9 @@ cmdNodeDeviceInfo(vshControl *ctl, const vshCmd *cmd) /* * "nodedev-update" command */ -static const vshCmdInfo info_node_device_update[] = { - {.name = "help", - .data = N_("Update a active and/or inactive node device") - }, - {.name = "desc", - .data = N_("Updates the configuration of a node device") - }, - {.name = NULL} +static const vshCmdInfo info_node_device_update = { + .help = N_("Update a active and/or inactive node device"), + .desc = N_("Updates the configuration of a node device"), }; static const vshCmdOptDef opts_node_device_update[] = { @@ -1399,19 +1329,19 @@ const vshCmdDef nodedevCmds[] = { {.name = "nodedev-create", .handler = cmdNodeDeviceCreate, .opts = opts_node_device_create, - .info = info_node_device_create, + .info = &info_node_device_create, .flags = 0 }, {.name = "nodedev-destroy", .handler = cmdNodeDeviceDestroy, .opts = opts_node_device_destroy, - .info = info_node_device_destroy, + .info = &info_node_device_destroy, .flags = 0 }, {.name = "nodedev-detach", .handler = cmdNodeDeviceDetach, .opts = opts_node_device_detach, - .info = info_node_device_detach, + .info = &info_node_device_detach, .flags = 0 }, {.name = "nodedev-dettach", @@ -1420,67 +1350,67 @@ const vshCmdDef nodedevCmds[] = { {.name = "nodedev-dumpxml", .handler = cmdNodeDeviceDumpXML, .opts = opts_node_device_dumpxml, - .info = info_node_device_dumpxml, + .info = &info_node_device_dumpxml, .flags = 0 }, {.name = "nodedev-list", .handler = cmdNodeListDevices, .opts = opts_node_list_devices, - .info = info_node_list_devices, + .info = &info_node_list_devices, .flags = 0 }, {.name = "nodedev-reattach", .handler = cmdNodeDeviceReAttach, .opts = opts_node_device_reattach, - .info = info_node_device_reattach, + .info = &info_node_device_reattach, .flags = 0 }, {.name = "nodedev-reset", .handler = cmdNodeDeviceReset, .opts = opts_node_device_reset, - .info = info_node_device_reset, + .info = &info_node_device_reset, .flags = 0 }, {.name = "nodedev-event", .handler = cmdNodeDeviceEvent, .opts = opts_node_device_event, - .info = info_node_device_event, + .info = &info_node_device_event, .flags = 0 }, {.name = "nodedev-define", .handler = cmdNodeDeviceDefine, .opts = opts_node_device_define, - .info = info_node_device_define, + .info = &info_node_device_define, .flags = 0 }, {.name = "nodedev-undefine", .handler = cmdNodeDeviceUndefine, .opts = opts_node_device_undefine, - .info = info_node_device_undefine, + .info = &info_node_device_undefine, .flags = 0 }, {.name = "nodedev-start", .handler = cmdNodeDeviceStart, .opts = opts_node_device_start, - .info = info_node_device_start, + .info = &info_node_device_start, .flags = 0 }, {.name = "nodedev-autostart", .handler = cmdNodeDeviceAutostart, .opts = opts_node_device_autostart, - .info = info_node_device_autostart, + .info = &info_node_device_autostart, .flags = 0 }, {.name = "nodedev-info", .handler = cmdNodeDeviceInfo, .opts = opts_node_device_info, - .info = info_node_device_info, + .info = &info_node_device_info, .flags = 0 }, {.name = "nodedev-update", .handler = cmdNodeDeviceUpdate, .opts = opts_node_device_update, - .info = info_node_device_update, + .info = &info_node_device_update, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index fa52d020e4..7a578f3f7c 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -69,14 +69,9 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, /* * "nwfilter-define" command */ -static const vshCmdInfo info_nwfilter_define[] = { - {.name = "help", - .data = N_("define or update a network filter from an XML file") - }, - {.name = "desc", - .data = N_("Define a new network filter or update an existing one.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_define = { + .help = N_("define or update a network filter from an XML file"), + .desc = N_("Define a new network filter or update an existing one."), }; static const vshCmdOptDef opts_nwfilter_define[] = { @@ -126,14 +121,9 @@ cmdNWFilterDefine(vshControl *ctl, const vshCmd *cmd) /* * "nwfilter-undefine" command */ -static const vshCmdInfo info_nwfilter_undefine[] = { - {.name = "help", - .data = N_("undefine a network filter") - }, - {.name = "desc", - .data = N_("Undefine a given network filter.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_undefine = { + .help = N_("undefine a network filter"), + .desc = N_("Undefine a given network filter."), }; static const vshCmdOptDef opts_nwfilter_undefine[] = { @@ -169,14 +159,9 @@ cmdNWFilterUndefine(vshControl *ctl, const vshCmd *cmd) /* * "nwfilter-dumpxml" command */ -static const vshCmdInfo info_nwfilter_dumpxml[] = { - {.name = "help", - .data = N_("network filter information in XML") - }, - {.name = "desc", - .data = N_("Output the network filter information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_dumpxml = { + .help = N_("network filter information in XML"), + .desc = N_("Output the network filter information as an XML dump to stdout."), }; static const vshCmdOptDef opts_nwfilter_dumpxml[] = { @@ -351,14 +336,9 @@ virshNWFilterListCollect(vshControl *ctl, /* * "nwfilter-list" command */ -static const vshCmdInfo info_nwfilter_list[] = { - {.name = "help", - .data = N_("list network filters") - }, - {.name = "desc", - .data = N_("Returns list of network filters.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_list = { + .help = N_("list network filters"), + .desc = N_("Returns list of network filters."), }; static const vshCmdOptDef opts_nwfilter_list[] = { @@ -403,14 +383,9 @@ cmdNWFilterList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "nwfilter-edit" command */ -static const vshCmdInfo info_nwfilter_edit[] = { - {.name = "help", - .data = N_("edit XML configuration for a network filter") - }, - {.name = "desc", - .data = N_("Edit the XML configuration for a network filter.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_edit = { + .help = N_("edit XML configuration for a network filter"), + .desc = N_("Edit the XML configuration for a network filter."), }; static const vshCmdOptDef opts_nwfilter_edit[] = { @@ -493,14 +468,9 @@ virshCommandOptNWFilterBindingBy(vshControl *ctl, /* * "nwfilter-binding-create" command */ -static const vshCmdInfo info_nwfilter_binding_create[] = { - {.name = "help", - .data = N_("create a network filter binding from an XML file") - }, - {.name = "desc", - .data = N_("Create a new network filter binding.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_binding_create = { + .help = N_("create a network filter binding from an XML file"), + .desc = N_("Create a new network filter binding."), }; static const vshCmdOptDef opts_nwfilter_binding_create[] = { @@ -548,14 +518,9 @@ cmdNWFilterBindingCreate(vshControl *ctl, const vshCmd *cmd) /* * "nwfilter-binding-delete" command */ -static const vshCmdInfo info_nwfilter_binding_delete[] = { - {.name = "help", - .data = N_("delete a network filter binding") - }, - {.name = "desc", - .data = N_("Delete a given network filter binding.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_binding_delete = { + .help = N_("delete a network filter binding"), + .desc = N_("Delete a given network filter binding."), }; static const vshCmdOptDef opts_nwfilter_binding_delete[] = { @@ -593,14 +558,9 @@ cmdNWFilterBindingDelete(vshControl *ctl, const vshCmd *cmd) /* * "nwfilter-binding-dumpxml" command */ -static const vshCmdInfo info_nwfilter_binding_dumpxml[] = { - {.name = "help", - .data = N_("network filter information in XML") - }, - {.name = "desc", - .data = N_("Output the network filter information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_binding_dumpxml = { + .help = N_("network filter information in XML"), + .desc = N_("Output the network filter information as an XML dump to stdout."), }; static const vshCmdOptDef opts_nwfilter_binding_dumpxml[] = { @@ -726,14 +686,9 @@ virshNWFilterBindingListCollect(vshControl *ctl, /* * "nwfilter-binding-list" command */ -static const vshCmdInfo info_nwfilter_binding_list[] = { - {.name = "help", - .data = N_("list network filter bindings") - }, - {.name = "desc", - .data = N_("Returns list of network filter bindings.") - }, - {.name = NULL} +static const vshCmdInfo info_nwfilter_binding_list = { + .help = N_("list network filter bindings"), + .desc = N_("Returns list of network filter bindings."), }; static const vshCmdOptDef opts_nwfilter_binding_list[] = { @@ -778,55 +733,55 @@ const vshCmdDef nwfilterCmds[] = { {.name = "nwfilter-define", .handler = cmdNWFilterDefine, .opts = opts_nwfilter_define, - .info = info_nwfilter_define, + .info = &info_nwfilter_define, .flags = 0 }, {.name = "nwfilter-dumpxml", .handler = cmdNWFilterDumpXML, .opts = opts_nwfilter_dumpxml, - .info = info_nwfilter_dumpxml, + .info = &info_nwfilter_dumpxml, .flags = 0 }, {.name = "nwfilter-edit", .handler = cmdNWFilterEdit, .opts = opts_nwfilter_edit, - .info = info_nwfilter_edit, + .info = &info_nwfilter_edit, .flags = 0 }, {.name = "nwfilter-list", .handler = cmdNWFilterList, .opts = opts_nwfilter_list, - .info = info_nwfilter_list, + .info = &info_nwfilter_list, .flags = 0 }, {.name = "nwfilter-undefine", .handler = cmdNWFilterUndefine, .opts = opts_nwfilter_undefine, - .info = info_nwfilter_undefine, + .info = &info_nwfilter_undefine, .flags = 0 }, {.name = "nwfilter-binding-create", .handler = cmdNWFilterBindingCreate, .opts = opts_nwfilter_binding_create, - .info = info_nwfilter_binding_create, + .info = &info_nwfilter_binding_create, .flags = 0 }, {.name = "nwfilter-binding-delete", .handler = cmdNWFilterBindingDelete, .opts = opts_nwfilter_binding_delete, - .info = info_nwfilter_binding_delete, + .info = &info_nwfilter_binding_delete, .flags = 0 }, {.name = "nwfilter-binding-dumpxml", .handler = cmdNWFilterBindingDumpXML, .opts = opts_nwfilter_binding_dumpxml, - .info = info_nwfilter_binding_dumpxml, + .info = &info_nwfilter_binding_dumpxml, .flags = 0 }, {.name = "nwfilter-binding-list", .handler = cmdNWFilterBindingList, .opts = opts_nwfilter_binding_list, - .info = info_nwfilter_binding_list, + .info = &info_nwfilter_binding_list, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 8a583a8e1b..a7b82de9be 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -196,14 +196,9 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, /* * "pool-autostart" command */ -static const vshCmdInfo info_pool_autostart[] = { - {.name = "help", - .data = N_("autostart a pool") - }, - {.name = "desc", - .data = N_("Configure a pool to be automatically started at boot.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_autostart = { + .help = N_("autostart a pool"), + .desc = N_("Configure a pool to be automatically started at boot."), }; static const vshCmdOptDef opts_pool_autostart[] = { @@ -247,14 +242,9 @@ cmdPoolAutostart(vshControl *ctl, const vshCmd *cmd) /* * "pool-create" command */ -static const vshCmdInfo info_pool_create[] = { - {.name = "help", - .data = N_("create a pool from an XML file") - }, - {.name = "desc", - .data = N_("Create a pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_create = { + .help = N_("create a pool from an XML file"), + .desc = N_("Create a pool."), }; static const vshCmdOptDef opts_pool_create[] = { @@ -437,14 +427,9 @@ virshBuildPoolXML(vshControl *ctl, /* * "pool-create-as" command */ -static const vshCmdInfo info_pool_create_as[] = { - {.name = "help", - .data = N_("create a pool from a set of args") - }, - {.name = "desc", - .data = N_("Create a pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_create_as = { + .help = N_("create a pool from a set of args"), + .desc = N_("Create a pool."), }; static const vshCmdOptDef opts_pool_create_as[] = { @@ -503,15 +488,10 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd) /* * "pool-define" command */ -static const vshCmdInfo info_pool_define[] = { - {.name = "help", - .data = N_("define an inactive persistent storage pool or modify " - "an existing persistent one from an XML file") - }, - {.name = "desc", - .data = N_("Define or modify a persistent storage pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_define = { + .help = N_("define an inactive persistent storage pool or modify " + "an existing persistent one from an XML file"), + .desc = N_("Define or modify a persistent storage pool."), }; static const vshCmdOptDef opts_pool_define[] = { @@ -554,14 +534,9 @@ cmdPoolDefine(vshControl *ctl, const vshCmd *cmd) /* * "pool-define-as" command */ -static const vshCmdInfo info_pool_define_as[] = { - {.name = "help", - .data = N_("define a pool from a set of args") - }, - {.name = "desc", - .data = N_("Define a pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_define_as = { + .help = N_("define a pool from a set of args"), + .desc = N_("Define a pool."), }; static bool @@ -593,14 +568,9 @@ cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd) /* * "pool-build" command */ -static const vshCmdInfo info_pool_build[] = { - {.name = "help", - .data = N_("build a pool") - }, - {.name = "desc", - .data = N_("Build a given pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_build = { + .help = N_("build a pool"), + .desc = N_("Build a given pool."), }; static const vshCmdOptDef opts_pool_build[] = { @@ -641,14 +611,9 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd) /* * "pool-destroy" command */ -static const vshCmdInfo info_pool_destroy[] = { - {.name = "help", - .data = N_("destroy (stop) a pool") - }, - {.name = "desc", - .data = N_("Forcefully stop a given pool. Raw data in the pool is untouched") - }, - {.name = NULL} +static const vshCmdInfo info_pool_destroy = { + .help = N_("destroy (stop) a pool"), + .desc = N_("Forcefully stop a given pool. Raw data in the pool is untouched"), }; static const vshCmdOptDef opts_pool_destroy[] = { @@ -680,14 +645,9 @@ cmdPoolDestroy(vshControl *ctl, const vshCmd *cmd) /* * "pool-delete" command */ -static const vshCmdInfo info_pool_delete[] = { - {.name = "help", - .data = N_("delete a pool") - }, - {.name = "desc", - .data = N_("Delete a given pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_delete = { + .help = N_("delete a pool"), + .desc = N_("Delete a given pool."), }; static const vshCmdOptDef opts_pool_delete[] = { @@ -719,14 +679,9 @@ cmdPoolDelete(vshControl *ctl, const vshCmd *cmd) /* * "pool-refresh" command */ -static const vshCmdInfo info_pool_refresh[] = { - {.name = "help", - .data = N_("refresh a pool") - }, - {.name = "desc", - .data = N_("Refresh a given pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_refresh = { + .help = N_("refresh a pool"), + .desc = N_("Refresh a given pool."), }; static const vshCmdOptDef opts_pool_refresh[] = { @@ -758,14 +713,9 @@ cmdPoolRefresh(vshControl *ctl, const vshCmd *cmd) /* * "pool-dumpxml" command */ -static const vshCmdInfo info_pool_dumpxml[] = { - {.name = "help", - .data = N_("pool information in XML") - }, - {.name = "desc", - .data = N_("Output the pool information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_dumpxml = { + .help = N_("pool information in XML"), + .desc = N_("Output the pool information as an XML dump to stdout."), }; static const vshCmdOptDef opts_pool_dumpxml[] = { @@ -1051,14 +1001,9 @@ virshStoragePoolStateToString(int state) /* * "pool-list" command */ -static const vshCmdInfo info_pool_list[] = { - {.name = "help", - .data = N_("list pools") - }, - {.name = "desc", - .data = N_("Returns list of pools.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_list = { + .help = N_("list pools"), + .desc = N_("Returns list of pools."), }; 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 */ -static const vshCmdInfo info_find_storage_pool_sources_as[] = { - {.name = "help", - .data = N_("find potential storage pool sources") - }, - {.name = "desc", - .data = N_("Returns XML document.") - }, - {.name = NULL} +static const vshCmdInfo info_find_storage_pool_sources_as = { + .help = N_("find potential storage pool sources"), + .desc = N_("Returns XML document."), }; 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 */ -static const vshCmdInfo info_find_storage_pool_sources[] = { - {.name = "help", - .data = N_("discover potential storage pool sources") - }, - {.name = "desc", - .data = N_("Returns XML document.") - }, - {.name = NULL} +static const vshCmdInfo info_find_storage_pool_sources = { + .help = N_("discover potential storage pool sources"), + .desc = N_("Returns XML document."), }; static const vshCmdOptDef opts_find_storage_pool_sources[] = { @@ -1546,14 +1481,9 @@ cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd G_GNUC_UNUSED) /* * "pool-info" command */ -static const vshCmdInfo info_pool_info[] = { - {.name = "help", - .data = N_("storage pool information") - }, - {.name = "desc", - .data = N_("Returns basic information about the storage pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_info = { + .help = N_("storage pool information"), + .desc = N_("Returns basic information about the storage pool."), }; static const vshCmdOptDef opts_pool_info[] = { @@ -1636,14 +1566,9 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd) /* * "pool-name" command */ -static const vshCmdInfo info_pool_name[] = { - {.name = "help", - .data = N_("convert a pool UUID to pool name") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_pool_name = { + .help = N_("convert a pool UUID to pool name"), + .desc = "", }; static const vshCmdOptDef opts_pool_name[] = { @@ -1667,14 +1592,9 @@ cmdPoolName(vshControl *ctl, const vshCmd *cmd) /* * "pool-start" command */ -static const vshCmdInfo info_pool_start[] = { - {.name = "help", - .data = N_("start a (previously defined) inactive pool") - }, - {.name = "desc", - .data = N_("Start a pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_start = { + .help = N_("start a (previously defined) inactive pool"), + .desc = N_("Start a pool."), }; static const vshCmdOptDef opts_pool_start[] = { @@ -1727,14 +1647,9 @@ cmdPoolStart(vshControl *ctl, const vshCmd *cmd) /* * "pool-undefine" command */ -static const vshCmdInfo info_pool_undefine[] = { - {.name = "help", - .data = N_("undefine an inactive pool") - }, - {.name = "desc", - .data = N_("Undefine the configuration for an inactive pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_undefine = { + .help = N_("undefine an inactive pool"), + .desc = N_("Undefine the configuration for an inactive pool."), }; static const vshCmdOptDef opts_pool_undefine[] = { @@ -1766,14 +1681,9 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd) /* * "pool-uuid" command */ -static const vshCmdInfo info_pool_uuid[] = { - {.name = "help", - .data = N_("convert a pool name to pool UUID") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_pool_uuid = { + .help = N_("convert a pool name to pool UUID"), + .desc = "", }; static const vshCmdOptDef opts_pool_uuid[] = { @@ -1802,14 +1712,9 @@ cmdPoolUuid(vshControl *ctl, const vshCmd *cmd) /* * "pool-edit" command */ -static const vshCmdInfo info_pool_edit[] = { - {.name = "help", - .data = N_("edit XML configuration for a storage pool") - }, - {.name = "desc", - .data = N_("Edit the XML configuration for a storage pool.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_edit = { + .help = N_("edit XML configuration for a storage pool"), + .desc = N_("Edit the XML configuration for a storage pool."), }; 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)); -static const vshCmdInfo info_pool_event[] = { - {.name = "help", - .data = N_("Storage Pool Events") - }, - {.name = "desc", - .data = N_("List event types, or wait for storage pool events to occur") - }, - {.name = NULL} +static const vshCmdInfo info_pool_event = { + .help = N_("Storage Pool Events"), + .desc = N_("List event types, or wait for storage pool events to occur"), }; static const vshCmdOptDef opts_pool_event[] = { @@ -2085,14 +1985,9 @@ cmdPoolEvent(vshControl *ctl, const vshCmd *cmd) /* * "pool-capabilities" command */ -static const vshCmdInfo info_pool_capabilities[] = { - {.name = "help", - .data = N_("storage pool capabilities") - }, - {.name = "desc", - .data = N_("Returns capabilities of storage pool support.") - }, - {.name = NULL} +static const vshCmdInfo info_pool_capabilities = { + .help = N_("storage pool capabilities"), + .desc = N_("Returns capabilities of storage pool support."), }; static const vshCmdOptDef opts_pool_capabilities[] = { @@ -2122,127 +2017,127 @@ const vshCmdDef storagePoolCmds[] = { {.name = "find-storage-pool-sources-as", .handler = cmdPoolDiscoverSourcesAs, .opts = opts_find_storage_pool_sources_as, - .info = info_find_storage_pool_sources_as, + .info = &info_find_storage_pool_sources_as, .flags = 0 }, {.name = "find-storage-pool-sources", .handler = cmdPoolDiscoverSources, .opts = opts_find_storage_pool_sources, - .info = info_find_storage_pool_sources, + .info = &info_find_storage_pool_sources, .flags = 0 }, {.name = "pool-autostart", .handler = cmdPoolAutostart, .opts = opts_pool_autostart, - .info = info_pool_autostart, + .info = &info_pool_autostart, .flags = 0 }, {.name = "pool-build", .handler = cmdPoolBuild, .opts = opts_pool_build, - .info = info_pool_build, + .info = &info_pool_build, .flags = 0 }, {.name = "pool-create-as", .handler = cmdPoolCreateAs, .opts = opts_pool_create_as, - .info = info_pool_create_as, + .info = &info_pool_create_as, .flags = 0 }, {.name = "pool-create", .handler = cmdPoolCreate, .opts = opts_pool_create, - .info = info_pool_create, + .info = &info_pool_create, .flags = 0 }, {.name = "pool-define-as", .handler = cmdPoolDefineAs, .opts = opts_pool_define_as, - .info = info_pool_define_as, + .info = &info_pool_define_as, .flags = 0 }, {.name = "pool-define", .handler = cmdPoolDefine, .opts = opts_pool_define, - .info = info_pool_define, + .info = &info_pool_define, .flags = 0 }, {.name = "pool-delete", .handler = cmdPoolDelete, .opts = opts_pool_delete, - .info = info_pool_delete, + .info = &info_pool_delete, .flags = 0 }, {.name = "pool-destroy", .handler = cmdPoolDestroy, .opts = opts_pool_destroy, - .info = info_pool_destroy, + .info = &info_pool_destroy, .flags = 0 }, {.name = "pool-dumpxml", .handler = cmdPoolDumpXML, .opts = opts_pool_dumpxml, - .info = info_pool_dumpxml, + .info = &info_pool_dumpxml, .flags = 0 }, {.name = "pool-edit", .handler = cmdPoolEdit, .opts = opts_pool_edit, - .info = info_pool_edit, + .info = &info_pool_edit, .flags = 0 }, {.name = "pool-info", .handler = cmdPoolInfo, .opts = opts_pool_info, - .info = info_pool_info, + .info = &info_pool_info, .flags = 0 }, {.name = "pool-list", .handler = cmdPoolList, .opts = opts_pool_list, - .info = info_pool_list, + .info = &info_pool_list, .flags = 0 }, {.name = "pool-name", .handler = cmdPoolName, .opts = opts_pool_name, - .info = info_pool_name, + .info = &info_pool_name, .flags = 0 }, {.name = "pool-refresh", .handler = cmdPoolRefresh, .opts = opts_pool_refresh, - .info = info_pool_refresh, + .info = &info_pool_refresh, .flags = 0 }, {.name = "pool-start", .handler = cmdPoolStart, .opts = opts_pool_start, - .info = info_pool_start, + .info = &info_pool_start, .flags = 0 }, {.name = "pool-undefine", .handler = cmdPoolUndefine, .opts = opts_pool_undefine, - .info = info_pool_undefine, + .info = &info_pool_undefine, .flags = 0 }, {.name = "pool-uuid", .handler = cmdPoolUuid, .opts = opts_pool_uuid, - .info = info_pool_uuid, + .info = &info_pool_uuid, .flags = 0 }, {.name = "pool-event", .handler = cmdPoolEvent, .opts = opts_pool_event, - .info = info_pool_event, + .info = &info_pool_event, .flags = 0 }, {.name = "pool-capabilities", .handler = cmdPoolCapabilities, .opts = opts_pool_capabilities, - .info = info_pool_capabilities, + .info = &info_pool_capabilities, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index e54712ba78..a88980ef9e 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -61,14 +61,9 @@ virshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name) /* * "secret-define" command */ -static const vshCmdInfo info_secret_define[] = { - {.name = "help", - .data = N_("define or modify a secret from an XML file") - }, - {.name = "desc", - .data = N_("Define or modify a secret.") - }, - {.name = NULL} +static const vshCmdInfo info_secret_define = { + .help = N_("define or modify a secret from an XML file"), + .desc = N_("Define or modify a secret."), }; static const vshCmdOptDef opts_secret_define[] = { @@ -121,14 +116,9 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd) /* * "secret-dumpxml" command */ -static const vshCmdInfo info_secret_dumpxml[] = { - {.name = "help", - .data = N_("secret attributes in XML") - }, - {.name = "desc", - .data = N_("Output attributes of a secret as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_secret_dumpxml = { + .help = N_("secret attributes in XML"), + .desc = N_("Output attributes of a secret as an XML dump to stdout."), }; static const vshCmdOptDef opts_secret_dumpxml[] = { @@ -181,14 +171,9 @@ cmdSecretDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "secret-set-value" command */ -static const vshCmdInfo info_secret_set_value[] = { - {.name = "help", - .data = N_("set a secret value") - }, - {.name = "desc", - .data = N_("Set a secret value.") - }, - {.name = NULL} +static const vshCmdInfo info_secret_set_value = { + .help = N_("set a secret value"), + .desc = N_("Set a secret value."), }; static const vshCmdOptDef opts_secret_set_value[] = { @@ -297,14 +282,9 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd) /* * "secret-get-value" command */ -static const vshCmdInfo info_secret_get_value[] = { - {.name = "help", - .data = N_("Output a secret value") - }, - {.name = "desc", - .data = N_("Output a secret value to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_secret_get_value = { + .help = N_("Output a secret value"), + .desc = N_("Output a secret value to stdout."), }; static const vshCmdOptDef opts_secret_get_value[] = { @@ -355,14 +335,9 @@ cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd) /* * "secret-undefine" command */ -static const vshCmdInfo info_secret_undefine[] = { - {.name = "help", - .data = N_("undefine a secret") - }, - {.name = "desc", - .data = N_("Undefine a secret.") - }, - {.name = NULL} +static const vshCmdInfo info_secret_undefine = { + .help = N_("undefine a secret"), + .desc = N_("Undefine a secret."), }; static const vshCmdOptDef opts_secret_undefine[] = { @@ -539,14 +514,9 @@ virshSecretListCollect(vshControl *ctl, /* * "secret-list" command */ -static const vshCmdInfo info_secret_list[] = { - {.name = "help", - .data = N_("list secrets") - }, - {.name = "desc", - .data = N_("Returns a list of secrets") - }, - {.name = NULL} +static const vshCmdInfo info_secret_list = { + .help = N_("list secrets"), + .desc = N_("Returns a list of secrets"), }; static const vshCmdOptDef opts_secret_list[] = { @@ -732,14 +702,9 @@ virshSecretEventCallback virshSecretEventCallbacks[] = { }; G_STATIC_ASSERT(VIR_SECRET_EVENT_ID_LAST == G_N_ELEMENTS(virshSecretEventCallbacks)); -static const vshCmdInfo info_secret_event[] = { - {.name = "help", - .data = N_("Secret Events") - }, - {.name = "desc", - .data = N_("List event types, or wait for secret events to occur") - }, - {.name = NULL} +static const vshCmdInfo info_secret_event = { + .help = N_("Secret Events"), + .desc = N_("List event types, or wait for secret events to occur"), }; static const vshCmdOptDef opts_secret_event[] = { @@ -852,43 +817,43 @@ const vshCmdDef secretCmds[] = { {.name = "secret-define", .handler = cmdSecretDefine, .opts = opts_secret_define, - .info = info_secret_define, + .info = &info_secret_define, .flags = 0 }, {.name = "secret-dumpxml", .handler = cmdSecretDumpXML, .opts = opts_secret_dumpxml, - .info = info_secret_dumpxml, + .info = &info_secret_dumpxml, .flags = 0 }, {.name = "secret-event", .handler = cmdSecretEvent, .opts = opts_secret_event, - .info = info_secret_event, + .info = &info_secret_event, .flags = 0 }, {.name = "secret-get-value", .handler = cmdSecretGetValue, .opts = opts_secret_get_value, - .info = info_secret_get_value, + .info = &info_secret_get_value, .flags = 0 }, {.name = "secret-list", .handler = cmdSecretList, .opts = opts_secret_list, - .info = info_secret_list, + .info = &info_secret_list, .flags = 0 }, {.name = "secret-set-value", .handler = cmdSecretSetValue, .opts = opts_secret_set_value, - .info = info_secret_set_value, + .info = &info_secret_set_value, .flags = 0 }, {.name = "secret-undefine", .handler = cmdSecretUndefine, .opts = opts_secret_undefine, - .info = info_secret_undefine, + .info = &info_secret_undefine, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 2049872322..31ab27b112 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -100,14 +100,9 @@ virshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer, /* * "snapshot-create" command */ -static const vshCmdInfo info_snapshot_create[] = { - {.name = "help", - .data = N_("Create a snapshot from XML") - }, - {.name = "desc", - .data = N_("Create a snapshot (disk and RAM) from XML") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_create = { + .help = N_("Create a snapshot from XML"), + .desc = N_("Create a snapshot (disk and RAM) from XML"), }; static const vshCmdOptDef opts_snapshot_create[] = { @@ -309,14 +304,9 @@ virshParseSnapshotDiskspec(vshControl *ctl, virBuffer *buf, const char *str) return ret; } -static const vshCmdInfo info_snapshot_create_as[] = { - {.name = "help", - .data = N_("Create a snapshot from a set of args") - }, - {.name = "desc", - .data = N_("Create a snapshot (disk and RAM) from arguments") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_create_as = { + .help = N_("Create a snapshot from a set of args"), + .desc = N_("Create a snapshot (disk and RAM) from arguments"), }; static const vshCmdOptDef opts_snapshot_create_as[] = { @@ -486,14 +476,9 @@ virshLookupSnapshot(vshControl *ctl, const vshCmd *cmd, /* * "snapshot-edit" command */ -static const vshCmdInfo info_snapshot_edit[] = { - {.name = "help", - .data = N_("edit XML for a snapshot") - }, - {.name = "desc", - .data = N_("Edit the domain snapshot XML for a named snapshot") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_edit = { + .help = N_("edit XML for a snapshot"), + .desc = N_("Edit the domain snapshot XML for a named snapshot"), }; static const vshCmdOptDef opts_snapshot_edit[] = { @@ -596,14 +581,9 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd) /* * "snapshot-current" command */ -static const vshCmdInfo info_snapshot_current[] = { - {.name = "help", - .data = N_("Get or set the current snapshot") - }, - {.name = "desc", - .data = N_("Get or set the current snapshot") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_current = { + .help = N_("Get or set the current snapshot"), + .desc = N_("Get or set the current snapshot"), }; static const vshCmdOptDef opts_snapshot_current[] = { @@ -808,14 +788,9 @@ virshSnapshotFilter(vshControl *ctl, virDomainSnapshotPtr snapshot, /* * "snapshot-info" command */ -static const vshCmdInfo info_snapshot_info[] = { - {.name = "help", - .data = N_("snapshot information") - }, - {.name = "desc", - .data = N_("Returns basic information about a snapshot.") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_info = { + .help = N_("snapshot information"), + .desc = N_("Returns basic information about a snapshot."), }; static const vshCmdOptDef opts_snapshot_info[] = { @@ -1342,14 +1317,9 @@ virshSnapshotListLookup(int id, bool parent, void *opaque) /* * "snapshot-list" command */ -static const vshCmdInfo info_snapshot_list[] = { - {.name = "help", - .data = N_("List snapshots for a domain") - }, - {.name = "desc", - .data = N_("Snapshot List") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_list = { + .help = N_("List snapshots for a domain"), + .desc = N_("Snapshot List"), }; static const vshCmdOptDef opts_snapshot_list[] = { @@ -1589,14 +1559,9 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) /* * "snapshot-dumpxml" command */ -static const vshCmdInfo info_snapshot_dumpxml[] = { - {.name = "help", - .data = N_("Dump XML for a domain snapshot") - }, - {.name = "desc", - .data = N_("Snapshot Dump XML") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_dumpxml = { + .help = N_("Dump XML for a domain snapshot"), + .desc = N_("Snapshot Dump XML"), }; static const vshCmdOptDef opts_snapshot_dumpxml[] = { @@ -1659,14 +1624,9 @@ cmdSnapshotDumpXML(vshControl *ctl, const vshCmd *cmd) /* * "snapshot-parent" command */ -static const vshCmdInfo info_snapshot_parent[] = { - {.name = "help", - .data = N_("Get the name of the parent of a snapshot") - }, - {.name = "desc", - .data = N_("Extract the snapshot's parent, if any") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_parent = { + .help = N_("Get the name of the parent of a snapshot"), + .desc = N_("Extract the snapshot's parent, if any"), }; static const vshCmdOptDef opts_snapshot_parent[] = { @@ -1711,14 +1671,9 @@ cmdSnapshotParent(vshControl *ctl, const vshCmd *cmd) /* * "snapshot-revert" command */ -static const vshCmdInfo info_snapshot_revert[] = { - {.name = "help", - .data = N_("Revert a domain to a snapshot") - }, - {.name = "desc", - .data = N_("Revert domain to snapshot") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_revert = { + .help = N_("Revert a domain to a snapshot"), + .desc = N_("Revert domain to snapshot"), }; static const vshCmdOptDef opts_snapshot_revert[] = { @@ -1797,14 +1752,9 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCmd *cmd) /* * "snapshot-delete" command */ -static const vshCmdInfo info_snapshot_delete[] = { - {.name = "help", - .data = N_("Delete a domain snapshot") - }, - {.name = "desc", - .data = N_("Snapshot Delete") - }, - {.name = NULL} +static const vshCmdInfo info_snapshot_delete = { + .help = N_("Delete a domain snapshot"), + .desc = N_("Snapshot Delete"), }; static const vshCmdOptDef opts_snapshot_delete[] = { @@ -1872,61 +1822,61 @@ const vshCmdDef snapshotCmds[] = { {.name = "snapshot-create", .handler = cmdSnapshotCreate, .opts = opts_snapshot_create, - .info = info_snapshot_create, + .info = &info_snapshot_create, .flags = 0 }, {.name = "snapshot-create-as", .handler = cmdSnapshotCreateAs, .opts = opts_snapshot_create_as, - .info = info_snapshot_create_as, + .info = &info_snapshot_create_as, .flags = 0 }, {.name = "snapshot-current", .handler = cmdSnapshotCurrent, .opts = opts_snapshot_current, - .info = info_snapshot_current, + .info = &info_snapshot_current, .flags = 0 }, {.name = "snapshot-delete", .handler = cmdSnapshotDelete, .opts = opts_snapshot_delete, - .info = info_snapshot_delete, + .info = &info_snapshot_delete, .flags = 0 }, {.name = "snapshot-dumpxml", .handler = cmdSnapshotDumpXML, .opts = opts_snapshot_dumpxml, - .info = info_snapshot_dumpxml, + .info = &info_snapshot_dumpxml, .flags = 0 }, {.name = "snapshot-edit", .handler = cmdSnapshotEdit, .opts = opts_snapshot_edit, - .info = info_snapshot_edit, + .info = &info_snapshot_edit, .flags = 0 }, {.name = "snapshot-info", .handler = cmdSnapshotInfo, .opts = opts_snapshot_info, - .info = info_snapshot_info, + .info = &info_snapshot_info, .flags = 0 }, {.name = "snapshot-list", .handler = cmdSnapshotList, .opts = opts_snapshot_list, - .info = info_snapshot_list, + .info = &info_snapshot_list, .flags = 0 }, {.name = "snapshot-parent", .handler = cmdSnapshotParent, .opts = opts_snapshot_parent, - .info = info_snapshot_parent, + .info = &info_snapshot_parent, .flags = 0 }, {.name = "snapshot-revert", .handler = cmdDomainSnapshotRevert, .opts = opts_snapshot_revert, - .info = info_snapshot_revert, + .info = &info_snapshot_revert, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 329ca3a66c..0cb7262b67 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -164,14 +164,9 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, /* * "vol-create-as" command */ -static const vshCmdInfo info_vol_create_as[] = { - {.name = "help", - .data = N_("create a volume from a set of args") - }, - {.name = "desc", - .data = N_("Create a vol.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_create_as = { + .help = N_("create a volume from a set of args"), + .desc = N_("Create a vol."), }; static const vshCmdOptDef opts_vol_create_as[] = { @@ -363,14 +358,9 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd) /* * "vol-create" command */ -static const vshCmdInfo info_vol_create[] = { - {.name = "help", - .data = N_("create a vol from an XML file") - }, - {.name = "desc", - .data = N_("Create a vol.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_create = { + .help = N_("create a vol from an XML file"), + .desc = N_("Create a vol."), }; static const vshCmdOptDef opts_vol_create[] = { @@ -426,14 +416,9 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd) /* * "vol-create-from" command */ -static const vshCmdInfo info_vol_create_from[] = { - {.name = "help", - .data = N_("create a vol, using another volume as input") - }, - {.name = "desc", - .data = N_("Create a vol from an existing volume.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_create_from = { + .help = N_("create a vol, using another volume as input"), + .desc = N_("Create a vol from an existing volume."), }; static const vshCmdOptDef opts_vol_create_from[] = { @@ -526,14 +511,9 @@ virshMakeCloneXML(const char *origxml, const char *newname) /* * "vol-clone" command */ -static const vshCmdInfo info_vol_clone[] = { - {.name = "help", - .data = N_("clone a volume.") - }, - {.name = "desc", - .data = N_("Clone an existing volume within the parent pool.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_clone = { + .help = N_("clone a volume."), + .desc = N_("Clone an existing volume within the parent pool."), }; static const vshCmdOptDef opts_vol_clone[] = { @@ -616,14 +596,9 @@ cmdVolClone(vshControl *ctl, const vshCmd *cmd) /* * "vol-upload" command */ -static const vshCmdInfo info_vol_upload[] = { - {.name = "help", - .data = N_("upload file contents to a volume") - }, - {.name = "desc", - .data = N_("Upload file contents to a volume") - }, - {.name = NULL} +static const vshCmdInfo info_vol_upload = { + .help = N_("upload file contents to a volume"), + .desc = N_("Upload file contents to a volume"), }; static const vshCmdOptDef opts_vol_upload[] = { @@ -729,14 +704,9 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd) /* * "vol-download" command */ -static const vshCmdInfo info_vol_download[] = { - {.name = "help", - .data = N_("download volume contents to a file") - }, - {.name = "desc", - .data = N_("Download volume contents to a file") - }, - {.name = NULL} +static const vshCmdInfo info_vol_download = { + .help = N_("download volume contents to a file"), + .desc = N_("Download volume contents to a file"), }; static const vshCmdOptDef opts_vol_download[] = { @@ -845,14 +815,9 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) /* * "vol-delete" command */ -static const vshCmdInfo info_vol_delete[] = { - {.name = "help", - .data = N_("delete a vol") - }, - {.name = "desc", - .data = N_("Delete a given vol.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_delete = { + .help = N_("delete a vol"), + .desc = N_("Delete a given vol."), }; static const vshCmdOptDef opts_vol_delete[] = { @@ -894,14 +859,9 @@ cmdVolDelete(vshControl *ctl, const vshCmd *cmd) /* * "vol-wipe" command */ -static const vshCmdInfo info_vol_wipe[] = { - {.name = "help", - .data = N_("wipe a vol") - }, - {.name = "desc", - .data = N_("Ensure data previously on a volume is not accessible to future reads") - }, - {.name = NULL} +static const vshCmdInfo info_vol_wipe = { + .help = N_("wipe a vol"), + .desc = N_("Ensure data previously on a volume is not accessible to future reads"), }; static const vshCmdOptDef opts_vol_wipe[] = { @@ -978,14 +938,9 @@ virshVolumeTypeToString(int type) /* * "vol-info" command */ -static const vshCmdInfo info_vol_info[] = { - {.name = "help", - .data = N_("storage vol information") - }, - {.name = "desc", - .data = N_("Returns basic information about the storage vol.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_info = { + .help = N_("storage vol information"), + .desc = N_("Returns basic information about the storage vol."), }; static const vshCmdOptDef opts_vol_info[] = { @@ -1058,16 +1013,11 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd) /* * "vol-resize" command */ -static const vshCmdInfo info_vol_resize[] = { - {.name = "help", - .data = N_("resize a vol") - }, - {.name = "desc", - .data = N_("Resizes a storage volume. This is safe only for storage " +static const vshCmdInfo info_vol_resize = { + .help = N_("resize a vol"), + .desc = N_("Resizes a storage volume. This is safe only for storage " "volumes not in use by an active guest.\n" - "See blockresize for live resizing.") - }, - {.name = NULL} + "See blockresize for live resizing."), }; static const vshCmdOptDef opts_vol_resize[] = { @@ -1153,14 +1103,9 @@ cmdVolResize(vshControl *ctl, const vshCmd *cmd) /* * "vol-dumpxml" command */ -static const vshCmdInfo info_vol_dumpxml[] = { - {.name = "help", - .data = N_("vol information in XML") - }, - {.name = "desc", - .data = N_("Output the vol information as an XML dump to stdout.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_dumpxml = { + .help = N_("vol information in XML"), + .desc = N_("Output the vol information as an XML dump to stdout."), }; static const vshCmdOptDef opts_vol_dumpxml[] = { @@ -1327,14 +1272,9 @@ virshStorageVolListCollect(vshControl *ctl, /* * "vol-list" command */ -static const vshCmdInfo info_vol_list[] = { - {.name = "help", - .data = N_("list vols") - }, - {.name = "desc", - .data = N_("Returns list of vols by pool.") - }, - {.name = NULL} +static const vshCmdInfo info_vol_list = { + .help = N_("list vols"), + .desc = N_("Returns list of vols by pool."), }; static const vshCmdOptDef opts_vol_list[] = { @@ -1485,14 +1425,9 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) /* * "vol-name" command */ -static const vshCmdInfo info_vol_name[] = { - {.name = "help", - .data = N_("returns the volume name for a given volume key or path") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_vol_name = { + .help = N_("returns the volume name for a given volume key or path"), + .desc = "", }; static const vshCmdOptDef opts_vol_name[] = { @@ -1516,14 +1451,9 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd) /* * "vol-pool" command */ -static const vshCmdInfo info_vol_pool[] = { - {.name = "help", - .data = N_("returns the storage pool for a given volume key or path") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_vol_pool = { + .help = N_("returns the storage pool for a given volume key or path"), + .desc = "", }; static const vshCmdOptDef opts_vol_pool[] = { @@ -1571,14 +1501,9 @@ cmdVolPool(vshControl *ctl, const vshCmd *cmd) /* * "vol-key" command */ -static const vshCmdInfo info_vol_key[] = { - {.name = "help", - .data = N_("returns the volume key for a given volume name or path") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_vol_key = { + .help = N_("returns the volume key for a given volume name or path"), + .desc = "", }; static const vshCmdOptDef opts_vol_key[] = { @@ -1602,14 +1527,9 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd) /* * "vol-path" command */ -static const vshCmdInfo info_vol_path[] = { - {.name = "help", - .data = N_("returns the volume path for a given volume name or key") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_vol_path = { + .help = N_("returns the volume path for a given volume name or key"), + .desc = "", }; static const vshCmdOptDef opts_vol_path[] = { @@ -1639,97 +1559,97 @@ const vshCmdDef storageVolCmds[] = { {.name = "vol-clone", .handler = cmdVolClone, .opts = opts_vol_clone, - .info = info_vol_clone, + .info = &info_vol_clone, .flags = 0 }, {.name = "vol-create-as", .handler = cmdVolCreateAs, .opts = opts_vol_create_as, - .info = info_vol_create_as, + .info = &info_vol_create_as, .flags = 0 }, {.name = "vol-create", .handler = cmdVolCreate, .opts = opts_vol_create, - .info = info_vol_create, + .info = &info_vol_create, .flags = 0 }, {.name = "vol-create-from", .handler = cmdVolCreateFrom, .opts = opts_vol_create_from, - .info = info_vol_create_from, + .info = &info_vol_create_from, .flags = 0 }, {.name = "vol-delete", .handler = cmdVolDelete, .opts = opts_vol_delete, - .info = info_vol_delete, + .info = &info_vol_delete, .flags = 0 }, {.name = "vol-download", .handler = cmdVolDownload, .opts = opts_vol_download, - .info = info_vol_download, + .info = &info_vol_download, .flags = 0 }, {.name = "vol-dumpxml", .handler = cmdVolDumpXML, .opts = opts_vol_dumpxml, - .info = info_vol_dumpxml, + .info = &info_vol_dumpxml, .flags = 0 }, {.name = "vol-info", .handler = cmdVolInfo, .opts = opts_vol_info, - .info = info_vol_info, + .info = &info_vol_info, .flags = 0 }, {.name = "vol-key", .handler = cmdVolKey, .opts = opts_vol_key, - .info = info_vol_key, + .info = &info_vol_key, .flags = 0 }, {.name = "vol-list", .handler = cmdVolList, .opts = opts_vol_list, - .info = info_vol_list, + .info = &info_vol_list, .flags = 0 }, {.name = "vol-name", .handler = cmdVolName, .opts = opts_vol_name, - .info = info_vol_name, + .info = &info_vol_name, .flags = 0 }, {.name = "vol-path", .handler = cmdVolPath, .opts = opts_vol_path, - .info = info_vol_path, + .info = &info_vol_path, .flags = 0 }, {.name = "vol-pool", .handler = cmdVolPool, .opts = opts_vol_pool, - .info = info_vol_pool, + .info = &info_vol_pool, .flags = 0 }, {.name = "vol-resize", .handler = cmdVolResize, .opts = opts_vol_resize, - .info = info_vol_resize, + .info = &info_vol_resize, .flags = 0 }, {.name = "vol-upload", .handler = cmdVolUpload, .opts = opts_vol_upload, - .info = info_vol_upload, + .info = &info_vol_upload, .flags = 0 }, {.name = "vol-wipe", .handler = cmdVolWipe, .opts = opts_vol_wipe, - .info = info_vol_wipe, + .info = &info_vol_wipe, .flags = 0 }, {.name = NULL} diff --git a/tools/virsh.c b/tools/virsh.c index 0d860d0390..5b38881066 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -256,15 +256,10 @@ static const vshCmdOptDef opts_connect[] = { {.name = NULL} }; -static const vshCmdInfo info_connect[] = { - {.name = "help", - .data = N_("(re)connect to hypervisor") - }, - {.name = "desc", - .data = N_("Connect to local hypervisor. This is built-in " - "command after shell start up.") - }, - {.name = NULL} +static const vshCmdInfo info_connect = { + .help = N_("(re)connect to hypervisor"), + .desc = N_("Connect to local hypervisor. This is built-in " + "command after shell start up."), }; static bool @@ -464,8 +459,7 @@ virshUsage(void) cmd->flags & VSH_CMD_FLAG_HIDDEN) continue; fprintf(stdout, - " %-30s %s\n", cmd->name, - _(vshCmddefGetInfo(cmd, "help"))); + " %-30s %s\n", cmd->name, _(cmd->info->help)); } fprintf(stdout, "\n"); } @@ -795,7 +789,7 @@ static const vshCmdDef virshCmds[] = { {.name = "connect", .handler = cmdConnect, .opts = opts_connect, - .info = info_connect, + .info = &info_connect, .flags = VSH_CMD_FLAG_NOCONNECT }, {.name = NULL} diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 32e0c82f36..114ec2e8e7 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -167,14 +167,9 @@ vshAdmReconnect(vshControl *ctl) * 'uri' command */ -static const vshCmdInfo info_uri[] = { - {.name = "help", - .data = N_("print the admin server URI") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +static const vshCmdInfo info_uri = { + .help = N_("print the admin server URI"), + .desc = "", }; static bool @@ -198,14 +193,9 @@ cmdURI(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) * "version" command */ -static const vshCmdInfo info_version[] = { - {.name = "help", - .data = N_("show version") - }, - {.name = "desc", - .data = N_("Display the system and also the daemon version information.") - }, - {.name = NULL} +static const vshCmdInfo info_version = { + .help = N_("show version"), + .desc = N_("Display the system and also the daemon version information."), }; static bool @@ -270,14 +260,9 @@ static const vshCmdOptDef opts_connect[] = { {.name = NULL} }; -static const vshCmdInfo info_connect[] = { - {.name = "help", - .data = N_("connect to daemon's admin server") - }, - {.name = "desc", - .data = N_("Connect to a daemon's administrating server.") - }, - {.name = NULL} +static const vshCmdInfo info_connect = { + .help = N_("connect to daemon's admin server"), + .desc = N_("Connect to a daemon's administrating server."), }; static bool @@ -308,14 +293,9 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd) * ------------------- */ -static const vshCmdInfo info_srv_list[] = { - {.name = "help", - .data = N_("list available servers on a daemon") - }, - {.name = "desc", - .data = N_("List all manageable servers on a daemon.") - }, - {.name = NULL} +static const vshCmdInfo info_srv_list = { + .help = N_("list available servers on a daemon"), + .desc = N_("List all manageable servers on a daemon."), }; static bool @@ -371,14 +351,9 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) * ------------------------------ */ -static const vshCmdInfo info_srv_threadpool_info[] = { - {.name = "help", - .data = N_("get server workerpool parameters") - }, - {.name = "desc", - .data = N_("Retrieve threadpool attributes from a server.") - }, - {.name = NULL} +static const vshCmdInfo info_srv_threadpool_info = { + .help = N_("get server workerpool parameters"), + .desc = N_("Retrieve threadpool attributes from a server."), }; static const vshCmdOptDef opts_srv_threadpool_info[] = { @@ -432,15 +407,10 @@ cmdSrvThreadpoolInfo(vshControl *ctl, const vshCmd *cmd) * ----------------------------- */ -static const vshCmdInfo info_srv_threadpool_set[] = { - {.name = "help", - .data = N_("set server workerpool parameters") - }, - {.name = "desc", - .data = N_("Tune threadpool attributes on a server. See OPTIONS for " - "currently supported attributes.") - }, - {.name = NULL} +static const vshCmdInfo info_srv_threadpool_set = { + .help = N_("set server workerpool parameters"), + .desc = N_("Tune threadpool attributes on a server. See OPTIONS for " + "currently supported attributes."), }; static const vshCmdOptDef opts_srv_threadpool_set[] = { @@ -539,14 +509,9 @@ cmdSrvThreadpoolSet(vshControl *ctl, const vshCmd *cmd) * --------------------------- */ -static const vshCmdInfo info_srv_clients_list[] = { - {.name = "help", - .data = N_("list clients connected to ") - }, - {.name = "desc", - .data = N_("List all manageable clients connected to .") - }, - {.name = NULL} +static const vshCmdInfo info_srv_clients_list = { + .help = N_("list clients connected to "), + .desc = N_("List all manageable clients connected to ."), }; static const vshCmdOptDef opts_srv_clients_list[] = { @@ -626,14 +591,9 @@ cmdSrvClientsList(vshControl *ctl, const vshCmd *cmd) * ------------------- */ -static const vshCmdInfo info_client_info[] = { - {.name = "help", - .data = N_("retrieve client's identity info from server") - }, - {.name = "desc", - .data = N_("Retrieve identity details about from ") - }, - {.name = NULL} +static const vshCmdInfo info_client_info = { + .help = N_("retrieve client's identity info from server"), + .desc = N_("Retrieve identity details about from "), }; static const vshCmdOptDef opts_client_info[] = { @@ -712,15 +672,10 @@ cmdClientInfo(vshControl *ctl, const vshCmd *cmd) * ------------------------- */ -static const vshCmdInfo info_client_disconnect[] = { - {.name = "help", - .data = N_("force disconnect a client from the given server") - }, - {.name = "desc", - .data = N_("Force close a specific client's connection to the given " - "server.") - }, - {.name = NULL} +static const vshCmdInfo info_client_disconnect = { + .help = N_("force disconnect a client from the given server"), + .desc = N_("Force close a specific client's connection to the given " + "server."), }; static const vshCmdOptDef opts_client_disconnect[] = { @@ -779,14 +734,9 @@ cmdClientDisconnect(vshControl *ctl, const vshCmd *cmd) * --------------------------- */ -static const vshCmdInfo info_srv_clients_info[] = { - {.name = "help", - .data = N_("get server's client-related configuration limits") - }, - {.name = "desc", - .data = N_("Retrieve server's client-related configuration limits") - }, - {.name = NULL} +static const vshCmdInfo info_srv_clients_info = { + .help = N_("get server's client-related configuration limits"), + .desc = N_("Retrieve server's client-related configuration limits"), }; static const vshCmdOptDef opts_srv_clients_info[] = { @@ -837,15 +787,10 @@ cmdSrvClientsInfo(vshControl *ctl, const vshCmd *cmd) * -------------------------- */ -static const vshCmdInfo info_srv_clients_set[] = { - {.name = "help", - .data = N_("set server's client-related configuration limits") - }, - {.name = "desc", - .data = N_("Tune server's client-related configuration limits. " - "See OPTIONS for currently supported attributes.") - }, - {.name = NULL} +static const vshCmdInfo info_srv_clients_set = { + .help = N_("set server's client-related configuration limits"), + .desc = N_("Tune server's client-related configuration limits. " + "See OPTIONS for currently supported attributes."), }; static const vshCmdOptDef opts_srv_clients_set[] = { @@ -938,16 +883,11 @@ cmdSrvClientsSet(vshControl *ctl, const vshCmd *cmd) * Command server-update-tls * -------------------------- */ -static const vshCmdInfo info_srv_update_tls_file[] = { - {.name = "help", - .data = N_("notify server to update TLS related files online.") - }, - {.name = "desc", - .data = N_("notify server to update the CA cert, " +static const vshCmdInfo info_srv_update_tls_file = { + .help = N_("notify server to update TLS related files online."), + .desc = N_("notify server to update the CA cert, " "CA CRL, server cert / key without restarts. " - "See OPTIONS for currently supported attributes.") - }, - {.name = NULL} + "See OPTIONS for currently supported attributes."), }; static const vshCmdOptDef opts_srv_update_tls_file[] = { @@ -992,17 +932,12 @@ cmdSrvUpdateTlsFiles(vshControl *ctl, const vshCmd *cmd) * Command daemon-log-filters * -------------------------- */ -static const vshCmdInfo info_daemon_log_filters[] = { - {.name = "help", - .data = N_("fetch or set the currently defined set of logging filters on " - "daemon") - }, - {.name = "desc", - .data = N_("Depending on whether run with or without options, the command " +static const vshCmdInfo info_daemon_log_filters = { + .help = N_("fetch or set the currently defined set of logging filters on " + "daemon"), + .desc = N_("Depending on whether run with or without options, the command " "fetches or redefines the existing active set of filters on " - "daemon.") - }, - {.name = NULL} + "daemon."), }; static const vshCmdOptDef opts_daemon_log_filters[] = { @@ -1045,17 +980,12 @@ cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd) * Command daemon-log-outputs * -------------------------- */ -static const vshCmdInfo info_daemon_log_outputs[] = { - {.name = "help", - .data = N_("fetch or set the currently defined set of logging outputs on " - "daemon") - }, - {.name = "desc", - .data = N_("Depending on whether run with or without options, the command " +static const vshCmdInfo info_daemon_log_outputs = { + .help = N_("fetch or set the currently defined set of logging outputs on " + "daemon"), + .desc = N_("Depending on whether run with or without options, the command " "fetches or redefines the existing active set of outputs on " - "daemon.") - }, - {.name = NULL} + "daemon."), }; static const vshCmdOptDef opts_daemon_timeout[] = { @@ -1087,14 +1017,9 @@ cmdDaemonTimeout(vshControl *ctl, const vshCmd *cmd) * Command daemon-timeout * -------------------------- */ -static const vshCmdInfo info_daemon_timeout[] = { - {.name = "help", - .data = 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 vshCmdInfo info_daemon_timeout = { + .help = N_("set the auto shutdown timeout of the daemon"), + .desc = N_("set the auto shutdown timeout of the daemon"), }; static const vshCmdOptDef opts_daemon_log_outputs[] = { @@ -1266,8 +1191,7 @@ vshAdmUsage(void) cmd->flags & VSH_CMD_FLAG_HIDDEN) continue; fprintf(stdout, - " %-30s %s\n", cmd->name, - _(vshCmddefGetInfo(cmd, "help"))); + " %-30s %s\n", cmd->name, _(cmd->info->help)); } fprintf(stdout, "\n"); } @@ -1409,19 +1333,19 @@ static const vshCmdDef vshAdmCmds[] = { {.name = "uri", .handler = cmdURI, .opts = NULL, - .info = info_uri, + .info = &info_uri, .flags = 0 }, {.name = "version", .handler = cmdVersion, .opts = NULL, - .info = info_version, + .info = &info_version, .flags = 0 }, {.name = "connect", .handler = cmdConnect, .opts = opts_connect, - .info = info_connect, + .info = &info_connect, .flags = VSH_CMD_FLAG_NOCONNECT }, {.name = NULL} @@ -1434,7 +1358,7 @@ static const vshCmdDef monitoringCmds[] = { {.name = "server-list", .handler = cmdSrvList, .opts = NULL, - .info = info_srv_list, + .info = &info_srv_list, .flags = 0 }, {.name = "srv-threadpool-info", @@ -1443,7 +1367,7 @@ static const vshCmdDef monitoringCmds[] = { {.name = "server-threadpool-info", .handler = cmdSrvThreadpoolInfo, .opts = opts_srv_threadpool_info, - .info = info_srv_threadpool_info, + .info = &info_srv_threadpool_info, .flags = 0 }, {.name = "srv-clients-list", @@ -1452,13 +1376,13 @@ static const vshCmdDef monitoringCmds[] = { {.name = "client-list", .handler = cmdSrvClientsList, .opts = opts_srv_clients_list, - .info = info_srv_clients_list, + .info = &info_srv_clients_list, .flags = 0 }, {.name = "client-info", .handler = cmdClientInfo, .opts = opts_client_info, - .info = info_client_info, + .info = &info_client_info, .flags = 0 }, {.name = "srv-clients-info", @@ -1467,7 +1391,7 @@ static const vshCmdDef monitoringCmds[] = { {.name = "server-clients-info", .handler = cmdSrvClientsInfo, .opts = opts_srv_clients_info, - .info = info_srv_clients_info, + .info = &info_srv_clients_info, .flags = 0 }, {.name = NULL} @@ -1480,13 +1404,13 @@ static const vshCmdDef managementCmds[] = { {.name = "server-threadpool-set", .handler = cmdSrvThreadpoolSet, .opts = opts_srv_threadpool_set, - .info = info_srv_threadpool_set, + .info = &info_srv_threadpool_set, .flags = 0 }, {.name = "client-disconnect", .handler = cmdClientDisconnect, .opts = opts_client_disconnect, - .info = info_client_disconnect, + .info = &info_client_disconnect, .flags = 0 }, {.name = "srv-clients-set", @@ -1495,7 +1419,7 @@ static const vshCmdDef managementCmds[] = { {.name = "server-clients-set", .handler = cmdSrvClientsSet, .opts = opts_srv_clients_set, - .info = info_srv_clients_set, + .info = &info_srv_clients_set, .flags = 0 }, {.name = "srv-update-tls", @@ -1504,25 +1428,25 @@ static const vshCmdDef managementCmds[] = { {.name = "server-update-tls", .handler = cmdSrvUpdateTlsFiles, .opts = opts_srv_update_tls_file, - .info = info_srv_update_tls_file, + .info = &info_srv_update_tls_file, .flags = 0 }, {.name = "daemon-log-filters", .handler = cmdDaemonLogFilters, .opts = opts_daemon_log_filters, - .info = info_daemon_log_filters, + .info = &info_daemon_log_filters, .flags = 0 }, {.name = "daemon-log-outputs", .handler = cmdDaemonLogOutputs, .opts = opts_daemon_log_outputs, - .info = info_daemon_log_outputs, + .info = &info_daemon_log_outputs, .flags = 0 }, {.name = "daemon-timeout", .handler = cmdDaemonTimeout, .opts = opts_daemon_timeout, - .info = info_daemon_timeout, + .info = &info_daemon_timeout, .flags = 0 }, {.name = NULL} diff --git a/tools/vsh.c b/tools/vsh.c index 37a00e2065..ef7e86092b 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -239,22 +239,6 @@ vshReportError(vshControl *ctl) */ 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. * None of the errors are to be marked as translatable. */ static int @@ -263,7 +247,6 @@ vshCmddefCheckInternals(vshControl *ctl, bool missingCompleters) { size_t i; - const char *help = NULL; bool seenOptionalOption = false; g_auto(virBuffer) complbuf = VIR_BUFFER_INITIALIZER; @@ -308,7 +291,7 @@ vshCmddefCheckInternals(vshControl *ctl, } /* 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); return -1; } @@ -627,8 +610,7 @@ vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp) if (cmd->alias || cmd->flags & VSH_CMD_FLAG_HIDDEN) continue; - vshPrint(ctl, " %-30s %s\n", cmd->name, - _(vshCmddefGetInfo(cmd, "help"))); + vshPrint(ctl, " %-30s %s\n", cmd->name, _(cmd->info->help)); } return true; @@ -637,13 +619,11 @@ vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp) static bool vshCmddefHelp(const vshCmdDef *def) { - const char *desc = NULL; char buf[256]; bool shortopt = false; /* true if 'arg' works instead of '--opt arg' */ fputs(_(" NAME\n"), stdout); - fprintf(stdout, " %s - %s\n", def->name, - _(vshCmddefGetInfo(def, "help"))); + fprintf(stdout, " %s - %s\n", def->name, _(def->info->help)); fputs(_("\n SYNOPSIS\n"), stdout); fprintf(stdout, " %s", def->name); @@ -695,11 +675,10 @@ vshCmddefHelp(const vshCmdDef *def) } fputc('\n', stdout); - desc = vshCmddefGetInfo(def, "desc"); - if (desc && *desc) { + if (def->info->desc && *def->info->desc) { /* Print the description only if it's not empty. */ fputs(_("\n DESCRIPTION\n"), stdout); - fprintf(stdout, " %s\n", _(desc)); + fprintf(stdout, " %s\n", _(def->info->desc)); } if (def->opts && def->opts->name) { @@ -3114,15 +3093,10 @@ const vshCmdOptDef opts_help[] = { {.name = NULL} }; -const vshCmdInfo info_help[] = { - {.name = "help", - .data = N_("print help") - }, - {.name = "desc", - .data = N_("Prints global help, command specific help, or help for a\n" - " group of related commands") - }, - {.name = NULL} +const vshCmdInfo info_help = { + .help = N_("print help"), + .desc = N_("Prints global help, command specific help, or help for a\n" + " group of related commands"), }; bool @@ -3143,8 +3117,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd) if (def->alias || def->flags & VSH_CMD_FLAG_HIDDEN) continue; - vshPrint(ctl, " %-30s %s\n", def->name, - _(vshCmddefGetInfo(def, "help"))); + vshPrint(ctl, " %-30s %s\n", def->name, _(def->info->help)); } vshPrint(ctl, "\n"); @@ -3176,14 +3149,9 @@ const vshCmdOptDef opts_cd[] = { {.name = NULL} }; -const vshCmdInfo info_cd[] = { - {.name = "help", - .data = N_("change the current directory") - }, - {.name = "desc", - .data = N_("Change the current directory.") - }, - {.name = NULL} +const vshCmdInfo info_cd = { + .help = N_("change the current directory"), + .desc = N_("Change the current directory."), }; bool @@ -3243,14 +3211,9 @@ const vshCmdOptDef opts_echo[] = { {.name = NULL} }; -const vshCmdInfo info_echo[] = { - {.name = "help", - .data = N_("echo arguments. Used for internal testing.") - }, - {.name = "desc", - .data = N_("Echo back arguments, possibly with quoting. Used for internal testing.") - }, - {.name = NULL} +const vshCmdInfo info_echo = { + .help = N_("echo arguments. Used for internal testing."), + .desc = N_("Echo back arguments, possibly with quoting. Used for internal testing."), }; /* Exists mainly for debugging virsh, but also handy for adding back @@ -3305,14 +3268,9 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd) return true; } -const vshCmdInfo info_pwd[] = { - {.name = "help", - .data = N_("print the current directory") - }, - {.name = "desc", - .data = N_("Print the current directory.") - }, - {.name = NULL} +const vshCmdInfo info_pwd = { + .help = N_("print the current directory"), + .desc = N_("Print the current directory."), }; bool @@ -3325,14 +3283,9 @@ cmdPwd(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) return true; } -const vshCmdInfo info_quit[] = { - {.name = "help", - .data = N_("quit this interactive terminal") - }, - {.name = "desc", - .data = "" - }, - {.name = NULL} +const vshCmdInfo info_quit = { + .help = N_("quit this interactive terminal"), + .desc = "", }; bool @@ -3357,14 +3310,9 @@ const vshCmdOptDef opts_selftest[] = { }, {.name = NULL} }; -const vshCmdInfo info_selftest[] = { - {.name = "help", - .data = N_("internal command for testing virt shells") - }, - {.name = "desc", - .data = N_("internal use only") - }, - {.name = NULL} +const vshCmdInfo info_selftest = { + .help = N_("internal command for testing virt shells"), + .desc = N_("internal use only"), }; bool @@ -3402,14 +3350,9 @@ const vshCmdOptDef opts_complete[] = { {.name = NULL} }; -const vshCmdInfo info_complete[] = { - {.name = "help", - .data = N_("internal command for autocompletion") - }, - {.name = "desc", - .data = N_("internal use only") - }, - {.name = NULL} +const vshCmdInfo info_complete = { + .help = N_("internal command for autocompletion"), + .desc = N_("internal use only"), }; diff --git a/tools/vsh.h b/tools/vsh.h index 57aa613382..6007df2b7e 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -119,15 +119,12 @@ typedef char **(*vshCompleter)(vshControl *ctl, unsigned int flags); /* - * vshCmdInfo -- name/value pair for information about command - * - * Commands should have at least the following names: * "help" - short description of command * "desc" - description of command, or empty string */ struct _vshCmdInfo { - const char *name; /* name of information, or NULL for list end */ - const char *data; /* non-NULL information */ + const char *help; /* short description of command */ + 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); void vshCloseLogFile(vshControl *ctl); -const char *vshCmddefGetInfo(const vshCmdDef *cmd, const char *info); const vshCmdDef *vshCmddefSearch(const char *cmdname); const vshCmdGrp *vshCmdGrpSearch(const char *grpname); bool vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp); @@ -375,17 +371,17 @@ int vshEventWait(vshControl *ctl); /* generic commands */ extern const vshCmdOptDef opts_help[]; -extern const vshCmdInfo info_help[]; +extern const vshCmdInfo info_help; extern const vshCmdOptDef opts_cd[]; -extern const vshCmdInfo info_cd[]; +extern const vshCmdInfo info_cd; extern const vshCmdOptDef opts_echo[]; -extern const vshCmdInfo info_echo[]; -extern const vshCmdInfo info_pwd[]; -extern const vshCmdInfo info_quit[]; +extern const vshCmdInfo info_echo; +extern const vshCmdInfo info_pwd; +extern const vshCmdInfo info_quit; extern const vshCmdOptDef opts_selftest[]; -extern const vshCmdInfo info_selftest[]; +extern const vshCmdInfo info_selftest; extern const vshCmdOptDef opts_complete[]; -extern const vshCmdInfo info_complete[]; +extern const vshCmdInfo info_complete; bool cmdHelp(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", \ .handler = cmdCd, \ .opts = opts_cd, \ - .info = info_cd, \ + .info = &info_cd, \ .flags = VSH_CMD_FLAG_NOCONNECT \ } @@ -409,7 +405,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "echo", \ .handler = cmdEcho, \ .opts = opts_echo, \ - .info = info_echo, \ + .info = &info_echo, \ .flags = VSH_CMD_FLAG_NOCONNECT \ } @@ -418,7 +414,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "exit", \ .handler = cmdQuit, \ .opts = NULL, \ - .info = info_quit, \ + .info = &info_quit, \ .flags = VSH_CMD_FLAG_NOCONNECT \ } @@ -427,7 +423,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "help", \ .handler = cmdHelp, \ .opts = opts_help, \ - .info = info_help, \ + .info = &info_help, \ .flags = VSH_CMD_FLAG_NOCONNECT \ } @@ -436,7 +432,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "pwd", \ .handler = cmdPwd, \ .opts = NULL, \ - .info = info_pwd, \ + .info = &info_pwd, \ .flags = VSH_CMD_FLAG_NOCONNECT \ } @@ -445,7 +441,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "quit", \ .handler = cmdQuit, \ .opts = NULL, \ - .info = info_quit, \ + .info = &info_quit, \ .flags = VSH_CMD_FLAG_NOCONNECT \ } @@ -454,7 +450,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "self-test", \ .handler = cmdSelfTest, \ .opts = opts_selftest, \ - .info = info_selftest, \ + .info = &info_selftest, \ .flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_HIDDEN, \ } @@ -463,7 +459,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .name = "complete", \ .handler = cmdComplete, \ .opts = opts_complete, \ - .info = info_complete, \ + .info = &info_complete, \ .flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_HIDDEN, \ }