On Fri, Apr 12, 2024 at 03:24:12PM +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. The g_uri_get_host() also takes care
> of removing the square brackets from IPv6 addresses, so we can
> drop that part of the QEMU code now, too.
>
> Reviewed-by: Richard W.M. Jones <[email protected]>
> Signed-off-by: Thomas Huth <[email protected]>
> ---
> block/nbd.c | 76 ++++++++++++++++++++++++++---------------------------
> 1 file changed, 37 insertions(+), 39 deletions(-)
>
>
> /* transport */
> - if (!g_strcmp0(uri->scheme, "nbd")) {
> + uri_scheme = g_uri_get_scheme(uri);
> + if (!g_strcmp0(uri_scheme, "nbd")) {
> is_unix = false;
As with gluster, we should probably be using g_ascii_strcasecmp() here
to match the RFC; again, worth a separate patch.
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org