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

[Xen-devel] Question Regarding xs_read()


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Timothy Hayes" <hayesti@xxxxxx>
  • Date: Fri, 2 Jan 2009 19:33:48 +0000
  • Delivery-date: Fri, 02 Jan 2009 11:34:15 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi everyone,
 
I'm making a user application that's going to run in Xen guests (both dom0 and domU) and each instance needs to read values from the VM's unique space in XenStore. The way I have done it is use the functions defined in <xs.h> using the xs_read function to read a value. In command line I'm able to use the xenstore-read program and simply pass an argument like 'domid' or 'vm' without having to specify an absolute path, it will read the value in /local/domain/DOMID/ and I don't need to worry about what the DOMID is. When I try to use this technique in the xs_read function, it returns NULL. It works fine if I give the absolute path, but I can't really do that dynamically since I don't know the DOMID ahead of time.
 
Basically I'm trying this:
 
struct xs_handle* xs;
xs_transaction_t t;
void* domid;
char temp[] = "domid";
 
xs = xs_daemon_open();
t = xs_transaction_start(xs);
domid = xs_read(xs, t, temp, NULL);
 
Could someone explain why this doesn't work or maybe let me know of an alternative way to read XenStore in a C application without using absolute paths?
 
Cheers!
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.