
Markus Groß wrote:
Am Donnerstag 10 März 2011 07:45:49 schrieb Jim Fehlig:
Add a new xen driver based on libxenlight [1], which is the primary toolstack starting with Xen 4.1.0. The driver is stateful, runs privileged only, and is accessed with libxl:/// URI.
V5: - Ensure events are unregistered when domain private data is destroyed. Discovered and fixed by Markus Gross.
V4: - Handle restart of libvirtd, reconnecting to previously started domains - Rebased to current master - Tested against Xen 4.1 RC7-pre (c/s 22961:c5d121fd35c0)
V3: - Reserve vnc port within driver when autoport=yes
V2: - Update to Xen 4.1 RC6-pre (c/s 22940:5a4710640f81) - Rebased to current master - Plug memory leaks found by Stefano Stabellini and valgrind - Handle SHUTDOWN_crash domain death event
[1] http://lists.xensource.com/archives/html/xen-devel/2009-11/msg00436.html
The libxlEventHandler needs to hold an extra reference to the corresponding "vm" object. Otherwise the handler will try to access an invalid vm object under certain race conditions.
I fixed it using the following patch. Now the libxl driver keeps an extra reference of the vm object for the event handler and specifies a free callback function. This free callback function removes the reference to the vm object to avoid a memory leak.
Thanks Markus. I've incorporated this into V6, which I'll send out shortly. Regards, Jim