Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Users

Using LibXC

 

 

Xen users RSS feed   Index | Next | Previous | View Threaded


axs911 at cs

Jul 9, 2012, 7:50 AM

Post #1 of 4 (315 views)
Permalink
Using LibXC

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


raistlin at linux

Jul 10, 2012, 6:35 AM

Post #2 of 4 (298 views)
Permalink
Re: Using LibXC [In reply to]

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)
Attachments: signature.asc (0.19 KB)


axs911 at cs

Jul 11, 2012, 3:21 AM

Post #3 of 4 (290 views)
Permalink
Re: Using LibXC [In reply to]

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
>
>



_______________________________________________
Xen-users mailing list
Xen-users [at] lists
http://lists.xen.org/xen-users


raistlin at linux

Jul 12, 2012, 8:24 AM

Post #4 of 4 (289 views)
Permalink
Re: Using LibXC [In reply to]

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)
Attachments: signature.asc (0.19 KB)

Xen users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.