On 08/17/2010 12:06 PM, Daniel P. Berrange wrote:
On Mon, Aug 09, 2010 at 02:32:55PM -0500, Patrick Dignan wrote:
> Somehow the git-send-email patch didn't make it to the mailing list,
> though my reply to it did...I've attached the patch here, hopefully this
> one doesn't get flattened.
>
> I decided to allow vendor and product to be set independently of each
> other in order to allow greater flexibility at the possible expense of
> namespace clashes.
> From 3a2139c87a1d1c92a8bf947ecc5b431f0f67906c Mon Sep 17 00:00:00 2001
> From: Patrick Dignan<pat_dignan(a)dell.com>
> Date: Fri, 6 Aug 2010 11:08:03 -0500
> Subject: [PATCH] Add support for vendor/product
>
> ---
> docs/schemas/storagepool.rng | 52 ++++++++++++++++++++
> src/conf/storage_conf.c | 14 +++++
> src/conf/storage_conf.h | 6 ++
> .../pool-iscsi-vendor-product.xml | 19 +++++++
> .../pool-iscsi-vendor-product.xml | 22 ++++++++
> tests/storagepoolxml2xmltest.c | 1 +
> 6 files changed, 114 insertions(+), 0 deletions(-)
> create mode 100644 tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml
> create mode 100644 tests/storagepoolxml2xmlout/pool-iscsi-vendor-product.xml
>
> @@ -838,6 +843,15 @@ virStoragePoolSourceFormat(virBufferPtr buf,
> virBufferVSprintf(buf,"<auth type='chap' login='%s'
passwd='%s'/>\n",
> src->auth.chap.login,
> src->auth.chap.passwd);
> +
> + if (src->vendor != NULL) {
> + virBufferVSprintf(buf,"<vendor name='%s'/>\n",
src->vendor);
> + }
> +
> + if (src->product != NULL) {
> + virBufferVSprintf(buf,"<product name='%s'/>\n",
src->product);
> + }
> +
> virBufferAddLit(buf,"</source>\n");
The only change is that these should use virBufferEscapeString
since vendor/product strings might contain<,> or& characters
which would make the XML unhappy
Regards,
Daniel
Ok, so I've updated that. Hopefully all is well with this patch!
Best,
Patrick Dignan