[libvirt] [PATCH v3 2/2] add --cache, --serial, --sharable and --address options for attach-disk

Eric Blake eblake at redhat.com
Fri Jul 15 18:15:14 UTC 2011


On 07/15/2011 01:06 AM, Hu Tao wrote:
> This add three options for virsh command attach-disk.

s/add three/adds four/

> 
> --cache option allows user to specify cache mode of disk device
> from virsh command line when attaching a disk device.
> 
> --serial option allows user to specify serial string of disk device
> from virsh command line when attaching a disk device.
> 
> --sharable option allows user to specify whether the disk device is

--sharable here,

> sharable between domains when attaching a disk device from virsh
> command line.
> 
> --address option allows user to specify address of disk device when
> attaching a disk device.
> ---
>  tools/virsh.c   |  210 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  tools/virsh.pod |   10 ++-
>  2 files changed, 216 insertions(+), 4 deletions(-)

I think this patch can be applied prior to cleaning up the
vshCommandOptString mess (since that affects more than just your change).

> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index b43af70..aa7fb56 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -10168,19 +10168,172 @@ static const vshCmdOptDef opts_attach_disk[] = {
>      {"target",  VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")},
>      {"driver",    VSH_OT_STRING, 0, N_("driver of disk device")},
>      {"subdriver", VSH_OT_STRING, 0, N_("subdriver of disk device")},
> +    {"cache",     VSH_OT_STRING, 0, N_("cache mode of disk device")},
>      {"type",    VSH_OT_STRING, 0, N_("target device type")},
>      {"mode",    VSH_OT_STRING, 0, N_("mode of device reading and writing")},
>      {"persistent", VSH_OT_BOOL, 0, N_("persist disk attachment")},
>      {"sourcetype", VSH_OT_STRING, 0, N_("type of source (block|file)")},
> +    {"serial", VSH_OT_STRING, 0, N_("serial of disk device")},
> +    {"shareable", VSH_OT_BOOL, 0, N_("shareable between domains")},

but shareable here.  Which do we want?  Both are valid in the English
dictionary (gotta love that), but google fight picks shareable:

http://www.googlefight.com/index.php?lang=en_GB&word1=sharable&word2=shareable

as does our XML schema.  Also, 'unsharable' makes me think of the
shar(1) utility.  I've adjusted the commit message accordingly, so
ACK and pushed.  Meanwhile, I'm followup up with this one under the
trivial rule:

diff --git i/docs/internals/locking.html.in w/docs/internals/locking.html.in
index 3790ef0..e84321b 100644
--- i/docs/internals/locking.html.in
+++ w/docs/internals/locking.html.in
@@ -15,7 +15,7 @@
     <p>
       The high level goal is to prevent the same disk image being
       used by more than one QEMU instance at a time (unless the
-      disk is marked as sharable, or readonly). The scenarios
+      disk is marked as shareable, or readonly). The scenarios
       to be prevented are thus:
     </p>

diff --git i/src/locking/lock_driver_sanlock.c
w/src/locking/lock_driver_sanlock.c
index 87e7815..62eb28b 100644
--- i/src/locking/lock_driver_sanlock.c
+++ w/src/locking/lock_driver_sanlock.c
@@ -634,7 +634,7 @@ static int
virLockManagerSanlockAddResource(virLockManagerPtr lock,
     }
     if (flags & VIR_LOCK_MANAGER_RESOURCE_SHARED) {
         virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                     _("Sharable leases are not supported"));
+                     _("Shareable leases are not supported"));
         return -1;
     }


-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110715/66529a68/attachment-0001.sig>


More information about the libvir-list mailing list