virsh: Annodate 'unwanted_positional' arguments

Historically the command parser in virsh parses/fills even optional
arguments with values as if they were positional unless opted out using
VSH_OFLAG_REQ_OPT. This creates unexpected situations when commands can
break in this unwanted semantics:

 $ virsh snapshot-create-as --print-xml 1 2 3
 <domainsnapshot>
   <name>2</name>
   <description>3</description>
 </domainsnapshot>

To prevent any further addition annotate the rest of the arguments with
the 'unwanted_positional' flag, so that the parser can keep parsing them
as such but any further optional argument will not have this behaviour.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-03-14 17:17:19 +01:00
parent 32a89fc670
commit 100cbccecd
12 changed files with 145 additions and 0 deletions

View File

@ -189,11 +189,13 @@ static const vshCmdOptDef opts_checkpoint_create_as[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "name", {.name = "name",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("name of checkpoint") .help = N_("name of checkpoint")
}, },
{.name = "description", {.name = "description",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("description of checkpoint") .help = N_("description of checkpoint")
}, },
@ -630,6 +632,7 @@ static const vshCmdOptDef opts_checkpoint_list[] = {
}, },
{.name = "from", {.name = "from",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("limit list to children of given checkpoint"), .help = N_("limit list to children of given checkpoint"),
.completer = virshCheckpointNameCompleter, .completer = virshCheckpointNameCompleter,
}, },

View File

@ -867,11 +867,13 @@ static const vshCmdInfo info_event = {
static const vshCmdOptDef opts_event[] = { static const vshCmdOptDef opts_event[] = {
{.name = "domain", {.name = "domain",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("filter by domain name, id or uuid"), .help = N_("filter by domain name, id or uuid"),
.completer = virshDomainNameCompleter, .completer = virshDomainNameCompleter,
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainEventNameCompleter, .completer = virshDomainEventNameCompleter,
.help = N_("which event type to wait for") .help = N_("which event type to wait for")
}, },
@ -885,6 +887,7 @@ static const vshCmdOptDef opts_event[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("timeout seconds") .help = N_("timeout seconds")
}, },
{.name = "list", {.name = "list",

View File

@ -1349,6 +1349,7 @@ static const vshCmdOptDef opts_domtime[] = {
}, },
{.name = "time", {.name = "time",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("time to set") .help = N_("time to set")
}, },
{.name = NULL} {.name = NULL}
@ -2231,6 +2232,7 @@ static const vshCmdOptDef opts_domifaddr[] = {
.help = N_("always display names and MACs of interfaces")}, .help = N_("always display names and MACs of interfaces")},
{.name = "source", {.name = "source",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.flags = VSH_OFLAG_NONE, .flags = VSH_OFLAG_NONE,
.completer = virshDomainInterfaceAddrSourceCompleter, .completer = virshDomainInterfaceAddrSourceCompleter,
.help = N_("address source: 'lease', 'agent', or 'arp'")}, .help = N_("address source: 'lease', 'agent', or 'arp'")},

View File

@ -844,34 +844,41 @@ static const vshCmdOptDef opts_attach_interface[] = {
}, },
{.name = "target", {.name = "target",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("target network name") .help = N_("target network name")
}, },
{.name = "mac", {.name = "mac",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("MAC address") .help = N_("MAC address")
}, },
{.name = "script", {.name = "script",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("script used to bridge network interface") .help = N_("script used to bridge network interface")
}, },
{.name = "model", {.name = "model",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("model type") .help = N_("model type")
}, },
{.name = "alias", {.name = "alias",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("custom alias name of interface device") .help = N_("custom alias name of interface device")
}, },
{.name = "inbound", {.name = "inbound",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("control domain's incoming traffics") .help = N_("control domain's incoming traffics")
}, },
{.name = "outbound", {.name = "outbound",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("control domain's outgoing traffics") .help = N_("control domain's outgoing traffics")
}, },
@ -889,6 +896,7 @@ static const vshCmdOptDef opts_attach_interface[] = {
}, },
{.name = "source-mode", {.name = "source-mode",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainInterfaceSourceModeCompleter, .completer = virshDomainInterfaceSourceModeCompleter,
.help = N_("mode attribute of <source/> element") .help = N_("mode attribute of <source/> element")
}, },
@ -1550,30 +1558,36 @@ static const vshCmdOptDef opts_blkiotune[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "weight", {.name = "weight",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("IO Weight") .help = N_("IO Weight")
}, },
{.name = "device-weights", {.name = "device-weights",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("per-device IO Weights, in the form of /path/to/device,weight,...") .help = N_("per-device IO Weights, in the form of /path/to/device,weight,...")
}, },
{.name = "device-read-iops-sec", {.name = "device-read-iops-sec",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("per-device read I/O limit per second, in the form of /path/to/device,read_iops_sec,...") .help = N_("per-device read I/O limit per second, in the form of /path/to/device,read_iops_sec,...")
}, },
{.name = "device-write-iops-sec", {.name = "device-write-iops-sec",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("per-device write I/O limit per second, in the form of /path/to/device,write_iops_sec,...") .help = N_("per-device write I/O limit per second, in the form of /path/to/device,write_iops_sec,...")
}, },
{.name = "device-read-bytes-sec", {.name = "device-read-bytes-sec",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("per-device bytes read per second, in the form of /path/to/device,read_bytes_sec,...") .help = N_("per-device bytes read per second, in the form of /path/to/device,read_bytes_sec,...")
}, },
{.name = "device-write-bytes-sec", {.name = "device-write-bytes-sec",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("per-device bytes wrote per second, in the form of /path/to/device,write_bytes_sec,...") .help = N_("per-device bytes wrote per second, in the form of /path/to/device,write_bytes_sec,...")
}, },
@ -2031,10 +2045,12 @@ static const vshCmdOptDef opts_blockcommit[] = {
}, },
{.name = "bandwidth", {.name = "bandwidth",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("bandwidth limit in MiB/s") .help = N_("bandwidth limit in MiB/s")
}, },
{.name = "base", {.name = "base",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainBlockjobBaseTopCompleter, .completer = virshDomainBlockjobBaseTopCompleter,
.help = N_("path of base file to commit into (default bottom of chain)") .help = N_("path of base file to commit into (default bottom of chain)")
}, },
@ -2044,6 +2060,7 @@ static const vshCmdOptDef opts_blockcommit[] = {
}, },
{.name = "top", {.name = "top",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainBlockjobBaseTopCompleter, .completer = virshDomainBlockjobBaseTopCompleter,
.help = N_("path of top file to commit from (default top of chain)") .help = N_("path of top file to commit from (default top of chain)")
}, },
@ -2066,6 +2083,7 @@ static const vshCmdOptDef opts_blockcommit[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("implies --wait, abort if copy exceeds timeout (in seconds)") .help = N_("implies --wait, abort if copy exceeds timeout (in seconds)")
}, },
{.name = "pivot", {.name = "pivot",
@ -2251,10 +2269,12 @@ static const vshCmdOptDef opts_blockcopy[] = {
}, },
{.name = "dest", {.name = "dest",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("path of the copy to create") .help = N_("path of the copy to create")
}, },
{.name = "bandwidth", {.name = "bandwidth",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("bandwidth limit in MiB/s") .help = N_("bandwidth limit in MiB/s")
}, },
{.name = "shallow", {.name = "shallow",
@ -2283,6 +2303,7 @@ static const vshCmdOptDef opts_blockcopy[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("implies --wait, abort if copy exceeds timeout (in seconds)") .help = N_("implies --wait, abort if copy exceeds timeout (in seconds)")
}, },
{.name = "pivot", {.name = "pivot",
@ -2299,21 +2320,25 @@ static const vshCmdOptDef opts_blockcopy[] = {
}, },
{.name = "xml", {.name = "xml",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("filename containing XML description of the copy destination") .help = N_("filename containing XML description of the copy destination")
}, },
{.name = "format", {.name = "format",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.flags = VSH_OFLAG_NONE, .flags = VSH_OFLAG_NONE,
.completer = virshDomainStorageFileFormatCompleter, .completer = virshDomainStorageFileFormatCompleter,
.help = N_("format of the destination file") .help = N_("format of the destination file")
}, },
{.name = "granularity", {.name = "granularity",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("power-of-two granularity to use during the copy") .help = N_("power-of-two granularity to use during the copy")
}, },
{.name = "buf-size", {.name = "buf-size",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("maximum amount of in-flight data during the copy") .help = N_("maximum amount of in-flight data during the copy")
}, },
{.name = "bytes", {.name = "bytes",
@ -2608,6 +2633,7 @@ static const vshCmdOptDef opts_blockjob[] = {
}, },
{.name = "bandwidth", {.name = "bandwidth",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("set the bandwidth limit in MiB/s") .help = N_("set the bandwidth limit in MiB/s")
}, },
{.name = NULL} {.name = NULL}
@ -2796,10 +2822,12 @@ static const vshCmdOptDef opts_blockpull[] = {
}, },
{.name = "bandwidth", {.name = "bandwidth",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("bandwidth limit in MiB/s") .help = N_("bandwidth limit in MiB/s")
}, },
{.name = "base", {.name = "base",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainBlockjobBaseTopCompleter, .completer = virshDomainBlockjobBaseTopCompleter,
.help = N_("path of backing file in chain for a partial pull") .help = N_("path of backing file in chain for a partial pull")
}, },
@ -2813,6 +2841,7 @@ static const vshCmdOptDef opts_blockpull[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("with --wait, abort if pull exceeds timeout (in seconds)") .help = N_("with --wait, abort if pull exceeds timeout (in seconds)")
}, },
{.name = "async", {.name = "async",
@ -3000,6 +3029,7 @@ static const vshCmdOptDef opts_console[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "devname", /* sc_prohibit_devname */ {.name = "devname", /* sc_prohibit_devname */
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainConsoleCompleter, .completer = virshDomainConsoleCompleter,
.help = N_("character device name") .help = N_("character device name")
}, },
@ -3246,11 +3276,13 @@ static const vshCmdOptDef opts_domiftune[] = {
}, },
{.name = "inbound", {.name = "inbound",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("control domain's incoming traffics") .help = N_("control domain's incoming traffics")
}, },
{.name = "outbound", {.name = "outbound",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("control domain's outgoing traffics") .help = N_("control domain's outgoing traffics")
}, },
@ -3568,6 +3600,7 @@ static const vshCmdOptDef opts_undefine[] = {
}, },
{.name = "storage", {.name = "storage",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainUndefineStorageDisksCompleter, .completer = virshDomainUndefineStorageDisksCompleter,
.help = N_("remove associated storage volumes (comma separated list of " .help = N_("remove associated storage volumes (comma separated list of "
"targets or source paths) (see domblklist)") "targets or source paths) (see domblklist)")
@ -4013,6 +4046,7 @@ static const vshCmdOptDef opts_start[] = {
}, },
{.name = "pass-fds", {.name = "pass-fds",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("pass file descriptors N,M,... to the guest") .help = N_("pass file descriptors N,M,... to the guest")
}, },
@ -4159,6 +4193,7 @@ static const vshCmdOptDef opts_save[] = {
}, },
{.name = "xml", {.name = "xml",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target") .help = N_("filename containing updated XML for the target")
}, },
@ -5250,6 +5285,7 @@ static const vshCmdOptDef opts_restore[] = {
}, },
{.name = "xml", {.name = "xml",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target") .help = N_("filename containing updated XML for the target")
}, },
@ -5352,6 +5388,7 @@ static const vshCmdOptDef opts_dump[] = {
{.name = "format", {.name = "format",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.flags = VSH_OFLAG_NONE, .flags = VSH_OFLAG_NONE,
.unwanted_positional = true,
.completer = virshDomainCoreDumpFormatCompleter, .completer = virshDomainCoreDumpFormatCompleter,
.help = N_("specify the format of memory-only dump") .help = N_("specify the format of memory-only dump")
}, },
@ -5495,11 +5532,13 @@ static const vshCmdOptDef opts_screenshot[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "file", {.name = "file",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("where to store the screenshot") .help = N_("where to store the screenshot")
}, },
{.name = "screen", {.name = "screen",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("ID of a screen to take screenshot of") .help = N_("ID of a screen to take screenshot of")
}, },
{.name = NULL} {.name = NULL}
@ -6834,11 +6873,13 @@ static const vshCmdOptDef opts_vcpupin[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "vcpu", {.name = "vcpu",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.completer = virshDomainVcpuCompleter, .completer = virshDomainVcpuCompleter,
.help = N_("vcpu number") .help = N_("vcpu number")
}, },
{.name = "cpulist", {.name = "cpulist",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.flags = VSH_OFLAG_EMPTY_OK, .flags = VSH_OFLAG_EMPTY_OK,
.completer = virshDomainCpulistCompleter, .completer = virshDomainCpulistCompleter,
.help = N_("host cpu number(s) to set, or omit option to query") .help = N_("host cpu number(s) to set, or omit option to query")
@ -7047,6 +7088,7 @@ static const vshCmdOptDef opts_emulatorpin[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "cpulist", {.name = "cpulist",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.flags = VSH_OFLAG_EMPTY_OK, .flags = VSH_OFLAG_EMPTY_OK,
.completer = virshDomainCpulistCompleter, .completer = virshDomainCpulistCompleter,
.help = N_("host cpu number(s) to set, or omit option to query") .help = N_("host cpu number(s) to set, or omit option to query")
@ -7231,6 +7273,7 @@ static const vshCmdOptDef opts_guestvcpus[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "cpulist", {.name = "cpulist",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainVcpulistViaAgentCompleter, .completer = virshDomainVcpulistViaAgentCompleter,
.help = N_("list of cpus to enable or disable") .help = N_("list of cpus to enable or disable")
}, },
@ -7653,22 +7696,27 @@ static const vshCmdOptDef opts_iothreadset[] = {
}, },
{.name = "poll-max-ns", {.name = "poll-max-ns",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("set the maximum IOThread polling time in ns") .help = N_("set the maximum IOThread polling time in ns")
}, },
{.name = "poll-grow", {.name = "poll-grow",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("set the value to increase the IOThread polling time") .help = N_("set the value to increase the IOThread polling time")
}, },
{.name = "poll-shrink", {.name = "poll-shrink",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("set the value for reduction of the IOThread polling time") .help = N_("set the value for reduction of the IOThread polling time")
}, },
{.name = "thread-pool-min", {.name = "thread-pool-min",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("lower boundary for worker thread pool") .help = N_("lower boundary for worker thread pool")
}, },
{.name = "thread-pool-max", {.name = "thread-pool-max",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("upper boundary for worker thread pool") .help = N_("upper boundary for worker thread pool")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
@ -7824,10 +7872,12 @@ static const vshCmdOptDef opts_cpu_stats[] = {
}, },
{.name = "start", {.name = "start",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Show statistics from this CPU") .help = N_("Show statistics from this CPU")
}, },
{.name = "count", {.name = "count",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Number of shown CPUs at most") .help = N_("Number of shown CPUs at most")
}, },
{.name = NULL} {.name = NULL}
@ -8010,6 +8060,7 @@ static const vshCmdOptDef opts_create[] = {
}, },
{.name = "pass-fds", {.name = "pass-fds",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("pass file descriptors N,M,... to the guest") .help = N_("pass file descriptors N,M,... to the guest")
}, },
@ -8368,10 +8419,12 @@ static const vshCmdOptDef opts_metadata[] = {
}, },
{.name = "key", {.name = "key",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("key to be used as a namespace identifier"), .help = N_("key to be used as a namespace identifier"),
}, },
{.name = "set", {.name = "set",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("new metadata to set"), .help = N_("new metadata to set"),
}, },
@ -8856,15 +8909,18 @@ static const vshCmdOptDef opts_update_memory_device[] = {
}, },
{.name = "alias", {.name = "alias",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainDeviceAliasCompleter, .completer = virshDomainDeviceAliasCompleter,
.help = N_("memory device alias") .help = N_("memory device alias")
}, },
{.name = "node", {.name = "node",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("memory device target node") .help = N_("memory device target node")
}, },
{.name = "requested-size", {.name = "requested-size",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("new value of <requested/> size, as scaled integer (default KiB)") .help = N_("new value of <requested/> size, as scaled integer (default KiB)")
}, },
{.name = NULL} {.name = NULL}
@ -8998,18 +9054,22 @@ static const vshCmdOptDef opts_memtune[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "hard-limit", {.name = "hard-limit",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Max memory, as scaled integer (default KiB)") .help = N_("Max memory, as scaled integer (default KiB)")
}, },
{.name = "soft-limit", {.name = "soft-limit",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Memory during contention, as scaled integer (default KiB)") .help = N_("Memory during contention, as scaled integer (default KiB)")
}, },
{.name = "swap-hard-limit", {.name = "swap-hard-limit",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Max memory plus swap, as scaled integer (default KiB)") .help = N_("Max memory plus swap, as scaled integer (default KiB)")
}, },
{.name = "min-guarantee", {.name = "min-guarantee",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Min guaranteed memory, as scaled integer (default KiB)") .help = N_("Min guaranteed memory, as scaled integer (default KiB)")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
@ -9165,11 +9225,13 @@ static const vshCmdOptDef opts_perf[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "enable", {.name = "enable",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainPerfEnableCompleter, .completer = virshDomainPerfEnableCompleter,
.help = N_("perf events which will be enabled") .help = N_("perf events which will be enabled")
}, },
{.name = "disable", {.name = "disable",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainPerfDisableCompleter, .completer = virshDomainPerfDisableCompleter,
.help = N_("perf events which will be disabled") .help = N_("perf events which will be disabled")
}, },
@ -9289,12 +9351,14 @@ static const vshCmdOptDef opts_numatune[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "mode", {.name = "mode",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainNumatuneModeCompleter, .completer = virshDomainNumatuneModeCompleter,
.help = N_("NUMA mode, one of strict, preferred and interleave " .help = N_("NUMA mode, one of strict, preferred and interleave "
"or a number from the virDomainNumatuneMemMode enum") "or a number from the virDomainNumatuneMemMode enum")
}, },
{.name = "nodeset", {.name = "nodeset",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("NUMA node selections to set") .help = N_("NUMA node selections to set")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
@ -9470,6 +9534,7 @@ static const vshCmdOptDef opts_domsetlaunchsecstate[] = {
}, },
{.name = "set-address", {.name = "set-address",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("physical address within the guest domain's memory to set the secret"), .help = N_("physical address within the guest domain's memory to set the secret"),
}, },
{.name = NULL} {.name = NULL}
@ -9872,11 +9937,13 @@ static const vshCmdInfo info_qemu_monitor_event = {
static const vshCmdOptDef opts_qemu_monitor_event[] = { static const vshCmdOptDef opts_qemu_monitor_event[] = {
{.name = "domain", {.name = "domain",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("filter by domain name, id or uuid"), .help = N_("filter by domain name, id or uuid"),
.completer = virshDomainNameCompleter, .completer = virshDomainNameCompleter,
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("filter by event name") .help = N_("filter by event name")
}, },
{.name = "pretty", {.name = "pretty",
@ -9889,6 +9956,7 @@ static const vshCmdOptDef opts_qemu_monitor_event[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("timeout seconds") .help = N_("timeout seconds")
}, },
{.name = "regex", {.name = "regex",
@ -10379,6 +10447,7 @@ static const vshCmdOptDef opts_domxmltonative[] = {
}, },
{.name = "xml", {.name = "xml",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("xml data file to export from") .help = N_("xml data file to export from")
}, },
@ -11871,6 +11940,7 @@ static const vshCmdOptDef opts_domhostname[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "source", {.name = "source",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.flags = VSH_OFLAG_NONE, .flags = VSH_OFLAG_NONE,
.completer = virshDomainHostnameSourceCompleter, .completer = virshDomainHostnameSourceCompleter,
.help = N_("address source: 'lease' or 'agent'")}, .help = N_("address source: 'lease' or 'agent'")},
@ -12144,6 +12214,7 @@ static const vshCmdOptDef opts_detach_interface[] = {
}, },
{.name = "mac", {.name = "mac",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainInterfaceCompleter, .completer = virshDomainInterfaceCompleter,
.completer_flags = VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC, .completer_flags = VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC,
.help = N_("MAC address") .help = N_("MAC address")
@ -12823,11 +12894,13 @@ static const vshCmdOptDef opts_domfstrim[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "minimum", {.name = "minimum",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Just a hint to ignore contiguous " .help = N_("Just a hint to ignore contiguous "
"free ranges smaller than this (Bytes)") "free ranges smaller than this (Bytes)")
}, },
{.name = "mountpoint", {.name = "mountpoint",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainFSMountpointsCompleter, .completer = virshDomainFSMountpointsCompleter,
.help = N_("which mount point to trim") .help = N_("which mount point to trim")
}, },
@ -13295,11 +13368,13 @@ static const vshCmdOptDef opts_domdirtyrate_calc[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "seconds", {.name = "seconds",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("calculate memory dirty rate within specified seconds, " .help = N_("calculate memory dirty rate within specified seconds, "
"the supported value range from 1 to 60, default to 1.") "the supported value range from 1 to 60, default to 1.")
}, },
{.name = "mode", {.name = "mode",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainDirtyRateCalcModeCompleter, .completer = virshDomainDirtyRateCalcModeCompleter,
.help = N_("dirty page rate calculation mode, either of these 3 options " .help = N_("dirty page rate calculation mode, either of these 3 options "
"'page-sampling, dirty-bitmap, dirty-ring' can be specified.") "'page-sampling, dirty-bitmap, dirty-ring' can be specified.")

View File

@ -86,20 +86,24 @@ static const vshCmdInfo info_domcapabilities = {
static const vshCmdOptDef opts_domcapabilities[] = { static const vshCmdOptDef opts_domcapabilities[] = {
{.name = "virttype", {.name = "virttype",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainVirtTypeCompleter, .completer = virshDomainVirtTypeCompleter,
.help = N_("virtualization type (/domain/@type)"), .help = N_("virtualization type (/domain/@type)"),
}, },
{.name = "emulatorbin", {.name = "emulatorbin",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("path to emulator binary (/domain/devices/emulator)"), .help = N_("path to emulator binary (/domain/devices/emulator)"),
}, },
{.name = "arch", {.name = "arch",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshArchCompleter, .completer = virshArchCompleter,
.help = N_("domain architecture (/domain/os/type/@arch)"), .help = N_("domain architecture (/domain/os/type/@arch)"),
}, },
{.name = "machine", {.name = "machine",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("machine type (/domain/os/type/@machine)"), .help = N_("machine type (/domain/os/type/@machine)"),
}, },
{.name = "xpath", {.name = "xpath",
@ -156,6 +160,7 @@ static const vshCmdInfo info_freecell = {
static const vshCmdOptDef opts_freecell[] = { static const vshCmdOptDef opts_freecell[] = {
{.name = "cellno", {.name = "cellno",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.completer = virshCellnoCompleter, .completer = virshCellnoCompleter,
.help = N_("NUMA cell number") .help = N_("NUMA cell number")
}, },
@ -264,11 +269,13 @@ static const vshCmdInfo info_freepages = {
static const vshCmdOptDef opts_freepages[] = { static const vshCmdOptDef opts_freepages[] = {
{.name = "cellno", {.name = "cellno",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.completer = virshCellnoCompleter, .completer = virshCellnoCompleter,
.help = N_("NUMA cell number") .help = N_("NUMA cell number")
}, },
{.name = "pagesize", {.name = "pagesize",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.completer = virshAllocpagesPagesizeCompleter, .completer = virshAllocpagesPagesizeCompleter,
.help = N_("page size (in kibibytes)") .help = N_("page size (in kibibytes)")
}, },
@ -481,6 +488,7 @@ static const vshCmdOptDef opts_allocpages[] = {
}, },
{.name = "cellno", {.name = "cellno",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.completer = virshCellnoCompleter, .completer = virshCellnoCompleter,
.help = N_("NUMA cell number") .help = N_("NUMA cell number")
}, },
@ -582,6 +590,7 @@ static const vshCmdInfo info_maxvcpus = {
static const vshCmdOptDef opts_maxvcpus[] = { static const vshCmdOptDef opts_maxvcpus[] = {
{.name = "type", {.name = "type",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainVirtTypeCompleter, .completer = virshDomainVirtTypeCompleter,
.help = N_("domain type") .help = N_("domain type")
}, },
@ -712,6 +721,7 @@ static const vshCmdInfo info_nodecpustats = {
static const vshCmdOptDef opts_node_cpustats[] = { static const vshCmdOptDef opts_node_cpustats[] = {
{.name = "cpu", {.name = "cpu",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.completer = virshNodeCpuCompleter, .completer = virshNodeCpuCompleter,
.help = N_("prints specified cpu statistics only.") .help = N_("prints specified cpu statistics only.")
}, },
@ -850,6 +860,7 @@ static const vshCmdInfo info_nodememstats = {
static const vshCmdOptDef opts_node_memstats[] = { static const vshCmdOptDef opts_node_memstats[] = {
{.name = "cell", {.name = "cell",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("prints specified cell statistics only.") .help = N_("prints specified cell statistics only.")
}, },
{.name = NULL} {.name = NULL}
@ -1421,16 +1432,19 @@ static const vshCmdInfo info_node_memory_tune = {
static const vshCmdOptDef opts_node_memory_tune[] = { static const vshCmdOptDef opts_node_memory_tune[] = {
{.name = "shm-pages-to-scan", {.name = "shm-pages-to-scan",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("number of pages to scan before the shared memory service " .help = N_("number of pages to scan before the shared memory service "
"goes to sleep") "goes to sleep")
}, },
{.name = "shm-sleep-millisecs", {.name = "shm-sleep-millisecs",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("number of millisecs the shared memory service should " .help = N_("number of millisecs the shared memory service should "
"sleep before next scan") "sleep before next scan")
}, },
{.name = "shm-merge-across-nodes", {.name = "shm-merge-across-nodes",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("Specifies if pages from different numa nodes can be merged") .help = N_("Specifies if pages from different numa nodes can be merged")
}, },
{.name = NULL} {.name = NULL}
@ -1535,20 +1549,24 @@ static const vshCmdOptDef opts_hypervisor_cpu_compare[] = {
VIRSH_COMMON_OPT_FILE(N_("file containing an XML CPU description")), VIRSH_COMMON_OPT_FILE(N_("file containing an XML CPU description")),
{.name = "virttype", {.name = "virttype",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainVirtTypeCompleter, .completer = virshDomainVirtTypeCompleter,
.help = N_("virtualization type (/domain/@type)"), .help = N_("virtualization type (/domain/@type)"),
}, },
{.name = "emulator", {.name = "emulator",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("path to emulator binary (/domain/devices/emulator)"), .help = N_("path to emulator binary (/domain/devices/emulator)"),
}, },
{.name = "arch", {.name = "arch",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshArchCompleter, .completer = virshArchCompleter,
.help = N_("CPU architecture (/domain/os/type/@arch)"), .help = N_("CPU architecture (/domain/os/type/@arch)"),
}, },
{.name = "machine", {.name = "machine",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("machine type (/domain/os/type/@machine)"), .help = N_("machine type (/domain/os/type/@machine)"),
}, },
{.name = "error", {.name = "error",
@ -1637,25 +1655,30 @@ static const vshCmdInfo info_hypervisor_cpu_baseline = {
static const vshCmdOptDef opts_hypervisor_cpu_baseline[] = { static const vshCmdOptDef opts_hypervisor_cpu_baseline[] = {
{.name = "file", {.name = "file",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("file containing XML CPU descriptions"), .help = N_("file containing XML CPU descriptions"),
}, },
{.name = "virttype", {.name = "virttype",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshDomainVirtTypeCompleter, .completer = virshDomainVirtTypeCompleter,
.help = N_("virtualization type (/domain/@type)"), .help = N_("virtualization type (/domain/@type)"),
}, },
{.name = "emulator", {.name = "emulator",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("path to emulator binary (/domain/devices/emulator)"), .help = N_("path to emulator binary (/domain/devices/emulator)"),
}, },
{.name = "arch", {.name = "arch",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshArchCompleter, .completer = virshArchCompleter,
.help = N_("CPU architecture (/domain/os/type/@arch)"), .help = N_("CPU architecture (/domain/os/type/@arch)"),
}, },
{.name = "machine", {.name = "machine",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("machine type (/domain/os/type/@machine)"), .help = N_("machine type (/domain/os/type/@machine)"),
}, },
{.name = "features", {.name = "features",
@ -1668,6 +1691,7 @@ static const vshCmdOptDef opts_hypervisor_cpu_baseline[] = {
}, },
{.name = "model", {.name = "model",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCPUModelCompleter, .completer = virshCPUModelCompleter,
.help = N_("Shortcut for calling the command with a single CPU model " .help = N_("Shortcut for calling the command with a single CPU model "
"and no additional features") "and no additional features")

View File

@ -736,6 +736,7 @@ static const vshCmdOptDef opts_interface_bridge[] = {
}, },
{.name = "delay", {.name = "delay",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("number of seconds to squelch traffic on newly connected ports") .help = N_("number of seconds to squelch traffic on newly connected ports")
}, },
{.name = "no-start", {.name = "no-start",

View File

@ -506,11 +506,13 @@ static const vshCmdOptDef opts_network_metadata[] = {
.help = N_("use an editor to change the metadata") .help = N_("use an editor to change the metadata")
}, },
{.name = "key", {.name = "key",
.unwanted_positional = true,
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.help = N_("key to be used as a namespace identifier"), .help = N_("key to be used as a namespace identifier"),
}, },
{.name = "set", {.name = "set",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("new metadata to set"), .help = N_("new metadata to set"),
}, },
@ -1240,6 +1242,7 @@ static const vshCmdOptDef opts_network_update[] = {
}, },
{.name = "parent-index", {.name = "parent-index",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("which parent object to search through") .help = N_("which parent object to search through")
}, },
VIRSH_COMMON_OPT_CONFIG(N_("affect next network startup")), VIRSH_COMMON_OPT_CONFIG(N_("affect next network startup")),
@ -1579,11 +1582,13 @@ static const vshCmdInfo info_network_event = {
static const vshCmdOptDef opts_network_event[] = { static const vshCmdOptDef opts_network_event[] = {
{.name = "network", {.name = "network",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("filter by network name or uuid"), .help = N_("filter by network name or uuid"),
.completer = virshNetworkNameCompleter, .completer = virshNetworkNameCompleter,
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshNetworkEventNameCompleter, .completer = virshNetworkEventNameCompleter,
.help = N_("which event type to wait for") .help = N_("which event type to wait for")
}, },
@ -1593,6 +1598,7 @@ static const vshCmdOptDef opts_network_event[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("timeout seconds") .help = N_("timeout seconds")
}, },
{.name = "list", {.name = "list",
@ -1694,6 +1700,7 @@ static const vshCmdOptDef opts_network_dhcp_leases[] = {
VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE),
{.name = "mac", {.name = "mac",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.flags = VSH_OFLAG_NONE, .flags = VSH_OFLAG_NONE,
.help = N_("MAC address"), .help = N_("MAC address"),
.completer = virshNetworkDhcpMacCompleter, .completer = virshNetworkDhcpMacCompleter,

View File

@ -365,6 +365,7 @@ static const vshCmdOptDef opts_node_list_devices[] = {
}, },
{.name = "cap", {.name = "cap",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshNodeDeviceCapabilityNameCompleter, .completer = virshNodeDeviceCapabilityNameCompleter,
.help = N_("capability names, separated by comma") .help = N_("capability names, separated by comma")
}, },
@ -643,6 +644,7 @@ static const vshCmdOptDef opts_node_device_detach[] = {
}, },
{.name = "driver", {.name = "driver",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshNodeDevicePCIBackendCompleter, .completer = virshNodeDevicePCIBackendCompleter,
.help = N_("pci device assignment backend driver (e.g. 'vfio' or 'xen')") .help = N_("pci device assignment backend driver (e.g. 'vfio' or 'xen')")
}, },
@ -884,11 +886,13 @@ static const vshCmdInfo info_node_device_event = {
static const vshCmdOptDef opts_node_device_event[] = { static const vshCmdOptDef opts_node_device_event[] = {
{.name = "device", {.name = "device",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("filter by node device name"), .help = N_("filter by node device name"),
.completer = virshNodeDeviceNameCompleter, .completer = virshNodeDeviceNameCompleter,
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshNodeDeviceEventNameCompleter, .completer = virshNodeDeviceEventNameCompleter,
.help = N_("which event type to wait for") .help = N_("which event type to wait for")
}, },
@ -898,6 +902,7 @@ static const vshCmdOptDef opts_node_device_event[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("timeout seconds") .help = N_("timeout seconds")
}, },
{.name = "list", {.name = "list",

View File

@ -1055,6 +1055,7 @@ static const vshCmdOptDef opts_pool_list[] = {
{.name = "type", {.name = "type",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.completer = virshPoolTypeCompleter, .completer = virshPoolTypeCompleter,
.unwanted_positional = true,
.completer_flags = VIRSH_POOL_TYPE_COMPLETER_COMMA, .completer_flags = VIRSH_POOL_TYPE_COMPLETER_COMMA,
.help = N_("only list pool of specified type(s) (if supported)") .help = N_("only list pool of specified type(s) (if supported)")
}, },
@ -1382,16 +1383,19 @@ static const vshCmdOptDef opts_find_storage_pool_sources_as[] = {
}, },
{.name = "host", {.name = "host",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("optional host to query") .help = N_("optional host to query")
}, },
{.name = "port", {.name = "port",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("optional port to query") .help = N_("optional port to query")
}, },
{.name = "initiator", {.name = "initiator",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("optional initiator IQN to use for query") .help = N_("optional initiator IQN to use for query")
}, },
@ -1466,6 +1470,7 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = {
}, },
{.name = "srcSpec", {.name = "srcSpec",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompletePathLocalExisting, .completer = virshCompletePathLocalExisting,
.help = N_("optional file of source xml to query for pools") .help = N_("optional file of source xml to query for pools")
}, },
@ -1901,11 +1906,13 @@ static const vshCmdInfo info_pool_event = {
static const vshCmdOptDef opts_pool_event[] = { static const vshCmdOptDef opts_pool_event[] = {
{.name = "pool", {.name = "pool",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshStoragePoolNameCompleter, .completer = virshStoragePoolNameCompleter,
.help = N_("filter by storage pool name or uuid") .help = N_("filter by storage pool name or uuid")
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshPoolEventNameCompleter, .completer = virshPoolEventNameCompleter,
.help = N_("which event type to wait for") .help = N_("which event type to wait for")
}, },
@ -1915,6 +1922,7 @@ static const vshCmdOptDef opts_pool_event[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("timeout seconds") .help = N_("timeout seconds")
}, },
{.name = "list", {.name = "list",

View File

@ -201,6 +201,7 @@ static const vshCmdOptDef opts_secret_set_value[] = {
}, },
{.name = "base64", {.name = "base64",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("base64-encoded secret value") .help = N_("base64-encoded secret value")
}, },
@ -714,11 +715,13 @@ static const vshCmdInfo info_secret_event = {
static const vshCmdOptDef opts_secret_event[] = { static const vshCmdOptDef opts_secret_event[] = {
{.name = "secret", {.name = "secret",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("filter by secret name or uuid"), .help = N_("filter by secret name or uuid"),
.completer = virshSecretUUIDCompleter, .completer = virshSecretUUIDCompleter,
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshSecretEventNameCompleter, .completer = virshSecretEventNameCompleter,
.help = N_("which event type to wait for") .help = N_("which event type to wait for")
}, },
@ -728,6 +731,7 @@ static const vshCmdOptDef opts_secret_event[] = {
}, },
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("timeout seconds") .help = N_("timeout seconds")
}, },
{.name = "list", {.name = "list",

View File

@ -314,11 +314,13 @@ static const vshCmdOptDef opts_snapshot_create_as[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0), VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "name", {.name = "name",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("name of snapshot") .help = N_("name of snapshot")
}, },
{.name = "description", {.name = "description",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("description of snapshot") .help = N_("description of snapshot")
}, },
@ -1379,6 +1381,7 @@ static const vshCmdOptDef opts_snapshot_list[] = {
}, },
{.name = "from", {.name = "from",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshSnapshotNameCompleter, .completer = virshSnapshotNameCompleter,
.help = N_("limit list to children of given snapshot") .help = N_("limit list to children of given snapshot")
}, },

View File

@ -190,19 +190,23 @@ static const vshCmdOptDef opts_vol_create_as[] = {
}, },
{.name = "allocation", {.name = "allocation",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshCompleteEmpty, .completer = virshCompleteEmpty,
.help = N_("initial allocation size, as scaled integer (default bytes)") .help = N_("initial allocation size, as scaled integer (default bytes)")
}, },
{.name = "format", {.name = "format",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("file format type raw,bochs,qcow,qcow2,qed,vmdk") .help = N_("file format type raw,bochs,qcow,qcow2,qed,vmdk")
}, },
{.name = "backing-vol", {.name = "backing-vol",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("the backing volume if taking a snapshot") .help = N_("the backing volume if taking a snapshot")
}, },
{.name = "backing-vol-format", {.name = "backing-vol-format",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.help = N_("format of backing volume if taking a snapshot") .help = N_("format of backing volume if taking a snapshot")
}, },
{.name = "prealloc-metadata", {.name = "prealloc-metadata",
@ -432,6 +436,7 @@ static const vshCmdOptDef opts_vol_create_from[] = {
VIRSH_COMMON_OPT_VOL_FULL, VIRSH_COMMON_OPT_VOL_FULL,
{.name = "inputpool", {.name = "inputpool",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshStoragePoolNameCompleter, .completer = virshStoragePoolNameCompleter,
.help = N_("pool name or uuid of the input volume's pool") .help = N_("pool name or uuid of the input volume's pool")
}, },
@ -613,10 +618,12 @@ static const vshCmdOptDef opts_vol_upload[] = {
VIRSH_COMMON_OPT_POOL_OPTIONAL, VIRSH_COMMON_OPT_POOL_OPTIONAL,
{.name = "offset", {.name = "offset",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("volume offset to upload to") .help = N_("volume offset to upload to")
}, },
{.name = "length", {.name = "length",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("amount of data to upload") .help = N_("amount of data to upload")
}, },
{.name = "sparse", {.name = "sparse",
@ -721,10 +728,12 @@ static const vshCmdOptDef opts_vol_download[] = {
VIRSH_COMMON_OPT_POOL_OPTIONAL, VIRSH_COMMON_OPT_POOL_OPTIONAL,
{.name = "offset", {.name = "offset",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("volume offset to download from") .help = N_("volume offset to download from")
}, },
{.name = "length", {.name = "length",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.unwanted_positional = true,
.help = N_("amount of data to download") .help = N_("amount of data to download")
}, },
{.name = "sparse", {.name = "sparse",
@ -875,6 +884,7 @@ static const vshCmdOptDef opts_vol_wipe[] = {
VIRSH_COMMON_OPT_POOL_OPTIONAL, VIRSH_COMMON_OPT_POOL_OPTIONAL,
{.name = "algorithm", {.name = "algorithm",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.unwanted_positional = true,
.completer = virshStorageVolWipeAlgorithmCompleter, .completer = virshStorageVolWipeAlgorithmCompleter,
.help = N_("perform selected wiping algorithm") .help = N_("perform selected wiping algorithm")
}, },