From nobody Mon Feb 9 07:38:21 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1710511868082190.21518546377263; Fri, 15 Mar 2024 07:11:08 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 87F911C98; Fri, 15 Mar 2024 10:11:06 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8363F1E9B; Fri, 15 Mar 2024 09:46:35 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 28E901AB9; Fri, 15 Mar 2024 09:45:40 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A34DC1A85 for ; Fri, 15 Mar 2024 09:44:49 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-73-8pxmjQM8O0-gMT4L4wvXcA-1; Fri, 15 Mar 2024 09:44:47 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 46516185A784 for ; Fri, 15 Mar 2024 13:44:47 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8352EC1576F for ; Fri, 15 Mar 2024 13:44:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: 8pxmjQM8O0-gMT4L4wvXcA-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 24/28] virsh: Annodate 'unwanted_positional' arguments Date: Fri, 15 Mar 2024 14:44:19 +0100 Message-ID: <003c0c5e3b50da77a0b1db78c3a31ca73475dae7.1710510137.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: QFTPGH5PD4EKPHKEOI4IWU54HFII6K7F X-Message-ID-Hash: QFTPGH5PD4EKPHKEOI4IWU54HFII6K7F X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1710511869190100001 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 2 3 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 --- tools/virsh-checkpoint.c | 3 ++ tools/virsh-domain-event.c | 3 ++ tools/virsh-domain-monitor.c | 2 + tools/virsh-domain.c | 75 ++++++++++++++++++++++++++++++++++++ tools/virsh-host.c | 24 ++++++++++++ tools/virsh-interface.c | 1 + tools/virsh-network.c | 7 ++++ tools/virsh-nodedev.c | 5 +++ tools/virsh-pool.c | 8 ++++ tools/virsh-secret.c | 4 ++ tools/virsh-snapshot.c | 3 ++ tools/virsh-volume.c | 10 +++++ 12 files changed, 145 insertions(+) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 7151e2b182..48e3a586e4 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -189,11 +189,13 @@ static const vshCmdOptDef opts_checkpoint_create_as[]= =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "name", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("name of checkpoint") }, {.name =3D "description", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("description of checkpoint") }, @@ -630,6 +632,7 @@ static const vshCmdOptDef opts_checkpoint_list[] =3D { }, {.name =3D "from", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("limit list to children of given checkpoint"), .completer =3D virshCheckpointNameCompleter, }, diff --git a/tools/virsh-domain-event.c b/tools/virsh-domain-event.c index 73b00f3bb2..8bf57ade7a 100644 --- a/tools/virsh-domain-event.c +++ b/tools/virsh-domain-event.c @@ -867,11 +867,13 @@ static const vshCmdInfo info_event =3D { static const vshCmdOptDef opts_event[] =3D { {.name =3D "domain", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("filter by domain name, id or uuid"), .completer =3D virshDomainNameCompleter, }, {.name =3D "event", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainEventNameCompleter, .help =3D N_("which event type to wait for") }, @@ -885,6 +887,7 @@ static const vshCmdOptDef opts_event[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("timeout seconds") }, {.name =3D "list", diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 71a5086c00..d88cf64235 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1349,6 +1349,7 @@ static const vshCmdOptDef opts_domtime[] =3D { }, {.name =3D "time", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("time to set") }, {.name =3D NULL} @@ -2231,6 +2232,7 @@ static const vshCmdOptDef opts_domifaddr[] =3D { .help =3D N_("always display names and MACs of interfaces")}, {.name =3D "source", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .flags =3D VSH_OFLAG_NONE, .completer =3D virshDomainInterfaceAddrSourceCompleter, .help =3D N_("address source: 'lease', 'agent', or 'arp'")}, diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 9a41e32e3d..600388dceb 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -844,34 +844,41 @@ static const vshCmdOptDef opts_attach_interface[] =3D= { }, {.name =3D "target", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("target network name") }, {.name =3D "mac", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("MAC address") }, {.name =3D "script", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("script used to bridge network interface") }, {.name =3D "model", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("model type") }, {.name =3D "alias", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("custom alias name of interface device") }, {.name =3D "inbound", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("control domain's incoming traffics") }, {.name =3D "outbound", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("control domain's outgoing traffics") }, @@ -889,6 +896,7 @@ static const vshCmdOptDef opts_attach_interface[] =3D { }, {.name =3D "source-mode", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainInterfaceSourceModeCompleter, .help =3D N_("mode attribute of element") }, @@ -1550,30 +1558,36 @@ static const vshCmdOptDef opts_blkiotune[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "weight", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("IO Weight") }, {.name =3D "device-weights", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("per-device IO Weights, in the form of /path/to/device,w= eight,...") }, {.name =3D "device-read-iops-sec", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("per-device read I/O limit per second, in the form of /p= ath/to/device,read_iops_sec,...") }, {.name =3D "device-write-iops-sec", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("per-device write I/O limit per second, in the form of /= path/to/device,write_iops_sec,...") }, {.name =3D "device-read-bytes-sec", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("per-device bytes read per second, in the form of /path/= to/device,read_bytes_sec,...") }, {.name =3D "device-write-bytes-sec", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D 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[] =3D { }, {.name =3D "bandwidth", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("bandwidth limit in MiB/s") }, {.name =3D "base", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainBlockjobBaseTopCompleter, .help =3D N_("path of base file to commit into (default bottom of cha= in)") }, @@ -2044,6 +2060,7 @@ static const vshCmdOptDef opts_blockcommit[] =3D { }, {.name =3D "top", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainBlockjobBaseTopCompleter, .help =3D N_("path of top file to commit from (default top of chain)") }, @@ -2066,6 +2083,7 @@ static const vshCmdOptDef opts_blockcommit[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("implies --wait, abort if copy exceeds timeout (in secon= ds)") }, {.name =3D "pivot", @@ -2251,10 +2269,12 @@ static const vshCmdOptDef opts_blockcopy[] =3D { }, {.name =3D "dest", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("path of the copy to create") }, {.name =3D "bandwidth", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("bandwidth limit in MiB/s") }, {.name =3D "shallow", @@ -2283,6 +2303,7 @@ static const vshCmdOptDef opts_blockcopy[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("implies --wait, abort if copy exceeds timeout (in secon= ds)") }, {.name =3D "pivot", @@ -2299,21 +2320,25 @@ static const vshCmdOptDef opts_blockcopy[] =3D { }, {.name =3D "xml", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("filename containing XML description of the copy destina= tion") }, {.name =3D "format", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .flags =3D VSH_OFLAG_NONE, .completer =3D virshDomainStorageFileFormatCompleter, .help =3D N_("format of the destination file") }, {.name =3D "granularity", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("power-of-two granularity to use during the copy") }, {.name =3D "buf-size", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("maximum amount of in-flight data during the copy") }, {.name =3D "bytes", @@ -2608,6 +2633,7 @@ static const vshCmdOptDef opts_blockjob[] =3D { }, {.name =3D "bandwidth", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("set the bandwidth limit in MiB/s") }, {.name =3D NULL} @@ -2796,10 +2822,12 @@ static const vshCmdOptDef opts_blockpull[] =3D { }, {.name =3D "bandwidth", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("bandwidth limit in MiB/s") }, {.name =3D "base", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainBlockjobBaseTopCompleter, .help =3D N_("path of backing file in chain for a partial pull") }, @@ -2813,6 +2841,7 @@ static const vshCmdOptDef opts_blockpull[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("with --wait, abort if pull exceeds timeout (in seconds)= ") }, {.name =3D "async", @@ -3000,6 +3029,7 @@ static const vshCmdOptDef opts_console[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "devname", /* sc_prohibit_devname */ .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainConsoleCompleter, .help =3D N_("character device name") }, @@ -3246,11 +3276,13 @@ static const vshCmdOptDef opts_domiftune[] =3D { }, {.name =3D "inbound", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("control domain's incoming traffics") }, {.name =3D "outbound", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("control domain's outgoing traffics") }, @@ -3568,6 +3600,7 @@ static const vshCmdOptDef opts_undefine[] =3D { }, {.name =3D "storage", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainUndefineStorageDisksCompleter, .help =3D N_("remove associated storage volumes (comma separated list= of " "targets or source paths) (see domblklist)") @@ -4013,6 +4046,7 @@ static const vshCmdOptDef opts_start[] =3D { }, {.name =3D "pass-fds", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("pass file descriptors N,M,... to the guest") }, @@ -4159,6 +4193,7 @@ static const vshCmdOptDef opts_save[] =3D { }, {.name =3D "xml", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("filename containing updated XML for the target") }, @@ -5250,6 +5285,7 @@ static const vshCmdOptDef opts_restore[] =3D { }, {.name =3D "xml", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("filename containing updated XML for the target") }, @@ -5352,6 +5388,7 @@ static const vshCmdOptDef opts_dump[] =3D { {.name =3D "format", .type =3D VSH_OT_STRING, .flags =3D VSH_OFLAG_NONE, + .unwanted_positional =3D true, .completer =3D virshDomainCoreDumpFormatCompleter, .help =3D N_("specify the format of memory-only dump") }, @@ -5495,11 +5532,13 @@ static const vshCmdOptDef opts_screenshot[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "file", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("where to store the screenshot") }, {.name =3D "screen", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("ID of a screen to take screenshot of") }, {.name =3D NULL} @@ -6834,11 +6873,13 @@ static const vshCmdOptDef opts_vcpupin[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "vcpu", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .completer =3D virshDomainVcpuCompleter, .help =3D N_("vcpu number") }, {.name =3D "cpulist", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .flags =3D VSH_OFLAG_EMPTY_OK, .completer =3D virshDomainCpulistCompleter, .help =3D N_("host cpu number(s) to set, or omit option to query") @@ -7047,6 +7088,7 @@ static const vshCmdOptDef opts_emulatorpin[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "cpulist", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .flags =3D VSH_OFLAG_EMPTY_OK, .completer =3D virshDomainCpulistCompleter, .help =3D N_("host cpu number(s) to set, or omit option to query") @@ -7231,6 +7273,7 @@ static const vshCmdOptDef opts_guestvcpus[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "cpulist", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainVcpulistViaAgentCompleter, .help =3D N_("list of cpus to enable or disable") }, @@ -7653,22 +7696,27 @@ static const vshCmdOptDef opts_iothreadset[] =3D { }, {.name =3D "poll-max-ns", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("set the maximum IOThread polling time in ns") }, {.name =3D "poll-grow", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("set the value to increase the IOThread polling time") }, {.name =3D "poll-shrink", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("set the value for reduction of the IOThread polling tim= e") }, {.name =3D "thread-pool-min", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("lower boundary for worker thread pool") }, {.name =3D "thread-pool-max", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("upper boundary for worker thread pool") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -7824,10 +7872,12 @@ static const vshCmdOptDef opts_cpu_stats[] =3D { }, {.name =3D "start", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Show statistics from this CPU") }, {.name =3D "count", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Number of shown CPUs at most") }, {.name =3D NULL} @@ -8010,6 +8060,7 @@ static const vshCmdOptDef opts_create[] =3D { }, {.name =3D "pass-fds", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("pass file descriptors N,M,... to the guest") }, @@ -8368,10 +8419,12 @@ static const vshCmdOptDef opts_metadata[] =3D { }, {.name =3D "key", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("key to be used as a namespace identifier"), }, {.name =3D "set", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("new metadata to set"), }, @@ -8856,15 +8909,18 @@ static const vshCmdOptDef opts_update_memory_device= [] =3D { }, {.name =3D "alias", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainDeviceAliasCompleter, .help =3D N_("memory device alias") }, {.name =3D "node", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("memory device target node") }, {.name =3D "requested-size", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("new value of size, as scaled integer (defa= ult KiB)") }, {.name =3D NULL} @@ -8998,18 +9054,22 @@ static const vshCmdOptDef opts_memtune[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "hard-limit", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Max memory, as scaled integer (default KiB)") }, {.name =3D "soft-limit", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Memory during contention, as scaled integer (default Ki= B)") }, {.name =3D "swap-hard-limit", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Max memory plus swap, as scaled integer (default KiB)") }, {.name =3D "min-guarantee", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Min guaranteed memory, as scaled integer (default KiB)") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -9165,11 +9225,13 @@ static const vshCmdOptDef opts_perf[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "enable", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainPerfEnableCompleter, .help =3D N_("perf events which will be enabled") }, {.name =3D "disable", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainPerfDisableCompleter, .help =3D N_("perf events which will be disabled") }, @@ -9289,12 +9351,14 @@ static const vshCmdOptDef opts_numatune[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "mode", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainNumatuneModeCompleter, .help =3D N_("NUMA mode, one of strict, preferred and interleave " "or a number from the virDomainNumatuneMemMode enum") }, {.name =3D "nodeset", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("NUMA node selections to set") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -9470,6 +9534,7 @@ static const vshCmdOptDef opts_domsetlaunchsecstate[]= =3D { }, {.name =3D "set-address", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("physical address within the guest domain's memory to se= t the secret"), }, {.name =3D NULL} @@ -9872,11 +9937,13 @@ static const vshCmdInfo info_qemu_monitor_event =3D= { static const vshCmdOptDef opts_qemu_monitor_event[] =3D { {.name =3D "domain", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("filter by domain name, id or uuid"), .completer =3D virshDomainNameCompleter, }, {.name =3D "event", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("filter by event name") }, {.name =3D "pretty", @@ -9889,6 +9956,7 @@ static const vshCmdOptDef opts_qemu_monitor_event[] = =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("timeout seconds") }, {.name =3D "regex", @@ -10379,6 +10447,7 @@ static const vshCmdOptDef opts_domxmltonative[] =3D= { }, {.name =3D "xml", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("xml data file to export from") }, @@ -11871,6 +11940,7 @@ static const vshCmdOptDef opts_domhostname[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "source", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .flags =3D VSH_OFLAG_NONE, .completer =3D virshDomainHostnameSourceCompleter, .help =3D N_("address source: 'lease' or 'agent'")}, @@ -12144,6 +12214,7 @@ static const vshCmdOptDef opts_detach_interface[] = =3D { }, {.name =3D "mac", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainInterfaceCompleter, .completer_flags =3D VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC, .help =3D N_("MAC address") @@ -12823,11 +12894,13 @@ static const vshCmdOptDef opts_domfstrim[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "minimum", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Just a hint to ignore contiguous " "free ranges smaller than this (Bytes)") }, {.name =3D "mountpoint", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainFSMountpointsCompleter, .help =3D N_("which mount point to trim") }, @@ -13295,11 +13368,13 @@ static const vshCmdOptDef opts_domdirtyrate_calc[= ] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "seconds", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("calculate memory dirty rate within specified seconds, " "the supported value range from 1 to 60, default to 1.") }, {.name =3D "mode", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainDirtyRateCalcModeCompleter, .help =3D N_("dirty page rate calculation mode, either of these 3 opt= ions " "'page-sampling, dirty-bitmap, dirty-ring' can be specifie= d.") diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 712db39d35..52e0dc55de 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -86,20 +86,24 @@ static const vshCmdInfo info_domcapabilities =3D { static const vshCmdOptDef opts_domcapabilities[] =3D { {.name =3D "virttype", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainVirtTypeCompleter, .help =3D N_("virtualization type (/domain/@type)"), }, {.name =3D "emulatorbin", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("path to emulator binary (/domain/devices/emulator)"), }, {.name =3D "arch", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshArchCompleter, .help =3D N_("domain architecture (/domain/os/type/@arch)"), }, {.name =3D "machine", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("machine type (/domain/os/type/@machine)"), }, {.name =3D "xpath", @@ -156,6 +160,7 @@ static const vshCmdInfo info_freecell =3D { static const vshCmdOptDef opts_freecell[] =3D { {.name =3D "cellno", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .completer =3D virshCellnoCompleter, .help =3D N_("NUMA cell number") }, @@ -264,11 +269,13 @@ static const vshCmdInfo info_freepages =3D { static const vshCmdOptDef opts_freepages[] =3D { {.name =3D "cellno", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .completer =3D virshCellnoCompleter, .help =3D N_("NUMA cell number") }, {.name =3D "pagesize", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .completer =3D virshAllocpagesPagesizeCompleter, .help =3D N_("page size (in kibibytes)") }, @@ -481,6 +488,7 @@ static const vshCmdOptDef opts_allocpages[] =3D { }, {.name =3D "cellno", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .completer =3D virshCellnoCompleter, .help =3D N_("NUMA cell number") }, @@ -582,6 +590,7 @@ static const vshCmdInfo info_maxvcpus =3D { static const vshCmdOptDef opts_maxvcpus[] =3D { {.name =3D "type", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainVirtTypeCompleter, .help =3D N_("domain type") }, @@ -712,6 +721,7 @@ static const vshCmdInfo info_nodecpustats =3D { static const vshCmdOptDef opts_node_cpustats[] =3D { {.name =3D "cpu", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .completer =3D virshNodeCpuCompleter, .help =3D N_("prints specified cpu statistics only.") }, @@ -850,6 +860,7 @@ static const vshCmdInfo info_nodememstats =3D { static const vshCmdOptDef opts_node_memstats[] =3D { {.name =3D "cell", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("prints specified cell statistics only.") }, {.name =3D NULL} @@ -1421,16 +1432,19 @@ static const vshCmdInfo info_node_memory_tune =3D { static const vshCmdOptDef opts_node_memory_tune[] =3D { {.name =3D "shm-pages-to-scan", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("number of pages to scan before the shared memory servi= ce " "goes to sleep") }, {.name =3D "shm-sleep-millisecs", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("number of millisecs the shared memory service should " "sleep before next scan") }, {.name =3D "shm-merge-across-nodes", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("Specifies if pages from different numa nodes can be me= rged") }, {.name =3D NULL} @@ -1535,20 +1549,24 @@ static const vshCmdOptDef opts_hypervisor_cpu_compa= re[] =3D { VIRSH_COMMON_OPT_FILE(N_("file containing an XML CPU description")), {.name =3D "virttype", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainVirtTypeCompleter, .help =3D N_("virtualization type (/domain/@type)"), }, {.name =3D "emulator", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("path to emulator binary (/domain/devices/emulator)"), }, {.name =3D "arch", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshArchCompleter, .help =3D N_("CPU architecture (/domain/os/type/@arch)"), }, {.name =3D "machine", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("machine type (/domain/os/type/@machine)"), }, {.name =3D "error", @@ -1637,25 +1655,30 @@ static const vshCmdInfo info_hypervisor_cpu_baselin= e =3D { static const vshCmdOptDef opts_hypervisor_cpu_baseline[] =3D { {.name =3D "file", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("file containing XML CPU descriptions"), }, {.name =3D "virttype", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshDomainVirtTypeCompleter, .help =3D N_("virtualization type (/domain/@type)"), }, {.name =3D "emulator", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("path to emulator binary (/domain/devices/emulator)"), }, {.name =3D "arch", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshArchCompleter, .help =3D N_("CPU architecture (/domain/os/type/@arch)"), }, {.name =3D "machine", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("machine type (/domain/os/type/@machine)"), }, {.name =3D "features", @@ -1668,6 +1691,7 @@ static const vshCmdOptDef opts_hypervisor_cpu_baselin= e[] =3D { }, {.name =3D "model", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCPUModelCompleter, .help =3D N_("Shortcut for calling the command with a single CPU mode= l " "and no additional features") diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 1b1344c17c..a08bb822ed 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -736,6 +736,7 @@ static const vshCmdOptDef opts_interface_bridge[] =3D { }, {.name =3D "delay", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("number of seconds to squelch traffic on newly connected= ports") }, {.name =3D "no-start", diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 59ca842181..5bc91a361f 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -506,11 +506,13 @@ static const vshCmdOptDef opts_network_metadata[] =3D= { .help =3D N_("use an editor to change the metadata") }, {.name =3D "key", + .unwanted_positional =3D true, .type =3D VSH_OT_STRING, .help =3D N_("key to be used as a namespace identifier"), }, {.name =3D "set", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("new metadata to set"), }, @@ -1240,6 +1242,7 @@ static const vshCmdOptDef opts_network_update[] =3D { }, {.name =3D "parent-index", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("which parent object to search through") }, VIRSH_COMMON_OPT_CONFIG(N_("affect next network startup")), @@ -1579,11 +1582,13 @@ static const vshCmdInfo info_network_event =3D { static const vshCmdOptDef opts_network_event[] =3D { {.name =3D "network", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("filter by network name or uuid"), .completer =3D virshNetworkNameCompleter, }, {.name =3D "event", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshNetworkEventNameCompleter, .help =3D N_("which event type to wait for") }, @@ -1593,6 +1598,7 @@ static const vshCmdOptDef opts_network_event[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("timeout seconds") }, {.name =3D "list", @@ -1694,6 +1700,7 @@ static const vshCmdOptDef opts_network_dhcp_leases[] = =3D { VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), {.name =3D "mac", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .flags =3D VSH_OFLAG_NONE, .help =3D N_("MAC address"), .completer =3D virshNetworkDhcpMacCompleter, diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 90cfc187e5..fafebf9972 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -365,6 +365,7 @@ static const vshCmdOptDef opts_node_list_devices[] =3D { }, {.name =3D "cap", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshNodeDeviceCapabilityNameCompleter, .help =3D N_("capability names, separated by comma") }, @@ -643,6 +644,7 @@ static const vshCmdOptDef opts_node_device_detach[] =3D= { }, {.name =3D "driver", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshNodeDevicePCIBackendCompleter, .help =3D N_("pci device assignment backend driver (e.g. 'vfio' or 'x= en')") }, @@ -884,11 +886,13 @@ static const vshCmdInfo info_node_device_event =3D { static const vshCmdOptDef opts_node_device_event[] =3D { {.name =3D "device", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("filter by node device name"), .completer =3D virshNodeDeviceNameCompleter, }, {.name =3D "event", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshNodeDeviceEventNameCompleter, .help =3D N_("which event type to wait for") }, @@ -898,6 +902,7 @@ static const vshCmdOptDef opts_node_device_event[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("timeout seconds") }, {.name =3D "list", diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 66f8516017..c93204dd30 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1055,6 +1055,7 @@ static const vshCmdOptDef opts_pool_list[] =3D { {.name =3D "type", .type =3D VSH_OT_STRING, .completer =3D virshPoolTypeCompleter, + .unwanted_positional =3D true, .completer_flags =3D VIRSH_POOL_TYPE_COMPLETER_COMMA, .help =3D N_("only list pool of specified type(s) (if supported)") }, @@ -1382,16 +1383,19 @@ static const vshCmdOptDef opts_find_storage_pool_so= urces_as[] =3D { }, {.name =3D "host", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("optional host to query") }, {.name =3D "port", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("optional port to query") }, {.name =3D "initiator", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("optional initiator IQN to use for query") }, @@ -1466,6 +1470,7 @@ static const vshCmdOptDef opts_find_storage_pool_sour= ces[] =3D { }, {.name =3D "srcSpec", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompletePathLocalExisting, .help =3D N_("optional file of source xml to query for pools") }, @@ -1901,11 +1906,13 @@ static const vshCmdInfo info_pool_event =3D { static const vshCmdOptDef opts_pool_event[] =3D { {.name =3D "pool", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshStoragePoolNameCompleter, .help =3D N_("filter by storage pool name or uuid") }, {.name =3D "event", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshPoolEventNameCompleter, .help =3D N_("which event type to wait for") }, @@ -1915,6 +1922,7 @@ static const vshCmdOptDef opts_pool_event[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("timeout seconds") }, {.name =3D "list", diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 7e10afa765..edf3c47362 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -201,6 +201,7 @@ static const vshCmdOptDef opts_secret_set_value[] =3D { }, {.name =3D "base64", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("base64-encoded secret value") }, @@ -714,11 +715,13 @@ static const vshCmdInfo info_secret_event =3D { static const vshCmdOptDef opts_secret_event[] =3D { {.name =3D "secret", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("filter by secret name or uuid"), .completer =3D virshSecretUUIDCompleter, }, {.name =3D "event", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshSecretEventNameCompleter, .help =3D N_("which event type to wait for") }, @@ -728,6 +731,7 @@ static const vshCmdOptDef opts_secret_event[] =3D { }, {.name =3D "timeout", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("timeout seconds") }, {.name =3D "list", diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index b47733d05b..2fcf6e3d5e 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -314,11 +314,13 @@ static const vshCmdOptDef opts_snapshot_create_as[] = =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "name", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("name of snapshot") }, {.name =3D "description", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("description of snapshot") }, @@ -1379,6 +1381,7 @@ static const vshCmdOptDef opts_snapshot_list[] =3D { }, {.name =3D "from", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshSnapshotNameCompleter, .help =3D N_("limit list to children of given snapshot") }, diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 7e6c6d5ef5..4e5673e0ee 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -190,19 +190,23 @@ static const vshCmdOptDef opts_vol_create_as[] =3D { }, {.name =3D "allocation", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshCompleteEmpty, .help =3D N_("initial allocation size, as scaled integer (default byt= es)") }, {.name =3D "format", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("file format type raw,bochs,qcow,qcow2,qed,vmdk") }, {.name =3D "backing-vol", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("the backing volume if taking a snapshot") }, {.name =3D "backing-vol-format", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .help =3D N_("format of backing volume if taking a snapshot") }, {.name =3D "prealloc-metadata", @@ -432,6 +436,7 @@ static const vshCmdOptDef opts_vol_create_from[] =3D { VIRSH_COMMON_OPT_VOL_FULL, {.name =3D "inputpool", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshStoragePoolNameCompleter, .help =3D N_("pool name or uuid of the input volume's pool") }, @@ -613,10 +618,12 @@ static const vshCmdOptDef opts_vol_upload[] =3D { VIRSH_COMMON_OPT_POOL_OPTIONAL, {.name =3D "offset", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("volume offset to upload to") }, {.name =3D "length", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("amount of data to upload") }, {.name =3D "sparse", @@ -721,10 +728,12 @@ static const vshCmdOptDef opts_vol_download[] =3D { VIRSH_COMMON_OPT_POOL_OPTIONAL, {.name =3D "offset", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("volume offset to download from") }, {.name =3D "length", .type =3D VSH_OT_INT, + .unwanted_positional =3D true, .help =3D N_("amount of data to download") }, {.name =3D "sparse", @@ -875,6 +884,7 @@ static const vshCmdOptDef opts_vol_wipe[] =3D { VIRSH_COMMON_OPT_POOL_OPTIONAL, {.name =3D "algorithm", .type =3D VSH_OT_STRING, + .unwanted_positional =3D true, .completer =3D virshStorageVolWipeAlgorithmCompleter, .help =3D N_("perform selected wiping algorithm") }, --=20 2.44.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org