[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: IPv6 hostfwd command line syntax [was Re: [PATCH v6 2/4] util/q
From: |
Daniel P . Berrangé |
Subject: |
Re: RFC: IPv6 hostfwd command line syntax [was Re: [PATCH v6 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse] |
Date: |
Wed, 26 May 2021 14:57:21 +0100 |
User-agent: |
Mutt/2.0.7 (2021-05-04) |
On Tue, May 25, 2021 at 12:37:21PM -0700, Doug Evans wrote:
> Hi.
>
> I want to confirm the command line syntax y'all want for ipv6 host
> forwarding.
>
> IIUC, the command line syntax is required to be consistent with the use of
> "ipv6=on|off" elsewhere.
> Can you confirm that's correct?
>
> If so, how does one apply "ipv6=on" to the "::60022-:22" hostfwd spec in
> the following example:
>
> $ qemu-system-x86_64 [...] --nic user,id=n1,model=e1000,hostfwd=::60022-:22
>
> ?
Probably easier if we start from the HMP hostfwd_add command which takes
hostfwd_add ::60022-:22
With that, adding the flags is obvious
hostfwd_add ::60022-:22,ipv6=on|off,ipv4=on|off
IIUC, that can be handled in the slirp_hostfwd() method impl.
The question is then how this works on the CLI. IIUC ,the "hostfwd=XXX"
ARG value is passed to slirp_hostfwd() eventually, so the change for
the HMP parsing will "just work".
The complication is that the comma is ambiguous between the --net arg
parsing, and the hostfwd parsing. So you would end up having to escape
the commas (ie replace , with ,,):
--nic user,id=n1,model=e1000,hostfwd=::60022-:22,,ipv6=on,,ipv4=on
If you forget to escape the commas, then the flag ends up applying
to the --nic instead, where ipv4/ipv6 are indeed value for other
reasons.
This kind of sucks, but that's where we are with the old fashioned
design of --nic parsing
Not sure if someone else has better ideas here ?
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 :|