this patchset fix lots of segfault (mostly in unexpected scenario), making libxl more fault resiliant. it also fix a couple of bugs that were introduced with previous patchset. Vincent Hanquez (8): don''t ignore ctx_init errors if there is one. don''t free ifname, can lead to double free returns errors if xc and/or xs has not been initialized properly. don''t use the cloning logic in dm_xenstore_record_pid. remove all cloning logic. simplify the logic of domain_list to just return 1024 domains maximum don''t try to delete path when they doesn''t exists. initialize domid to -1 in domain_create tools/libxl/libxl.c | 83 ++++++++++++++++++------------------------ tools/libxl/libxl_device.c | 20 ++++------ tools/libxl/libxl_internal.c | 25 ++----------- tools/libxl/libxl_internal.h | 19 +--------- tools/libxl/libxl_xshelp.c | 19 ++++++++++ tools/libxl/xl.c | 64 +++++++++++++++++++++++++-------- 6 files changed, 116 insertions(+), 114 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:17 UTC
[Xen-devel] [PATCH 1/8] don''t ignore ctx_init errors if there is one.
ctx_init can return error, and ignoring the errors, would lead to segfault later. fix all call sites to check return values. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/xl.c | 61 +++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 49 insertions(+), 12 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:17 UTC
[Xen-devel] [PATCH 2/8] don''t free ifname, can lead to double free
ifname is mostly handled directly in xl now, do not attempts to free this. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/xl.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:17 UTC
[Xen-devel] [PATCH 3/8] returns errors if xc and/or xs has not been initialized properly.
fixed segfault when xenstore or xc are not available. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/libxl.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:17 UTC
[Xen-devel] [PATCH 4/8] don''t use the cloning logic in dm_xenstore_record_pid.
use call to lowlevel functions to do the same things. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/libxl.c | 32 ++++++++++---------------------- tools/libxl/libxl_internal.h | 2 ++ tools/libxl/libxl_xshelp.c | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 22 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
replace by simpler xl ctx init/free calls. also don''t segfault if there''s no callback for log. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/libxl_device.c | 20 ++++++++------------ tools/libxl/libxl_internal.c | 25 +++---------------------- tools/libxl/libxl_internal.h | 17 ----------------- 3 files changed, 11 insertions(+), 51 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:17 UTC
[Xen-devel] [PATCH 6/8] simplify the logic of domain_list to just return 1024 domains maximum
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/libxl.c | 24 +++++------------------- 1 files changed, 5 insertions(+), 19 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:18 UTC
[Xen-devel] [PATCH 7/8] don''t try to delete path when they doesn''t exists.
fix segfault in destroy when creation hasn''t been done properly. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/libxl.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2010-Jan-08 11:18 UTC
[Xen-devel] [PATCH 8/8] initialize domid to -1 in domain_create
prevent call site that doesn''t check return values to try to do operation on domain 0. instead they use domid -1, which is unlikely to exist. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com> --- tools/libxl/libxl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel