Closed liubin closed 2 years ago
@jodh-intel @mxpv @Tim-Zhang
I tried another method to achieve it. This method depends on the format of the address passed by the user. The specific rules are as follows:
vsock://xxx:xx -> Vsock unix:///run/aaa.sock -> normal Unix domain sock /run/abc.sock -> abstract Unix sock other:///run/d.sock -> error
This method has a bigger problem, that is, compatibility. Users of the original version will get an abstract socket if they use unix:///run/a.sock
, but will get a normal Unix socket in this version. To use abstract Unix socket, users must use /run/abs.sock
as the address parameter.
Thanks for @teawater , here are some other patterns for abstract socket:
unix://@/run/aaa.sock
-> abstract socket: /run/aaa.sock@unix:///run/aaa.sock
-> abstract socket: /run/aaa.sock@/run/aaa.sock
-> abstract socket: /run/aaa.sockThe @
mark is what we can see from netstat
command for abstract sockets.
/cc @lifupan
I vote for option 1
I'd prefer 3
I'd vote for 1 (as we already use that format for https://github.com/kata-containers/kata-containers/tree/main/src/tools/agent-ctl here: https://github.com/kata-containers/kata-containers/blob/main/src/tools/agent-ctl/src/client.rs#L456..L463 ;)
Regarding compatability, you could bump the semver major, but that won't help much given the API hasn't changed. So maybe add a #[deprecated(since="a.b.c", note = "please use new_func() instead")]
but maintain the abstract compat in that function for a few releases on the original function, but introduce a new API that understands the new @
syntax.
I vote for option 1
To let Linux os use normal Unix domain socket, this commit extends the Domain enum and control the socket type by the address pattern passed in:
Fixes: #115
Signed-off-by: bin liu bin@hyper.sh