[PATCH 2/3] qemuBlockStorageSourceGetURI: Properly preserve query component

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux