xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Classify and remove (some) abort()s in libxl
@ 2016-08-24 15:57 Wei Liu
  2016-08-26 10:54 ` Ian Jackson
  2016-09-02 14:33 ` Wei Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Liu @ 2016-08-24 15:57 UTC (permalink / raw)
  To: Xen-devel; +Cc: Ian Jackson, Wei Liu, Doug Goldstein, Andrew Cooper

Hi all

There has been some interest in removing abort() in libxl in another
thread. I think this topic deserves a dedicated thread.

I've checked most instances of abort() and exit() in code and classify
them as several classes.

* System has entered an impossible to recover state

Can't be removed, there is no meaningful return code to return.

E.g. libxl_utils.c, libxl_event.c, libxl_exec.c and libxl_fork.c

* Used by some stub functions

Can be classified as "impossible to recover state" because caller
shouldn't have use them in the first place. But can be relaxed to
return error code.

* Configuration error

Some internal functions expect sanitised input. Up until now the
expectation (at least AIUI) is that libxl should have sanitised those
values before calling internal functions. I'm not sure if this rule is
strictly followed though.

The abort() in this class can be and turn into error return path.

E.g. various devices and domain configuration options

* Memory allocation failure

Actually exit() is called, but process will exit anyway.  Can't be
easily changed without rewriting error handle logic across libxl.


The "configuration error" class is the easiest one to trip over for
library user. I think we can change that class to return error code
provided there is enough interest.

The "stub functions" class can also be dealt with, but I'm not too keen
on changing that.


Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-02 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-24 15:57 [RFC] Classify and remove (some) abort()s in libxl Wei Liu
2016-08-26 10:54 ` Ian Jackson
2016-09-02 14:33 ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).