diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index b911f7c..a8a3f36 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -103,6 +103,23 @@ + + + + + + + + + + + + + + + + + @@ -272,6 +289,9 @@ ocfs2 + + + @@ -286,6 +306,9 @@ nfs + + + @@ -307,6 +330,9 @@ lvm2 + + + @@ -321,6 +347,9 @@ lvm2 + + + @@ -330,13 +359,20 @@ + + + + + + + @@ -345,6 +381,9 @@ + + + @@ -359,6 +398,9 @@ + + + @@ -366,6 +408,9 @@ + + + @@ -379,12 +424,19 @@ + + + + + + + diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index bf86c93..be9effc 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 bedee9e..5f17b5a 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 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 0000000..01fbd9b --- /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 0000000..baab6c0 --- /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 33a7343..2ec29e3 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); }