Justin Clift <jclift@redhat.com>
Alan Pevec <apevec@redhat.com>
Aurelien Rougemont <beorn@binaries.fr>
+ Patrick Dignan <pat_dignan@dell.com>
[....send patches to get your name here....]
<source>
<host name="iscsi.example.com"/>
<device path="demo-target"/>
+ <vendor name="Acme"/>
+ <product name="model"/&t;
</source>
...</pre>
type, or network filesystem type, or partition table type, or
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>vendor</code></dt>
+ <dd>Provides optional information about the vendor of the
+ storage device. This contains a single
+ attribute <code>name</code> whose value is backend
+ specific. <span class="since">Since 0.8.4</span></dd>
+ <dt><code>product</code></dt>
+ <dd>Provides an optional product name of the storage device.
+ This contains a single attribute <code>name</code> whose value
+ is backend specific. <span class="since">Since 0.8.4</span></dd>
</dl>
<h3><a name="StoragePoolTarget">Target elements</a></h3>
<ref name='target'/>
</define>
+ <define name='sourceinfovendor'>
+ <optional>
+ <element name='vendor'>
+ <attribute name='name'>
+ <text/>
+ </attribute>
+ </element>
+ </optional>
+ <optional>
+ <element name='product'>
+ <attribute name='name'>
+ <text/>
+ </attribute>
+ </element>
+ </optional>
+ </define>
+
<define name='commonmetadata'>
<element name='name'>
<ref name='name'/>
<value>nfs</value>
</choice>
</attribute>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</optional>
</define>
<value>lvm2</value>
</choice>
</attribute>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</optional>
</define>
<value>lvm2</value>
</choice>
</attribute>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</optional>
</define>
<optional>
<element name='source'>
<empty/>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</optional>
</define>
+
<define name='sourcefs'>
<element name='source'>
<ref name='sourceinfodev'/>
<ref name='sourcefmtfs'/>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</define>
<ref name='sourceinfohost'/>
<ref name='sourceinfodir'/>
<ref name='sourcefmtnetfs'/>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</define>
</optional>
</oneOrMore>
<ref name='sourcefmtlogical'/>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</define>
<element name='source'>
<ref name='sourceinfodev'/>
<ref name='sourcefmtdisk'/>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</define>
<optional>
<ref name='sourceinfoauth'/>
</optional>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
</element>
</define>
<define name='sourcescsi'>
<element name='source'>
<ref name='sourceinfoadapter'/>
+ <optional>
+ <ref name='sourceinfovendor'/>
+ </optional>
+
</element>
</define>
VIR_FREE(source->name);
VIR_FREE(source->adapter);
VIR_FREE(source->initiator.iqn);
+ VIR_FREE(source->vendor);
+ VIR_FREE(source->product);
if (source->authType == VIR_STORAGE_POOL_AUTH_CHAP) {
VIR_FREE(source->auth.chap.login);
goto cleanup;
}
+ source->vendor = virXPathString("string(./vendor/@name)", ctxt);
+ source->product = virXPathString("string(./product/@name)", ctxt);
+
ret = 0;
cleanup:
ctxt->node = relnode;
virBufferVSprintf(buf," <auth type='chap' login='%s' passwd='%s'/>\n",
src->auth.chap.login,
src->auth.chap.passwd);
+
+ if (src->vendor != NULL) {
+ virBufferEscapeString(buf," <vendor name='%s'/>\n", src->vendor);
+ }
+
+ if (src->product != NULL) {
+ virBufferEscapeString(buf," <product name='%s'/>\n", src->product);
+ }
+
virBufferAddLit(buf," </source>\n");
return 0;
virStoragePoolAuthChap chap;
} auth;
+ /* Vendor of the source */
+ char *vendor;
+
+ /* Product name of the source*/
+ char *product;
+
int format; /* Pool type specific format such as filesystem type, or lvm version, etc */
};
--- /dev/null
+<pool type='iscsi'>
+ <name>virtimages</name>
+ <uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
+ <source>
+ <host name="iscsi.example.com"/>
+ <device path="demo-target"/>
+ <auth type='chap' login='foobar' passwd='frobbar'/>
+ <vendor name='test-vendor'/>
+ <product name='test-product'/>
+ </source>
+ <target>
+ <path>/dev/disk/by-path</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>0</owner>
+ <group>0</group>
+ </permissions>
+ </target>
+</pool>
--- /dev/null
+<pool type='iscsi'>
+ <name>virtimages</name>
+ <uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
+ <capacity>0</capacity>
+ <allocation>0</allocation>
+ <available>0</available>
+ <source>
+ <host name='iscsi.example.com'/>
+ <device path='demo-target'/>
+ <auth type='chap' login='foobar' passwd='frobbar'/>
+ <vendor name='test-vendor'/>
+ <product name='test-product'/>
+ </source>
+ <target>
+ <path>/dev/disk/by-path</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>0</owner>
+ <group>0</group>
+ </permissions>
+ </target>
+</pool>
DO_TEST("pool-scsi");
DO_TEST("pool-mpath");
DO_TEST("pool-iscsi-multiiqn");
+ DO_TEST("pool-iscsi-vendor-product");
return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}