Re: Question about building libvirt.so

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Vik,

On Thu, 2014-02-20 at 15:14 -0800, vikhyath reddy wrote:
> Thanks for libvirt. It is a life saver. I am in the process of writing
> some custom wrappers for libvirt so that it can be easily accessed
> from nodejs using the nodejs-ffi interfacing (basically describes a
> way to convert nodejs to c calls). I did write the wrapper on the
> lines of the examples provided. But I am unable to see my new
> functions in the libvirt.so file (which nodejs interfacing needs).
> Which means that my wrappers under <libvirt>/wrappers/ are not getting
> into libvirt.so like the ones at <libvirt>/examples

I don't quite get what you are doing. Why would you need to modify
libvirt to wrap it in a nodejs-based script? What is that
libvirt/wrappers folder you are mentioning? there is no such thing in
the libvirt repository.

>From what I understood from the nodejs-ffi page, you should mostly write
javascript code similar to this:

------------ %< ------------

var ref = require('ref');
var ffi = require('ffi');

var virConnect = ref.types.void;
var virConnectPtr = ref.refType(virConnect);

var libvirt = ffi.Library('libvirt', {
  'virInitialize': [ 'int', [ ] ],
  'virConnectOpen': [virConnectPtr, [ string ]],
  ...
});

------------ %< ------------

I'm pretty sure generating this could be automated by a small program or
script or even a clang plugin, using include/libvirt/libvirt.h.in as
input.

> Can you please guide me as to where I am going wrong? I was able to do
> a successful configure + make and I thought this will regenerate the
> new libvirt.so (which it does, but I cant see my new wrapper methods
> in it).

I case you really want to modify libvirt, then you should proceed as
mentioned on this page:

http://libvirt.org/compiling.html

Regards,
--
Cedric

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]