mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virsh: Require option flags for all optional arguments of 'attach-disk'
Annotate arguments which can be unintentionally parsed positionally. (See previous commits for explanation.) Currently virsh accepts the arguments such as: $ virsh attach-disk --print-xml 1 2 3 4 5 6 7 8 9 10 <disk type='file' device='10'> <driver name='5' type='6' iothread='7' cache='8' io='9'/> <source file='2'/> <target dev='3' bus='4'/> </disk> While making virsh require the flags is technically a breaking change, there were multiple instances where arguments were added to the argument list thus changing the order the positional arguments would be interpreted as. Examples are commits:7e157858b4
,bc5a8090af
,ca21d75d25
. As of such there are multiple breaks of compatibility for the positional arguments. As of such, require the option flag for all optional arguments with value for 'virsh attach-disk'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1efb794487
commit
a7b10919e7
@ -434,31 +434,38 @@ static const vshCmdOptDef opts_attach_disk[] = {
|
|||||||
},
|
},
|
||||||
{.name = "targetbus",
|
{.name = "targetbus",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("target bus of disk device")
|
.help = N_("target bus of disk device")
|
||||||
},
|
},
|
||||||
{.name = "driver",
|
{.name = "driver",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("driver of disk device")
|
.help = N_("driver of disk device")
|
||||||
},
|
},
|
||||||
{.name = "subdriver",
|
{.name = "subdriver",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("subdriver of disk device")
|
.help = N_("subdriver of disk device")
|
||||||
},
|
},
|
||||||
{.name = "iothread",
|
{.name = "iothread",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.completer = virshDomainIOThreadIdCompleter,
|
.completer = virshDomainIOThreadIdCompleter,
|
||||||
.help = N_("IOThread to be used by supported device")
|
.help = N_("IOThread to be used by supported device")
|
||||||
},
|
},
|
||||||
{.name = "cache",
|
{.name = "cache",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("cache mode of disk device")
|
.help = N_("cache mode of disk device")
|
||||||
},
|
},
|
||||||
{.name = "io",
|
{.name = "io",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("io policy of disk device")
|
.help = N_("io policy of disk device")
|
||||||
},
|
},
|
||||||
{.name = "type",
|
{.name = "type",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("target device type")
|
.help = N_("target device type")
|
||||||
},
|
},
|
||||||
{.name = "shareable",
|
{.name = "shareable",
|
||||||
@ -467,24 +474,29 @@ static const vshCmdOptDef opts_attach_disk[] = {
|
|||||||
},
|
},
|
||||||
{.name = "mode",
|
{.name = "mode",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("mode of device reading and writing")
|
.help = N_("mode of device reading and writing")
|
||||||
},
|
},
|
||||||
{.name = "sourcetype",
|
{.name = "sourcetype",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("type of source (block|file|network)")
|
.help = N_("type of source (block|file|network)")
|
||||||
},
|
},
|
||||||
{.name = "serial",
|
{.name = "serial",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.completer = virshCompleteEmpty,
|
.completer = virshCompleteEmpty,
|
||||||
.help = N_("serial of disk device")
|
.help = N_("serial of disk device")
|
||||||
},
|
},
|
||||||
{.name = "wwn",
|
{.name = "wwn",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.completer = virshCompleteEmpty,
|
.completer = virshCompleteEmpty,
|
||||||
.help = N_("wwn of disk device")
|
.help = N_("wwn of disk device")
|
||||||
},
|
},
|
||||||
{.name = "alias",
|
{.name = "alias",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.completer = virshCompleteEmpty,
|
.completer = virshCompleteEmpty,
|
||||||
.help = N_("custom alias name of disk device")
|
.help = N_("custom alias name of disk device")
|
||||||
},
|
},
|
||||||
@ -494,6 +506,7 @@ static const vshCmdOptDef opts_attach_disk[] = {
|
|||||||
},
|
},
|
||||||
{.name = "address",
|
{.name = "address",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.completer = virshCompleteEmpty,
|
.completer = virshCompleteEmpty,
|
||||||
.help = N_("address of disk device")
|
.help = N_("address of disk device")
|
||||||
},
|
},
|
||||||
@ -507,19 +520,23 @@ static const vshCmdOptDef opts_attach_disk[] = {
|
|||||||
},
|
},
|
||||||
{.name = "source-protocol",
|
{.name = "source-protocol",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("protocol used by disk device source")
|
.help = N_("protocol used by disk device source")
|
||||||
},
|
},
|
||||||
{.name = "source-host-name",
|
{.name = "source-host-name",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.completer = virshCompleteEmpty,
|
.completer = virshCompleteEmpty,
|
||||||
.help = N_("host name for source of disk device")
|
.help = N_("host name for source of disk device")
|
||||||
},
|
},
|
||||||
{.name = "source-host-transport",
|
{.name = "source-host-transport",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("host transport for source of disk device")
|
.help = N_("host transport for source of disk device")
|
||||||
},
|
},
|
||||||
{.name = "source-host-socket",
|
{.name = "source-host-socket",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
.help = N_("host socket for source of disk device")
|
.help = N_("host socket for source of disk device")
|
||||||
},
|
},
|
||||||
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
|
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
|
||||||
|
Loading…
Reference in New Issue
Block a user