[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: Fix libxl_retrieve_domain_configuration error path



commit 8f1d6c049c0439d8c5b175a0f8369cfde57ba08c
Author:     Anthony PERARD <anthony.perard@xxxxxxxxx>
AuthorDate: Tue Nov 12 14:19:43 2019 +0000
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Tue Nov 12 15:31:41 2019 +0000

    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@xxxxxxxxxxxxxxxxxxxxxx>
    Fixes: 61563419257ed40278938db2cce7d697aed44f5d
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Tested-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
---
 tools/libxl/libxl_domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c
index 9d0eb5aed1..33f9d9eaa4 100644
--- a/tools/libxl/libxl_domain.c
+++ b/tools/libxl/libxl_domain.c
@@ -1998,12 +1998,14 @@ static void 
retrieve_domain_configuration_end(libxl__egc *egc,
     retrieve_domain_configuration_state *rdcs, int rc)
 {
     STATE_AO_GC(rdcs->qmp.ao);
-    libxl__domain_userdata_lock *lock;
+    libxl__domain_userdata_lock *lock = NULL;
 
     /* Convenience aliases */
     libxl_domain_config *const d_config = rdcs->d_config;
     libxl_domid domid = rdcs->qmp.domid;
 
+    if (rc) goto out;
+
     lock = libxl__lock_domain_userdata(gc, domid);
     if (!lock) {
         rc = ERROR_LOCK_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.