From: "Timothy Hayes" Subject: Question Regarding xs_read() Date: Fri, 2 Jan 2009 19:33:48 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1599251158==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1599251158== Content-Type: multipart/alternative; boundary="----=_Part_162511_14171759.1230924828186" ------=_Part_162511_14171759.1230924828186 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 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! ------=_Part_162511_14171759.1230924828186 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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!
------=_Part_162511_14171759.1230924828186-- --===============1599251158== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1599251158==--