On Thu, Apr 18, 2024 at 12:10:52PM +0200, Thomas Huth wrote: > Since version 2.66, glib has useful URI parsing functions, too. > Use those instead of the QEMU-internal ones to be finally able > to get rid of the latter. > > Since g_uri_get_path() returns a const pointer, we also need to > tweak the parameter of parse_volume_options() (where we use the > result of g_uri_get_path() as input). > > Reviewed-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> > Signed-off-by: Thomas Huth <th...@redhat.com> > --- > block/gluster.c | 71 ++++++++++++++++++++++++------------------------- > 1 file changed, 35 insertions(+), 36 deletions(-) >
> @@ -364,57 +363,57 @@ static int > qemu_gluster_parse_uri(BlockdevOptionsGluster *gconf, > QAPI_LIST_PREPEND(gconf->server, gsconf); > > /* transport */ > - if (!uri->scheme || !strcmp(uri->scheme, "gluster")) { > + uri_scheme = g_uri_get_scheme(uri); > + if (!uri_scheme || !strcmp(uri_scheme, "gluster")) { > gsconf->type = SOCKET_ADDRESS_TYPE_INET; It may be worth a mention in the commit message that we are aware that this provides a positive user-visible change as a side-effect: namely, by virtue of using glib's parser (which normalizes the scheme to lowercase) instead of our own (which did not), we now accept GLUSTER:// URIs in addition to the usual gluster:// spelling. Similar comments to all the other affected patches in the series. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org