Commit e962a57 added 'attach-disk --shareable', even though we
already had 'attach-disk --mode=shareable'. Worse, if the user
types 'attach-disk --mode=readonly --shareable', we create
non-sensical XML. The best solution is just to undocument the
duplicate spelling, by having it fall back to the preferred
spelling.
* tools/virsh-domain.c (cmdAttachDisk): Let alias handling fix our
mistake in exposing a second spelling for an existing option.
* tools/virsh.pod: Fix documentation.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
tools/virsh-domain.c | 11 ++++-------
tools/virsh.pod | 4 ++--
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 5aabccd..59e3d8d 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -295,6 +295,10 @@ static const vshCmdOptDef opts_attach_disk[] = {
.type = VSH_OT_STRING,
.help = N_("target device type")
},
+ {.name = "shareable",
+ .type = VSH_OT_ALIAS,
+ .help = "mode=shareable"
+ },
{.name = "mode",
.type = VSH_OT_STRING,
.help = N_("mode of device reading and writing")
@@ -311,10 +315,6 @@ static const vshCmdOptDef opts_attach_disk[] = {
.type = VSH_OT_STRING,
.help = N_("wwn of disk device")
},
- {.name = "shareable",
- .type = VSH_OT_BOOL,
- .help = N_("shareable between domains")
- },
{.name = "rawio",
.type = VSH_OT_BOOL,
.help = N_("needs rawio capability")
@@ -602,9 +602,6 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
if (wwn)
virBufferAsprintf(&buf, " <wwn>%s</wwn>\n", wwn);
- if (vshCommandOptBool(cmd, "shareable"))
- virBufferAddLit(&buf, " <shareable/>\n");
-
if (straddr) {
if (str2DiskAddress(straddr, &diskAddr) != 0) {
vshError(ctl, _("Invalid address."));
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 7af5503..302f811 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1923,7 +1923,7 @@ expected.
[[[I<--live>] [I<--config>] | [I<--current>]] |
[I<--persistent>]]
[I<--driver driver>] [I<--subdriver subdriver>] [I<--cache cache>]
[I<--type type>] [I<--mode mode>] [I<--config>] [I<--sourcetype
soucetype>]
-[I<--serial serial>] [I<--wwn wwn>] [I<--shareable>]
[I<--rawio>]
+[I<--serial serial>] [I<--wwn wwn>] [I<--rawio>]
[I<--address address>] [I<--multifunction>] [I<--print-xml>]
Attach a new disk device to the domain.
@@ -1945,7 +1945,6 @@ I<sourcetype> can indicate the type of source (block|file)
I<cache> can be one of "default", "none",
"writethrough", "writeback",
"directsync" or "unsafe".
I<serial> is the serial of disk device. I<wwn> is the wwn of disk device.
-I<shareable> indicates the disk device is shareable between domains.
I<rawio> indicates the disk needs rawio capability.
I<address> is the address of disk device in the form of
pci:domain.bus.slot.function,
scsi:controller.bus.unit or ide:controller.bus.unit.
@@ -1964,6 +1963,7 @@ on the hypervisor driver.
For compatibility purposes, I<--persistent> behaves like I<--config> for
an offline domain, and like I<--live> I<--config> for a running domain.
+Likewise, I<--shareable> is an alias for I<--mode shareable>.
=item B<attach-interface> I<domain> I<type> I<source>
[[[I<--live>] [I<--config>] | [I<--current>]] |
[I<--persistent>]]
--
1.8.3.1