libxl_dm: Pre-open QMP socket for QEMU
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 31 May 2018 13:43:20 +0000 (14:43 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 11 Jan 2019 14:57:52 +0000 (14:57 +0000)
commit77b595836bfd97711afae9b1bb2548e33e87b042
treee56ee471b69b05c2c9e7a341d4589f253da80279
parente3f606ca1a05a6fee5516b687ac035638eba1c2a
libxl_dm: Pre-open QMP socket for QEMU

This patch moves the creation of the QMP unix socket from QEMU to libxl.
But libxl doesn't rely on this yet.

When starting QEMU with dm_restrict=1, pre-open the QMP socket before
exec QEMU. That socket will be useful to find out if QEMU is ready, and
pre-opening it means that libxl can connect to it without waiting for
QEMU to create it.

The pre-opening is conditional, based on the use of dm_restrict
because it is using a new command line option of QEMU, and dm_restrict
support in QEMU is newer.

-chardev socket,fd=X is available with QEMU 2.12, since commit:
> char: allow passing pre-opened socket file descriptor at startup
0935700f8544033ebbd41e1f13cd528f8a58d24d

dm_restrict is available in QEMU 3.0.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c
tools/libxl/libxl_dm.c
tools/libxl/libxl_internal.h