libxl: Re-scope qmp_proxy_spawn.ao usage
authorJason Andryuk <jandryuk@gmail.com>
Fri, 1 Apr 2022 14:33:10 +0000 (10:33 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Apr 2022 16:01:57 +0000 (17:01 +0100)
commitd62a34423a1a98aefd7c30e22d2d82d198f077c8
tree21d0e7f8c8e48645907ff8c1fa86185e65db3bb8
parentd2ecf97f911fc00a85b34b70ca311b5d355a9756
libxl: Re-scope qmp_proxy_spawn.ao usage

I've observed this failed assertion:
libxl_event.c:2057: libxl__ao_inprogress_gc: Assertion `ao' failed.

AFAICT, this is happening in qmp_proxy_spawn_outcome where
sdss->qmp_proxy_spawn.ao is NULL.

The out label of spawn_stub_launch_dm() calls qmp_proxy_spawn_outcome(),
but it is only in the success path that sdss->qmp_proxy_spawn.ao gets
set to the current ao.

qmp_proxy_spawn_outcome() should instead use sdss->dm.spawn.ao, which is
the already in-use ao when spawn_stub_launch_dm() is called.  The same
is true for spawn_qmp_proxy().

With this, move sdss->qmp_proxy_spawn.ao initialization to
spawn_qmp_proxy() since its use is for libxl__spawn_spawn() and it can
be initialized along with the rest of sdss->qmp_proxy_spawn.

Fixes: 83c845033dc8 ("libxl: use vchan for QMP access with Linux stubdomain")
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/light/libxl_dm.c