Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-14 Thread Doug Evans
On Sat, Mar 6, 2021 at 11:29 AM Samuel Thibault wrote: > Hello, > > Doug Evans, le ven. 05 mars 2021 17:00:13 -0800, a ecrit: > > Is it possible for QEMU to lazily determine the guest's IPv6 > > address? I.e., postpone the ""->guest address mapping until it's > > needed and then, say, take the

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-06 Thread Samuel Thibault
Hello, Doug Evans, le ven. 05 mars 2021 17:00:13 -0800, a ecrit: > Is it possible for QEMU to lazily determine the guest's IPv6 > address? I.e., postpone the ""->guest address mapping until it's > needed and then, say, take the first entry in the NDP table? That would probably be possible, yes,

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-05 Thread Doug Evans
On Fri, Mar 5, 2021 at 4:10 PM Samuel Thibault wrote: > Doug Evans, le ven. 05 mars 2021 16:05:05 -0800, a ecrit: > > Given that the code is not supposed to be able to know brackets were > present > > (they're stripped off early on), what does the above mean w.r.t. the > guest? > > For the host

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-05 Thread Samuel Thibault
Doug Evans, le ven. 05 mars 2021 16:05:05 -0800, a ecrit: > Given that the code is not supposed to be able to know brackets were present > (they're stripped off early on), what does the above mean w.r.t. the guest? > For the host we can have "" mean listen on both IPv4 and IPv6 > (by default,

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-05 Thread Doug Evans
On Fri, Mar 5, 2021 at 1:28 PM Samuel Thibault wrote: > Daniel P. Berrangé, le mer. 03 mars 2021 18:11:41 +, a ecrit: > > On Wed, Mar 03, 2021 at 10:06:50AM -0800, Doug Evans wrote: > > > On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault < > samuel.thiba...@gnu.org> > > > wrote: > > > > > > >

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-05 Thread Doug Evans
On Fri, Mar 5, 2021 at 1:51 PM Doug Evans wrote: > On Fri, Mar 5, 2021 at 1:28 PM Samuel Thibault > wrote: > >> Daniel P. Berrangé, le mer. 03 mars 2021 18:11:41 +, a ecrit: >> > On Wed, Mar 03, 2021 at 10:06:50AM -0800, Doug Evans wrote: >> > > On Sun, Feb 28, 2021 at 1:40 PM Samuel

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-05 Thread Doug Evans
On Fri, Mar 5, 2021 at 1:28 PM Samuel Thibault wrote: > Daniel P. Berrangé, le mer. 03 mars 2021 18:11:41 +, a ecrit: > > On Wed, Mar 03, 2021 at 10:06:50AM -0800, Doug Evans wrote: > > > On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault < > samuel.thiba...@gnu.org> > > > wrote: > > > > > > >

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-05 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 03 mars 2021 18:11:41 +, a ecrit: > On Wed, Mar 03, 2021 at 10:06:50AM -0800, Doug Evans wrote: > > On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault > > wrote: > > > > > > + Examples: > > > > + hostfwd_add net0 tcp:127.0.0.1:10022-:22 > > > > + hostfwd_add net0

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-03 Thread Daniel P . Berrangé
On Wed, Mar 03, 2021 at 10:06:50AM -0800, Doug Evans wrote: > On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault > wrote: > > > [...] > > > > > + Examples: > > > + hostfwd_add net0 tcp:127.0.0.1:10022-:22 > > > + hostfwd_add net0 tcp:[::1]:10022-[fe80::1:2:3:4]:22 > > > > Yep, that looks good to

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-03 Thread Doug Evans
On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault wrote: > [...] > > > + Examples: > > + hostfwd_add net0 tcp:127.0.0.1:10022-:22 > > + hostfwd_add net0 tcp:[::1]:10022-[fe80::1:2:3:4]:22 > > Yep, that looks good to me. > > Daniel, you wanted me to use inet_parse(). Is the above syntax ok with

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Samuel Thibault
Samuel Thibault, le lun. 01 mars 2021 17:27:47 +0100, a ecrit: > Doug Evans, le lun. 01 mars 2021 08:23:03 -0800, a ecrit: > > On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault <[1]samuel.thiba...@gnu.org> > > wrote: > > > > [...] > > > Note that one issue I am leaving for later (i.e., I

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Samuel Thibault
Samuel Thibault, le lun. 01 mars 2021 17:26:23 +0100, a ecrit: > We could make libslirp enable the IPV6ONLY flag to avoid that, and > make qemu pass an AF_UNSPEC address for the ipv4+ipv6 case, in which > case libslirp wouldn't set IPV6ONLY. Ah, no, AF_UNSPEC would not allow to specify the port.

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Samuel Thibault
Doug Evans, le lun. 01 mars 2021 08:23:03 -0800, a ecrit: > On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault <[1]samuel.thiba...@gnu.org> > wrote: > > [...] > > Note that one issue I am leaving for later (i.e., I don't want to drag > this > > patch series out to include it), is

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Samuel Thibault
Doug Evans, le lun. 01 mars 2021 08:07:19 -0800, a ecrit: > Are there any users that this functional change would break? > [Previously the empty address meant qemu would only listen on ipv4 addr-any.] One case that could be broken would be a user having already another service listening on

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Doug Evans
On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault wrote: > [...] > > Note that one issue I am leaving for later (i.e., I don't want to drag > this > > patch series out to include it), is whether and how to support > ipv4-host-> > > ipv6-guest forwarding and vice versa. Can libslirp support this? >

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Doug Evans
On Sun, Feb 28, 2021 at 1:40 PM Samuel Thibault wrote: > Hello, > > Daniel P. Berrangé, le lun. 22 févr. 2021 09:39:41 +, a ecrit: > > > The is_v6 flag is only needed > > for the legacy compat needs in slirp, even that is only if we want to > > have strict equivalence with historical

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Samuel Thibault
Markus Armbruster, le lun. 01 mars 2021 09:15:41 +0100, a ecrit: > Samuel Thibault writes: > > Specifying [127.0.0.1] would be odd, but for instance > > > > ssh localhost -D '[127.0.0.1]':23456 > > > > happens to listen on 127.0.0.1. So I would say that common practice > > really is that [] only

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-03-01 Thread Markus Armbruster
Samuel Thibault writes: > Hello, > > Daniel P. Berrangé, le lun. 22 févr. 2021 09:39:41 +, a ecrit: >> In general callers shouldn't care about which format was parsed. The use >> of [] is just a mechanism to reliably separate the port from the address. >> Once you have the address part

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-28 Thread Samuel Thibault
Samuel Thibault, le dim. 28 févr. 2021 22:39:57 +0100, a ecrit: > It was simpler to have e.g. udp_listen and udp6_listen separate to keep > uint32_t / in6_addr parameters, but there is no strict reason for this: > the haddr is only passed to the bind() call, and the laddr is only > recorded in the

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-28 Thread Samuel Thibault
Hello, Daniel P. Berrangé, le lun. 22 févr. 2021 09:39:41 +, a ecrit: > In general callers shouldn't care about which format was parsed. The use > of [] is just a mechanism to reliably separate the port from the address. > Once you have the address part getaddrinfo() will reliably parse the >

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-23 Thread Doug Evans
On Mon, Feb 22, 2021 at 1:39 AM Daniel P. Berrangé wrote: > On Fri, Feb 19, 2021 at 02:17:42PM -0800, Doug Evans wrote: > > On Fri, Feb 19, 2021 at 2:00 AM Daniel P. Berrangé > > wrote: > > > > > On Thu, Feb 18, 2021 at 12:15:36PM -0800, Doug Evans wrote: > > > > The parsing is moved into new

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-22 Thread Daniel P . Berrangé
On Fri, Feb 19, 2021 at 02:17:42PM -0800, Doug Evans wrote: > On Fri, Feb 19, 2021 at 2:00 AM Daniel P. Berrangé > wrote: > > > On Thu, Feb 18, 2021 at 12:15:36PM -0800, Doug Evans wrote: > > > The parsing is moved into new function inet_parse_host_and_port. > > > This is done in preparation for

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-19 Thread Doug Evans
On Fri, Feb 19, 2021 at 2:00 AM Daniel P. Berrangé wrote: > On Thu, Feb 18, 2021 at 12:15:36PM -0800, Doug Evans wrote: > > The parsing is moved into new function inet_parse_host_and_port. > > This is done in preparation for using the function in net/slirp.c. > > > > Signed-off-by: Doug Evans >

Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-19 Thread Daniel P . Berrangé
On Thu, Feb 18, 2021 at 12:15:36PM -0800, Doug Evans wrote: > The parsing is moved into new function inet_parse_host_and_port. > This is done in preparation for using the function in net/slirp.c. > > Signed-off-by: Doug Evans > --- > > Changes from v3: > - this patch is new in v4 > - provides

[PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse

2021-02-18 Thread Doug Evans via
The parsing is moved into new function inet_parse_host_and_port. This is done in preparation for using the function in net/slirp.c. Signed-off-by: Doug Evans --- Changes from v3: - this patch is new in v4 - provides new utility: inet_parse_host_and_port, updates inet_parse to use it