Good afternoon all, I wish to write a program to use the LibXC library. I want this program to spawn a VM and return its ID. I see that there is a file called xc_domain.c which has a function for doing that. Is this the function I should be using? I haven''t been able to find any documentation or examples of how to use this in C. If I try to import the library I get a huge amount of errors for uint_XY_t where XY is either 16 or 32 or 64, as well as other incomplete structure types. I''ve tried importing all the standard Xen libraries but still these errors persist. Which libraries does it require? Can anybody guide me to the light? It would be really helpful. Regards, AXS _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Mon, 2012-07-09 at 15:50 +0100, Adrian Shaw wrote:> Good afternoon all, >Hello,> > I wish to write a program to use the LibXC library. > I want this program to spawn a VM and return its ID. > I see that there is a file called xc_domain.c which has a function for > doing that. > Is this the function I should be using? > I haven''t been able to find any documentation or examples of how to > use this in C. >I can''t tell whether or not there is a _single_ function to do that (and, if yes, which one is), but if you''re willing to read some code you can check what xl and libxl do to accomplish something similar (xl_cmdimpl.c:create_domain() and/or libxl_domain_create_new(), for example). Thanks and Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Hi Dario, Thanks for your reply. I had a look in LibXL and the way the toolstack works. It seems that the call is fundamentally similar to that of the one I mentioned in LibXC. libxl_domain_create_new is indeed something I am looking for. The problem is that when I try to build my program to use the library, the compiler cannot find xen/libelf/libelf.h in xc_dom.h. Having looked at libelf it seems to be arch specific code. Does that mean that I have to cross compile something? Or compile it _with_ the rest of the tools? Sounds like a nightmare if this is the solution. Regards, AXS On 10/07/2012 14:35, Dario Faggioli wrote:> On Mon, 2012-07-09 at 15:50 +0100, Adrian Shaw wrote: >> Good afternoon all, >> > Hello, > >> I wish to write a program to use the LibXC library. >> I want this program to spawn a VM and return its ID. >> I see that there is a file called xc_domain.c which has a function for >> doing that. >> Is this the function I should be using? >> I haven''t been able to find any documentation or examples of how to >> use this in C. >> > I can''t tell whether or not there is a _single_ function to do that > (and, if yes, which one is), but if you''re willing to read some code you > can check what xl and libxl do to accomplish something similar > (xl_cmdimpl.c:create_domain() and/or libxl_domain_create_new(), for > example). > > Thanks and Regards, > Dario > >
On Wed, 2012-07-11 at 11:21 +0100, Adrian Shaw wrote:> Hi Dario, >Hi,> The problem is that when I try to build my program to use the library, > the compiler cannot find xen/libelf/libelf.h in xc_dom.h. >That seems like a build issue you''re having.> Having looked at libelf it seems to be arch specific code. > Does that mean that I have to cross compile something? > Or compile it _with_ the rest of the tools? > Sounds like a nightmare if this is the solution. >I''ve never done anything similar, but from what I see, that file is provided by xen and what you should do while building your program, is making sure it can access it. Again, you can look at how things work for the bundled toolstack, e.g. this file: tools/include/Makefile Hope that helps, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users