From nobody Sat Feb 7 07:11:34 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 171016055635214.650507404252835; Mon, 11 Mar 2024 05:35:56 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CF1981DDE; Mon, 11 Mar 2024 08:35:54 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7A3731F10; Mon, 11 Mar 2024 07:36:37 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EF22B1DF2; Mon, 11 Mar 2024 07:32:30 -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 D05E31DF7 for ; Mon, 11 Mar 2024 07:31:25 -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-671-SkCyeGOhOHCjLtJpIdtM5g-1; Mon, 11 Mar 2024 07:31:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 B38B2185A781 for ; Mon, 11 Mar 2024 11:31:23 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C1D9112131D for ; Mon, 11 Mar 2024 11:31:22 +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,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: SkCyeGOhOHCjLtJpIdtM5g-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 22/23] vsh: remove VSH_OFLAG_REQ Date: Mon, 11 Mar 2024 12:30:59 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: NV6IB764ZMIZ2MDTRVZGH6FEA7VTQE3V X-Message-ID-Hash: NV6IB764ZMIZ2MDTRVZGH6FEA7VTQE3V 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: 1710160557724100001 The flag was replaced by the 'required' field in the option definition. Remove last few uses and all assignments. Signed-off-by: Peter Krempa --- tools/virsh-domain-monitor.c | 2 -- tools/virsh-domain.c | 62 +----------------------------------- tools/virsh-host.c | 5 --- tools/virsh-interface.c | 6 ---- tools/virsh-network.c | 7 ---- tools/virsh-nodedev.c | 10 ------ tools/virsh-nwfilter.c | 5 --- tools/virsh-pool.c | 4 --- tools/virsh-secret.c | 4 --- tools/virsh-snapshot.c | 1 - tools/virsh-volume.c | 6 ---- tools/virsh.h | 3 -- tools/virt-admin.c | 12 +------ tools/vsh.c | 8 ++--- tools/vsh.h | 1 - 15 files changed, 6 insertions(+), 130 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 568ff770a1..6c2499fb9f 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -740,7 +740,6 @@ static const vshCmdOptDef opts_domif_getlink[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainInterfaceCompleter, .help =3D N_("interface device (MAC Address)") }, @@ -1042,7 +1041,6 @@ static const vshCmdOptDef opts_domifstat[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainInterfaceCompleter, .help =3D N_("interface device specified by name or MAC Address") }, diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1dbef9a7a6..7c2613c85b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -422,14 +422,13 @@ static const vshCmdOptDef opts_attach_disk[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ | VSH_OFLAG_EMPTY_OK, + .flags =3D VSH_OFLAG_EMPTY_OK, .help =3D N_("source of disk device or name of network disk") }, {.name =3D "target", .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("target of disk device") }, @@ -818,14 +817,12 @@ static const vshCmdOptDef opts_attach_interface[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network interface type") }, {.name =3D "source", .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("source of network interface") }, {.name =3D "target", @@ -1198,7 +1195,6 @@ static const vshCmdOptDef opts_blkdeviotune[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("block device") }, @@ -1993,7 +1989,6 @@ static const vshCmdOptDef opts_blockcommit[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("fully-qualified path of disk") }, @@ -2214,7 +2209,6 @@ static const vshCmdOptDef opts_blockcopy[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("fully-qualified path of source disk") }, @@ -2548,7 +2542,6 @@ static const vshCmdOptDef opts_blockjob[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("fully-qualified path of disk") }, @@ -2761,7 +2754,6 @@ static const vshCmdOptDef opts_blockpull[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("fully-qualified path of disk") }, @@ -2905,7 +2897,6 @@ static const vshCmdOptDef opts_blockresize[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("Fully-qualified path of block device") }, @@ -3064,7 +3055,6 @@ static const vshCmdOptDef opts_domif_setlink[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainInterfaceCompleter, .help =3D N_("interface device (MAC Address)") }, @@ -3072,7 +3062,6 @@ static const vshCmdOptDef opts_domif_setlink[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainInterfaceStateCompleter, .help =3D N_("new state of the device") }, @@ -3214,7 +3203,6 @@ static const vshCmdOptDef opts_domiftune[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainInterfaceCompleter, .help =3D N_("interface device (MAC Address)") }, @@ -3441,7 +3429,6 @@ static const vshCmdOptDef opts_dom_pm_suspend[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshNodeSuspendTargetCompleter, .help =3D N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), " @@ -4126,7 +4113,6 @@ static const vshCmdOptDef opts_save[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("where to save the data") }, {.name =3D "bypass-cache", @@ -4477,7 +4463,6 @@ static const vshCmdOptDef opts_save_image_dumpxml[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("saved state file to read") }, {.name =3D "security-info", @@ -4536,14 +4521,12 @@ static const vshCmdOptDef opts_save_image_define[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("saved state file to modify") }, {.name =3D "xml", .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompletePathLocalExisting, .help =3D N_("filename containing updated XML for the target") }, @@ -4603,7 +4586,6 @@ static const vshCmdOptDef opts_save_image_edit[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("saved state file to edit") }, {.name =3D "running", @@ -4944,7 +4926,6 @@ static const vshCmdOptDef opts_managed_save_define[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompletePathLocalExisting, .help =3D N_("filename containing updated XML for the target") }, @@ -5222,7 +5203,6 @@ static const vshCmdOptDef opts_restore[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("the state to restore") }, {.name =3D "bypass-cache", @@ -5307,7 +5287,6 @@ static const vshCmdOptDef opts_dump[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("where to dump the core") }, VIRSH_COMMON_OPT_LIVE(N_("perform a live core dump if supported")), @@ -5608,7 +5587,6 @@ static const vshCmdOptDef opts_setLifecycleAction[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainLifecycleCompleter, .help =3D N_("lifecycle type to modify") }, @@ -5616,7 +5594,6 @@ static const vshCmdOptDef opts_setLifecycleAction[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainLifecycleActionCompleter, .help =3D N_("lifecycle action to set") }, @@ -5704,14 +5681,12 @@ static const vshCmdOptDef opts_set_user_password[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("the username") }, {.name =3D "password", .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("the new password") }, @@ -7128,7 +7103,6 @@ static const vshCmdOptDef opts_setvcpus[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("number of virtual CPUs") }, {.name =3D "maximum", @@ -7296,7 +7270,6 @@ static const vshCmdOptDef opts_setvcpu[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainVcpulistCompleter, .help =3D N_("ids of vcpus to manipulate") }, @@ -7372,7 +7345,6 @@ static const vshCmdOptDef opts_domblkthreshold[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("device to set threshold for") }, @@ -7380,7 +7352,6 @@ static const vshCmdOptDef opts_domblkthreshold[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("threshold as a scaled number (by default bytes)") }, {.name =3D NULL} @@ -7504,7 +7475,6 @@ static const vshCmdOptDef opts_iothreadpin[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainIOThreadIdCompleter, .help =3D N_("IOThread ID number") }, @@ -7512,7 +7482,6 @@ static const vshCmdOptDef opts_iothreadpin[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainCpulistCompleter, .help =3D N_("host cpu number(s) to set") }, @@ -7581,7 +7550,6 @@ static const vshCmdOptDef opts_iothreadadd[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("iothread for the new IOThread") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -7639,7 +7607,6 @@ static const vshCmdOptDef opts_iothreadset[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainIOThreadIdCompleter, .help =3D N_("iothread id of existing IOThread") }, @@ -7757,7 +7724,6 @@ static const vshCmdOptDef opts_iothreaddel[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainIOThreadIdCompleter, .help =3D N_("iothread_id for the IOThread to delete") }, @@ -8368,7 +8334,6 @@ static const vshCmdOptDef opts_metadata[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("URI of the namespace") }, VIRSH_COMMON_OPT_LIVE(N_("modify/get running state")), @@ -8547,7 +8512,6 @@ static const vshCmdOptDef opts_send_key[] =3D { {.name =3D "keycode", .type =3D VSH_OT_ARGV, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshKeycodeNameCompleter, .help =3D N_("the key code") }, @@ -8633,7 +8597,6 @@ static const vshCmdOptDef opts_send_process_signal[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("the process ID") }, @@ -8641,7 +8604,6 @@ static const vshCmdOptDef opts_send_process_signal[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainSignalCompleter, .help =3D N_("the signal number or name") }, @@ -8731,7 +8693,6 @@ static const vshCmdOptDef opts_setmem[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("new memory size, as scaled integer (default KiB)") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -8802,7 +8763,6 @@ static const vshCmdOptDef opts_setmaxmem[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("new maximum memory size, as scaled integer (default KiB= )") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -9577,7 +9537,6 @@ static const vshCmdOptDef opts_dom_fd_associate[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("name of the FD group") }, @@ -9585,7 +9544,6 @@ static const vshCmdOptDef opts_dom_fd_associate[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("file descriptors N,M,... to associate") }, @@ -9662,7 +9620,6 @@ static const vshCmdOptDef opts_qemu_monitor_command[]= =3D { {.name =3D "cmd", .type =3D VSH_OT_ARGV, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("command") }, {.name =3D NULL} @@ -9999,7 +9956,6 @@ static const vshCmdOptDef opts_qemu_attach[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("pid") }, @@ -10057,7 +10013,6 @@ static const vshCmdOptDef opts_qemu_agent_command[]= =3D { {.name =3D "cmd", .type =3D VSH_OT_ARGV, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("command") }, {.name =3D NULL} @@ -10154,7 +10109,6 @@ static const vshCmdOptDef opts_lxc_enter_namespace[= ] =3D { {.name =3D "cmd", .type =3D VSH_OT_ARGV, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("command to run") }, {.name =3D NULL} @@ -10335,14 +10289,12 @@ static const vshCmdOptDef opts_domxmlfromnative[]= =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("source config data format") }, {.name =3D "config", .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompletePathLocalExisting, .help =3D N_("config data file to import from") }, @@ -10387,7 +10339,6 @@ static const vshCmdOptDef opts_domxmltonative[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("target config data type format") }, VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(VSH_OFLAG_REQ_OPT, 0), @@ -10456,7 +10407,6 @@ static const vshCmdOptDef opts_domname[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainUUIDCompleter, .help =3D N_("domain id or uuid") }, @@ -10491,7 +10441,6 @@ static const vshCmdOptDef opts_domrename[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("new domain name") }, @@ -10595,7 +10544,6 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("connection URI of the destination host as seen from the= client(normal migration) or source(p2p migration)") }, @@ -11294,7 +11242,6 @@ static const vshCmdOptDef opts_migrate_setmaxdownti= me[] =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("maximum tolerable downtime (in milliseconds) for migrat= ion") }, {.name =3D NULL} @@ -11414,7 +11361,6 @@ static const vshCmdOptDef opts_migrate_setspeed[] = =3D { .type =3D VSH_OT_INT, .required =3D true, .positional =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("migration bandwidth limit in MiB/s") }, {.name =3D "postcopy", @@ -12005,7 +11951,6 @@ static const vshCmdOptDef opts_detach_device_alias[= ] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDeviceAliasCompleter, .help =3D N_("device alias") }, @@ -12135,7 +12080,6 @@ static const vshCmdOptDef opts_detach_interface[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network interface type") }, {.name =3D "mac", @@ -12509,7 +12453,6 @@ static const vshCmdOptDef opts_detach_disk[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("target of disk device") }, @@ -12671,7 +12614,6 @@ static const vshCmdOptDef opts_change_media[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("Fully-qualified path or target of disk device") }, @@ -13147,7 +13089,6 @@ static const vshCmdOptDef opts_get_user_sshkeys[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("user to list authorized keys for"), }, {.name =3D NULL} @@ -13196,7 +13137,6 @@ static const vshCmdOptDef opts_set_user_sshkeys[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("user to set authorized keys for"), }, {.name =3D "file", diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 97de6f8bed..ffb993de79 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -470,7 +470,6 @@ static const vshCmdOptDef opts_allocpages[] =3D { .type =3D VSH_OT_INT, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshAllocpagesPagesizeCompleter, .help =3D N_("page size (in kibibytes)") }, @@ -478,7 +477,6 @@ static const vshCmdOptDef opts_allocpages[] =3D { .type =3D VSH_OT_INT, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("page count") }, {.name =3D "cellno", @@ -949,7 +947,6 @@ static const vshCmdOptDef opts_node_suspend[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshNodeSuspendTargetCompleter, .help =3D N_("mem(Suspend-to-RAM), disk(Suspend-to-Disk), " "hybrid(Hybrid-Suspend)") @@ -958,7 +955,6 @@ static const vshCmdOptDef opts_node_suspend[] =3D { .type =3D VSH_OT_INT, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("Suspend duration in seconds, at least 60") }, {.name =3D NULL} @@ -1281,7 +1277,6 @@ static const vshCmdOptDef opts_cpu_models[] =3D { .positional =3D true, .required =3D true, .completer =3D virshArchCompleter, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("architecture") }, {.name =3D NULL} diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 109378ca71..1b1344c17c 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -23,7 +23,6 @@ .type =3D VSH_OT_STRING, \ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D N_("interface name or MAC address"), \ .completer =3D virshInterfaceNameCompleter, \ .completer_flags =3D cflags, \ @@ -387,7 +386,6 @@ static const vshCmdOptDef opts_interface_name[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshInterfaceMacCompleter, .help =3D N_("interface mac") }, @@ -420,7 +418,6 @@ static const vshCmdOptDef opts_interface_mac[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshInterfaceNameCompleter, .help =3D N_("interface name") }, @@ -724,7 +721,6 @@ static const vshCmdOptDef opts_interface_bridge[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshInterfaceNameCompleter, .help =3D N_("existing interface name") }, @@ -732,7 +728,6 @@ static const vshCmdOptDef opts_interface_bridge[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("new bridge device name") }, {.name =3D "no-stp", @@ -955,7 +950,6 @@ static const vshCmdOptDef opts_interface_unbridge[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("current bridge device name") }, {.name =3D "no-start", diff --git a/tools/virsh-network.c b/tools/virsh-network.c index edbcebd682..376de46cf4 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -35,7 +35,6 @@ .type =3D VSH_OT_STRING,\ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D _helpstr, \ .completer =3D virshNetworkNameCompleter, \ .completer_flags =3D cflags, \ @@ -60,7 +59,6 @@ .type =3D VSH_OT_STRING, \ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D N_("port UUID"), \ .completer =3D virshNetworkPortUUIDCompleter, \ .completer_flags =3D cflags, \ @@ -526,7 +524,6 @@ static const vshCmdOptDef opts_network_metadata[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("URI of the namespace") }, VIRSH_COMMON_OPT_LIVE(N_("modify/get running state")), @@ -1153,7 +1150,6 @@ static const vshCmdOptDef opts_network_name[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshNetworkUUIDCompleter, .help =3D N_("network uuid") }, @@ -1252,7 +1248,6 @@ static const vshCmdOptDef opts_network_update[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshNetworkUpdateCommandCompleter, .help =3D N_("type of update (add-first, add-last (add), delete, or m= odify)") }, @@ -1260,7 +1255,6 @@ static const vshCmdOptDef opts_network_update[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshNetworkUpdateSectionCompleter, .help =3D N_("which section of network configuration to update") }, @@ -1268,7 +1262,6 @@ static const vshCmdOptDef opts_network_update[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompletePathLocalExisting, .help =3D N_("name of file containing xml (or, if it starts with '<',= the complete " "xml element itself) to add/modify, or to be matched for s= earch") diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 7d63581436..90cfc187e5 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -99,7 +99,6 @@ static const vshCmdOptDef opts_node_device_destroy[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name or wwn pair in 'wwnn,wwpn' format"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -575,7 +574,6 @@ static const vshCmdOptDef opts_node_device_dumpxml[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name or wwn pair in 'wwnn,wwpn' format"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -640,7 +638,6 @@ static const vshCmdOptDef opts_node_device_detach[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device key"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -704,7 +701,6 @@ static const vshCmdOptDef opts_node_device_reattach[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device key"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -751,7 +747,6 @@ static const vshCmdOptDef opts_node_device_reset[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device key"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -1014,7 +1009,6 @@ static const vshCmdOptDef opts_node_device_undefine[]= =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name or wwn pair in 'wwnn,wwpn' format"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -1107,7 +1101,6 @@ static const vshCmdOptDef opts_node_device_start[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -1154,7 +1147,6 @@ static const vshCmdOptDef opts_node_device_autostart[= ] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name or wwn pair in 'wwnn,wwpn' format"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -1213,7 +1205,6 @@ static const vshCmdOptDef opts_node_device_info[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name or wwn pair in 'wwnn,wwpn' format"), .completer =3D virshNodeDeviceNameCompleter, }, @@ -1265,7 +1256,6 @@ static const vshCmdOptDef opts_node_device_update[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("device name or wwn pair in 'wwnn,wwpn' format"), .completer =3D virshNodeDeviceNameCompleter, }, diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index faa8e98130..f54d2a0ae5 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -131,7 +131,6 @@ static const vshCmdOptDef opts_nwfilter_undefine[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network filter name or uuid"), .completer =3D virshNWFilterNameCompleter, }, @@ -171,7 +170,6 @@ static const vshCmdOptDef opts_nwfilter_dumpxml[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network filter name or uuid"), .completer =3D virshNWFilterNameCompleter, }, @@ -397,7 +395,6 @@ static const vshCmdOptDef opts_nwfilter_edit[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network filter name or uuid"), .completer =3D virshNWFilterNameCompleter, }, @@ -534,7 +531,6 @@ static const vshCmdOptDef opts_nwfilter_binding_delete[= ] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network filter binding port dev"), .completer =3D virshNWFilterBindingNameCompleter, }, @@ -576,7 +572,6 @@ static const vshCmdOptDef opts_nwfilter_binding_dumpxml= [] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("network filter binding portdev"), .completer =3D virshNWFilterBindingNameCompleter, }, diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 8557e0d5e0..67cc1b94cf 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -60,7 +60,6 @@ .type =3D VSH_OT_STRING, \ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .completer =3D virshCompleteEmpty, \ .help =3D N_("name of the pool") \ }, \ @@ -68,7 +67,6 @@ .type =3D VSH_OT_STRING, \ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .completer =3D virshPoolTypeCompleter, \ .help =3D N_("type of the pool") \ }, \ @@ -1360,7 +1358,6 @@ static const vshCmdOptDef opts_find_storage_pool_sour= ces_as[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshPoolTypeCompleter, .help =3D N_("type of storage pool sources to find") }, @@ -1445,7 +1442,6 @@ static const vshCmdOptDef opts_find_storage_pool_sour= ces[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshPoolTypeCompleter, .help =3D N_("type of storage pool sources to discover") }, diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 0d0db9877b..7e10afa765 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -126,7 +126,6 @@ static const vshCmdOptDef opts_secret_dumpxml[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("secret UUID"), .completer =3D virshSecretUUIDCompleter, }, @@ -183,7 +182,6 @@ static const vshCmdOptDef opts_secret_set_value[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("secret UUID"), .completer =3D virshSecretUUIDCompleter, }, @@ -296,7 +294,6 @@ static const vshCmdOptDef opts_secret_get_value[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("secret UUID"), .completer =3D virshSecretUUIDCompleter, }, @@ -351,7 +348,6 @@ static const vshCmdOptDef opts_secret_undefine[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("secret UUID"), .completer =3D virshSecretUUIDCompleter, }, diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 9658fdefcd..899bae7e9a 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1570,7 +1570,6 @@ static const vshCmdOptDef opts_snapshot_dumpxml[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("snapshot name"), .completer =3D virshSnapshotNameCompleter, }, diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 90a450ad14..8794126f21 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -59,7 +59,6 @@ .type =3D VSH_OT_STRING, \ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D _helpstr, \ .completer =3D virshStorageVolNameCompleter, \ } @@ -69,7 +68,6 @@ .type =3D VSH_OT_STRING, \ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D _helpstr, \ .completer =3D virshStorageVolKeyCompleter, \ } @@ -179,7 +177,6 @@ static const vshCmdOptDef opts_vol_create_as[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("name of the volume") }, @@ -187,7 +184,6 @@ static const vshCmdOptDef opts_vol_create_as[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("size of the vol, as scaled integer (default bytes)") }, @@ -530,7 +526,6 @@ static const vshCmdOptDef opts_vol_clone[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("clone name") }, @@ -1036,7 +1031,6 @@ static const vshCmdOptDef opts_vol_resize[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D virshCompleteEmpty, .help =3D N_("new capacity for the vol, as scaled integer (default by= tes)") }, diff --git a/tools/virsh.h b/tools/virsh.h index b009ed5854..73c0b826a5 100644 --- a/tools/virsh.h +++ b/tools/virsh.h @@ -60,7 +60,6 @@ .type =3D VSH_OT_STRING,\ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D _helpstr, \ .completer =3D virshStoragePoolNameCompleter, \ .completer_flags =3D cflags, \ @@ -71,7 +70,6 @@ .type =3D VSH_OT_STRING,\ .positional =3D true, \ .required =3D true, \ - .flags =3D VSH_OFLAG_REQ, \ .help =3D _helpstr, \ .completer =3D virshDomainNameCompleter, \ .completer_flags =3D cflags, \ @@ -107,7 +105,6 @@ .type =3D VSH_OT_STRING, \ .required =3D required_, \ .positional =3D required_, \ - .flags =3D required_ ? VSH_OFLAG_REQ : VSH_OFLAG_NONE, \ .completer =3D virshCompletePathLocalExisting, \ .help =3D _helpstr \ } diff --git a/tools/virt-admin.c b/tools/virt-admin.c index d119116124..37bc6fe4f0 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -361,7 +361,6 @@ static const vshCmdOptDef opts_srv_threadpool_info[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("Server to retrieve threadpool attributes from."), }, @@ -420,7 +419,6 @@ static const vshCmdOptDef opts_srv_threadpool_set[] =3D= { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("Server to alter threadpool attributes on."), }, @@ -523,7 +521,6 @@ static const vshCmdOptDef opts_srv_clients_list[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("server which to list connected clients from"), }, @@ -607,7 +604,6 @@ static const vshCmdOptDef opts_client_info[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("server to which is connected to"), }, @@ -615,7 +611,6 @@ static const vshCmdOptDef opts_client_info[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("client which to retrieve identity information for"), }, {.name =3D NULL} @@ -693,7 +688,6 @@ static const vshCmdOptDef opts_client_disconnect[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("server which the client is currently connected to"), }, @@ -701,7 +695,6 @@ static const vshCmdOptDef opts_client_disconnect[] =3D { .type =3D VSH_OT_INT, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("client which to disconnect, specified by ID"), }, {.name =3D NULL} @@ -758,7 +751,6 @@ static const vshCmdOptDef opts_srv_clients_info[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("Server to retrieve the client limits from."), }, @@ -814,7 +806,6 @@ static const vshCmdOptDef opts_srv_clients_set[] =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .completer =3D vshAdmServerCompleter, .help =3D N_("Server to alter the client-related configuration limits= on."), }, @@ -913,7 +904,6 @@ static const vshCmdOptDef opts_srv_update_tls_file[] = =3D { .type =3D VSH_OT_STRING, .positional =3D true, .required =3D true, - .flags =3D VSH_OFLAG_REQ, .help =3D N_("Available servers on a daemon. " "Currently only supports 'libvirtd' or 'virtproxyd'.") }, @@ -1013,7 +1003,7 @@ static const vshCmdOptDef opts_daemon_timeout[] =3D { .type =3D VSH_OT_INT, .required =3D true, .help =3D N_("number of seconds the daemon will run without any activ= e connection"), - .flags =3D VSH_OFLAG_REQ | VSH_OFLAG_REQ_OPT + .flags =3D VSH_OFLAG_REQ_OPT }, {.name =3D NULL} }; diff --git a/tools/vsh.c b/tools/vsh.c index 7e8fbf8050..85296c35c7 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -345,8 +345,8 @@ vshCmddefCheckInternals(vshControl *ctl, return -1; } - if (opt->flags & VSH_OFLAG_REQ) { - vshError(ctl, "parameter '%s' of command '%s' misused VSH_= OFLAG_REQ", + if (opt->required) { + vshError(ctl, "parameter '%s' of command '%s' misused 'req= uired' flag", opt->name, cmd->name); return -1; /* bool can't be mandatory */ } @@ -445,7 +445,7 @@ vshCmddefOptParse(const vshCmdDef *cmd, if (!(opt->flags & VSH_OFLAG_REQ_OPT)) *opts_need_arg |=3D 1ULL << i; - if (opt->flags & VSH_OFLAG_REQ) + if (opt->required) *opts_required |=3D 1ULL << i; } } @@ -800,7 +800,7 @@ vshCommandOpt(const vshCmd *cmd, const char *name, vshC= mdOpt **opt, if (!cmd->skipChecks) assert(valid && (!needData || valid->type !=3D VSH_OT_BOOL)); - if (valid && valid->flags & VSH_OFLAG_REQ) + if (valid && valid->required) ret =3D -1; /* See if option is present on command line. */ diff --git a/tools/vsh.h b/tools/vsh.h index 73b908a5f2..5f3e610dd7 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -98,7 +98,6 @@ typedef enum { */ enum { VSH_OFLAG_NONE =3D 0, /* without flags */ - VSH_OFLAG_REQ =3D (1 << 0), /* option required */ VSH_OFLAG_EMPTY_OK =3D (1 << 1), /* empty string option allowed */ VSH_OFLAG_REQ_OPT =3D (1 << 2), /* --optionname required */ }; --=20 2.44.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org