Skip to contentSkip to conversation

xl: log an error if libxl_cpupool_destroy() fails

PATCH Superseded Dario Faggioli 3 participants 4 messages Oct 28, 2015 – Nov 3, 2015

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xl: log an error if libxl_cpupool_destroy() fails

In fact, right now, failing at destroying a cpupool is just not reported to the user in any explicit way.

Let's log an error, as it is customary for xl in these cases.

---
Cc: Ian Jackson <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Wei Liu <[email protected]>
---
Changes from v1:
* avoid changing the return code to EXIT_SUCCESS/FAILURE; that is being taken care of in another series anyway.

---
 tools/libxl/xl_cmdimpl.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/libxl/xl_cmdimpl.c +3 -1
index 646b281..09a6bd7 100644
@@ -7584,8 +7584,10 @@ int main_cpupooldestroy(int argc, char **argv)
         return 1;
     }
 
-    if (libxl_cpupool_destroy(ctx, poolid))
+    if (libxl_cpupool_destroy(ctx, poolid)) {
+        fprintf(stderr, "Can't destroy cpupool '%s'\n", pool);
         return 1;
+    }
 
     return 0;
 }
#2 lore raw
Quoted 10 lines · Wei Liu
Quoted 7 lines · Dario Faggioli

In fact, right now, failing at destroying a cpupool is just not reported to the user in any explicit way.

Let's log an error, as it is customary for xl in these cases.

This conflicted with the changes to use EXIT_(ERROR|SUCCESS). By changing "return 0" into "return EXIT_SUCCESS" and "return 1" into "return EXIT_ERROR" in the context it applied cleanly.

I was about to apply when I noticed the strange Reviewed-by: Jueregen (having already spotted and fixed in the Cc). I don't think I want to apply it like that. Please can you fix and rebase (after I push Harman's changes soon) and resend.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 10 lines · Ian Campbell
Quoted 9 lines · Wei Liu
Quoted 7 lines · Dario Faggioli

In fact, right now, failing at destroying a cpupool is just not reported to the user in any explicit way.

Let's log an error, as it is customary for xl in these cases.

Quoted 7 lines
Quoted 1 line

This conflicted with the changes to use EXIT_(ERROR|SUCCESS). By changing
"return 0" into "return EXIT_SUCCESS" and "return 1" into "return EXIT_ERROR" in the context it applied cleanly.

Right, thanks for trying.

Quoted 5 lines

I was about to apply when I noticed the strange Reviewed-by: Jueregen (having already spotted and fixed in the Cc). I don't think I want to apply
it like that.

Oh, come on! How the heck did I manage to put it in there like that, and to not notice it until now! :-(

Anyway, sorry for wasting your time.

Quoted 3 lines

Please can you fix and rebase (after I push Harman's changes soon) and resend.

Sure thing.

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel