[libvirt] [PATCH] storage pool discovery

David Lively dlively at virtualiron.com
Fri Aug 22 20:31:10 UTC 2008


On Fri, 2008-08-22 at 19:16 +0200, Jim Meyering wrote:
> > +            asprintf(&srcSpec,
> > +                     "<source><host name='%.*s' port='%s'/></source>",
> > +                     hostlen, host, port) :
> 
> Do the hostname and port string need to be quoted (and/or evoke
> warning/failure), in case they contain things like "'"?

The host string isn't quoted when creating XML in some similar code in
cmdPoolCreateAs ... but that's not necessarily a good justification.

Is there an existing routine to quote a string to make it suitable for
an XML attribute value?  (Something in libxml2, perhaps??)  I'm not even
sure of the correct syntax to quote a "'" in an attribute value, for
example.

Dave






More information about the libvir-list mailing list