All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@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>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Konstantin Kostiuk" <kkostiuk@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v2 12/13] block/ssh: Use URI parsing code from glib
Date: Fri, 12 Apr 2024 19:04:14 +0200	[thread overview]
Message-ID: <878r1i8qcx.fsf@pond.sub.org> (raw)
In-Reply-To: <fxncshsyb5bnknswy2wkpr6l32adiy5hz6smd42o5eyomezz2k@twgbjztfubps> (Eric Blake's message of "Fri, 12 Apr 2024 09:56:40 -0500")

Eric Blake <eblake@redhat.com> writes:

> On Fri, Apr 12, 2024 at 03:24:14PM +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.
>> 
>> Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  block/ssh.c | 75 ++++++++++++++++++++++++++++-------------------------
>>  1 file changed, 40 insertions(+), 35 deletions(-)
>> 
>
>>  
>> -    if (g_strcmp0(uri->scheme, "ssh") != 0) {
>> +    if (g_strcmp0(g_uri_get_scheme(uri), "ssh") != 0) {
>
> Yet another case-sensitive spot to consider.
>
>>  
>> -    qdict_put_str(options, "path", uri->path);
>> -
>> -    /* Pick out any query parameters that we understand, and ignore
>> -     * the rest.
>> -     */
>> -    for (i = 0; i < qp->n; ++i) {
>> -        if (strcmp(qp->p[i].name, "host_key_check") == 0) {
>> -            qdict_put_str(options, "host_key_check", qp->p[i].value);
>> +    qdict_put_str(options, "path", uri_path);
>> +
>> +    uri_query = g_uri_get_query(uri);
>> +    if (uri_query) {
>> +        g_uri_params_iter_init(&qp, uri_query, -1, "&", G_URI_PARAMS_NONE);
>> +        while (g_uri_params_iter_next(&qp, &qp_name, &qp_value, &gerror)) {
>> +            if (!qp_name || !qp_value || gerror) {
>> +                warn_report("Failed to parse SSH URI parameters '%s'.",
>> +                            uri_query);
>> +                break;
>> +            }
>> +            /*
>> +             * Pick out the query parameters that we understand, and ignore
>> +             * (or rather warn about) the rest.
>> +             */
>> +            if (g_str_equal(qp_name, "host_key_check")) {
>> +                qdict_put_str(options, "host_key_check", qp_value);
>> +            } else {
>> +                warn_report("Unsupported parameter '%s' in URI.", qp_name);
>
> Do we want the trailing '.' in warn_report?

We do not.

> The warning is new; it was not in the old code, nor mentioned in the
> commit message.  It seems like a good idea, but we should be more
> intentional if we intend to make that change.



  reply	other threads:[~2024-04-12 17:05 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é
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 [this message]
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=878r1i8qcx.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.