libxl: Fix libxl_retrieve_domain_configuration error path
authorAnthony PERARD <anthony.perard@gmail.com>
Tue, 12 Nov 2019 14:19:43 +0000 (14:19 +0000)
committerWei Liu <wl@xen.org>
Tue, 12 Nov 2019 15:31:41 +0000 (15:31 +0000)
commit8f1d6c049c0439d8c5b175a0f8369cfde57ba08c
treef53804bd2cbe6c3426313c090a8ce9138e6bc023
parentaaef3d904bbbde1fcf9c07943878bd2aa64cc2bc
libxl: Fix libxl_retrieve_domain_configuration error path

If an error were to happen before the last step, for example the
domain_configuration is missing, the error wouldn't be checked by the
_end callback.

Fix that, also initialise `lock' to NULL because the exit path checks
it.

The issue shows up when there's a stubdom, and running `xl list -l`
aborts. Instead, with this patch, `xl list -l` will not list stubdom,
probably like before.

Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Fixes: 61563419257ed40278938db2cce7d697aed44f5d
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wl@xen.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
tools/libxl/libxl_domain.c