[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] BUG: virDomainLookupByID fails after XenStore path discovery



>>> "Bryan D. Payne" <bryan 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().

Thanks,
Jim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]