Skip to contentSkip to conversation

Some questions about Wrting XenStore Code!~~

DISCUSSION 吴佳民 2 participants 2 messages Jul 4, 2008

lore
Share & tools
lore

吴佳民

author
#0 lore raw

Hi:
I am now writing code about using XenStore to write some (keys, values) on Dom0. my code is as follows:

//filename: w_main.h

#include "w_xenstore.h"
//The "w_xenstore.h" is a header file I write myself

#include <x86_mm.h>

extern shared_info_t * shared_info;

int main(void)

{    
    /* Set up the XenStore driver */
    xenstore_init(start_info);
    /* Test the store */
    xenstore_test();
    /* Flush the console buffer */    
    
    return 0;
}

and I know that if I wanna use xenStore, I have to use shared_info_t * shared_info. When I compile the code, it tells me that shared_info is not stated before using.

my question is :
(1)
How to get a pointer to shared_info_t structure in my program (running in Userspace)?

(2) I can not include ":hypercall-x86_32.h" and "x86_mm.h" , and I really can not find these two files on my machine.What is the problem?

Thanks a lot!

Danius Wu
================================================================

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Hi,

To access XenStore from a userspace process, you should use the functions in libxs, as can be found in $XEN_ROOT/tools/xenstore/xs.h. The contents of xsls.c in the same directory should give you an idea of how to connect to and use the store - note that you do not need the shared_info_t structure or any direct hypercalls.

Regards,

Derek Murray.

2008/7/4 吴佳民 <[email protected]>:

Quoted 45 lines

Hi:
I am now writing code about using XenStore to write some (keys, values)
on Dom0.
my code is as follows:

//filename: w_main.h

#include "w_xenstore.h"
//The "w_xenstore.h" is a header file I write myself

#include <x86_mm.h>

extern shared_info_t * shared_info;

int main(void)

{
    /* Set up the XenStore driver */
    xenstore_init(start_info);
    /* Test the store */
    xenstore_test();
    /* Flush the console buffer */

    return 0;
}

and I know that if I wanna use xenStore, I have to use shared_info_t * shared_info. When I compile the code, it tells me that shared_info is not stated before using.

my question is :
(1)
How to get a pointer to shared_info_t structure in my program (running in Userspace)?

(2) I can not include ":hypercall-x86_32.h" and "x86_mm.h" , and I really can not find these two files on my machine.What is the problem?

Thanks a lot!

Danius Wu
================================================================

Quoted 8 lines

________________________________
350万起 独栋山墅
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel