</source>
...</pre>
+ <pre>
+...
+ <source>
+ <host name='localhost'/>
+ <dir path='/var/lib/libvirt/images'/>
+ <format type='nfs'/>
+ <protocol ver='3'/>
+ </source>
+...</pre>
+
<dl>
<dt><code>device</code></dt>
<dd>Provides the source for pools backed by physical devices
LVM metadata type. All drivers are required to have a default
value for this, so it is optional. <span class="since">Since 0.4.1</span></dd>
+ <dt><code>protocol</code></dt>
+ <dd>For a <code>netfs</code> Storage Pool provide a mechanism to
+ define which NFS protocol version number will be used to contact
+ the server's NFS service. The attribute <code>ver</code> accepts
+ an unsigned integer as the version number to use.
+ <span class="since">Since 5.1.0</span></dd>
<dt><code>vendor</code></dt>
<dd>Provides optional information about the vendor of the
storage device. This contains a single
<ref name='sourceinfohost'/>
<ref name='sourceinfodir'/>
<ref name='sourcefmtnetfs'/>
+ <optional>
+ <element name='protocol'>
+ <attribute name='ver'>
+ <ref name='unsignedInt'/>
+ </attribute>
+ </element>
+ </optional>
<optional>
<ref name='sourceinfovendor'/>
</optional>
virStorageAuthDefPtr authdef = NULL;
char *name = NULL;
char *port = NULL;
+ char *ver = NULL;
int n;
relnode = ctxt->node;
authdef = NULL;
}
+ /* Option protocol version string (NFSvN) */
+ if ((ver = virXPathString("string(./protocol/@ver)", ctxt))) {
+ if ((source->format != VIR_STORAGE_POOL_NETFS_NFS) &&
+ (source->format != VIR_STORAGE_POOL_NETFS_AUTO)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("storage pool protocol ver unsupported for "
+ "pool type '%s'"),
+ virStoragePoolFormatFileSystemNetTypeToString(source->format));
+ goto cleanup;
+ }
+ if (virStrToLong_uip(ver, NULL, 0, &source->protocolVer) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("storage pool protocol ver '%s' is malformaed"),
+ ver);
+ goto cleanup;
+ }
+ }
+
source->vendor = virXPathString("string(./vendor/@name)", ctxt);
source->product = virXPathString("string(./product/@name)", ctxt);
if (src->auth)
virStorageAuthDefFormat(buf, src->auth);
+ if (src->protocolVer)
+ virBufferAsprintf(buf, "<protocol ver='%u'/>\n", src->protocolVer);
+
virBufferEscapeString(buf, "<vendor name='%s'/>\n", src->vendor);
virBufferEscapeString(buf, "<product name='%s'/>\n", src->product);
* or lvm version, etc.
*/
int format;
+
+ /* Protocol version value for netfs */
+ unsigned int protocolVer;
};
typedef struct _virStoragePoolTarget virStoragePoolTarget;
--- /dev/null
+<pool type='netfs'>
+ <name>nfsimages</name>
+ <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
+ <capacity>0</capacity>
+ <allocation>0</allocation>
+ <available>0</available>
+ <source>
+ <host name='localhost'/>
+ <dir path='/var/lib/libvirt/images'/>
+ <format type='nfs'/>
+ <protocol ver='3'/>
+ </source>
+ <target>
+ <path>/mnt</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>0</owner>
+ <group>0</group>
+ </permissions>
+ </target>
+</pool>
--- /dev/null
+<pool type='netfs'>
+ <name>nfsimages</name>
+ <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
+ <capacity unit='bytes'>0</capacity>
+ <allocation unit='bytes'>0</allocation>
+ <available unit='bytes'>0</available>
+ <source>
+ <host name='localhost'/>
+ <dir path='/var/lib/libvirt/images'/>
+ <format type='nfs'/>
+ <protocol ver='3'/>
+ </source>
+ <target>
+ <path>/mnt</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>0</owner>
+ <group>0</group>
+ </permissions>
+ </target>
+</pool>
DO_TEST("pool-iscsi-auth");
DO_TEST("pool-netfs");
DO_TEST("pool-netfs-auto");
+ DO_TEST("pool-netfs-protocol-ver");
DO_TEST("pool-netfs-gluster");
DO_TEST("pool-netfs-cifs");
DO_TEST("pool-scsi");