[Libvir] BUG: virDomainLookupByID fails after XenStore path discovery

Jim Fehlig jfehlig at novell.com
Wed Apr 5 04:27:27 UTC 2006

>>> "Bryan D. Payne" <bryan at thepaynes.cc> 04/04/06 6:23 PM >>>
>> 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);
>     }

My brain is not working today :-).  Don't know why I didn't consider
xs_read().  I'll fix up your patch and test/submit it tomorrow.  I think
the only problem is concatenating "/name" on the end of namepath, which
has only been allocated enough memory to hold path via strdup().


More information about the libvir-list mailing list