libxl_internal: Introduce libxl__ev_devlock for devices hotplug via QMP
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 6 Jun 2019 13:32:11 +0000 (14:32 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 19 Sep 2019 11:24:52 +0000 (12:24 +0100)
commit79964e941364c17968fea7a44a37dff2c77c01da
tree08907166843ec1c113a0170efe6ef54effc205a8
parentfb1d33bd7b1415f9fb5ec7e2d9817655c4eda0a5
libxl_internal: Introduce libxl__ev_devlock for devices hotplug via QMP

The current lock `domain_userdata_lock' can't be used when modification
to a guest is done by sending command to QEMU, this is a slow process
and requires to call CTX_UNLOCK, which is not possible while holding
the `domain_userdata_lock'.

To resolve this issue, we create a new lock which can take over part
of the job of the json_lock.

This lock is outside CTX_LOCK in the lock hierarchy.
libxl__ev_devlock_lock will have CTX_UNLOCK before trying to grab the
ev_devlock. The callback is used to notify when the ev_devlock have
been acquired.

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