Table of Contents:
libvirt is released under the GNU LesserGeneral Public License, see the file COPYING.LIB in the distributionfor the precise wording. The only library that libvirt depends upon isthe Xen store access library which is also licenced under the LGPL.
Yes. The LGPL allows you to embed libvirt into a proprietaryapplication. It would be graceful to send-back bug fixes and improvementsas patches for possible incorporation in the main development tree. Itwill decrease your maintainance costs anyway if you do so.
The original distribution comes from ftp://libvirt.org/libvirt/.
The most generic solution is to re-fetch the latest src.rpm , andrebuild it locally with
rpm --rebuild libvirt-xxx.src.rpm
.
If everything goes well it will generate two binary rpm packages (oneproviding the shared libs and virsh, and the other one, the -develpackage, providing includes, static libraries and scripts needed to buildapplications with libvirt that you can install locally.
One can also rebuild the RPMs from a tarball:
rpmbuild -ta libdir-xxx.tar.gz
Or from a configured tree with:
make rpm
Large parts of the API may only be accessible with root priviledges,however the read only access to the xenstore data doesnot have to beforbidden to user, at least for monitoring purposes. If "virsh dominfo"fails to run as an user, change the mode of the xenstore read-only socketwith:
chmod 666 /var/run/xenstored/socket_ro
and also make sure that the Xen Daemon is running correctly with
localHTTP server enabled, this is defined
in/etc/xen/xend-config.sxp
which need the following line to
beenabled:
(xend-http-server yes)
If needed restart the xend daemon after making the change with thefollowing command run as root:
service xend restart
As most UNIX libraries libvirt follows the "standard":
gunzip -c libvirt-xxx.tar.gz | tar xvf -
cd libvirt-xxxx
./configure --help
to see the options, then the compilation/installation proper
./configure [possible options]
make
make install
At that point you may have to rerun ldconfig or a similar utility toupdate your list of installed shared libs.
Libvirt requires libxenstore, which is usually provided by the xenpackages as well as the public headers to compile against libxenstore.
The configure script (and other Makefiles) are generated. Use theautogen.sh script to regenerate the configure script and Makefiles,like:
./autogen.sh --prefix=/usr --disable-shared
To simplify the process of reusing the library, libvirt comes withpkgconfig support, which can be used directly from autoconf support orvia the pkg-config command line tool, like:
pkg-config libvirt --libs
Graphics and design by Diana Fong