[Libvir] BUG: virDomainLookupByID fails after XenStore path discovery

Bryan D. Payne bryan at thepaynes.cc
Wed Apr 5 00:23:54 UTC 2006

> I'm just not seeing it included in path returned by  
> xs_get_domain_path(), only see /local/domain/<num>

For what it's worth, I was trying to put a patch together for this,  
but I kept getting memory corruption errors.  I was trying to access  
the name through the xenstore as shown below...

     /* lookup is easier with the Xen store so try it first */
     if (conn->xshandle != NULL) {
         char *namepath = NULL;
         path = xs_get_domain_path(conn->xshandle, (unsigned int) id);
         namepath = strdup(path);
         strcat(namepath, "/name");
         name = xs_read(conn->xshandle, NULL, namepath, NULL);
         if (namepath) free(namepath);

     /* fallback to xend API then */
     if (path == NULL) {

The memory corruption error is thrown by glibc at runtime.   
Ironically, I tried running it through valgrind and the error went  
away ;-)  Anyway, perhaps this will lead someone to the right  
solution...  Unfortunately, I don't have the time right now to keep  
playing with it.


Bryan D. Payne
Graduate Student, Computer Science
Georgia Tech Information Security Center

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2365 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20060404/32426c4a/attachment-0001.p7s>

More information about the libvir-list mailing list