Look for the questionmark in the name and move the contents into the
query portion so that we format the URI back properly.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_block.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 648c3f1026..c51fb2b6ea 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -429,12 +429,18 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
}
if (src->path) {
+ char *query;
if (src->volume) {
uri->path = g_strdup_printf("/%s/%s", src->volume,
src->path);
} else {
uri->path = g_strdup_printf("%s%s", src->path[0] ==
'/' ? "" : "/",
src->path);
}
+
+ if ((query = strchr(uri->path, '?'))) {
+ uri->query = g_strdup(query + 1);
+ *query = '\0';
+ }
}
uri->server = g_strdup(src->hosts->name);
--
2.24.1