[PATCH 0/3] esx: Form URLs containing IPv6 addresses correctly

Richard W.M. Jones via Devel posted 3 patches 6 days, 17 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20260126110905.1316001-1-rjones@redhat.com
There is a newer version of this series
[PATCH 0/3] esx: Form URLs containing IPv6 addresses correctly
Posted by Richard W.M. Jones via Devel 6 days, 17 hours ago
https://issues.redhat.com/browse/RHEL-138300

This bug requires a further fix to allow libvirt to access ESXi
servers over IPv6.  The way that we constructed the URL (for fetching
things from the SDK with curl) was wrong.  We formed URLs like:

  https://1234:56:0:789a:bcde:72ff:fe0a:7baa:443/sdk

but with IPv6 we need to put [...] around the IPv6 address.

The first patch just adds some debugging so we can see what URLs we
are passing to curl.  THe second patch is a bit of abstraction so that
we're only creating URLs in one place (but two functions).  The third
detects if the server name is an IPv6 address and adds the square
brackets as appropriate.

Tested by me, by connecting to an IPv6 VMware server and listing all
the domains, and getting the libvirt XML of a single domain.  I didn't
test all possible operations in depth.

The bug was reported by Ming Xie.

Rich.
Re: [PATCH 0/3] esx: Form URLs containing IPv6 addresses correctly
Posted by Michal Prívozník via Devel 6 days, 15 hours ago
On 1/26/26 12:04, Richard W.M. Jones wrote:
> https://issues.redhat.com/browse/RHEL-138300
> 
> This bug requires a further fix to allow libvirt to access ESXi
> servers over IPv6.  The way that we constructed the URL (for fetching
> things from the SDK with curl) was wrong.  We formed URLs like:
> 
>   https://1234:56:0:789a:bcde:72ff:fe0a:7baa:443/sdk
> 
> but with IPv6 we need to put [...] around the IPv6 address.
> 
> The first patch just adds some debugging so we can see what URLs we
> are passing to curl.  THe second patch is a bit of abstraction so that
> we're only creating URLs in one place (but two functions).  The third
> detects if the server name is an IPv6 address and adds the square
> brackets as appropriate.
> 
> Tested by me, by connecting to an IPv6 VMware server and listing all
> the domains, and getting the libvirt XML of a single domain.  I didn't
> test all possible operations in depth.
> 
> The bug was reported by Ming Xie.
> 
> Rich.
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal