]> xenbits.xensource.com Git - xen.git/commit
libxl: Fix domain soft reset state handling
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 24 Feb 2021 18:39:20 +0000 (18:39 +0000)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Mar 2021 13:56:33 +0000 (14:56 +0100)
commitdae3c3e8b257cd27d6b35a467a34bf79a6650340
treea86762f02967bde4f596917b949c22e3410ec7a4
parent21657ad4f01a634beac570c64c0691e51b9cf366
libxl: Fix domain soft reset state handling

In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
without been properly initialised and disposed of. This lead do a
abort() in libxl due to the `dsps.qmp' state been used before been
initialised:
    libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.

Once initialised, `dsps' also needs to be disposed of as the `qmp'
state might still be in the `Connected' state in the callback for
libxl__domain_suspend_device_model(). So this patch adds
libxl__domain_suspend_dispose() which can be called from the two
places where we need to dispose of `dsps'.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Ian Jackson <iwj@xenproject.org>
Tested-by: Olaf Hering <olaf@aepfle.de>
tools/libs/light/libxl_create.c
tools/libs/light/libxl_dom_suspend.c
tools/libs/light/libxl_internal.h