]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Add source-protocol-ver for pool commands
authorJohn Ferlan <jferlan@redhat.com>
Fri, 11 Jan 2019 19:48:31 +0000 (14:48 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 30 Jan 2019 00:16:13 +0000 (19:16 -0500)
Allow the addition of the <protocol ver='n'/> to the provided XML.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tools/virsh-pool.c
tools/virsh.pod

index 70ca39bd3ddb6b07c6a94f44cf62992a64160990..9514570468a586ab9484944291cc151b097e408b 100644 (file)
     {.name = "adapter-parent-fabric-wwn", \
      .type = VSH_OT_STRING, \
      .help = N_("adapter parent scsi_hostN fabric_wwn to be used for underlying vHBA storage") \
+    }, \
+    {.name = "source-protocol-ver", \
+     .type = VSH_OT_STRING, \
+     .help = N_("nfsvers value for NFS pool mount option") \
     }
 
 virStoragePoolPtr
@@ -319,7 +323,7 @@ virshBuildPoolXML(vshControl *ctl,
                *secretUsage = NULL, *adapterName = NULL, *adapterParent = NULL,
                *adapterWwnn = NULL, *adapterWwpn = NULL, *secretUUID = NULL,
                *adapterParentWwnn = NULL, *adapterParentWwpn = NULL,
-               *adapterParentFabricWwn = NULL;
+               *adapterParentFabricWwn = NULL, *protoVer = NULL;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
 
     VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid");
@@ -345,7 +349,8 @@ virshBuildPoolXML(vshControl *ctl,
         vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent) < 0 ||
         vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwnn", &adapterParentWwnn) < 0 ||
         vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwpn", &adapterParentWwpn) < 0 ||
-        vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0)
+        vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0 ||
+        vshCommandOptStringReq(ctl, cmd, "source-protocol-ver", &protoVer) < 0)
         goto cleanup;
 
     virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
@@ -394,6 +399,9 @@ virshBuildPoolXML(vshControl *ctl,
         if (srcName)
             virBufferAsprintf(&buf, "<name>%s</name>\n", srcName);
 
+        if (protoVer)
+            virBufferAsprintf(&buf, "<protocol ver='%s'/>\n", protoVer);
+
         virBufferAdjustIndent(&buf, -2);
         virBufferAddLit(&buf, "</source>\n");
     }
index 86a4996caea9193ee1e35015c5ec3f0e65063e67..59a59001624484424a22923613101232e3240008 100644 (file)
@@ -3887,6 +3887,7 @@ just I<--build> is provided, then B<pool-build> is called with no flags.
 [I<--source-name name>] [I<--target path>] [I<--source-format format>]
 [I<--auth-type authtype> I<--auth-username username>
 [I<--secret-usage usage> | I<--secret-uuid uuid>]]
+[I<--source-protocol-ver ver>]
 [[I<--adapter-name name>] | [I<--adapter-wwnn> wwnn I<--adapter-wwpn> wwpn]
 [I<--adapter-parent parent> |
  I<--adapter-parent-wwnn parent_wwnn> I<adapter-parent-wwpn parent_wwpn> |
@@ -3929,6 +3930,10 @@ the storage pool. The I<authtype> is either chap for iscsi I<type> pools or
 ceph for rbd I<type> pools. Either the secret I<usage> or I<uuid> value may
 be provided, but not both.
 
+[I<--source-protocol-ver ver>] provides the NFS protocol version number used
+to contact the server's NFS service via nfs mount option 'nfsvers=n'. It is
+expect the I<ver> value is an unsigned integer.
+
 [I<--adapter-name name>] defines the scsi_hostN adapter name to be used for
 the scsi_host adapter type pool.