From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Umar Farooq Minhas" Subject: Regarding Xenstore/Xenbus Date: Sun, 19 Nov 2006 03:09:32 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1326236648==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Umar Farooq Minhas List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============1326236648== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0003_01C70B88.225063A0" This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C70B88.225063A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi everyone, I have installed Xen on OpenSUSE Linux 10.1 and am just starting to = develop with Xen. I want to implement a very straightforward application = in domUs which simply gets notified whenever a resource provisioning = change (specifically for cpu/memory allocation) is made for that = particular domU using for example xm mem-set. From the readings that I = have done so far it seems that since xenstore is a shared database = between all the domains which keeps track of domain specific = values(including values of allocated resources) and that it can be = accessed through xenbus from domUs so what I need to do is to write a = program that would access xenstore from withing that domU over xenbus. = Or more specifically I will have to register a 'watch' in xenstore (just = as the balloon driver does) to monitor memory values. I don't know = whether this is true or not. I would greatly appreciate if someone could = verify this understanding or point me in the right direction. Also if = this is true some pointers to start developing with xenbus/xenstore = would be very helpful. A prompt response will be appreciated as I am running on a deadline :) Thanks. -Umar ------=_NextPart_000_0003_01C70B88.225063A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi everyone,
 
I have installed Xen on OpenSUSE Linux = 10.1 and am=20 just starting to develop with Xen. I want to implement a very = straightforward=20 application in domUs which simply gets notified whenever a resource = provisioning=20 change (specifically for cpu/memory allocation) is made for that = particular=20 domU using for example xm mem-set. From the readings that I have done so = far it=20 seems that since xenstore is a shared database between all the domains = which=20 keeps track of domain specific values(including values of allocated = resources) and that it can be accessed through xenbus from domUs so = what I=20 need to do is to write a program that would access xenstore = from=20 withing that domU over xenbus. Or more specifically I will have to = register a=20 'watch' in xenstore (just as the balloon driver does) to monitor = memory=20 values. I don't know whether this is true or not. I would greatly=20 appreciate if someone could verify this understanding or point me in the = right=20 direction. Also if this is true some pointers to start developing with=20 xenbus/xenstore would be very helpful.
 
A prompt response will be appreciated = as I am=20 running on a deadline :)
 
Thanks.
-Umar
------=_NextPart_000_0003_01C70B88.225063A0-- --===============1326236648== 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 --===============1326236648==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew D. Ball" Subject: Re: Regarding Xenstore/Xenbus Date: Mon, 20 Nov 2006 17:02:45 -0500 Message-ID: <1164060166.24087.53.camel@localhost> References: Reply-To: aball@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Umar Farooq Minhas Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org I think that's right. Look into using libxenstore inside of the domU -- I think there are functions to do what you want there. Peace. Andrew On Sun, 2006-11-19 at 03:09 -0500, Umar Farooq Minhas wrote: > Hi everyone, > > I have installed Xen on OpenSUSE Linux 10.1 and am just starting to > develop with Xen. I want to implement a very straightforward > application in domUs which simply gets notified whenever a resource > provisioning change (specifically for cpu/memory allocation) is made > for that particular domU using for example xm mem-set. From the > readings that I have done so far it seems that since xenstore is a > shared database between all the domains which keeps track of domain > specific values(including values of allocated resources) and that it > can be accessed through xenbus from domUs so what I need to do is to > write a program that would access xenstore from withing that domU over > xenbus. Or more specifically I will have to register a 'watch' in > xenstore (just as the balloon driver does) to monitor memory values. I > don't know whether this is true or not. I would greatly appreciate if > someone could verify this understanding or point me in the right > direction. Also if this is true some pointers to start developing with > xenbus/xenstore would be very helpful. > > A prompt response will be appreciated as I am running on a deadline :) > > Thanks. > -Umar > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Umar Farooq Minhas" Subject: Re: Regarding Xenstore/Xenbus Date: Mon, 20 Nov 2006 20:21:20 -0500 Message-ID: References: <1164060166.24087.53.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: aball@linux.vnet.ibm.com Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Thanks for your reply. I was into trying out xenstore acess using 'libxenstore.so'. I have copied the exact code that I am trying to run (most of this comes from xenstore wiki). The issue is that I am able to run this code from dom0 but when I try to run it from inside a domU after the first printf output i.e. "Msg1" it terminates abnormally saying "unknown error". My guess is that its failing when it calls xs_daemon_open(). I can't figure out what am i missing. Some processes need to be started before i can acess xenstore? Are there any packages that need to be installed in domU to access xenstore? I already have 'xen-devel', 'xen-lib' and 'xen-tools' packages installed inside domU. Please help. ------------------------------------------------------------------------------------------- #include #include #include #include void main(int argc, char *argv[]) { struct xs_handle *xs; xs_transaction_t th; char *path; int fd; fd_set set; int er; struct timeval tv = {.tv_sec = 0, .tv_usec = 0 }; char **vec; unsigned int num; char * buf; char ** buf2; unsigned int len; unsigned int domid; printf("Msg1\n"); /* Get a connection to the daemon */ xs = xs_daemon_open(); if ( xs == NULL ) error(); th = xs_transaction_start(xs); buf2 = xs_directory(xs, th,"/local/domain", &len); xs_transaction_end(xs, th, true); int i=0; for(i=0;i1) domid = atoi(buf2[1]); if(len==1) domid = atoi(buf2[0]); //sprintf( domid, "%ui", buf2[0] ); printf("Domid: %i\n", domid); /* Get the local domain path */ path = xs_get_domain_path(xs, domid); if ( path == NULL ) error(); printf("Msg3\n"); /* Make space for our node on the path */ path = realloc(path, strlen(path) + strlen("/memory/target") + 1); if ( path == NULL ) error(); strcat(path, "/memory/target"); /* Create a watch on /local/domain/%d/mynode. */ er = xs_watch(xs, path, "mytoken"); if ( er == 0 ) error(); /* We are notified of read availability on the watch via the * file descriptor. */ fd = xs_fileno(xs); while (1) { FD_ZERO(&set); FD_SET(fd, &set); /* Poll for data. */ if ( select(fd + 1, &set, NULL, NULL, &tv) > 0 && FD_ISSET(fd, &set)) { /* I am not sure how num works -- please describe. */ vec = xs_read_watch(xs, &num); if ( !vec ) error(); printf("vec contents: %s|%s\n", vec[XS_WATCH_PATH], vec[XS_WATCH_TOKEN]); /* Prepare a transaction and do a read. */ th = xs_transaction_start(xs); buf = xs_read(xs, th, vec[XS_WATCH_PATH], &len); xs_transaction_end(xs, th, true); if ( buf ) { printf("buflen: %d\nbuf: %s\n", len, buf); } /* Prepare a transaction and do a write. */ /*th = xs_transaction_start(xs); er = xs_write(xs, th, path, "somestuff", strlen("somestuff")); xs_transaction_end(xs, th, true); if ( er == 0 ) error();*/ } } /* Cleanup */ close(fd); xs_daemon_close(xs); free(path); } ------------------------------------------------------------------------------------------- ----- Original Message ----- From: "Andrew D. Ball" To: "Umar Farooq Minhas" Cc: Sent: Monday, November 20, 2006 5:02 PM Subject: Re: [Xen-devel] Regarding Xenstore/Xenbus >I think that's right. Look into using libxenstore inside of the domU -- > I think there are functions to do what you want there. > > Peace. > Andrew > > > On Sun, 2006-11-19 at 03:09 -0500, Umar Farooq Minhas wrote: >> Hi everyone, >> >> I have installed Xen on OpenSUSE Linux 10.1 and am just starting to >> develop with Xen. I want to implement a very straightforward >> application in domUs which simply gets notified whenever a resource >> provisioning change (specifically for cpu/memory allocation) is made >> for that particular domU using for example xm mem-set. From the >> readings that I have done so far it seems that since xenstore is a >> shared database between all the domains which keeps track of domain >> specific values(including values of allocated resources) and that it >> can be accessed through xenbus from domUs so what I need to do is to >> write a program that would access xenstore from withing that domU over >> xenbus. Or more specifically I will have to register a 'watch' in >> xenstore (just as the balloon driver does) to monitor memory values. I >> don't know whether this is true or not. I would greatly appreciate if >> someone could verify this understanding or point me in the right >> direction. Also if this is true some pointers to start developing with >> xenbus/xenstore would be very helpful. >> >> A prompt response will be appreciated as I am running on a deadline :) >> >> Thanks. >> -Umar >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Hanquez Subject: Re: Regarding Xenstore/Xenbus Date: Wed, 22 Nov 2006 16:52:09 +0100 Message-ID: <20061122155209.GA317@snarc.org> References: <1164060166.24087.53.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Umar Farooq Minhas Cc: xen-devel@lists.xensource.com, aball@linux.vnet.ibm.com List-Id: xen-devel@lists.xenproject.org On Mon, Nov 20, 2006 at 08:21:20PM -0500, Umar Farooq Minhas wrote: > Thanks for your reply. I was into trying out xenstore acess using > 'libxenstore.so'. I have copied the exact code that I am trying to run > (most of this comes from xenstore wiki). The issue is that I am able to run > this code from dom0 but when I try to run it from inside a domU after the > first printf output i.e. "Msg1" it terminates abnormally saying "unknown > error". My guess is that its failing when it calls xs_daemon_open(). I > can't figure out what am i missing. Some processes need to be started > before i can acess xenstore? Are there any packages that need to be > installed in domU to access xenstore? I already have 'xen-devel', 'xen-lib' > and 'xen-tools' packages installed inside domU. Please help. you need to use "domain_open" instead of "daemon_open" in domU. daemon_open is using a direct unix socket to communicate with xenstored. this socket is only accessible to dom0. domU need to use the other way to communicate with xenstored. Cheers, -- Vincent Hanquez From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Umar Farooq Minhas" Subject: Re: Regarding Xenstore/Xenbus Date: Wed, 22 Nov 2006 19:56:41 -0500 Message-ID: References: <1164060166.24087.53.camel@localhost> <20061122155209.GA317@snarc.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: Vincent Hanquez Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Once again thanks for replying, I appreciate your patience. Actually I already realized that mistake and replaced "daemon_open" with "domain_open". But getting the "unknown error" has now changed into a "segmentation fault" and apparently it occurs after i execute the "xs_directory" function to get the path in buf2 variable (line31 below). I checked the value of 'len' variable after the call and it turns out to be arbitrarily large. What am I doing wrong here ? After replacing "daemon_open" with "domain_open" all the rest of the calls to xs.h functions remain the same or are there specific "daemon" and "domain" versions of functions? (apparently its the former case) A few related questions: -Are there any specific initializations/calls that need to be made from inside domU to first initialize and then access xenstore ? Or the functions exposed by xs.h are the only thing required ? Apparently xenstore is initialized by dom0 once at startup only. -Does ability to communicate with xenstore depend on whether the ethernet interface b/w dom0 and domU is working or not (since it uses sockets)? Currently my domU can't ping dom0 or any one else for that matter. -I am trying to only read the xenstore(which is allowed to all domains by default), does my problem in anyway relate to xenstore access permissions ? -Are you aware of any user-space management tools available that access xenstore from within domU? Sorry for a detailed mail but I am just a beginner and dont know a lot of stuff. I'll appreciate your help once again. ------------------------------------------------------------------------------------------- 1 #include 2 #include 3 #include 4 #include 5 6 void main(int argc, char *argv[]) 7 { 8 9 struct xs_handle *xs; 10 xs_transaction_t th; 11 char *path; 12 int fd; 13 fd_set set; 14 int er; 15 struct timeval tv = {.tv_sec = 0, .tv_usec = 0 }; 16 char **vec; 17 unsigned int num; 18 char * buf; 19 char ** buf2; 20 unsigned int len; 21 22 unsigned int domid; 23 24 printf("Msg1\n"); 25 26 /* Get a connection to the daemon */ 27 xs = xs_domain_open(); 28 if ( xs == NULL ) error(); 29 30 th = xs_transaction_start(xs); 31 buf2 = xs_directory(xs, th,"/local/domain", &len); 32 xs_transaction_end(xs, th, true); 33 34 int i=0; 35 36 for(i=0;i1) 44 domid = atoi(buf2[1]); 45 if(len==1) 46 domid = atoi(buf2[0]); 47 //sprintf( domid, "%ui", buf2[0] ); 48 49 printf("Domid: %i\n", domid); 50 51 /* Get the local domain path */ 52 path = xs_get_domain_path(xs, domid); 53 if ( path == NULL ) error(); 54 55 printf("Msg3\n"); 56 57 /* Make space for our node on the path */ 58 path = realloc(path, strlen(path) + strlen("/memory/target") + 1); 59 if ( path == NULL ) error(); 60 strcat(path, "/memory/target"); 61 62 /* Create a watch on /local/domain/%d/mynode. */ 63 er = xs_watch(xs, path, "mytoken"); 64 if ( er == 0 ) error(); 65 66 /* We are notified of read availability on the watch via the 67 * file descriptor. 68 */ 69 fd = xs_fileno(xs); 70 71 while (1) 72 { 73 FD_ZERO(&set); 74 FD_SET(fd, &set); 75 76 /* Poll for data. */ 77 if ( select(fd + 1, &set, NULL, NULL, &tv) > 0 78 && FD_ISSET(fd, &set)) 79 { 80 /* I am not sure how num works -- please describe. */ 81 vec = xs_read_watch(xs, &num); 82 if ( !vec ) error(); 83 printf("vec contents: %s|%s\n", vec[XS_WATCH_PATH], 84 vec[XS_WATCH_TOKEN]); 85 86 /* Prepare a transaction and do a read. */ 87 th = xs_transaction_start(xs); 88 buf = xs_read(xs, th, vec[XS_WATCH_PATH], &len); 89 xs_transaction_end(xs, th, true); 90 if ( buf ) 91 { 92 printf("buflen: %d\nbuf: %s\n", len, buf); 93 } 94 95 /* Prepare a transaction and do a write. */ 96 /*th = xs_transaction_start(xs); 97 98 er = xs_write(xs, th, path, "somestuff", strlen("somestuff")); 99 xs_transaction_end(xs, th, true); 100 if ( er == 0 ) error();*/ 101 } 102 } 103 104 /* Cleanup */ 105 close(fd); 106 xs_daemon_close(xs); 107 free(path); 108 109 } ----- Original Message ----- From: "Vincent Hanquez" To: "Umar Farooq Minhas" Cc: ; Sent: Wednesday, November 22, 2006 10:52 AM Subject: Re: [Xen-devel] Regarding Xenstore/Xenbus > On Mon, Nov 20, 2006 at 08:21:20PM -0500, Umar Farooq Minhas wrote: >> Thanks for your reply. I was into trying out xenstore acess using >> 'libxenstore.so'. I have copied the exact code that I am trying to run >> (most of this comes from xenstore wiki). The issue is that I am able to >> run >> this code from dom0 but when I try to run it from inside a domU after the >> first printf output i.e. "Msg1" it terminates abnormally saying "unknown >> error". My guess is that its failing when it calls xs_daemon_open(). I >> can't figure out what am i missing. Some processes need to be started >> before i can acess xenstore? Are there any packages that need to be >> installed in domU to access xenstore? I already have 'xen-devel', >> 'xen-lib' >> and 'xen-tools' packages installed inside domU. Please help. > > you need to use "domain_open" instead of "daemon_open" in domU. > > daemon_open is using a direct unix socket to communicate with xenstored. > this socket is only accessible to dom0. domU need to use the other way > to communicate with xenstored. > > Cheers, > -- > Vincent Hanquez > From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Umar Farooq Minhas" Subject: Re: Regarding Xenstore/Xenbus Date: Thu, 23 Nov 2006 15:22:24 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit 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: Vincent Hanquez Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Kindly, ignore my previous message. I figured out what was wrong with the code. I don't need to call "xs_directory" function because I learned that when you access Xenstore from inside domU it has an implicit root at "/local/domain/" so in-order to read "/local/domain//memory/target" I just need to pass "memory/target" to "xs_read" as path. The thing that I want to know now is that can a userspace tool register and be notified of watches on xenstore or is it allowed for kernel level drivers only? Apparently, the later seems to be the case because when I try to call "xs_watch" from domU it returns with an unknown error. Is there a workaround this? If not, I can always setup a loop that polls the path periodically to detect changes. I just want to be notified of changes to the path "memory/target". Thanks for your help. ----- Original Message ----- From: "Umar Farooq Minhas" To: "Vincent Hanquez" Cc: Sent: Wednesday, November 22, 2006 7:56 PM Subject: Re: [Xen-devel] Regarding Xenstore/Xenbus > Once again thanks for replying, I appreciate your patience. > > Actually I already realized that mistake and replaced "daemon_open" with > "domain_open". > But getting the "unknown error" has now changed into a "segmentation > fault" and apparently > it occurs after i execute the "xs_directory" function to get the path in > buf2 variable (line31 below). > I checked the value of 'len' variable after the call and it turns out to > be arbitrarily large. > What am I doing wrong here ? After replacing "daemon_open" with > "domain_open" all the rest > of the calls to xs.h functions remain the same or are there specific > "daemon" and "domain" > versions of functions? (apparently its the former case) > > A few related questions: > > -Are there any specific initializations/calls that need to be made from > inside domU to first initialize > and then access xenstore ? Or the functions exposed by xs.h are the only > thing required ? Apparently > xenstore is initialized by dom0 once at startup only. > > -Does ability to communicate with xenstore depend on whether the ethernet > interface b/w > dom0 and domU is working or not (since it uses sockets)? Currently my domU > can't ping dom0 or any one else > for that matter. > > -I am trying to only read the xenstore(which is allowed to all domains by > default), does my problem > in anyway relate to xenstore access permissions ? > > -Are you aware of any user-space management tools available that access > xenstore from within domU? > > Sorry for a detailed mail but I am just a beginner and dont know a lot of > stuff. > > I'll appreciate your help once again. > > > ------------------------------------------------------------------------------------------- > > 1 #include > 2 #include > 3 #include > 4 #include > 5 > 6 void main(int argc, char *argv[]) > 7 { > 8 > 9 struct xs_handle *xs; > 10 xs_transaction_t th; > 11 char *path; > 12 int fd; > 13 fd_set set; > 14 int er; > 15 struct timeval tv = {.tv_sec = 0, .tv_usec = 0 }; > 16 char **vec; > 17 unsigned int num; > 18 char * buf; > 19 char ** buf2; > 20 unsigned int len; > 21 > 22 unsigned int domid; > 23 > 24 printf("Msg1\n"); > 25 > 26 /* Get a connection to the daemon */ > 27 xs = xs_domain_open(); > 28 if ( xs == NULL ) error(); > 29 > 30 th = xs_transaction_start(xs); > 31 buf2 = xs_directory(xs, th,"/local/domain", &len); > 32 xs_transaction_end(xs, th, true); > 33 > 34 int i=0; > 35 > 36 for(i=0;i 37 { > 38 printf("%s\n",buf2[i]); > 39 } > 40 > 41 > 42 // I am running dom0 and oly 1 domU so this condition chooses one of > them > 43 if(len>1) > 44 domid = atoi(buf2[1]); > 45 if(len==1) > 46 domid = atoi(buf2[0]); > 47 //sprintf( domid, "%ui", buf2[0] ); > 48 > 49 printf("Domid: %i\n", domid); > 50 > 51 /* Get the local domain path */ > 52 path = xs_get_domain_path(xs, domid); > 53 if ( path == NULL ) error(); > 54 > 55 printf("Msg3\n"); > 56 > 57 /* Make space for our node on the path */ > 58 path = realloc(path, strlen(path) + strlen("/memory/target") + 1); > 59 if ( path == NULL ) error(); > 60 strcat(path, "/memory/target"); > 61 > 62 /* Create a watch on /local/domain/%d/mynode. */ > 63 er = xs_watch(xs, path, "mytoken"); > 64 if ( er == 0 ) error(); > 65 > 66 /* We are notified of read availability on the watch via the > 67 * file descriptor. > 68 */ > 69 fd = xs_fileno(xs); > 70 > 71 while (1) > 72 { > 73 FD_ZERO(&set); > 74 FD_SET(fd, &set); > 75 > 76 /* Poll for data. */ > 77 if ( select(fd + 1, &set, NULL, NULL, &tv) > 0 > 78 && FD_ISSET(fd, &set)) > 79 { > 80 /* I am not sure how num works -- please describe. */ > 81 vec = xs_read_watch(xs, &num); > 82 if ( !vec ) error(); > 83 printf("vec contents: %s|%s\n", vec[XS_WATCH_PATH], > 84 vec[XS_WATCH_TOKEN]); > 85 > 86 /* Prepare a transaction and do a read. */ > 87 th = xs_transaction_start(xs); > 88 buf = xs_read(xs, th, vec[XS_WATCH_PATH], &len); > 89 xs_transaction_end(xs, th, true); > 90 if ( buf ) > 91 { > 92 printf("buflen: %d\nbuf: %s\n", len, buf); > 93 } > 94 > 95 /* Prepare a transaction and do a write. */ > 96 /*th = xs_transaction_start(xs); > 97 > 98 er = xs_write(xs, th, path, "somestuff", strlen("somestuff")); > 99 xs_transaction_end(xs, th, true); > 100 if ( er == 0 ) error();*/ > 101 } > 102 } > 103 > 104 /* Cleanup */ > 105 close(fd); > 106 xs_daemon_close(xs); > 107 free(path); > 108 > 109 } > ----- Original Message ----- > From: "Vincent Hanquez" > To: "Umar Farooq Minhas" > Cc: ; > Sent: Wednesday, November 22, 2006 10:52 AM > Subject: Re: [Xen-devel] Regarding Xenstore/Xenbus > > >> On Mon, Nov 20, 2006 at 08:21:20PM -0500, Umar Farooq Minhas wrote: >>> Thanks for your reply. I was into trying out xenstore acess using >>> 'libxenstore.so'. I have copied the exact code that I am trying to run >>> (most of this comes from xenstore wiki). The issue is that I am able to >>> run >>> this code from dom0 but when I try to run it from inside a domU after >>> the >>> first printf output i.e. "Msg1" it terminates abnormally saying "unknown >>> error". My guess is that its failing when it calls xs_daemon_open(). I >>> can't figure out what am i missing. Some processes need to be started >>> before i can acess xenstore? Are there any packages that need to be >>> installed in domU to access xenstore? I already have 'xen-devel', >>> 'xen-lib' >>> and 'xen-tools' packages installed inside domU. Please help. >> >> you need to use "domain_open" instead of "daemon_open" in domU. >> >> daemon_open is using a direct unix socket to communicate with xenstored. >> this socket is only accessible to dom0. domU need to use the other way >> to communicate with xenstored. >> >> Cheers, >> -- >> Vincent Hanquez >> >