[Libvir] BUG: virDomainLookupByID fails in libvirt-0.1.0

Hi, I tried to execute the info1 C code example on my redhat distribution with Xen installed. It fails due to the virDomainLookupByID API wich returns NULL. The problem seems to be in the internal function xenDaemonListDomains called after xs_get_domain_path inside the API. For the domain 0, xs_get_domain_path returns path=/local/domain/0. Then, the call to xenDaemonListDomains function logs the error message: "libvir: Xen Daemon error : could not connect to Xen Daemon" and returns names=NULL. A bug present in the release 0.0.6 has been fixed for the release 0.1.0. But this bug seems still present! Regards.

The problem comes from the xend configuration. The HTTP interface of xend must be enabled to use libvirt. Please adds the following line in your /etc/xen/xend-config.sxp file: (xend-http-server yes) and libvirt will be ok after restarting xend daemon. Philippe Berthault. Michel Gauthier a écrit :
Hi, I tried to execute the info1 C code example on my redhat distribution with Xen installed. It fails due to the virDomainLookupByID API wich returns NULL. The problem seems to be in the internal function xenDaemonListDomains called after xs_get_domain_path inside the API. For the domain 0, xs_get_domain_path returns path=/local/domain/0. Then, the call to xenDaemonListDomains function logs the error message: "libvir: Xen Daemon error : could not connect to Xen Daemon" and returns names=NULL. A bug present in the release 0.0.6 has been fixed for the release 0.1.0. But this bug seems still present!
Regards. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Fri, May 05, 2006 at 02:52:57PM +0200, Philippe Berthault wrote:
The problem comes from the xend configuration.
The HTTP interface of xend must be enabled to use libvirt.
Please adds the following line in your /etc/xen/xend-config.sxp file: (xend-http-server yes)
and libvirt will be ok after restarting xend daemon.
Yes. See http://libvirt.org/FAQ.html : 3. Failure to use the API for non-root users Large parts of the API may only be accessible with root priviledges, however the read only access to the xenstore data doesnot have to be forbidden to user, at least for monitoring purposes. If "virsh dominfo" fails to run as an user, change the mode of the xenstore read-only socket with: chmod 666 /var/run/xenstored/socket_ro and also make sure that the Xen Daemon is running correctly with local HTTP server enabled, this is defined in /etc/xen/xend-config.sxp which need the following line to be enabled: (xend-http-server yes) If needed restart the xend daemon after making the change with the following command run as root: service xend restart Karel -- Karel Zak <kzak@redhat.com>
participants (3)
-
Karel Zak
-
Michel Gauthier
-
Philippe Berthault