Re-adding Snesha: +sneshaf@microsoft.com

Hi Pino,

Thanks, this looks like a good list of alternatives.  I think (b) is probably the way to go.  I'm willing to just add the query string to the path in only the HTTP and HTTPS cases for now.  If other protocols run into some problems around lacking query strings we can probably re-visit the issue.  The (a) option seems needlessly complex and bug prone to me.

-- Gabriel
 
We have few possibilities at this point, in order of complexity:

(a) split the query string into an "hash table" (i.e. a C list of
key/value items), pass that as new parameter to add_drive, and rebuild
a query string depending on the backend (direct/qemu, libvirt, etc) and
on the protocol (http, nbd, etc)

(b) pass the query string as-is (percent-encoded or not) to add_drive,
and add it back depending on the protocol

(c) join the query string to the path, depending on the protocol, in
guestfish

Your solution so far is (c), while IMHO a better one would be (b) or
even (a).

Also, something more to check is how e.g. libvirt needs such kind of
URI parameter after the path, and how. You can check whether your
change also work with libvirt by exporting LIBGUESTFS_BACKEND=libvirt
(or also using "set-backend libvirt" in guestfish), provided you have
built libguestfs with libvirt support.