WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Question Regarding xs_read()

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Question Regarding xs_read()
From: "Timothy Hayes" <hayesti@xxxxxx>
Date: Fri, 2 Jan 2009 19:33:48 +0000
Delivery-date: Fri, 02 Jan 2009 11:34:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Question Regarding xs_read(), Timothy Hayes <=