diff --git a/AUTHORS b/AUTHORS index 3c7319b2b3..8b037a185a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -127,6 +127,7 @@ Patches have also been contributed by: Justin Clift Alan Pevec Aurelien Rougemont + Patrick Dignan [....send patches to get your name here....] diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in index 5c1d36c685..91f70a343d 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -70,6 +70,8 @@ <source> <host name="iscsi.example.com"/> <device path="demo-target"/> + <vendor name="Acme"/> + <product name="model"/&t; </source> ... @@ -108,6 +110,16 @@ 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. Since 0.4.1 + +
vendor
+
Provides optional information about the vendor of the + storage device. This contains a single + attribute name whose value is backend + specific. Since 0.8.4
+
product
+
Provides an optional product name of the storage device. + This contains a single attribute name whose value + is backend specific. Since 0.8.4

Target elements

diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index b911f7cdda..54eb802314 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -103,6 +103,23 @@ + + + + + + + + + + + + + + + + + @@ -286,6 +303,9 @@ nfs + + + @@ -307,6 +327,9 @@ lvm2 + + + @@ -321,6 +344,9 @@ lvm2 + + + @@ -330,13 +356,20 @@ + + + + + + + @@ -345,6 +378,9 @@ + + + @@ -359,6 +395,9 @@ + + + @@ -366,6 +405,9 @@ + + + @@ -379,12 +421,19 @@ + + + + + + + diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 18a6472512..168243fec9 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -284,6 +284,8 @@ virStoragePoolSourceFree(virStoragePoolSourcePtr source) { 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); @@ -465,6 +467,9 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, goto cleanup; } + source->vendor = virXPathString("string(./vendor/@name)", ctxt); + source->product = virXPathString("string(./product/@name)", ctxt); + ret = 0; cleanup: ctxt->node = relnode; @@ -838,6 +843,15 @@ virStoragePoolSourceFormat(virBufferPtr buf, virBufferVSprintf(buf," \n", src->auth.chap.login, src->auth.chap.passwd); + + if (src->vendor != NULL) { + virBufferEscapeString(buf," \n", src->vendor); + } + + if (src->product != NULL) { + virBufferEscapeString(buf," \n", src->product); + } + virBufferAddLit(buf," \n"); return 0; diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index bedee9efee..fef0a462ce 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -237,6 +237,12 @@ struct _virStoragePoolSource { 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 */ }; diff --git a/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml b/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml new file mode 100644 index 0000000000..01fbd9b7ce --- /dev/null +++ b/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml @@ -0,0 +1,19 @@ + + virtimages + e9392370-2917-565e-692b-d057f46512d6 + + + + + + + + + /dev/disk/by-path + + 0700 + 0 + 0 + + + diff --git a/tests/storagepoolxml2xmlout/pool-iscsi-vendor-product.xml b/tests/storagepoolxml2xmlout/pool-iscsi-vendor-product.xml new file mode 100644 index 0000000000..baab6c0232 --- /dev/null +++ b/tests/storagepoolxml2xmlout/pool-iscsi-vendor-product.xml @@ -0,0 +1,22 @@ + + virtimages + e9392370-2917-565e-692b-d057f46512d6 + 0 + 0 + 0 + + + + + + + + + /dev/disk/by-path + + 0700 + 0 + 0 + + + diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 33a7343910..2ec29e3260 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -96,6 +96,7 @@ mymain(int argc, char **argv) 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); }