
create ! title it libxl_ctx_alloc should have dummy mode which does not require a Xen host severity it wishlist thanks (just creating a bug for this issue) On Mon, 2014-06-02 at 13:41 +0100, Ian Campbell wrote:
On Fri, 2014-05-30 at 18:24 +0100, Daniel P. Berrange wrote:
I hit a couple of small issues with libxl, which I worked around, when writing this test which I why I'm copying xen-devel
- libxl_ctx_alloc() will call xs_daemon_open and xc_interface_open, and stat /var/run/xenstored.pid to see if Xen is actually running. This fails when run on non-Xen hosts (and also possibly if run unprivileged).
I used an evil LD_PRELOAD hack to stub out xs_daemon_open and xc_interface_open to return (void*)0x1, and also turn xc_interface_close and xs_daemon_close to no-ops, and make stat() always return success for xenstored.pid.
This works (evidenced by the fact that if something was needing these xs/xc handles they would have crashed referencing 0x1), but at the same time it might be an idea to have an officially supported "non live" mode for libxl_ctx_alloc() turned on by a flag of some sort.
Yes, we absolutely should have this.