Request for Comment - xl: start implementing "the policy" wrt memory

Full RFC Patch - http://lists.xensource.com/archives/html/xen-devel/2010-08/msg00359.html
It is libxl policy to return objects to callers which the caller must
free. It therefore a matter of correctness for libxl to only free it's
internal scratch allocations and never to free things which may be
returned so as to avoid double-free error conditions.
This patch (probably won't apply and is dirty as hell for now) - begins
to implement this. The approach taken is to use gcc's visibility
attribute to hide libxl internal functions from callers. This includes
the libxl garbage collection routines. These routines now take a new
structure libxl_gc which contains the garbage collection variables and a
back-pointer to the associated libxl context. Other changes include
returning void from libxl_*free* and abort()'ing when it goes wrong.
Working on this patch exposed numerous violations of the policy:
 - libxl_domid_to_name()
 - libxl_get_version_info()
 - libxl_list_vcpu()
 - libxl_list_nics()
 - libxl_device_net2_list()
 - perhaps others
domid_to_name has numerous in and out of library callers so for that I
introduced a libxl-internal _libxl_domid_to_name() which participates in
libxl garbage collection - a little too subtle for my taste but perhaps
something to be lived with.
The others would benefit from destructor functions such as Ian
Campbell's patch introduced.
A side effect of the gcc visibility stuff is getting rid of about a
thousand GOT/PLT entries which shaves 1-2KB off the binary size and
ought to speed up dynamic linking.
What needs to be done from here is a thorough audit of the policy and a
lot of time alone in a dark room doing bad things to xl with valgrind :)
I am thinking eventually of 4 logical changesets:
 1. Fix flagrant policy violations
 2. Get rid of leakiness with the new gc stuff (bulk of patch)
 3. Sprinkle the _hidden macros around
 4. Not decided how best to handle xs vs. NULL paths yet...
    probably xs_$(OP)f() w/ printf semantics built-in?

Read more

Say hello to our new website
12/05/2024

Hello Xen Community, You may have noticed something different... We've refreshed our existing website! Why did we do this? Well, all these new changes are part of an ongoing effort to increase our visibility and make it easier to find information on pages. We know how important it

Xen Project Announces Performance and Security Advancements with Release of 4.19
08/05/2024

New release marks significant enhancements in performance, security, and versatility across various architectures.  SAN FRANCISCO – July 31st, 2024 – The Xen Project, an open source project under the Linux Foundation, is proud to announce the release of Xen Project 4.19. This release marks a significant milestone in enhancing performance, security,

Upcoming Closure of Xen Project Colo Facility
07/10/2024

Dear Xen Community, We regret to inform you that the Xen Project is currently experiencing unexpected changes due to the sudden shutdown of our colocated (colo) data center facility by Synoptek. This incident is beyond our control and will impact the continuity of OSSTest (the gating Xen Project CI loop)

Xen Summit Talks Now Live on YouTube!
06/18/2024

Hello Xen Community! We have some thrilling news to share with you all. The highly anticipated talks from this year’s Xen Summit are now live on YouTube! Whether you attended the summit in person or couldn’t make it this time, you can now access all the insightful presentations