qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Peter Lieven" <pl@kamp.de>,
	"Richard W.M. Jones" <rjones@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Konstantin Kostiuk" <kkostiuk@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v2 09/13] block/gluster: Use URI parsing code from glib
Date: Mon, 15 Apr 2024 18:23:49 +0100	[thread overview]
Message-ID: <Zh1ipU7Zgd_ViPH5@redhat.com> (raw)
In-Reply-To: <zrdtuxegb3kyrp6qobgpygmoydiigpc6tv5e4jk7w7fi7cwvr3@pivj5d3df5uj>

On Fri, Apr 12, 2024 at 09:40:11AM -0500, Eric Blake wrote:
> On Fri, Apr 12, 2024 at 03:24:11PM +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.
> > 
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> >  block/gluster.c | 71 ++++++++++++++++++++++++-------------------------
> >  1 file changed, 35 insertions(+), 36 deletions(-)
> > 
> > diff --git a/block/gluster.c b/block/gluster.c
> > index cc74af06dc..1c9505f8bb 100644
> > --- a/block/gluster.c
> > +++ b/block/gluster.c
> > @@ -17,7 +17,6 @@
> >  #include "qapi/error.h"
> >  #include "qapi/qmp/qdict.h"
> >  #include "qapi/qmp/qerror.h"
> > -#include "qemu/uri.h"
> >  #include "qemu/error-report.h"
> >  #include "qemu/module.h"
> >  #include "qemu/option.h"
> > @@ -289,9 +288,9 @@ static void glfs_clear_preopened(glfs_t *fs)
> >      }
> >  }
> >  
> > -static int parse_volume_options(BlockdevOptionsGluster *gconf, char *path)
> > +static int parse_volume_options(BlockdevOptionsGluster *gconf, const char *path)
> 
> Is it worth mentioning in the commit message that this includes a
> const-correctness tweak?
> 
> > @@ -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")) {
> 
> Pre-existing, but per RFC 3986, we should probably be using strcasecmp
> for scheme comparisons (I'm not sure if g_uri_parse guarantees a
> lower-case return, even when the user passed in upper case).  That can
> be a separate patch.

Docs say it is lowercase:

  https://developer-old.gnome.org/glib/stable/glib-URI-Functions.html

  "on return, contains the scheme (converted to lowercase), or NULL."

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  parent reply	other threads:[~2024-04-15 17:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 13:24 [PATCH v2 00/13] Drop old distros, bump glib and switch to glib URI parsing code Thomas Huth
2024-04-12 13:24 ` [PATCH v2 01/13] tests: Remove Ubuntu 20.04 container Thomas Huth
2024-04-12 17:18   ` Philippe Mathieu-Daudé
2024-04-12 13:24 ` [PATCH v2 02/13] tests/lcitool/libvirt-ci: Update to the latest master branch Thomas Huth
2024-04-15 17:09   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 03/13] tests/docker/dockerfiles: Run lcitool-refresh after the lcitool update Thomas Huth
2024-04-15 17:11   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 04/13] tests: Update our CI to use CentOS Stream 9 instead of 8 Thomas Huth
2024-04-15 17:12   ` Daniel P. Berrangé
2024-04-17 16:15   ` Daniel P. Berrangé
2024-04-18  6:19     ` Thomas Huth
2024-04-12 13:24 ` [PATCH v2 05/13] .travis.yml: Update the jobs to Ubuntu 22.04 Thomas Huth
2024-04-15 17:13   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 06/13] ci: move external build environment setups to CentOS Stream 9 Thomas Huth
2024-04-15 17:15   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 07/13] Bump minimum glib version to v2.66 Thomas Huth
2024-04-15 17:16   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 08/13] Remove glib compatibility code that is not required anymore Thomas Huth
2024-04-15 17:16   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 09/13] block/gluster: Use URI parsing code from glib Thomas Huth
2024-04-12 14:40   ` Eric Blake
2024-04-12 14:43     ` Eric Blake
2024-04-15 17:23     ` Daniel P. Berrangé [this message]
2024-04-18  6:13     ` Thomas Huth
2024-04-15 17:19   ` Daniel P. Berrangé
2024-04-12 13:24 ` [PATCH v2 10/13] block/nbd: " Thomas Huth
2024-04-12 14:45   ` Eric Blake
2024-04-12 13:24 ` [PATCH v2 11/13] block/nfs: " Thomas Huth
2024-04-12 14:49   ` Eric Blake
2024-04-12 13:24 ` [PATCH v2 12/13] block/ssh: " Thomas Huth
2024-04-12 14:56   ` Eric Blake
2024-04-12 17:04     ` Markus Armbruster
2024-04-12 13:24 ` [PATCH v2 13/13] util/uri: Remove the old URI parsing code Thomas Huth
2024-04-12 14:59   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zh1ipU7Zgd_ViPH5@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kkostiuk@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).