vsh: remove VSH_OFLAG_REQ

The flag was replaced by the 'required' field in the option definition.
Remove last few uses and all assignments.

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-05 17:21:05 +01:00
parent cce3e049a9
commit 78993f618f
15 changed files with 6 additions and 130 deletions

View File

@ -740,7 +740,6 @@ static const vshCmdOptDef opts_domif_getlink[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainInterfaceCompleter,
.help = N_("interface device (MAC Address)")
},
@ -1042,7 +1041,6 @@ static const vshCmdOptDef opts_domifstat[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainInterfaceCompleter,
.help = N_("interface device specified by name or MAC Address")
},

View File

@ -422,14 +422,13 @@ static const vshCmdOptDef opts_attach_disk[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ | VSH_OFLAG_EMPTY_OK,
.flags = VSH_OFLAG_EMPTY_OK,
.help = N_("source of disk device or name of network disk")
},
{.name = "target",
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("target of disk device")
},
@ -818,14 +817,12 @@ static const vshCmdOptDef opts_attach_interface[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network interface type")
},
{.name = "source",
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("source of network interface")
},
{.name = "target",
@ -1198,7 +1195,6 @@ static const vshCmdOptDef opts_blkdeviotune[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("block device")
},
@ -1993,7 +1989,6 @@ static const vshCmdOptDef opts_blockcommit[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("fully-qualified path of disk")
},
@ -2214,7 +2209,6 @@ static const vshCmdOptDef opts_blockcopy[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("fully-qualified path of source disk")
},
@ -2548,7 +2542,6 @@ static const vshCmdOptDef opts_blockjob[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("fully-qualified path of disk")
},
@ -2761,7 +2754,6 @@ static const vshCmdOptDef opts_blockpull[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("fully-qualified path of disk")
},
@ -2905,7 +2897,6 @@ static const vshCmdOptDef opts_blockresize[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("Fully-qualified path of block device")
},
@ -3064,7 +3055,6 @@ static const vshCmdOptDef opts_domif_setlink[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainInterfaceCompleter,
.help = N_("interface device (MAC Address)")
},
@ -3072,7 +3062,6 @@ static const vshCmdOptDef opts_domif_setlink[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainInterfaceStateCompleter,
.help = N_("new state of the device")
},
@ -3214,7 +3203,6 @@ static const vshCmdOptDef opts_domiftune[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainInterfaceCompleter,
.help = N_("interface device (MAC Address)")
},
@ -3441,7 +3429,6 @@ static const vshCmdOptDef opts_dom_pm_suspend[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshNodeSuspendTargetCompleter,
.help = N_("mem(Suspend-to-RAM), "
"disk(Suspend-to-Disk), "
@ -4126,7 +4113,6 @@ static const vshCmdOptDef opts_save[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("where to save the data")
},
{.name = "bypass-cache",
@ -4477,7 +4463,6 @@ static const vshCmdOptDef opts_save_image_dumpxml[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("saved state file to read")
},
{.name = "security-info",
@ -4536,14 +4521,12 @@ static const vshCmdOptDef opts_save_image_define[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("saved state file to modify")
},
{.name = "xml",
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
@ -4603,7 +4586,6 @@ static const vshCmdOptDef opts_save_image_edit[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("saved state file to edit")
},
{.name = "running",
@ -4944,7 +4926,6 @@ static const vshCmdOptDef opts_managed_save_define[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
@ -5222,7 +5203,6 @@ static const vshCmdOptDef opts_restore[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("the state to restore")
},
{.name = "bypass-cache",
@ -5307,7 +5287,6 @@ static const vshCmdOptDef opts_dump[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = 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[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainLifecycleCompleter,
.help = N_("lifecycle type to modify")
},
@ -5616,7 +5594,6 @@ static const vshCmdOptDef opts_setLifecycleAction[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainLifecycleActionCompleter,
.help = N_("lifecycle action to set")
},
@ -5704,14 +5681,12 @@ static const vshCmdOptDef opts_set_user_password[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("the username")
},
{.name = "password",
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("the new password")
},
@ -7128,7 +7103,6 @@ static const vshCmdOptDef opts_setvcpus[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("number of virtual CPUs")
},
{.name = "maximum",
@ -7296,7 +7270,6 @@ static const vshCmdOptDef opts_setvcpu[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainVcpulistCompleter,
.help = N_("ids of vcpus to manipulate")
},
@ -7372,7 +7345,6 @@ static const vshCmdOptDef opts_domblkthreshold[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("device to set threshold for")
},
@ -7380,7 +7352,6 @@ static const vshCmdOptDef opts_domblkthreshold[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("threshold as a scaled number (by default bytes)")
},
{.name = NULL}
@ -7504,7 +7475,6 @@ static const vshCmdOptDef opts_iothreadpin[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainIOThreadIdCompleter,
.help = N_("IOThread ID number")
},
@ -7512,7 +7482,6 @@ static const vshCmdOptDef opts_iothreadpin[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainCpulistCompleter,
.help = N_("host cpu number(s) to set")
},
@ -7581,7 +7550,6 @@ static const vshCmdOptDef opts_iothreadadd[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("iothread for the new IOThread")
},
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
@ -7639,7 +7607,6 @@ static const vshCmdOptDef opts_iothreadset[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainIOThreadIdCompleter,
.help = N_("iothread id of existing IOThread")
},
@ -7757,7 +7724,6 @@ static const vshCmdOptDef opts_iothreaddel[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainIOThreadIdCompleter,
.help = N_("iothread_id for the IOThread to delete")
},
@ -8349,7 +8315,6 @@ static const vshCmdOptDef opts_metadata[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("URI of the namespace")
},
VIRSH_COMMON_OPT_LIVE(N_("modify/get running state")),
@ -8528,7 +8493,6 @@ static const vshCmdOptDef opts_send_key[] = {
{.name = "keycode",
.type = VSH_OT_ARGV,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshKeycodeNameCompleter,
.help = N_("the key code")
},
@ -8614,7 +8578,6 @@ static const vshCmdOptDef opts_send_process_signal[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("the process ID")
},
@ -8622,7 +8585,6 @@ static const vshCmdOptDef opts_send_process_signal[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainSignalCompleter,
.help = N_("the signal number or name")
},
@ -8712,7 +8674,6 @@ static const vshCmdOptDef opts_setmem[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("new memory size, as scaled integer (default KiB)")
},
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
@ -8783,7 +8744,6 @@ static const vshCmdOptDef opts_setmaxmem[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("new maximum memory size, as scaled integer (default KiB)")
},
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
@ -9558,7 +9518,6 @@ static const vshCmdOptDef opts_dom_fd_associate[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("name of the FD group")
},
@ -9566,7 +9525,6 @@ static const vshCmdOptDef opts_dom_fd_associate[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("file descriptors N,M,... to associate")
},
@ -9643,7 +9601,6 @@ static const vshCmdOptDef opts_qemu_monitor_command[] = {
{.name = "cmd",
.type = VSH_OT_ARGV,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("command")
},
{.name = NULL}
@ -9980,7 +9937,6 @@ static const vshCmdOptDef opts_qemu_attach[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("pid")
},
@ -10038,7 +9994,6 @@ static const vshCmdOptDef opts_qemu_agent_command[] = {
{.name = "cmd",
.type = VSH_OT_ARGV,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("command")
},
{.name = NULL}
@ -10135,7 +10090,6 @@ static const vshCmdOptDef opts_lxc_enter_namespace[] = {
{.name = "cmd",
.type = VSH_OT_ARGV,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("command to run")
},
{.name = NULL}
@ -10316,14 +10270,12 @@ static const vshCmdOptDef opts_domxmlfromnative[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("source config data format")
},
{.name = "config",
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("config data file to import from")
},
@ -10368,7 +10320,6 @@ static const vshCmdOptDef opts_domxmltonative[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("target config data type format")
},
VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(VSH_OFLAG_REQ_OPT, 0),
@ -10437,7 +10388,6 @@ static const vshCmdOptDef opts_domname[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainUUIDCompleter,
.help = N_("domain id or uuid")
},
@ -10472,7 +10422,6 @@ static const vshCmdOptDef opts_domrename[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("new domain name")
},
@ -10576,7 +10525,6 @@ static const vshCmdOptDef opts_migrate[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")
},
@ -11275,7 +11223,6 @@ static const vshCmdOptDef opts_migrate_setmaxdowntime[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("maximum tolerable downtime (in milliseconds) for migration")
},
{.name = NULL}
@ -11395,7 +11342,6 @@ static const vshCmdOptDef opts_migrate_setspeed[] = {
.type = VSH_OT_INT,
.required = true,
.positional = true,
.flags = VSH_OFLAG_REQ,
.help = N_("migration bandwidth limit in MiB/s")
},
{.name = "postcopy",
@ -11986,7 +11932,6 @@ static const vshCmdOptDef opts_detach_device_alias[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDeviceAliasCompleter,
.help = N_("device alias")
},
@ -12116,7 +12061,6 @@ static const vshCmdOptDef opts_detach_interface[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network interface type")
},
{.name = "mac",
@ -12490,7 +12434,6 @@ static const vshCmdOptDef opts_detach_disk[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("target of disk device")
},
@ -12652,7 +12595,6 @@ static const vshCmdOptDef opts_change_media[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshDomainDiskTargetCompleter,
.help = N_("Fully-qualified path or target of disk device")
},
@ -13128,7 +13070,6 @@ static const vshCmdOptDef opts_get_user_sshkeys[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("user to list authorized keys for"),
},
{.name = NULL}
@ -13177,7 +13118,6 @@ static const vshCmdOptDef opts_set_user_sshkeys[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("user to set authorized keys for"),
},
{.name = "file",

View File

@ -470,7 +470,6 @@ static const vshCmdOptDef opts_allocpages[] = {
.type = VSH_OT_INT,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshAllocpagesPagesizeCompleter,
.help = N_("page size (in kibibytes)")
},
@ -478,7 +477,6 @@ static const vshCmdOptDef opts_allocpages[] = {
.type = VSH_OT_INT,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("page count")
},
{.name = "cellno",
@ -949,7 +947,6 @@ static const vshCmdOptDef opts_node_suspend[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshNodeSuspendTargetCompleter,
.help = N_("mem(Suspend-to-RAM), disk(Suspend-to-Disk), "
"hybrid(Hybrid-Suspend)")
@ -958,7 +955,6 @@ static const vshCmdOptDef opts_node_suspend[] = {
.type = VSH_OT_INT,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("Suspend duration in seconds, at least 60")
},
{.name = NULL}
@ -1281,7 +1277,6 @@ static const vshCmdOptDef opts_cpu_models[] = {
.positional = true,
.required = true,
.completer = virshArchCompleter,
.flags = VSH_OFLAG_REQ,
.help = N_("architecture")
},
{.name = NULL}

View File

@ -23,7 +23,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = N_("interface name or MAC address"), \
.completer = virshInterfaceNameCompleter, \
.completer_flags = cflags, \
@ -387,7 +386,6 @@ static const vshCmdOptDef opts_interface_name[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshInterfaceMacCompleter,
.help = N_("interface mac")
},
@ -420,7 +418,6 @@ static const vshCmdOptDef opts_interface_mac[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshInterfaceNameCompleter,
.help = N_("interface name")
},
@ -724,7 +721,6 @@ static const vshCmdOptDef opts_interface_bridge[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshInterfaceNameCompleter,
.help = N_("existing interface name")
},
@ -732,7 +728,6 @@ static const vshCmdOptDef opts_interface_bridge[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("new bridge device name")
},
{.name = "no-stp",
@ -955,7 +950,6 @@ static const vshCmdOptDef opts_interface_unbridge[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("current bridge device name")
},
{.name = "no-start",

View File

@ -35,7 +35,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = _helpstr, \
.completer = virshNetworkNameCompleter, \
.completer_flags = cflags, \
@ -60,7 +59,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = N_("port UUID"), \
.completer = virshNetworkPortUUIDCompleter, \
.completer_flags = cflags, \
@ -508,7 +506,6 @@ static const vshCmdOptDef opts_network_metadata[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("URI of the namespace")
},
VIRSH_COMMON_OPT_LIVE(N_("modify/get running state")),
@ -1135,7 +1132,6 @@ static const vshCmdOptDef opts_network_name[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshNetworkUUIDCompleter,
.help = N_("network uuid")
},
@ -1234,7 +1230,6 @@ static const vshCmdOptDef opts_network_update[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshNetworkUpdateCommandCompleter,
.help = N_("type of update (add-first, add-last (add), delete, or modify)")
},
@ -1242,7 +1237,6 @@ static const vshCmdOptDef opts_network_update[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshNetworkUpdateSectionCompleter,
.help = N_("which section of network configuration to update")
},
@ -1250,7 +1244,6 @@ static const vshCmdOptDef opts_network_update[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("name of file containing xml (or, if it starts with '<', the complete "
"xml element itself) to add/modify, or to be matched for search")

View File

@ -99,7 +99,6 @@ static const vshCmdOptDef opts_node_device_destroy[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
.completer = virshNodeDeviceNameCompleter,
},
@ -575,7 +574,6 @@ static const vshCmdOptDef opts_node_device_dumpxml[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
.completer = virshNodeDeviceNameCompleter,
},
@ -640,7 +638,6 @@ static const vshCmdOptDef opts_node_device_detach[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device key"),
.completer = virshNodeDeviceNameCompleter,
},
@ -704,7 +701,6 @@ static const vshCmdOptDef opts_node_device_reattach[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device key"),
.completer = virshNodeDeviceNameCompleter,
},
@ -751,7 +747,6 @@ static const vshCmdOptDef opts_node_device_reset[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device key"),
.completer = virshNodeDeviceNameCompleter,
},
@ -1014,7 +1009,6 @@ static const vshCmdOptDef opts_node_device_undefine[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
.completer = virshNodeDeviceNameCompleter,
},
@ -1107,7 +1101,6 @@ static const vshCmdOptDef opts_node_device_start[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name"),
.completer = virshNodeDeviceNameCompleter,
},
@ -1154,7 +1147,6 @@ static const vshCmdOptDef opts_node_device_autostart[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
.completer = virshNodeDeviceNameCompleter,
},
@ -1213,7 +1205,6 @@ static const vshCmdOptDef opts_node_device_info[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
.completer = virshNodeDeviceNameCompleter,
},
@ -1265,7 +1256,6 @@ static const vshCmdOptDef opts_node_device_update[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
.completer = virshNodeDeviceNameCompleter,
},

View File

@ -131,7 +131,6 @@ static const vshCmdOptDef opts_nwfilter_undefine[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network filter name or uuid"),
.completer = virshNWFilterNameCompleter,
},
@ -171,7 +170,6 @@ static const vshCmdOptDef opts_nwfilter_dumpxml[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network filter name or uuid"),
.completer = virshNWFilterNameCompleter,
},
@ -397,7 +395,6 @@ static const vshCmdOptDef opts_nwfilter_edit[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network filter name or uuid"),
.completer = virshNWFilterNameCompleter,
},
@ -534,7 +531,6 @@ static const vshCmdOptDef opts_nwfilter_binding_delete[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network filter binding port dev"),
.completer = virshNWFilterBindingNameCompleter,
},
@ -576,7 +572,6 @@ static const vshCmdOptDef opts_nwfilter_binding_dumpxml[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("network filter binding portdev"),
.completer = virshNWFilterBindingNameCompleter,
},

View File

@ -60,7 +60,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.completer = virshCompleteEmpty, \
.help = N_("name of the pool") \
}, \
@ -68,7 +67,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.completer = virshPoolTypeCompleter, \
.help = N_("type of the pool") \
}, \
@ -1360,7 +1358,6 @@ static const vshCmdOptDef opts_find_storage_pool_sources_as[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshPoolTypeCompleter,
.help = N_("type of storage pool sources to find")
},
@ -1445,7 +1442,6 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshPoolTypeCompleter,
.help = N_("type of storage pool sources to discover")
},

View File

@ -126,7 +126,6 @@ static const vshCmdOptDef opts_secret_dumpxml[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("secret UUID"),
.completer = virshSecretUUIDCompleter,
},
@ -183,7 +182,6 @@ static const vshCmdOptDef opts_secret_set_value[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("secret UUID"),
.completer = virshSecretUUIDCompleter,
},
@ -296,7 +294,6 @@ static const vshCmdOptDef opts_secret_get_value[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("secret UUID"),
.completer = virshSecretUUIDCompleter,
},
@ -351,7 +348,6 @@ static const vshCmdOptDef opts_secret_undefine[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("secret UUID"),
.completer = virshSecretUUIDCompleter,
},

View File

@ -1570,7 +1570,6 @@ static const vshCmdOptDef opts_snapshot_dumpxml[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("snapshot name"),
.completer = virshSnapshotNameCompleter,
},

View File

@ -59,7 +59,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = _helpstr, \
.completer = virshStorageVolNameCompleter, \
}
@ -69,7 +68,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = _helpstr, \
.completer = virshStorageVolKeyCompleter, \
}
@ -179,7 +177,6 @@ static const vshCmdOptDef opts_vol_create_as[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("name of the volume")
},
@ -187,7 +184,6 @@ static const vshCmdOptDef opts_vol_create_as[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("size of the vol, as scaled integer (default bytes)")
},
@ -530,7 +526,6 @@ static const vshCmdOptDef opts_vol_clone[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("clone name")
},
@ -1036,7 +1031,6 @@ static const vshCmdOptDef opts_vol_resize[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = virshCompleteEmpty,
.help = N_("new capacity for the vol, as scaled integer (default bytes)")
},

View File

@ -60,7 +60,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = _helpstr, \
.completer = virshStoragePoolNameCompleter, \
.completer_flags = cflags, \
@ -71,7 +70,6 @@
.type = VSH_OT_STRING, \
.positional = true, \
.required = true, \
.flags = VSH_OFLAG_REQ, \
.help = _helpstr, \
.completer = virshDomainNameCompleter, \
.completer_flags = cflags, \
@ -107,7 +105,6 @@
.type = VSH_OT_STRING, \
.required = required_, \
.positional = required_, \
.flags = required_ ? VSH_OFLAG_REQ : VSH_OFLAG_NONE, \
.completer = virshCompletePathLocalExisting, \
.help = _helpstr \
}

View File

@ -361,7 +361,6 @@ static const vshCmdOptDef opts_srv_threadpool_info[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("Server to retrieve threadpool attributes from."),
},
@ -420,7 +419,6 @@ static const vshCmdOptDef opts_srv_threadpool_set[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("Server to alter threadpool attributes on."),
},
@ -523,7 +521,6 @@ static const vshCmdOptDef opts_srv_clients_list[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("server which to list connected clients from"),
},
@ -607,7 +604,6 @@ static const vshCmdOptDef opts_client_info[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("server to which <client> is connected to"),
},
@ -615,7 +611,6 @@ static const vshCmdOptDef opts_client_info[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("client which to retrieve identity information for"),
},
{.name = NULL}
@ -693,7 +688,6 @@ static const vshCmdOptDef opts_client_disconnect[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("server which the client is currently connected to"),
},
@ -701,7 +695,6 @@ static const vshCmdOptDef opts_client_disconnect[] = {
.type = VSH_OT_INT,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("client which to disconnect, specified by ID"),
},
{.name = NULL}
@ -758,7 +751,6 @@ static const vshCmdOptDef opts_srv_clients_info[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("Server to retrieve the client limits from."),
},
@ -814,7 +806,6 @@ static const vshCmdOptDef opts_srv_clients_set[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.completer = vshAdmServerCompleter,
.help = N_("Server to alter the client-related configuration limits on."),
},
@ -913,7 +904,6 @@ static const vshCmdOptDef opts_srv_update_tls_file[] = {
.type = VSH_OT_STRING,
.positional = true,
.required = true,
.flags = VSH_OFLAG_REQ,
.help = N_("Available servers on a daemon. "
"Currently only supports 'libvirtd' or 'virtproxyd'.")
},
@ -1013,7 +1003,7 @@ static const vshCmdOptDef opts_daemon_timeout[] = {
.type = VSH_OT_INT,
.required = true,
.help = N_("number of seconds the daemon will run without any active connection"),
.flags = VSH_OFLAG_REQ | VSH_OFLAG_REQ_OPT
.flags = VSH_OFLAG_REQ_OPT
},
{.name = NULL}
};

View File

@ -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 'required' 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 |= 1ULL << i;
if (opt->flags & VSH_OFLAG_REQ)
if (opt->required)
*opts_required |= 1ULL << i;
}
}
@ -800,7 +800,7 @@ vshCommandOpt(const vshCmd *cmd, const char *name, vshCmdOpt **opt,
if (!cmd->skipChecks)
assert(valid && (!needData || valid->type != VSH_OT_BOOL));
if (valid && valid->flags & VSH_OFLAG_REQ)
if (valid && valid->required)
ret = -1;
/* See if option is present on command line. */

View File

@ -98,7 +98,6 @@ typedef enum {
*/
enum {
VSH_OFLAG_NONE = 0, /* without flags */
VSH_OFLAG_REQ = (1 << 0), /* option required */
VSH_OFLAG_EMPTY_OK = (1 << 1), /* empty string option allowed */
VSH_OFLAG_REQ_OPT = (1 << 2), /* --optionname required */
};