Re: BUG: virDomainLookupByID fails after XenStore path discovery

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

 



On Tue, Apr 04, 2006 at 10:27:27PM -0600, Jim Fehlig wrote:
> >>> "Bryan D. Payne" <bryan@xxxxxxxxxxxx> 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

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]