[libvirt] [PATCH 06/14] Store parsed query parameters directly in the virURIPtr struct

Eric Blake eblake at redhat.com
Fri Mar 23 22:41:37 UTC 2012


On 03/20/2012 11:33 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Avoid the need for each driver to parse query parameters itself
> by storing them directly in the virURIPtr struct. The parsing
> code is a copy of that from src/util/qparams.c  The latter will
> be removed in a later patch
> 
> * src/util/viruri.h: Add query params to virURIPtr
> * src/util/viruri.c: Parse query parameters when creating virURIPtr
> * tests/viruritest.c: Expand test to cover params
> ---
>  src/libvirt_private.syms |    1 +
>  src/util/viruri.c        |  139 ++++++++++++++++++++++++++++++++++++++++++++++
>  src/util/viruri.h        |   15 +++++
>  tests/viruritest.c       |   46 +++++++++++++---
>  4 files changed, 193 insertions(+), 8 deletions(-)

This patch does not round-trip queries that include % escapes.  The old
qparamtest.c tried to roundtrip foo=one%20two (the literal value of 'one
two' when not URI-encoded); but now virURIFormat re-escapes the % into
one%2520two.  I caught this with my attempt to enhance viruritest to the
same level as qparamtest, but didn't want to spend any further time in
fixing viruri.c.

https://www.redhat.com/archives/libvir-list/2012-March/msg01043.html

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120323/654ca385/attachment-0001.sig>


More information about the libvir-list mailing list