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

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

On Tue, Apr 04, 2006 at 10:27:27PM -0600, Jim Fehlig wrote:
> >>> "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().

  Well actually, I'm trying to avoid accessing the Xen store as the primary
source, I prefer to go with Xend first then fallback to Xenstore, as the
order virInitialize() sets-up indicates.


Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

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