qemu-sockets: add abstract UNIX domain socket support

unix_listen/connect_saddr now support abstract address types

two aditional BOOL switches are introduced:
tight: whether to set @addrlen to the minimal string length,
       or the maximum sun_path length. default is TRUE
abstract: whether we use abstract address. default is FALSE

cli example:
-monitor unix:/tmp/unix.socket,abstract,tight=off
OR
-chardev socket,path=/tmp/unix.socket,id=unix1,abstract,tight=on

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
xiaoqiang zhao 2020-05-16 11:13:25 +08:00 committed by Daniel P. Berrangé
parent f2465433b4
commit 776b97d360
4 changed files with 50 additions and 8 deletions

View file

@ -939,6 +939,13 @@ QemuOptsList qemu_chardev_opts = {
},{
.name = "logappend",
.type = QEMU_OPT_BOOL,
},{
.name = "tight",
.type = QEMU_OPT_BOOL,
.def_value_str = "on",
},{
.name = "abstract",
.type = QEMU_OPT_BOOL,
},
{ /* end of list */ }
},