mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-17 09:49:59 +03:00
Compare commits
205 Commits
Author | SHA1 | Date | |
---|---|---|---|
a56ec4515b | |||
4348a4a85a | |||
d66fab6eea | |||
3b13aa3db3 | |||
11a36d956c | |||
826cbac459 | |||
be2cd079af | |||
36297e1db2 | |||
e3f5dbcdf0 | |||
8fe128a46c | |||
74b379cbd5 | |||
c861237a64 | |||
b8b260dde9 | |||
7c39e4f885 | |||
73c901a807 | |||
33948c6844 | |||
93f77250b3 | |||
35b5f84c50 | |||
fae0da5c13 | |||
35e7f27141 | |||
8d75cb7fde | |||
0d5600fd2f | |||
345a5092e5 | |||
de85acdf3b | |||
543e013a15 | |||
f6c66d01fb | |||
dd26096ad1 | |||
ac33531a05 | |||
e1a2fe6af2 | |||
2dd44664cf | |||
c73a0c4ac9 | |||
221b457e69 | |||
ab8dd999f5 | |||
01e0e98f07 | |||
2e812c89e9 | |||
624a7927f0 | |||
bbaecd6a8f | |||
f5c65fa192 | |||
7b1fe89a5c | |||
e1f5f8516f | |||
3a05dc09ec | |||
709c37e932 | |||
db68d6b164 | |||
d285084b12 | |||
e46f6309d5 | |||
e2b8f981c4 | |||
e22f2f5c9c | |||
7165bef132 | |||
2eb9301ba5 | |||
6e24ccb266 | |||
112746cdc5 | |||
3c4b8a7706 | |||
ee8240b295 | |||
1e87ecd12e | |||
9e09f313d1 | |||
97648a9751 | |||
3f935df0af | |||
fca27ca2bb | |||
547d8e3a86 | |||
79cfda0013 | |||
529325bbdd | |||
ea6bc1e8c6 | |||
398d01b8a9 | |||
96ad9ed33b | |||
1a09553e52 | |||
6e16575a37 | |||
3bd4c7ba16 | |||
36e0372986 | |||
7cc1491d10 | |||
1daea0c59d | |||
79d233b5ca | |||
b37979023d | |||
553f31c579 | |||
8fc469b3d5 | |||
9d162096ca | |||
b013ebc3b2 | |||
c1a45b5107 | |||
15bfedcbbd | |||
47c8709564 | |||
f4e74cf63c | |||
14bf7270aa | |||
d710d60c31 | |||
fe627697a3 | |||
295fd6e833 | |||
a010fb58d6 | |||
5fede0a90b | |||
f5fc670638 | |||
00fd3ff49b | |||
c6f1459eb9 | |||
727cda9d1f | |||
970135f6bc | |||
d9b285d7e8 | |||
b08e6d38ae | |||
401c404811 | |||
4f17809a36 | |||
d790a66d6b | |||
11573f3ec1 | |||
182eba1bc6 | |||
d9e66a62b4 | |||
1caa19cb06 | |||
879cd8cc2b | |||
46da355022 | |||
79f45855a6 | |||
b06c97e51d | |||
4c10127b2c | |||
f8d54e7c94 | |||
aadab51541 | |||
85df93399c | |||
3e11f9ff90 | |||
e7f38d96f0 | |||
61ea9c89c5 | |||
f566c5924a | |||
ed2a10a1c5 | |||
81f3edea8f | |||
d7a3c8352e | |||
bdc8861aac | |||
f225e560de | |||
316e9f9032 | |||
6d9c4758ae | |||
eff29c8b28 | |||
6f19c16c78 | |||
19d70c7d96 | |||
1e64d8c731 | |||
4734a4227f | |||
3aee261527 | |||
f38b654e9b | |||
a541c76238 | |||
c93370c4ad | |||
237f3bf8da | |||
25e2857c21 | |||
323ad539bb | |||
5486abfe4e | |||
d104362d90 | |||
fe4bb32cba | |||
ce37c3a109 | |||
580ad29288 | |||
6bfffce916 | |||
3620e3cdcf | |||
b167672c74 | |||
23b2497292 | |||
8ce9f2b161 | |||
49faa15e4f | |||
c3aa1f8bdb | |||
0d4d04e550 | |||
15b0c4ffdb | |||
af4c893eb7 | |||
a1c4d7d765 | |||
6f9d8bdbcb | |||
ecd93b7541 | |||
b92587bc56 | |||
738ee810b4 | |||
03d777f345 | |||
b81a7ece97 | |||
12c542a421 | |||
6ed7374c5a | |||
27a1f781bc | |||
c8c9ef2757 | |||
0c85095e46 | |||
24e0171b86 | |||
faa8bf1079 | |||
58df0daa7f | |||
9ca731f66c | |||
3514c8c375 | |||
5d2df4100d | |||
aabafbea1d | |||
38b3514832 | |||
b1e32305bd | |||
cf5fa06c8d | |||
13f59ad733 | |||
bde4589189 | |||
b553b50acb | |||
7ad5c00ed9 | |||
634736a781 | |||
b1be11c727 | |||
1355e0552e | |||
e0a48c99e4 | |||
3decd4f9f1 | |||
f991a00653 | |||
81c28325aa | |||
cebeba7bd7 | |||
d6d528ca25 | |||
c00c6d038c | |||
ec171c529a | |||
7ff256ec98 | |||
e56c6a83b4 | |||
5c519beb2e | |||
7d6b260174 | |||
acfe3f2664 | |||
8c69a83881 | |||
0b648155e7 | |||
91b56239e0 | |||
c3fd4a75e9 | |||
229c5c9b2a | |||
c8b2f62297 | |||
58355a5bfb | |||
c93125b120 | |||
f7a107f73e | |||
5c2a1ae876 | |||
fd5c9bb9ab | |||
a70da51ff7 | |||
8881ae1bf8 | |||
3c80fac258 | |||
8110d304f4 | |||
315c0aa08c | |||
61fcc8b939 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -44,3 +44,4 @@ gnulib/
|
||||
*#*#
|
||||
*.#*#
|
||||
ChangeLog
|
||||
NEWS
|
||||
|
@ -1,5 +1,6 @@
|
||||
^src/util\.c$
|
||||
^src/xend_internal\.c$
|
||||
^src/util-lib\.c$
|
||||
^qemud/qemud.c$
|
||||
^src/libvirt\.c$
|
||||
^src/qemu/qemu_driver\.c$
|
||||
^src/util/util\.c$
|
||||
^src/xen/xend_internal\.c$
|
||||
^daemon/libvirtd.c$
|
||||
^gnulib/
|
||||
|
@ -4,5 +4,5 @@ docs/html/libvirt-virterror.html
|
||||
docs/libvirt-api.xml
|
||||
docs/libvirt-refs.xml
|
||||
include/libvirt/virterror.h
|
||||
qemud/dispatch.c
|
||||
src/virterror.c
|
||||
daemon/dispatch.c
|
||||
src/util/virterror.c
|
||||
|
@ -4,7 +4,7 @@ ChangeLog
|
||||
^Makefile*
|
||||
^docs/
|
||||
^tests/
|
||||
^src/virsh\.c
|
||||
^src/console\.c
|
||||
^src/virterror\.c
|
||||
^tools/virsh\.c
|
||||
^tools/console\.c
|
||||
^src/util/virterror\.c
|
||||
^build-aux/
|
||||
|
1
.x-sc_prohibit_strncpy
Normal file
1
.x-sc_prohibit_strncpy
Normal file
@ -0,0 +1 @@
|
||||
src/util/util.c
|
@ -1,6 +1,5 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
||||
^examples/
|
||||
^gnulib/lib/dummy\.c$
|
||||
^gnulib/tests/dummy\.c$
|
||||
^qemud/remote_protocol\.c$
|
||||
^daemon/remote_protocol\.c$
|
||||
^ChangeLog$
|
||||
|
@ -1,2 +1 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
||||
^examples/
|
||||
|
4
AUTHORS
4
AUTHORS
@ -22,6 +22,7 @@ The primary maintainers and people with commit access rights:
|
||||
Dan Smith <danms@us.ibm.com>
|
||||
Guido Günther <agx@sigxcpu.org>
|
||||
John Levon <john.levon@sun.com>
|
||||
Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
|
||||
Patches have also been contributed by:
|
||||
|
||||
@ -52,7 +53,7 @@ Patches have also been contributed by:
|
||||
Charles Duffy <Charles_Duffy@messageone.com>
|
||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
James Morris <jmorris@namei.org>
|
||||
Chris Wrigh <chrisw@redhat.com>
|
||||
Chris Wright <chrisw@redhat.com>
|
||||
Ben Guthro <ben.guthro@gmail.com>
|
||||
Shigeki Sakamoto <fj0588di@aa.jp.fujitsu.com>
|
||||
Gerd von Egidy <lists@egidy.de>
|
||||
@ -78,7 +79,6 @@ Patches have also been contributed by:
|
||||
Henrik Persson E <henrik.e.persson@ericsson.com>
|
||||
Satoru SATOH <satoru.satoh@gmail.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
Miloslav Trmač <mitr@redhat.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
31
HACKING
31
HACKING
@ -231,6 +231,37 @@ one of the following semantically named macros
|
||||
|
||||
|
||||
|
||||
String copying
|
||||
==============
|
||||
|
||||
Do not use the strncpy function. According to the man page, it does
|
||||
*not* guarantee a NULL-terminated buffer, which makes it extremely dangerous
|
||||
to use. Instead, use one of the functionally equivalent functions:
|
||||
|
||||
- virStrncpy(char *dest, const char *src, size_t n, size_t destbytes)
|
||||
The first three arguments have the same meaning as for strncpy; namely the
|
||||
destination, source, and number of bytes to copy, respectively. The last
|
||||
argument is the number of bytes available in the destination string; if a
|
||||
copy of the source string (including a \0) will not fit into the
|
||||
destination, no bytes are copied and the routine returns NULL.
|
||||
Otherwise, n bytes from the source are copied into the destination and a
|
||||
trailing \0 is appended.
|
||||
|
||||
- virStrcpy(char *dest, const char *src, size_t destbytes)
|
||||
Use this variant if you know you want to copy the entire src string
|
||||
into dest. Note that this is a macro, so arguments could be
|
||||
evaluated more than once. This is equivalent to
|
||||
virStrncpy(dest, src, strlen(src), destbytes)
|
||||
|
||||
- virStrcpyStatic(char *dest, const char *src)
|
||||
Use this variant if you know you want to copy the entire src string
|
||||
into dest *and* you know that your destination string is a static string
|
||||
(i.e. that sizeof(dest) returns something meaningful). Note that
|
||||
this is a macro, so arguments could be evaluated more than once. This is
|
||||
equivalent to virStrncpy(dest, src, strlen(src), sizeof(dest)).
|
||||
|
||||
|
||||
|
||||
Variable length string buffer
|
||||
=============================
|
||||
|
||||
|
26
Makefile.am
26
Makefile.am
@ -3,17 +3,20 @@
|
||||
LCOV = lcov
|
||||
GENHTML = genhtml
|
||||
|
||||
SUBDIRS = gnulib/lib include src qemud tools proxy docs gnulib/tests \
|
||||
python tests po examples/domain-events/events-c examples/hellolibvirt
|
||||
SUBDIRS = gnulib/lib include src daemon tools proxy docs gnulib/tests \
|
||||
python tests po examples/domain-events/events-c examples/hellolibvirt \
|
||||
examples/dominfo examples/domsuspend examples/python
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
|
||||
|
||||
XML_EXAMPLES = $(wildcard examples/xml/test/*.xml) $(wildcard examples/xml/storage/*.xml)
|
||||
|
||||
EXTRA_DIST = \
|
||||
ChangeLog-old \
|
||||
libvirt.spec libvirt.spec.in \
|
||||
mingw32-libvirt.spec.in \
|
||||
libvirt.pc libvirt.pc.in \
|
||||
$(man_MANS) autobuild.sh \
|
||||
autobuild.sh \
|
||||
.x-sc_avoid_if_before_free \
|
||||
.x-sc_require_config_h_first \
|
||||
.x-sc_prohibit_strcmp \
|
||||
@ -21,13 +24,22 @@ EXTRA_DIST = \
|
||||
.x-sc_require_config_h \
|
||||
.x-sc_prohibit_nonreentrant \
|
||||
Makefile.nonreentrant \
|
||||
autogen.sh
|
||||
|
||||
man_MANS = virsh.1
|
||||
autogen.sh \
|
||||
examples/domain-events/events-python \
|
||||
$(XML_EXAMPLES)
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libvirt.pc
|
||||
|
||||
NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl \
|
||||
$(top_srcdir)/docs/news.html.in \
|
||||
| perl -0777 -pe 's/\n\n+$$/\n/' \
|
||||
| perl -pe 's/[ \t]+$$//' \
|
||||
> $@-t && mv $@-t $@ ; fi );
|
||||
|
||||
|
||||
rpm: clean
|
||||
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
|
||||
|
||||
@ -40,7 +52,7 @@ tests:
|
||||
|
||||
cov: clean-cov
|
||||
mkdir $(top_builddir)/coverage
|
||||
$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/qemud -d $(top_srcdir)/tests
|
||||
$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/daemon -d $(top_srcdir)/tests
|
||||
$(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o $(top_builddir)/coverage/libvirt.info *usr*
|
||||
rm $(top_builddir)/coverage/libvirt.info.tmp
|
||||
$(GENHTML) -s -t "libvirt" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libvirt.info
|
||||
|
30
RENAMES
30
RENAMES
@ -1,30 +0,0 @@
|
||||
# Suggested list of file renames.
|
||||
#
|
||||
# File renames don't normally go into patches because they make
|
||||
# the patches much harder to read, so list them here instead.
|
||||
|
||||
# Clearer naming scheme after Xen-unified patch went in.
|
||||
src/xen_internal.c src/xen_internal_hv.c
|
||||
src/xen_internal.h src/xen_internal_hv.h
|
||||
src/proxy_internal.c src/xen_internal_proxy.c
|
||||
src/proxy_internal.h src/xen_internal_proxy.h
|
||||
src/xend_internal.c src/xen_internal_xend.c
|
||||
src/xend_internal.h src/xen_internal_xend.h
|
||||
src/xm_internal.c src/xen_internal_inactive.c
|
||||
src/xm_internal.h src/xen_internal_inactive.h
|
||||
src/xs_internal.c src/xen_internal_xenstore.c
|
||||
src/xs_internal.h src/xen_internal_xenstore.h
|
||||
src/xen_unified.c src/xen_internal.c
|
||||
src/xen_unified.h src/xen_internal.h
|
||||
|
||||
# Test driver should really be called test_internal.
|
||||
src/test.c src/test_internal.c
|
||||
src/test.h src/test_internal.h
|
||||
|
||||
# This would be better:
|
||||
src/*_internal*.c src/*_driver*.c
|
||||
src/*_internal*.h src/*_driver*.h
|
||||
|
||||
# Qemud is now the qemud + remote driver.
|
||||
qemud/protocol.x qemud/qemud_protocol.x
|
||||
qemud/* remote/*
|
7
cfg.mk
7
cfg.mk
@ -91,12 +91,17 @@ sc_prohibit_asprintf:
|
||||
msg='use virAsprintf, not a'sprintf \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_strncpy:
|
||||
@re='strncpy *\(' \
|
||||
msg='use virStrncpy, not strncpy' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_VIR_ERR_NO_MEMORY:
|
||||
@re='\<V''IR_ERR_NO_MEMORY\>' \
|
||||
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
include Makefile.nonreentrant
|
||||
include $(srcdir)/Makefile.nonreentrant
|
||||
sc_prohibit_nonreentrant:
|
||||
@fail=0 ; \
|
||||
for i in $(NON_REENTRANT) ; \
|
||||
|
102
configure.in
102
configure.in
@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([libvirt], [0.7.1])
|
||||
AC_INIT([libvirt], [0.7.2])
|
||||
AC_CONFIG_SRCDIR([src/libvirt.c])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
@ -799,6 +799,83 @@ fi
|
||||
AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"])
|
||||
|
||||
|
||||
dnl AppArmor
|
||||
AC_ARG_WITH([apparmor],
|
||||
[ --with-apparmor use AppArmor to manage security],
|
||||
[],
|
||||
[with_apparmor=check])
|
||||
|
||||
APPARMOR_CFLAGS=
|
||||
APPARMOR_LIBS=
|
||||
if test "$with_apparmor" != "no"; then
|
||||
old_cflags="$CFLAGS"
|
||||
old_libs="$LIBS"
|
||||
if test "$with_apparmor" = "check"; then
|
||||
AC_CHECK_HEADER([sys/apparmor.h],[],[with_apparmor=no])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_profile],[],[with_apparmor=no])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_hat],[],[with_apparmor=no])
|
||||
if test "$with_apparmor" != "no"; then
|
||||
with_apparmor="yes"
|
||||
fi
|
||||
else
|
||||
fail=0
|
||||
AC_CHECK_HEADER([sys/apparmor.h],[],[fail=1])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_profile],[],[fail=1])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_hat],[],[fail=1])
|
||||
test $fail = 1 &&
|
||||
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
|
||||
fi
|
||||
CFLAGS="$old_cflags"
|
||||
LIBS="$old_libs"
|
||||
fi
|
||||
if test "$with_apparmor" = "yes"; then
|
||||
APPARMOR_LIBS="-lapparmor"
|
||||
AC_DEFINE_UNQUOTED([HAVE_APPARMOR], 1, [whether AppArmor is available for security])
|
||||
AC_DEFINE_UNQUOTED([APPARMOR_DIR], "/etc/apparmor.d", [path to apparmor directory])
|
||||
AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], "/sys/kernel/security/apparmor/profiles", [path to kernel profiles])
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_APPARMOR], [test "$with_apparmor" != "no"])
|
||||
AC_SUBST([APPARMOR_CFLAGS])
|
||||
AC_SUBST([APPARMOR_LIBS])
|
||||
|
||||
|
||||
AC_ARG_WITH([secdriver-apparmor],
|
||||
[ --with-secdriver-apparmor use AppArmor security driver],
|
||||
[],
|
||||
[with_secdriver_apparmor=check])
|
||||
|
||||
if test "$with_apparmor" != "yes" ; then
|
||||
if test "$with_secdriver_apparmor" = "check" ; then
|
||||
with_secdriver_apparmor=no
|
||||
else
|
||||
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
|
||||
fi
|
||||
else
|
||||
old_cflags="$CFLAGS"
|
||||
old_libs="$LIBS"
|
||||
CFLAGS="$CFLAGS $APPARMOR_CFLAGS"
|
||||
LIBS="$CFLAGS $APPARMOR_LIBS"
|
||||
|
||||
fail=0
|
||||
AC_CHECK_FUNC([change_hat], [], [fail=1])
|
||||
AC_CHECK_FUNC([aa_change_profile], [], [fail=1])
|
||||
CFLAGS="$old_cflags"
|
||||
LIBS="$old_libs"
|
||||
|
||||
if test "$fail" = "1" ; then
|
||||
if test "$with_secdriver_apparmor" = "check" ; then
|
||||
with_secdriver_apparmor=no
|
||||
else
|
||||
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
|
||||
fi
|
||||
else
|
||||
with_secdriver_apparmor=yes
|
||||
AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"])
|
||||
|
||||
|
||||
|
||||
dnl NUMA lib
|
||||
AC_ARG_WITH([numactl],
|
||||
@ -1316,6 +1393,9 @@ dnl
|
||||
dnl check for python
|
||||
dnl
|
||||
|
||||
AC_ARG_WITH([python],
|
||||
[ --with-python Build python bindings (on)],[],[with_python=yes])
|
||||
|
||||
PYTHON_VERSION=
|
||||
PYTHON_INCLUDES=
|
||||
PYTHON_SITE_PACKAGES=
|
||||
@ -1373,7 +1453,7 @@ if test "$with_python" != "no" ; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$with_python" != ""
|
||||
if test "$with_python" != "yes"
|
||||
then
|
||||
pythondir='$(PYTHON_SITE_PACKAGES)'
|
||||
else
|
||||
@ -1685,8 +1765,6 @@ test "x$srcdir" = x. && ! test -f COPYING &&
|
||||
cp -f COPYING.LIB COPYING
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
docs/examples/Makefile docs/devhelp/Makefile \
|
||||
docs/examples/python/Makefile \
|
||||
docs/schemas/Makefile \
|
||||
gnulib/lib/Makefile \
|
||||
gnulib/tests/Makefile \
|
||||
@ -1694,7 +1772,7 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
po/Makefile.in \
|
||||
include/libvirt/Makefile include/libvirt/libvirt.h \
|
||||
python/Makefile python/tests/Makefile \
|
||||
qemud/Makefile \
|
||||
daemon/Makefile \
|
||||
tools/Makefile \
|
||||
tests/Makefile proxy/Makefile \
|
||||
tests/xml2sexprdata/Makefile \
|
||||
@ -1703,6 +1781,9 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
tests/xencapsdata/Makefile \
|
||||
tests/confdata/Makefile \
|
||||
examples/domain-events/events-c/Makefile \
|
||||
examples/domsuspend/Makefile \
|
||||
examples/dominfo/Makefile \
|
||||
examples/python/Makefile \
|
||||
examples/hellolibvirt/Makefile)
|
||||
|
||||
AC_MSG_NOTICE([])
|
||||
@ -1741,6 +1822,7 @@ AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Security Drivers])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ SELinux: $with_secdriver_selinux])
|
||||
AC_MSG_NOTICE([AppArmor: $with_secdriver_apparmor])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Driver Loadable Modules])
|
||||
AC_MSG_NOTICE([])
|
||||
@ -1759,9 +1841,9 @@ else
|
||||
AC_MSG_NOTICE([ libcurl: no])
|
||||
fi
|
||||
if test "$with_libssh2" != "no" ; then
|
||||
AC_MSG_NOTICE([ libssh2: $LIBSSH2_CFLAGS $LIBSSH2_LIBS])
|
||||
AC_MSG_NOTICE([ libssh2: $LIBSSH2_CFLAGS $LIBSSH2_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ libssh2: no])
|
||||
AC_MSG_NOTICE([ libssh2: no])
|
||||
fi
|
||||
AC_MSG_NOTICE([ gnutls: $GNUTLS_CFLAGS $GNUTLS_LIBS])
|
||||
if test "$with_sasl" != "no" ; then
|
||||
@ -1788,6 +1870,11 @@ AC_MSG_NOTICE([ selinux: $SELINUX_CFLAGS $SELINUX_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ selinux: no])
|
||||
fi
|
||||
if test "$with_apparmor" = "yes" ; then
|
||||
AC_MSG_NOTICE([apparmor: $APPARMOR_CFLAGS $APPARMOR_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([apparmor: no])
|
||||
fi
|
||||
if test "$with_numactl" = "yes" ; then
|
||||
AC_MSG_NOTICE([ numactl: $NUMACTL_CFLAGS $NUMACTL_LIBS])
|
||||
else
|
||||
@ -1834,6 +1921,7 @@ AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ Debug: $enable_debug])
|
||||
AC_MSG_NOTICE([ Warnings: $enable_compile_warnings])
|
||||
AC_MSG_NOTICE([ Readline: $lv_use_readline])
|
||||
AC_MSG_NOTICE([ Python: $with_python])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Privileges])
|
||||
AC_MSG_NOTICE([])
|
||||
|
0
qemud/.gitignore → daemon/.gitignore
vendored
0
qemud/.gitignore → daemon/.gitignore
vendored
@ -2,23 +2,22 @@
|
||||
|
||||
DAEMON_SOURCES = \
|
||||
event.c event.h \
|
||||
qemud.c qemud.h \
|
||||
libvirtd.c libvirtd.h \
|
||||
remote.c remote.h \
|
||||
dispatch.c dispatch.h \
|
||||
stream.c stream.h \
|
||||
remote_dispatch_prototypes.h \
|
||||
remote_dispatch_table.h \
|
||||
remote_dispatch_args.h \
|
||||
remote_dispatch_ret.h \
|
||||
remote_protocol.h remote_protocol.c
|
||||
../src/remote/remote_protocol.c
|
||||
|
||||
AVAHI_SOURCES = \
|
||||
mdns.c mdns.h
|
||||
|
||||
DISTCLEANFILES =
|
||||
EXTRA_DIST = \
|
||||
default-network.xml \
|
||||
remote_generate_stubs.pl rpcgen_fix.pl \
|
||||
remote_protocol.x \
|
||||
remote_generate_stubs.pl \
|
||||
libvirtd.conf \
|
||||
libvirtd.init.in \
|
||||
libvirtd.policy-0 \
|
||||
@ -26,61 +25,25 @@ EXTRA_DIST = \
|
||||
libvirtd.sasl \
|
||||
libvirtd.sysconf \
|
||||
libvirtd.aug \
|
||||
libvirtd_qemu.aug \
|
||||
libvirtd.logrotate.in \
|
||||
test_libvirtd.aug \
|
||||
test_libvirtd_qemu.aug \
|
||||
$(AVAHI_SOURCES) \
|
||||
$(DAEMON_SOURCES)
|
||||
|
||||
BUILT_SOURCES =
|
||||
|
||||
if HAVE_RPCGEN
|
||||
#
|
||||
# Maintainer-only target for re-generating the derived .c/.h source
|
||||
# files, which are actually derived from the .x file.
|
||||
#
|
||||
# For committing protocol changes to CVS, the GLIBC rpcgen *must*
|
||||
# be used.
|
||||
#
|
||||
# Support for non-GLIB rpcgen is here as a convenience for
|
||||
# non-Linux people needing to test changes during dev.
|
||||
#
|
||||
rpcgen:
|
||||
rm -f rp.c-t rp.h-t rp.c-t1 rp.c-t2 rp.h-t1
|
||||
$(RPCGEN) -h -o rp.h-t $(srcdir)/remote_protocol.x
|
||||
$(RPCGEN) -c -o rp.c-t $(srcdir)/remote_protocol.x
|
||||
if HAVE_GLIBC_RPCGEN
|
||||
perl -w $(srcdir)/rpcgen_fix.pl rp.h-t > rp.h-t1
|
||||
perl -w $(srcdir)/rpcgen_fix.pl rp.c-t > rp.c-t1
|
||||
(echo '#include <config.h>'; cat rp.c-t1) > rp.c-t2
|
||||
chmod 0444 rp.c-t2 rp.h-t1
|
||||
mv -f rp.h-t1 $(srcdir)/remote_protocol.h
|
||||
mv -f rp.c-t2 $(srcdir)/remote_protocol.c
|
||||
rm -f rp.c-t rp.h-t rp.c-t1
|
||||
else
|
||||
chmod 0444 rp.c-t rp.h-t
|
||||
mv -f rp.h-t $(srcdir)/remote_protocol.h
|
||||
mv -f rp.c-t $(srcdir)/remote_protocol.c
|
||||
endif
|
||||
endif
|
||||
|
||||
remote_protocol.c: remote_protocol.h
|
||||
|
||||
if WITH_LIBVIRTD
|
||||
|
||||
UUID=$(shell uuidgen 2>/dev/null)
|
||||
|
||||
sbin_PROGRAMS = libvirtd
|
||||
|
||||
confdir = $(sysconfdir)/libvirt/
|
||||
conf_DATA = libvirtd.conf
|
||||
|
||||
augeasdir = $(datadir)/augeas/lenses
|
||||
augeas_DATA = libvirtd.aug libvirtd_qemu.aug
|
||||
augeas_DATA = libvirtd.aug
|
||||
|
||||
augeastestsdir = $(datadir)/augeas/lenses/tests
|
||||
augeastests_DATA = test_libvirtd.aug test_libvirtd_qemu.aug
|
||||
augeastests_DATA = test_libvirtd.aug
|
||||
|
||||
libvirtd_SOURCES = $(DAEMON_SOURCES)
|
||||
|
||||
@ -89,6 +52,9 @@ libvirtd_CFLAGS = \
|
||||
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
|
||||
-I$(top_srcdir)/include -I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/util \
|
||||
-I$(top_srcdir)/src/conf \
|
||||
-I$(top_srcdir)/src/remote \
|
||||
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
||||
$(POLKIT_CFLAGS) \
|
||||
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
|
||||
@ -108,9 +74,10 @@ libvirtd_LDADD = \
|
||||
$(SASL_LIBS) \
|
||||
$(POLKIT_LIBS)
|
||||
|
||||
libvirtd_LDADD += ../src/libvirt_util.la
|
||||
|
||||
if WITH_DRIVER_MODULES
|
||||
libvirtd_LDADD += ../src/libvirt_driver.la
|
||||
libvirtd_LDADD += ../src/libvirt_util.la
|
||||
else
|
||||
if WITH_QEMU
|
||||
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
|
||||
@ -164,43 +131,17 @@ libvirtd_LDADD += $(AVAHI_LIBS)
|
||||
endif
|
||||
|
||||
|
||||
default_xml_dest = libvirt/qemu/networks/default.xml
|
||||
install-data-local: install-init install-data-sasl install-data-polkit \
|
||||
install-logrotate
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
|
||||
$(INSTALL_DATA) $(srcdir)/default-network.xml \
|
||||
$(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
||||
test -z "$(UUID)" || \
|
||||
sed -i -e "s,</name>,</name>\n <uuid>$(UUID)</uuid>," \
|
||||
$(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
||||
test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
|
||||
ln -s ../default.xml \
|
||||
$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
|
||||
|
||||
uninstall-local:: uninstall-init uninstall-data-sasl install-data-polkit
|
||||
rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
||||
rm -f $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
||||
rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || :
|
||||
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
|
||||
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
|
||||
rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
|
||||
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
|
||||
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
|
||||
|
||||
if HAVE_SASL
|
||||
install-data-sasl:: install-init
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
|
||||
uninstall-data-sasl:: install-init
|
||||
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
rmdir $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
else
|
||||
install-data-sasl:
|
||||
uninstall-data-sasl:
|
||||
endif
|
||||
|
||||
if HAVE_POLKIT
|
||||
install-data-polkit:: install-init
|
||||
mkdir -p $(DESTDIR)$(policydir)
|
||||
@ -218,17 +159,19 @@ remote.c: remote_dispatch_prototypes.h \
|
||||
remote_dispatch_args.h \
|
||||
remote_dispatch_ret.h
|
||||
|
||||
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -p $(srcdir)/remote_protocol.x > $@
|
||||
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
|
||||
|
||||
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -t $(srcdir)/remote_protocol.x > $@
|
||||
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -a $(srcdir)/remote_protocol.x > $@
|
||||
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -r $(srcdir)/remote_protocol.x > $@
|
||||
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
BUILT_SOURCES += libvirtd.logrotate
|
||||
|
||||
@ -240,6 +183,8 @@ libvirtd.logrotate: libvirtd.logrotate.in
|
||||
|
||||
install-logrotate: libvirtd.logrotate
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
|
||||
$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
|
||||
|
||||
@ -270,8 +215,6 @@ libvirtd.init: libvirtd.init.in
|
||||
check-local:
|
||||
test -x '$(AUGPARSE)' \
|
||||
&& '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
|
||||
test -x '$(AUGPARSE)' \
|
||||
&& '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd_qemu.aug || :
|
||||
|
||||
else
|
||||
|
||||
@ -285,7 +228,26 @@ endif # DBUS_INIT_SCRIPTS_RED_HAT
|
||||
# are used by nearly every other library.
|
||||
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
|
||||
|
||||
else # WITH_LIBVIRTD
|
||||
install-data-local: install-data-sasl
|
||||
uninstall-local:: uninstall-data-sasl
|
||||
endif # WITH_LIBVIRTD
|
||||
|
||||
# This is needed for clients too, so can't wrap in
|
||||
# the WITH_LIBVIRTD conditional
|
||||
if HAVE_SASL
|
||||
install-data-sasl:
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
|
||||
uninstall-data-sasl:
|
||||
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
rmdir $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
else
|
||||
install-data-sasl:
|
||||
uninstall-data-sasl:
|
||||
endif
|
||||
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
|
@ -59,4 +59,4 @@ for the associated RPC call.
|
||||
While the helper method is executing, no locks are held on either
|
||||
the client or server, but the ref count on the 'struct qemud_client'
|
||||
object is incremented to ensure its not deleted. The helper can
|
||||
now safely invoke the neccessary libvirt API call.
|
||||
now safely invoke the necessary libvirt API call.
|
@ -104,7 +104,7 @@ void remoteDispatchOOMError (remote_error *rerr)
|
||||
{
|
||||
remoteDispatchStringError(rerr,
|
||||
VIR_ERR_NO_MEMORY,
|
||||
NULL);
|
||||
"out of memory");
|
||||
}
|
||||
|
||||
|
||||
@ -136,6 +136,10 @@ remoteSerializeError(struct qemud_client *client,
|
||||
unsigned int len;
|
||||
struct qemud_client_message *msg = NULL;
|
||||
|
||||
DEBUG("prog=%d ver=%d proc=%d type=%d serial=%d, msg=%s",
|
||||
program, version, procedure, type, serial,
|
||||
rerr->message ? *rerr->message : "(none)");
|
||||
|
||||
if (VIR_ALLOC(msg) < 0)
|
||||
goto fatal_error;
|
||||
|
||||
@ -191,6 +195,7 @@ remoteSerializeError(struct qemud_client *client,
|
||||
|
||||
xdr_error:
|
||||
xdr_destroy(&xdr);
|
||||
VIR_FREE(msg);
|
||||
fatal_error:
|
||||
xdr_free((xdrproc_t)xdr_remote_error, (char *)rerr);
|
||||
return -1;
|
||||
@ -206,19 +211,38 @@ fatal_error:
|
||||
*
|
||||
* Returns 0 if the error was sent, -1 upon fatal error
|
||||
*/
|
||||
static int
|
||||
int
|
||||
remoteSerializeReplyError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
remote_message_header *req) {
|
||||
/*
|
||||
* For data streams, errors are sent back as data streams
|
||||
* For method calls, errors are sent back as method replies
|
||||
*/
|
||||
return remoteSerializeError(client,
|
||||
rerr,
|
||||
req->prog,
|
||||
req->vers,
|
||||
req->proc,
|
||||
REMOTE_REPLY,
|
||||
req->type == REMOTE_STREAM ? REMOTE_STREAM : REMOTE_REPLY,
|
||||
req->serial);
|
||||
}
|
||||
|
||||
int
|
||||
remoteSerializeStreamError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
int proc,
|
||||
int serial)
|
||||
{
|
||||
return remoteSerializeError(client,
|
||||
rerr,
|
||||
REMOTE_PROGRAM,
|
||||
REMOTE_PROTOCOL_VERSION,
|
||||
proc,
|
||||
REMOTE_STREAM,
|
||||
serial);
|
||||
}
|
||||
|
||||
/*
|
||||
* @msg: the complete incoming message, whose header to decode
|
||||
*
|
||||
@ -336,8 +360,13 @@ remoteDispatchClientRequest (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
int ret;
|
||||
remote_error rerr;
|
||||
|
||||
DEBUG("prog=%d ver=%d type=%d satus=%d serial=%d proc=%d",
|
||||
msg->hdr.prog, msg->hdr.vers, msg->hdr.type,
|
||||
msg->hdr.status, msg->hdr.serial, msg->hdr.proc);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
/* Check version, etc. */
|
||||
@ -358,13 +387,31 @@ remoteDispatchClientRequest (struct qemud_server *server,
|
||||
case REMOTE_CALL:
|
||||
return remoteDispatchClientCall(server, client, msg);
|
||||
|
||||
case REMOTE_STREAM:
|
||||
/* Since stream data is non-acked, async, we may continue to received
|
||||
* stream packets after we closed down a stream. Just drop & ignore
|
||||
* these.
|
||||
*/
|
||||
VIR_INFO("Ignoring unexpected stream data serial=%d proc=%d status=%d",
|
||||
msg->hdr.serial, msg->hdr.proc, msg->hdr.status);
|
||||
qemudClientMessageRelease(client, msg);
|
||||
break;
|
||||
|
||||
default:
|
||||
remoteDispatchFormatError (&rerr, _("type (%d) != REMOTE_CALL"),
|
||||
(int) msg->hdr.type);
|
||||
goto error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
ret = remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
|
||||
if (ret >= 0)
|
||||
VIR_FREE(msg);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -456,7 +503,7 @@ remoteDispatchClientCall (struct qemud_server *server,
|
||||
*
|
||||
* 'conn', 'rerr', 'args and 'ret'
|
||||
*/
|
||||
rv = (data->fn)(server, client, conn, &rerr, &args, &ret);
|
||||
rv = (data->fn)(server, client, conn, &msg->hdr, &rerr, &args, &ret);
|
||||
|
||||
virMutexLock(&server->lock);
|
||||
virMutexLock(&client->lock);
|
||||
@ -521,8 +568,12 @@ remoteDispatchClientCall (struct qemud_server *server,
|
||||
rpc_error:
|
||||
/* Semi-bad stuff happened, we can still try to send back
|
||||
* an RPC error message to client */
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
rv = remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
|
||||
if (rv >= 0)
|
||||
VIR_FREE(msg);
|
||||
|
||||
return rv;
|
||||
|
||||
xdr_error:
|
||||
/* Seriously bad stuff happened, so we'll kill off this client
|
||||
@ -532,3 +583,86 @@ xdr_error:
|
||||
fatal_error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
remoteSendStreamData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
const char *data,
|
||||
unsigned int len)
|
||||
{
|
||||
struct qemud_client_message *msg;
|
||||
XDR xdr;
|
||||
|
||||
DEBUG("client=%p stream=%p data=%p len=%d", client, stream, data, len);
|
||||
|
||||
if (VIR_ALLOC(msg) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Return header. We're re-using same message object, so
|
||||
* only need to tweak type/status fields */
|
||||
msg->hdr.prog = REMOTE_PROGRAM;
|
||||
msg->hdr.vers = REMOTE_PROTOCOL_VERSION;
|
||||
msg->hdr.proc = stream->procedure;
|
||||
msg->hdr.type = REMOTE_STREAM;
|
||||
msg->hdr.serial = stream->serial;
|
||||
/*
|
||||
* NB
|
||||
* data != NULL + len > 0 => REMOTE_CONTINUE (Sending back data)
|
||||
* data != NULL + len == 0 => REMOTE_CONTINUE (Sending read EOF)
|
||||
* data == NULL => REMOTE_OK (Sending finish handshake confirmation)
|
||||
*/
|
||||
msg->hdr.status = data ? REMOTE_CONTINUE : REMOTE_OK;
|
||||
|
||||
if (remoteEncodeClientMessageHeader(msg) < 0)
|
||||
goto fatal_error;
|
||||
|
||||
if (data && len) {
|
||||
if ((msg->bufferLength - msg->bufferOffset) < len)
|
||||
goto fatal_error;
|
||||
|
||||
/* Now for the payload */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer,
|
||||
msg->bufferLength,
|
||||
XDR_ENCODE);
|
||||
|
||||
/* Skip over existing header already written */
|
||||
if (xdr_setpos(&xdr, msg->bufferOffset) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
memcpy(msg->buffer + msg->bufferOffset, data, len);
|
||||
msg->bufferOffset += len;
|
||||
|
||||
/* Update the length word. */
|
||||
len = msg->bufferOffset;
|
||||
if (xdr_setpos (&xdr, 0) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
if (!xdr_u_int (&xdr, &len))
|
||||
goto xdr_error;
|
||||
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
DEBUG("Total %d", msg->bufferOffset);
|
||||
}
|
||||
if (data)
|
||||
msg->streamTX = 1;
|
||||
|
||||
/* Reset ready for I/O */
|
||||
msg->bufferLength = msg->bufferOffset;
|
||||
msg->bufferOffset = 0;
|
||||
|
||||
/* Put reply on end of tx queue to send out */
|
||||
qemudClientMessageQueuePush(&client->tx, msg);
|
||||
qemudUpdateClientEvent(client);
|
||||
|
||||
return 0;
|
||||
|
||||
xdr_error:
|
||||
xdr_destroy (&xdr);
|
||||
fatal_error:
|
||||
VIR_FREE(msg);
|
||||
return -1;
|
||||
}
|
@ -25,7 +25,7 @@
|
||||
#define __LIBVIRTD_DISPATCH_H__
|
||||
|
||||
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
|
||||
|
||||
int
|
||||
@ -49,6 +49,17 @@ void remoteDispatchOOMError (remote_error *rerr);
|
||||
void remoteDispatchConnError (remote_error *rerr,
|
||||
virConnectPtr conn);
|
||||
|
||||
|
||||
int
|
||||
remoteSerializeReplyError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
remote_message_header *req);
|
||||
int
|
||||
remoteSerializeStreamError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
int proc,
|
||||
int serial);
|
||||
|
||||
/* Having this here is dubious. It should be in remote.h
|
||||
* but qemud.c shouldn't depend on that header directly.
|
||||
* Refactor this later to deal with this properly.
|
||||
@ -60,4 +71,10 @@ int remoteRelayDomainEvent (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
void *opaque);
|
||||
|
||||
|
||||
int
|
||||
remoteSendStreamData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
const char *data,
|
||||
unsigned int len);
|
||||
|
||||
#endif /* __LIBVIRTD_DISPATCH_H__ */
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* qemud.c: daemon start of day, guest process & i/o management
|
||||
* libvirtd.c: daemon start of day, guest process & i/o management
|
||||
*
|
||||
* Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006 Daniel P. Berrange
|
||||
@ -53,14 +53,15 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "remote_internal.h"
|
||||
#include "remote_driver.h"
|
||||
#include "conf.h"
|
||||
#include "event.h"
|
||||
#include "memory.h"
|
||||
#include "stream.h"
|
||||
#ifdef HAVE_AVAHI
|
||||
#include "mdns.h"
|
||||
#endif
|
||||
@ -69,30 +70,30 @@
|
||||
#include "driver.h"
|
||||
#else
|
||||
#ifdef WITH_QEMU
|
||||
#include "qemu_driver.h"
|
||||
#include "qemu/qemu_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_LXC
|
||||
#include "lxc_driver.h"
|
||||
#include "lxc/lxc_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_UML
|
||||
#include "uml_driver.h"
|
||||
#include "uml/uml_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_ONE
|
||||
#include "opennebula/one_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_NETWORK
|
||||
#include "network_driver.h"
|
||||
#include "network/bridge_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_NETCF
|
||||
#include "interface_driver.h"
|
||||
#include "interface/netcf_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_STORAGE_DIR
|
||||
#include "storage_driver.h"
|
||||
#include "storage/storage_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_NODE_DEVICES
|
||||
#include "node_device.h"
|
||||
#include "node_device/node_device_driver.h"
|
||||
#endif
|
||||
#include "secret_driver.h"
|
||||
#include "secret/secret_driver.h"
|
||||
#endif
|
||||
|
||||
|
||||
@ -507,11 +508,13 @@ static int qemudListenUnix(struct qemud_server *server,
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy(addr.sun_path, path, sizeof(addr.sun_path)-1);
|
||||
if (virStrcpyStatic(addr.sun_path, path) == NULL) {
|
||||
VIR_ERROR(_("Path %s too long for unix socket"), path);
|
||||
goto cleanup;
|
||||
}
|
||||
if (addr.sun_path[0] == '@')
|
||||
addr.sun_path[0] = '\0';
|
||||
|
||||
|
||||
oldgrp = getgid();
|
||||
oldmask = umask(readonly ? ~unix_sock_ro_mask : ~unix_sock_rw_mask);
|
||||
if (server->privileged)
|
||||
@ -1721,10 +1724,15 @@ readmore:
|
||||
/* Check if any filters match this message */
|
||||
filter = client->filters;
|
||||
while (filter) {
|
||||
if ((filter->query)(msg, filter->opaque)) {
|
||||
qemudClientMessageQueuePush(&filter->dx, msg);
|
||||
int ret;
|
||||
ret = (filter->query)(client, msg, filter->opaque);
|
||||
if (ret == 1) {
|
||||
msg = NULL;
|
||||
break;
|
||||
} else if (ret == -1) {
|
||||
VIR_FREE(msg);
|
||||
qemudDispatchClientFailure(client);
|
||||
return;
|
||||
}
|
||||
filter = filter->next;
|
||||
}
|
||||
@ -1886,6 +1894,31 @@ static ssize_t qemudClientWrite(struct qemud_client *client) {
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
qemudClientMessageRelease(struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
if (msg->streamTX) {
|
||||
remoteStreamMessageFinished(client, msg);
|
||||
} else if (!msg->async)
|
||||
client->nrequests--;
|
||||
|
||||
/* See if the recv queue is currently throttled */
|
||||
if (!client->rx &&
|
||||
client->nrequests < max_client_requests) {
|
||||
/* Reset message record for next RX attempt */
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
client->rx = msg;
|
||||
/* Get ready to receive next message */
|
||||
client->rx->bufferLength = REMOTE_MESSAGE_HEADER_XDR_LEN;
|
||||
} else {
|
||||
VIR_FREE(msg);
|
||||
}
|
||||
|
||||
qemudUpdateClientEvent(client);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process all queued client->tx messages until
|
||||
* we would block on I/O
|
||||
@ -1909,26 +1942,10 @@ qemudDispatchClientWrite(struct qemud_client *client) {
|
||||
/* Get finished reply from head of tx queue */
|
||||
reply = qemudClientMessageQueueServe(&client->tx);
|
||||
|
||||
/* If its not an async message, then we have
|
||||
* just completed an RPC request */
|
||||
if (!reply->async)
|
||||
client->nrequests--;
|
||||
|
||||
/* Move record to end of 'rx' ist */
|
||||
if (!client->rx &&
|
||||
client->nrequests < max_client_requests) {
|
||||
/* Reset message record for next RX attempt */
|
||||
client->rx = reply;
|
||||
client->rx->bufferOffset = 0;
|
||||
client->rx->bufferLength = REMOTE_MESSAGE_HEADER_XDR_LEN;
|
||||
} else {
|
||||
VIR_FREE(reply);
|
||||
}
|
||||
qemudClientMessageRelease(client, reply);
|
||||
|
||||
if (client->closing)
|
||||
qemudDispatchClientFailure(client);
|
||||
else
|
||||
qemudUpdateClientEvent(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2140,6 +2157,9 @@ static void qemudFreeClient(struct qemud_client *client) {
|
||||
VIR_FREE(msg);
|
||||
}
|
||||
|
||||
while (client->streams)
|
||||
remoteRemoveClientStream(client, client->streams);
|
||||
|
||||
if (client->conn)
|
||||
virConnectClose(client->conn);
|
||||
virMutexDestroy(&client->lock);
|
||||
@ -2270,7 +2290,6 @@ cleanup:
|
||||
}
|
||||
VIR_FREE(server->workers);
|
||||
|
||||
free(server->workers);
|
||||
virMutexUnlock(&server->lock);
|
||||
return ret;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* qemud.h: daemon data structure definitions
|
||||
* libvirtd.h: daemon data structure definitions
|
||||
*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006 Daniel P. Berrange
|
||||
@ -129,26 +129,44 @@ struct qemud_client_message {
|
||||
unsigned int bufferLength;
|
||||
unsigned int bufferOffset;
|
||||
|
||||
int async : 1;
|
||||
unsigned int async : 1;
|
||||
unsigned int streamTX : 1;
|
||||
|
||||
remote_message_header hdr;
|
||||
|
||||
struct qemud_client_message *next;
|
||||
};
|
||||
|
||||
struct qemud_client;
|
||||
|
||||
/* Allow for filtering of incoming messages to a custom
|
||||
* dispatch processing queue, instead of client->dx.
|
||||
*/
|
||||
typedef int (*qemud_client_filter_func)(struct qemud_client_message *msg, void *opaque);
|
||||
typedef int (*qemud_client_filter_func)(struct qemud_client *client,
|
||||
struct qemud_client_message *msg, void *opaque);
|
||||
struct qemud_client_filter {
|
||||
qemud_client_filter_func query;
|
||||
void *opaque;
|
||||
|
||||
struct qemud_client_message *dx;
|
||||
|
||||
struct qemud_client_filter *next;
|
||||
};
|
||||
|
||||
struct qemud_client_stream {
|
||||
virStreamPtr st;
|
||||
int procedure;
|
||||
int serial;
|
||||
|
||||
unsigned int recvEOF : 1;
|
||||
unsigned int closed : 1;
|
||||
|
||||
struct qemud_client_filter filter;
|
||||
|
||||
struct qemud_client_message *rx;
|
||||
int tx;
|
||||
|
||||
struct qemud_client_stream *next;
|
||||
};
|
||||
|
||||
/* Stores the per-client connection state */
|
||||
struct qemud_client {
|
||||
virMutex lock;
|
||||
@ -197,6 +215,10 @@ struct qemud_client {
|
||||
* end up on the 'dx' queue */
|
||||
struct qemud_client_filter *filters;
|
||||
|
||||
/* Data streams */
|
||||
struct qemud_client_stream *streams;
|
||||
|
||||
|
||||
/* This is only valid if a remote open call has been made on this
|
||||
* connection, otherwise it will be NULL. Also if remote close is
|
||||
* called, it will be set back to NULL if that succeeds.
|
||||
@ -275,6 +297,9 @@ qemudClientMessageQueuePush(struct qemud_client_message **queue,
|
||||
struct qemud_client_message *
|
||||
qemudClientMessageQueueServe(struct qemud_client_message **queue);
|
||||
|
||||
void
|
||||
qemudClientMessageRelease(struct qemud_client *client,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
|
||||
#if HAVE_POLKIT
|
8
daemon/libvirtd.logrotate.in
Normal file
8
daemon/libvirtd.logrotate.in
Normal file
@ -0,0 +1,8 @@
|
||||
@localstatedir@/log/libvirt/qemu/*.log @localstatedir@/log/libvirt/uml/*.log @localstatedir@/log/libvirt/lxc/*.log {
|
||||
weekly
|
||||
missingok
|
||||
rotate 4
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
@ -7,3 +7,11 @@
|
||||
|
||||
# Override Kerberos service keytab for SASL/GSSAPI
|
||||
#KRB5_KTNAME=/etc/libvirt/krb5.tab
|
||||
|
||||
# Override the QEMU/SDL default audio driver probing when
|
||||
# starting virtual machines using SDL graphics
|
||||
#
|
||||
# NB these have no effect for VMs using VNC
|
||||
#QEMU_AUDIO_DRV=sdl
|
||||
#
|
||||
#SDL_AUDIODRIVER=pulse
|
@ -37,11 +37,9 @@
|
||||
#include <avahi-common/error.h>
|
||||
#include <avahi-common/timeval.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
#include "mdns.h"
|
||||
#include "event.h"
|
||||
#include "remote_internal.h"
|
||||
#include "memory.h"
|
||||
|
||||
#define AVAHI_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
|
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@
|
||||
#define __LIBVIRTD_REMOTE_H__
|
||||
|
||||
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
|
||||
typedef union {
|
||||
#include "remote_dispatch_args.h"
|
||||
@ -54,6 +54,7 @@ typedef union {
|
||||
typedef int (*dispatch_fn) (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
dispatch_args *args,
|
||||
dispatch_ret *ret);
|
@ -125,3 +125,4 @@
|
||||
remote_secret_get_value_args val_remote_secret_get_value_args;
|
||||
remote_secret_undefine_args val_remote_secret_undefine_args;
|
||||
remote_secret_lookup_by_usage_args val_remote_secret_lookup_by_usage_args;
|
||||
remote_domain_migrate_prepare_tunnel_args val_remote_domain_migrate_prepare_tunnel_args;
|
File diff suppressed because it is too large
Load Diff
@ -742,3 +742,8 @@
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_lookup_by_usage_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_lookup_by_usage_ret,
|
||||
},
|
||||
{ /* DomainMigratePrepareTunnel => 148 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainMigratePrepareTunnel,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_tunnel_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
@ -115,6 +115,7 @@ elsif ($opt_p) {
|
||||
print " struct qemud_server *server,\n";
|
||||
print " struct qemud_client *client,\n";
|
||||
print " virConnectPtr conn,\n";
|
||||
print " remote_message_header *hdr,\n";
|
||||
print " remote_error *err,\n";
|
||||
print " $calls{$_}->{args} *args,\n";
|
||||
print " $calls{$_}->{ret} *ret);\n";
|
607
daemon/stream.c
Normal file
607
daemon/stream.c
Normal file
@ -0,0 +1,607 @@
|
||||
/*
|
||||
* stream.c: APIs for managing client streams
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "stream.h"
|
||||
#include "memory.h"
|
||||
#include "dispatch.h"
|
||||
#include "logging.h"
|
||||
|
||||
static int
|
||||
remoteStreamHandleWrite(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
static int
|
||||
remoteStreamHandleRead(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
static int
|
||||
remoteStreamHandleFinish(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg);
|
||||
static int
|
||||
remoteStreamHandleAbort(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
|
||||
|
||||
static void
|
||||
remoteStreamUpdateEvents(struct qemud_client_stream *stream)
|
||||
{
|
||||
int newEvents = 0;
|
||||
if (stream->rx)
|
||||
newEvents |= VIR_STREAM_EVENT_WRITABLE;
|
||||
if (stream->tx && !stream->recvEOF)
|
||||
newEvents |= VIR_STREAM_EVENT_READABLE;
|
||||
|
||||
virStreamEventUpdateCallback(stream->st, newEvents);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Callback that gets invoked when a stream becomes writable/readable
|
||||
*/
|
||||
static void
|
||||
remoteStreamEvent(virStreamPtr st, int events, void *opaque)
|
||||
{
|
||||
struct qemud_client *client = opaque;
|
||||
struct qemud_client_stream *stream;
|
||||
|
||||
/* XXX sub-optimal - we really should be taking the server lock
|
||||
* first, but we have no handle to the server object
|
||||
* We're lucky to get away with it for now, due to this callback
|
||||
* executing in the main thread, but this should really be fixed
|
||||
*/
|
||||
virMutexLock(&client->lock);
|
||||
|
||||
stream = remoteFindClientStream(client, st);
|
||||
|
||||
if (!stream) {
|
||||
VIR_WARN("event for client=%p stream st=%p, but missing stream state", client, st);
|
||||
virStreamEventRemoveCallback(st);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
DEBUG("st=%p events=%d", st, events);
|
||||
|
||||
if (events & VIR_STREAM_EVENT_WRITABLE) {
|
||||
if (remoteStreamHandleWrite(client, stream) < 0) {
|
||||
remoteRemoveClientStream(client, stream);
|
||||
qemudDispatchClientFailure(client);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream->recvEOF &&
|
||||
(events & (VIR_STREAM_EVENT_READABLE | VIR_STREAM_EVENT_HANGUP))) {
|
||||
events = events & ~(VIR_STREAM_EVENT_READABLE | VIR_STREAM_EVENT_HANGUP);
|
||||
if (remoteStreamHandleRead(client, stream) < 0) {
|
||||
remoteRemoveClientStream(client, stream);
|
||||
qemudDispatchClientFailure(client);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream->closed &&
|
||||
(events & (VIR_STREAM_EVENT_ERROR | VIR_STREAM_EVENT_HANGUP))) {
|
||||
int ret;
|
||||
remote_error rerr;
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
stream->closed = 1;
|
||||
virStreamAbort(stream->st);
|
||||
if (events & VIR_STREAM_EVENT_HANGUP)
|
||||
remoteDispatchFormatError(&rerr, "%s", _("stream had unexpected termination"));
|
||||
else
|
||||
remoteDispatchFormatError(&rerr, "%s", _("stream had I/O failure"));
|
||||
ret = remoteSerializeStreamError(client, &rerr, stream->procedure, stream->serial);
|
||||
remoteRemoveClientStream(client, stream);
|
||||
if (ret < 0)
|
||||
qemudDispatchClientFailure(client);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (stream->closed) {
|
||||
remoteRemoveClientStream(client, stream);
|
||||
} else {
|
||||
remoteStreamUpdateEvents(stream);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
virMutexUnlock(&client->lock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
*
|
||||
* Invoked by the main loop when filtering incoming messages.
|
||||
*
|
||||
* Returns 1 if the message was processed, 0 if skipped,
|
||||
* -1 on fatal client error
|
||||
*/
|
||||
static int
|
||||
remoteStreamFilter(struct qemud_client *client,
|
||||
struct qemud_client_message *msg, void *opaque)
|
||||
{
|
||||
struct qemud_client_stream *stream = opaque;
|
||||
|
||||
if (msg->hdr.serial == stream->serial &&
|
||||
msg->hdr.proc == stream->procedure &&
|
||||
msg->hdr.type == REMOTE_STREAM) {
|
||||
DEBUG("Incoming rx=%p serial=%d proc=%d status=%d",
|
||||
stream->rx, msg->hdr.proc, msg->hdr.serial, msg->hdr.status);
|
||||
|
||||
/* If there are queued packets, we need to queue all further
|
||||
* messages, since they must be processed strictly in order.
|
||||
* If there are no queued packets, then OK/ERROR messages
|
||||
* should be processed immediately. Data packets are still
|
||||
* queued to only be processed when the stream is marked as
|
||||
* writable.
|
||||
*/
|
||||
if (stream->rx) {
|
||||
qemudClientMessageQueuePush(&stream->rx, msg);
|
||||
remoteStreamUpdateEvents(stream);
|
||||
} else {
|
||||
int ret = 0;
|
||||
switch (msg->hdr.status) {
|
||||
case REMOTE_OK:
|
||||
ret = remoteStreamHandleFinish(client, stream, msg);
|
||||
if (ret == 0)
|
||||
qemudClientMessageRelease(client, msg);
|
||||
break;
|
||||
|
||||
case REMOTE_CONTINUE:
|
||||
qemudClientMessageQueuePush(&stream->rx, msg);
|
||||
remoteStreamUpdateEvents(stream);
|
||||
break;
|
||||
|
||||
case REMOTE_ERROR:
|
||||
default:
|
||||
ret = remoteStreamHandleAbort(client, stream, msg);
|
||||
if (ret == 0)
|
||||
qemudClientMessageRelease(client, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @conn: a connection object to associate the stream with
|
||||
* @hdr: the method call to associate with the stram
|
||||
*
|
||||
* Creates a new stream for this conn
|
||||
*
|
||||
* Returns a new stream object, or NULL upon OOM
|
||||
*/
|
||||
struct qemud_client_stream *
|
||||
remoteCreateClientStream(virConnectPtr conn,
|
||||
remote_message_header *hdr)
|
||||
{
|
||||
struct qemud_client_stream *stream;
|
||||
|
||||
DEBUG("proc=%d serial=%d", hdr->proc, hdr->serial);
|
||||
|
||||
if (VIR_ALLOC(stream) < 0)
|
||||
return NULL;
|
||||
|
||||
stream->procedure = hdr->proc;
|
||||
stream->serial = hdr->serial;
|
||||
|
||||
stream->st = virStreamNew(conn, VIR_STREAM_NONBLOCK);
|
||||
if (!stream->st) {
|
||||
VIR_FREE(stream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
stream->filter.query = remoteStreamFilter;
|
||||
stream->filter.opaque = stream;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
/*
|
||||
* @stream: an unused client stream
|
||||
*
|
||||
* Frees the memory associated with this inactive client
|
||||
* stream
|
||||
*/
|
||||
void remoteFreeClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
struct qemud_client_message *msg;
|
||||
|
||||
if (!stream)
|
||||
return;
|
||||
|
||||
DEBUG("proc=%d serial=%d", stream->procedure, stream->serial);
|
||||
|
||||
msg = stream->rx;
|
||||
while (msg) {
|
||||
struct qemud_client_message *tmp = msg->next;
|
||||
qemudClientMessageRelease(client, msg);
|
||||
msg = tmp;
|
||||
}
|
||||
|
||||
virStreamFree(stream->st);
|
||||
VIR_FREE(stream);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client to add the stream to
|
||||
* @stream: a stream to add
|
||||
*/
|
||||
int remoteAddClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
int transmit)
|
||||
{
|
||||
struct qemud_client_stream *tmp = client->streams;
|
||||
|
||||
DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
|
||||
|
||||
if (virStreamEventAddCallback(stream->st, 0,
|
||||
remoteStreamEvent, client, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
if (tmp) {
|
||||
while (tmp->next)
|
||||
tmp = tmp->next;
|
||||
tmp->next = stream;
|
||||
} else {
|
||||
client->streams = stream;
|
||||
}
|
||||
|
||||
stream->filter.next = client->filters;
|
||||
client->filters = &stream->filter;
|
||||
|
||||
if (transmit)
|
||||
stream->tx = 1;
|
||||
|
||||
remoteStreamUpdateEvents(stream);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
* @procedure: procedure associated with the stream
|
||||
* @serial: serial number associated with the stream
|
||||
*
|
||||
* Finds a existing active stream
|
||||
*
|
||||
* Returns a stream object matching the procedure+serial number, or NULL
|
||||
*/
|
||||
struct qemud_client_stream *
|
||||
remoteFindClientStream(struct qemud_client *client,
|
||||
virStreamPtr st)
|
||||
{
|
||||
struct qemud_client_stream *stream = client->streams;
|
||||
|
||||
while (stream) {
|
||||
if (stream->st == st)
|
||||
return stream;
|
||||
stream = stream->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
* @stream: an inactive, closed stream object
|
||||
*
|
||||
* Removes a stream from the list of active streams for the client
|
||||
*
|
||||
* Returns 0 if the stream was removd, -1 if it doesn't exist
|
||||
*/
|
||||
int
|
||||
remoteRemoveClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
|
||||
|
||||
struct qemud_client_stream *curr = client->streams;
|
||||
struct qemud_client_stream *prev = NULL;
|
||||
struct qemud_client_filter *filter = NULL;
|
||||
|
||||
if (client->filters == &stream->filter) {
|
||||
client->filters = client->filters->next;
|
||||
} else {
|
||||
filter = client->filters;
|
||||
while (filter) {
|
||||
if (filter->next == &stream->filter) {
|
||||
filter->next = filter->next->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream->closed)
|
||||
virStreamAbort(stream->st);
|
||||
|
||||
while (curr) {
|
||||
if (curr == stream) {
|
||||
if (prev)
|
||||
prev->next = curr->next;
|
||||
else
|
||||
client->streams = curr->next;
|
||||
remoteFreeClientStream(client, stream);
|
||||
return 0;
|
||||
}
|
||||
prev = curr;
|
||||
curr = curr->next;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* -1 if fatal error occurred
|
||||
* 0 if message was fully processed
|
||||
* 1 if message is still being processed
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleWriteData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
remote_error rerr;
|
||||
int ret;
|
||||
|
||||
DEBUG("stream=%p proc=%d serial=%d len=%d offset=%d",
|
||||
stream, msg->hdr.proc, msg->hdr.serial, msg->bufferLength, msg->bufferOffset);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
ret = virStreamSend(stream->st,
|
||||
msg->buffer + msg->bufferOffset,
|
||||
msg->bufferLength - msg->bufferOffset);
|
||||
|
||||
if (ret > 0) {
|
||||
msg->bufferOffset += ret;
|
||||
|
||||
/* Partial write, so indicate we have more todo later */
|
||||
if (msg->bufferOffset < msg->bufferLength)
|
||||
return 1;
|
||||
} else if (ret == -2) {
|
||||
/* Blocking, so indicate we have more todo later */
|
||||
return 1;
|
||||
} else {
|
||||
VIR_INFO0("Stream send failed");
|
||||
stream->closed = 1;
|
||||
remoteDispatchConnError(&rerr, client->conn);
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process an finish handshake from the client.
|
||||
*
|
||||
* Returns a REMOTE_OK confirmation if successful, or a REMOTE_ERROR
|
||||
* if there was a stream error
|
||||
*
|
||||
* Returns 0 if successfully sent RPC reply, -1 upon fatal error
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleFinish(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
remote_error rerr;
|
||||
int ret;
|
||||
|
||||
DEBUG("stream=%p proc=%d serial=%d",
|
||||
stream, msg->hdr.proc, msg->hdr.serial);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
stream->closed = 1;
|
||||
ret = virStreamFinish(stream->st);
|
||||
|
||||
if (ret < 0) {
|
||||
remoteDispatchConnError(&rerr, client->conn);
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
} else {
|
||||
/* Send zero-length confirm */
|
||||
if (remoteSendStreamData(client, stream, NULL, 0) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process an abort request from the client.
|
||||
*
|
||||
* Returns 0 if successfully aborted, -1 upon error
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleAbort(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
remote_error rerr;
|
||||
|
||||
DEBUG("stream=%p proc=%d serial=%d",
|
||||
stream, msg->hdr.proc, msg->hdr.serial);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
stream->closed = 1;
|
||||
virStreamAbort(stream->st);
|
||||
|
||||
if (msg->hdr.status == REMOTE_ERROR)
|
||||
remoteDispatchFormatError(&rerr, "%s", _("stream aborted at client request"));
|
||||
else {
|
||||
VIR_WARN("unexpected stream status %d", msg->hdr.status);
|
||||
remoteDispatchFormatError(&rerr, _("stream aborted with unexpected status %d"),
|
||||
msg->hdr.status);
|
||||
}
|
||||
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Called when the stream is signalled has being able to accept
|
||||
* data writes. Will process all pending incoming messages
|
||||
* until they're all gone, or I/O blocks
|
||||
*
|
||||
* Returns 0 on success, or -1 upon fatal error
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleWrite(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
struct qemud_client_message *msg, *tmp;
|
||||
|
||||
DEBUG("stream=%p", stream);
|
||||
|
||||
msg = stream->rx;
|
||||
while (msg && !stream->closed) {
|
||||
int ret;
|
||||
switch (msg->hdr.status) {
|
||||
case REMOTE_OK:
|
||||
ret = remoteStreamHandleFinish(client, stream, msg);
|
||||
break;
|
||||
|
||||
case REMOTE_CONTINUE:
|
||||
ret = remoteStreamHandleWriteData(client, stream, msg);
|
||||
break;
|
||||
|
||||
case REMOTE_ERROR:
|
||||
default:
|
||||
ret = remoteStreamHandleAbort(client, stream, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
qemudClientMessageQueueServe(&stream->rx);
|
||||
else if (ret < 0)
|
||||
return -1;
|
||||
else
|
||||
break; /* still processing data */
|
||||
|
||||
tmp = msg->next;
|
||||
qemudClientMessageRelease(client, msg);
|
||||
msg = tmp;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Invoked when a stream is signalled as having data
|
||||
* available to read. This reads upto one message
|
||||
* worth of data, and then queues that for transmission
|
||||
* to the client.
|
||||
*
|
||||
* Returns 0 if data was queued for TX, or a error RPC
|
||||
* was sent, or -1 on fatal error, indicating client should
|
||||
* be killed
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleRead(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
char *buffer;
|
||||
size_t bufferLen = REMOTE_MESSAGE_PAYLOAD_MAX;
|
||||
int ret;
|
||||
|
||||
DEBUG("stream=%p", stream);
|
||||
|
||||
/* Shouldn't ever be called unless we're marked able to
|
||||
* transmit, but doesn't hurt to check */
|
||||
if (!stream->tx)
|
||||
return 0;
|
||||
|
||||
if (VIR_ALLOC_N(buffer, bufferLen) < 0)
|
||||
return -1;
|
||||
|
||||
ret = virStreamRecv(stream->st, buffer, bufferLen);
|
||||
if (ret == -2) {
|
||||
/* Should never get this, since we're only called when we know
|
||||
* we're readable, but hey things change... */
|
||||
ret = 0;
|
||||
} else if (ret < 0) {
|
||||
remote_error rerr;
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
remoteDispatchConnError(&rerr, NULL);
|
||||
|
||||
ret = remoteSerializeStreamError(client, &rerr, stream->procedure, stream->serial);
|
||||
} else {
|
||||
stream->tx = 0;
|
||||
if (ret == 0)
|
||||
stream->recvEOF = 1;
|
||||
ret = remoteSendStreamData(client, stream, buffer, ret);
|
||||
}
|
||||
|
||||
VIR_FREE(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Invoked when an outgoing data packet message has been fully sent.
|
||||
* This simply re-enables TX of further data.
|
||||
*
|
||||
* The idea is to stop the daemon growing without bound due to
|
||||
* fast stream, but slow client
|
||||
*/
|
||||
void
|
||||
remoteStreamMessageFinished(struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
struct qemud_client_stream *stream = client->streams;
|
||||
|
||||
while (stream) {
|
||||
if (msg->hdr.proc == stream->procedure &&
|
||||
msg->hdr.serial == stream->serial)
|
||||
break;
|
||||
stream = stream->next;
|
||||
}
|
||||
|
||||
DEBUG("Message client=%p stream=%p proc=%d serial=%d", client, stream, msg->hdr.proc, msg->hdr.serial);
|
||||
|
||||
if (stream) {
|
||||
stream->tx = 1;
|
||||
remoteStreamUpdateEvents(stream);
|
||||
}
|
||||
}
|
54
daemon/stream.h
Normal file
54
daemon/stream.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* stream.h: APIs for managing client streams
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LIBVIRTD_STREAM_H__
|
||||
#define __LIBVIRTD_STREAM_H__
|
||||
|
||||
#include "libvirtd.h"
|
||||
|
||||
|
||||
|
||||
struct qemud_client_stream *
|
||||
remoteCreateClientStream(virConnectPtr conn,
|
||||
remote_message_header *hdr);
|
||||
|
||||
void remoteFreeClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
|
||||
int remoteAddClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
int transmit);
|
||||
|
||||
struct qemud_client_stream *
|
||||
remoteFindClientStream(struct qemud_client *client,
|
||||
virStreamPtr stream);
|
||||
|
||||
int
|
||||
remoteRemoveClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
|
||||
void
|
||||
remoteStreamMessageFinished(struct qemud_client *client,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
#endif /* __LIBVIRTD_STREAM_H__ */
|
3
docs/.gitignore
vendored
3
docs/.gitignore
vendored
@ -2,3 +2,6 @@ Makefile
|
||||
Makefile.in
|
||||
.memdump
|
||||
apibuild.pyc
|
||||
*.html
|
||||
libvirt-api.xml
|
||||
libvirt-refs.xml
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 495 B |
198
docs/FAQ.html
198
docs/FAQ.html
@ -1,198 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from FAQ.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: FAQ</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">FAQ</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>FAQ</h1>
|
||||
<p>Table of Contents:</p>
|
||||
<ul><li>
|
||||
<a href="FAQ.html#License">License(s)</a>
|
||||
</li><li>
|
||||
<a href="FAQ.html#Installati">Installation</a>
|
||||
</li><li>
|
||||
<a href="FAQ.html#Compilatio">Compilation</a>
|
||||
</li><li>
|
||||
<a href="FAQ.html#Developer">Developer corner</a>
|
||||
</li></ul>
|
||||
<h3><a name="License" id="License">License</a>(s)</h3>
|
||||
<ol><li>
|
||||
<em>Licensing Terms for libvirt</em>
|
||||
<p>libvirt is released under the <a href="http://www.opensource.org/licenses/lgpl-license.html">GNU Lesser
|
||||
General Public License</a>, see the file COPYING.LIB in the distribution
|
||||
for the precise wording. The only library that libvirt depends upon is
|
||||
the Xen store access library which is also licenced under the LGPL.</p>
|
||||
</li><li>
|
||||
<em>Can I embed libvirt in a proprietary application ?</em>
|
||||
<p>Yes. The LGPL allows you to embed libvirt into a proprietary
|
||||
application. It would be graceful to send-back bug fixes and improvements
|
||||
as patches for possible incorporation in the main development tree. It
|
||||
will decrease your maintenance costs anyway if you do so.</p>
|
||||
</li></ol>
|
||||
<h3>
|
||||
<a name="Installati" id="Installati">Installation</a>
|
||||
</h3>
|
||||
<ol><li><em>Where can I get libvirt</em> ?
|
||||
<p>The original distribution comes from <a href="ftp://libvirt.org/libvirt/">ftp://libvirt.org/libvirt/</a>.</p>
|
||||
</li><li>
|
||||
<em>I can't install the libvirt/libvirt-devel RPM packages due to
|
||||
failed dependencies</em>
|
||||
<p>The most generic solution is to re-fetch the latest src.rpm , and
|
||||
rebuild it locally with</p>
|
||||
<p><code>rpm --rebuild libvirt-xxx.src.rpm</code>.</p>
|
||||
<p>If everything goes well it will generate two binary rpm packages (one
|
||||
providing the shared libs and virsh, and the other one, the -devel
|
||||
package, providing includes, static libraries and scripts needed to build
|
||||
applications with libvirt that you can install locally.</p>
|
||||
<p>One can also rebuild the RPMs from a tarball:</p>
|
||||
<p>
|
||||
<code>rpmbuild -ta libdir-xxx.tar.gz</code>
|
||||
</p>
|
||||
<p>Or from a configured tree with:</p>
|
||||
<p>
|
||||
<code>make rpm</code>
|
||||
</p>
|
||||
</li><li>
|
||||
<em>Failure to use the API for non-root users</em>
|
||||
<p>Large parts of the API may only be accessible with root privileges,
|
||||
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:</p>
|
||||
<p>
|
||||
<code>chmod 666 /var/run/xenstored/socket_ro</code>
|
||||
</p>
|
||||
<p>and also make sure that the Xen Daemon is running correctly with local
|
||||
HTTP server enabled, this is defined in
|
||||
<code>/etc/xen/xend-config.sxp</code> which need the following line to be
|
||||
enabled:</p>
|
||||
<p>
|
||||
<code>(xend-http-server yes)</code>
|
||||
</p>
|
||||
<p>If needed restart the xend daemon after making the change with the
|
||||
following command run as root:</p>
|
||||
<p>
|
||||
<code>service xend restart</code>
|
||||
</p>
|
||||
</li></ol>
|
||||
<h3>
|
||||
<a name="Compilatio" id="Compilatio">Compilation</a>
|
||||
</h3>
|
||||
<ol><li>
|
||||
<em>What is the process to compile libvirt ?</em>
|
||||
<p>As most UNIX libraries libvirt follows the "standard":</p>
|
||||
<p>
|
||||
<code>gunzip -c libvirt-xxx.tar.gz | tar xvf -</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>cd libvirt-xxxx</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>./configure --help</code>
|
||||
</p>
|
||||
<p>to see the options, then the compilation/installation proper</p>
|
||||
<p>
|
||||
<code>./configure [possible options]</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>make</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>make install</code>
|
||||
</p>
|
||||
<p>At that point you may have to rerun ldconfig or a similar utility to
|
||||
update your list of installed shared libs.</p>
|
||||
</li><li>
|
||||
<em>What other libraries are needed to compile/install libvirt ?</em>
|
||||
<p>Libvirt requires libxenstore, which is usually provided by the xen
|
||||
packages as well as the public headers to compile against libxenstore.</p>
|
||||
</li><li>
|
||||
<em>I use the CVS version and there is no configure script</em>
|
||||
<p>The configure script (and other Makefiles) are generated. Use the
|
||||
autogen.sh script to regenerate the configure script and Makefiles,
|
||||
like:</p>
|
||||
<p>
|
||||
<code>./autogen.sh --prefix=/usr --disable-shared</code>
|
||||
</p>
|
||||
</li></ol>
|
||||
<h3><a name="Developer" id="Developer">Developer</a> corner</h3>
|
||||
<ol><li>
|
||||
<em>Troubles compiling or linking programs using libvirt</em>
|
||||
<p>To simplify the process of reusing the library, libvirt comes with
|
||||
pkgconfig support, which can be used directly from autoconf support or
|
||||
via the pkg-config command line tool, like:</p>
|
||||
<p>
|
||||
<code>pkg-config libvirt --libs</code>
|
||||
</p>
|
||||
</li></ol>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
28
docs/Goals
28
docs/Goals
@ -1,28 +0,0 @@
|
||||
|
||||
Why libxen:
|
||||
-----------
|
||||
|
||||
|
||||
The main goals of the library is to provide an stable API abstracting
|
||||
the underlying acual implementation of the hypervisor calls.
|
||||
|
||||
1/ Stable API:
|
||||
by isolating the data structures and entry points used at the low
|
||||
level Xen Hypervisor interfaces, allowing evolution of said interface
|
||||
over time without breaking the application visible API and ABI
|
||||
|
||||
2/ Abstraction:
|
||||
by providing at the C level simplified concept exposed only as opaque
|
||||
structure for the hypervisor connection, domains and other kind of
|
||||
objects which may be needed in the future. It must also provide
|
||||
a set of higher level function calls simplifying the developement
|
||||
of applications using the supervisor.
|
||||
|
||||
3/ Maintainability and openness:
|
||||
All data structures and entry points must be fully documented, all
|
||||
changes will be driven in an open fashion based on a publicly archived
|
||||
mailing-list allowing peer-review before changes will be introduced.
|
||||
Tools and regression tests will be implemented and shipped as part of the
|
||||
releases of the library.
|
||||
|
||||
Daniel Veillard <veillard@redhat.com>
|
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB |
@ -1,10 +1,10 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS= schemas examples devhelp
|
||||
SUBDIRS= schemas
|
||||
|
||||
# The directory containing the source code (if it contains documentation).
|
||||
DOC_SOURCE_DIR=../src
|
||||
|
||||
man_MANS=
|
||||
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
|
||||
|
||||
apihtml = \
|
||||
html/index.html \
|
||||
@ -17,13 +17,27 @@ apipng = \
|
||||
html/home.png \
|
||||
html/right.png
|
||||
|
||||
devhelphtml = \
|
||||
devhelp/libvirt.devhelp \
|
||||
devhelp/index.html \
|
||||
devhelp/general.html \
|
||||
devhelp/libvirt-libvirt.html \
|
||||
devhelp/libvirt-virterror.html
|
||||
|
||||
devhelppng = \
|
||||
devhelp/home.png \
|
||||
devhelp/left.png \
|
||||
devhelp/right.png \
|
||||
devhelp/up.png
|
||||
|
||||
devhelpcss = devhelp/style.css
|
||||
|
||||
devhelpxsl = devhelp/devhelp.xsl devhelp/html.xsl
|
||||
|
||||
png = \
|
||||
16favicon.png \
|
||||
32favicon.png \
|
||||
footer_corner.png \
|
||||
footer_pattern.png \
|
||||
libvirHeader.png \
|
||||
libvirLogo.png \
|
||||
libvirt-header-bg.png \
|
||||
libvirt-header-logo.png \
|
||||
libvirtLogo.png \
|
||||
@ -33,13 +47,9 @@ png = \
|
||||
libvirt-driver-arch.png \
|
||||
libvirt-object-model.png \
|
||||
madeWith.png \
|
||||
windows-cygwin-1.png \
|
||||
windows-cygwin-2.png \
|
||||
windows-cygwin-3.png \
|
||||
et.png
|
||||
|
||||
gif = \
|
||||
Libxml2-Logo-90x34.gif \
|
||||
architecture.gif \
|
||||
node.gif
|
||||
|
||||
@ -50,14 +60,7 @@ patches = $(wildcard api_extension/*.patch)
|
||||
|
||||
xml = \
|
||||
libvirt-api.xml \
|
||||
libvirt-refs.xml \
|
||||
testdomfc4.xml \
|
||||
testdomfv0.xml \
|
||||
testnetdef.xml \
|
||||
testnetpriv.xml \
|
||||
testnode.xml \
|
||||
testpool.xml \
|
||||
testvol.xml
|
||||
libvirt-refs.xml
|
||||
|
||||
fig = \
|
||||
libvirt-net-logical.fig \
|
||||
@ -70,20 +73,18 @@ EXTRA_DIST= \
|
||||
libvirt-api.xml libvirt-refs.xml apibuild.py \
|
||||
site.xsl newapi.xsl news.xsl page.xsl ChangeLog.xsl \
|
||||
$(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
|
||||
$(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
|
||||
$(xml) $(fig) $(png) \
|
||||
$(patches) \
|
||||
virsh.pod ChangeLog.awk
|
||||
ChangeLog.awk
|
||||
|
||||
all: web $(top_builddir)/NEWS $(man_MANS)
|
||||
CLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
|
||||
|
||||
virsh.1: virsh.pod
|
||||
pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" $(srcdir)/virsh.pod > $@-t
|
||||
mv $@-t $@
|
||||
cp $@ $(top_builddir)
|
||||
all: web
|
||||
|
||||
api: libvirt-api.xml libvirt-refs.xml $(srcdir)/html/index.html
|
||||
api: libvirt-api.xml libvirt-refs.xml
|
||||
|
||||
web: $(dot_html)
|
||||
web: $(dot_html) html/index.html devhelp/index.html
|
||||
|
||||
ChangeLog.xml: ../ChangeLog ChangeLog.awk
|
||||
awk -f ChangeLog.awk < $< > $@
|
||||
@ -111,7 +112,7 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
|
||||
else echo "missing XHTML1 DTD" ; fi ; fi );
|
||||
|
||||
|
||||
$(srcdir)/html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the HTML pages from the XML API" ; \
|
||||
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi )
|
||||
@ -121,18 +122,17 @@ $(srcdir)/html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
$(XMLLINT) --nonet --valid --noout html/*.html ; \
|
||||
else echo "missing XHTML1 DTD" ; fi ; fi );
|
||||
|
||||
devhelp/index.html devhelp/libvirt.devhelp: libvirt-api.xml $(devhelpxsl)
|
||||
-@(echo Rebuilding devhelp files)
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet -o devhelp/libvirt.devhelp $(top_srcdir)/docs/devhelp/devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
|
||||
|
||||
|
||||
libvirt-api.xml libvirt-refs.xml: apibuild.py \
|
||||
$(srcdir)/../include/libvirt/*.h \
|
||||
$(srcdir)/../src/*.h $(srcdir)/../src/*.c
|
||||
$(srcdir)/../src/libvirt.c $(srcdir)/../src/util/virterror.c
|
||||
-(./apibuild.py)
|
||||
|
||||
$(top_builddir)/NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl \
|
||||
$(top_srcdir)/docs/news.html.in \
|
||||
| perl -0777 -pe 's/\n\n+$$/\n/' \
|
||||
> $@-t && mv $@-t $@ ; fi );
|
||||
|
||||
clean-local:
|
||||
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
|
||||
|
||||
@ -150,7 +150,13 @@ install-data-local:
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
|
||||
for p in $(apipng); do \
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
|
||||
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
|
||||
for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
|
||||
@INSTALL@ -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
|
||||
done
|
||||
|
||||
uninstall-local:
|
||||
for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
|
||||
for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
|
||||
for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
|
||||
rm $(DESTDIR)$(DEVHELP_DIR)$$f ; done
|
246
docs/api.html
246
docs/api.html
@ -1,246 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from api.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: The libvirt API concepts</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">API concepts</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>The libvirt API concepts</h1>
|
||||
<p> This page describes the main principles and architecture choices
|
||||
behind the definition of the libvirt API:
|
||||
</p>
|
||||
<ul><li>
|
||||
<a href="#Objects">Objects exposed</a>
|
||||
</li><li>
|
||||
<a href="#Functions">Functions and naming conventions</a>
|
||||
</li><li>
|
||||
<a href="#Driver">The drivers</a>
|
||||
</li><li>
|
||||
<a href="#Remote">Daemon and remote access</a>
|
||||
</li></ul>
|
||||
<h2>
|
||||
<a name="Objects" id="Objects">Objects exposed</a>
|
||||
</h2>
|
||||
<p> As defined in the <a href="goals.html">goals section</a>, libvirt
|
||||
API need to expose all the resources needed to manage the virtualization
|
||||
support of recent operating systems. The first object manipulated though
|
||||
the API is <code>virConnectPtr</code> which represent a connection to
|
||||
an hypervisor. Any application using libvirt is likely to start using the
|
||||
API by calling one of <a href="html/libvirt-libvirt.html#virConnectOpen">the virConnectOpen functions</a>. You will note that those functions take
|
||||
a name argument which is actually an URI to select the right hypervisor to
|
||||
open, this is needed to allow remote connections and also select between
|
||||
different possible hypervisors (for example on a Linux system it may be
|
||||
possible to use both KVM and LinuxContainers on the same node). A NULL
|
||||
name will default to a preselected hypervisor but it's probably not a
|
||||
wise thing to do in most cases. See the <a href="uri.html">connection
|
||||
URI</a> page for a full descriptions of the values allowed.</p>
|
||||
<p>
|
||||
</p>
|
||||
<p> Once the application obtained a <a href="html/libvirt-libvirt.html#virConnectPtr"><code>virConnectPtr</code></a>
|
||||
connection to the
|
||||
hypervisor it can then use it to manage domains and related resources
|
||||
available for virtualization like storage and networking. All those are
|
||||
exposed as first class objects, and connected to the hypervisor connection
|
||||
(and the node or cluster where it is available).</p>
|
||||
<p class="image">
|
||||
<img alt="first class objects exposed by the API" src="libvirt-object-model.png" /></p>
|
||||
<p> The figure above shows the five main objects exported by the API:</p>
|
||||
<ul><li>virConnectPtr: represent a connection to an hypervisor.</li><li>virDomainPtr: represent one domain either active or defined (i.e.
|
||||
existing as permanent config file and storage but not currently running
|
||||
on that node). The function <a href="html/libvirt-libvirt.html#virConnectListDomains"><code>virConnectListDomains</code></a>
|
||||
allows to list all the IDs for the domains active on this hypervisor.</li><li>virNetworkPtr: represent one network either active or defined (i.e.
|
||||
existing as permanent config file and storage but not currently activated.
|
||||
The function <a href="html/libvirt-libvirt.html#virConnectListNetworks"><code>virConnectListNetworks</code></a>
|
||||
allows to list all the virtualization networks actived on this node.</li><li>virStorageVolPtr: represent one storage volume, usually this is used
|
||||
as a block device available to one of the domains. The function
|
||||
<a href="html/libvirt-libvirt.html#virStorageVolLookupByPath"><code>virStorageVolLookupByPath</code></a> allows to find
|
||||
the object based on its path on the node.</li><li>virStoragePoolPtr: represent a storage pool, i.e. a logical area
|
||||
which can be used to allocate and store storage volumes. The function
|
||||
<a href="html/libvirt-libvirt.html#virStoragePoolLookupByVolume"><code>virStoragePoolLookupByVolume</code></a> allows to find
|
||||
the storage pool containing a given storage volume.</li></ul>
|
||||
<p> Most object manipulated by the library can also be represented using
|
||||
XML descriptions. This is used primarily to create those object, but is
|
||||
also helpful to modify or save their description back.</p>
|
||||
<p> Domains, network and storage pools can be either <code>active</code>
|
||||
i.e. either running or available for immediate use, or
|
||||
<code>defined</code> in which case they are inactive but there is
|
||||
a permanent definition available in the system for them. Based on this
|
||||
thay can be activated dynamically in order to be used.</p>
|
||||
<p> Most kind of object can also be named in various ways:</p>
|
||||
<p>
|
||||
</p>
|
||||
<ul><li>by their <code>name</code>, an user friendly identifier but
|
||||
whose unicity cannot be garanteed between two nodes.</li><li>by their <code>ID</code>, which is a runtime unique identifier
|
||||
provided by the hypervisor for one given activation of the object,
|
||||
but it becomes invalid once the resource is deactivated.</li><li>by their <code>UUID</code>, a 16 bytes unique identifier
|
||||
as defined in <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>,
|
||||
which is garanteed to be unique for long term usage and across a
|
||||
set of nodes.</li></ul>
|
||||
<h2>
|
||||
<a name="Functions" id="Functions">Functions and naming
|
||||
conventions</a>
|
||||
</h2>
|
||||
<p> The naming of the functions present in the library is usually
|
||||
made of a prefix describing the object associated to the function
|
||||
and a verb describing the action on that object.</p>
|
||||
<p> For each first class object you will find apis
|
||||
for the following actions:</p>
|
||||
<ul><li><b>Lookup</b>:...LookupByName,
|
||||
</li><li><b>Enumeration</b>:virConnectList... and virConnectNumOf...:
|
||||
those are used to enumerate a set of object available to an given
|
||||
hypervisor connection like:
|
||||
<a href="html/libvirt-libvirt.html#virConnectListDomains"><code>virConnectListDomains</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virConnectNumOfDomains"><code>virConnectNumOfDomains</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virConnectListNetworks"><code>virConnectListNetworks</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virConnectListStoragePools"><code>virConnectListStoragePools</code></a>, etc.</li><li><b>Description</b>: ...GetInfo: those are generic accessor providing
|
||||
a set of informations about an object, they are
|
||||
<a href="html/libvirt-libvirt.html#virNodeGetInfo"><code>virNodeGetInfo</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainGetInfo"><code>virDomainGetInfo</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virStoragePoolGetInfo"><code>virStoragePoolGetInfo</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virStorageVolGetInfo"><code>virStorageVolGetInfo</code></a>.</li><li><b>Accessors</b>: ...Get... and ...Set...: those are more specific
|
||||
accessors to query or modify the given object, like
|
||||
<a href="html/libvirt-libvirt.html#virConnectGetType"><code>virConnectGetType</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainGetMaxMemory"><code>virDomainGetMaxMemory</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainSetMemory"><code>virDomainSetMemory</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainGetVcpus"><code>virDomainGetVcpus</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virStoragePoolSetAutostart"><code>virStoragePoolSetAutostart</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virNetworkGetBridgeName"><code>virNetworkGetBridgeName</code></a>, etc.</li><li><b>Creation</b>: </li><li><b>Destruction</b>: ... </li></ul>
|
||||
<p> For more in-depth details of the storage related APIs see
|
||||
<a href="storage.html">the storage management page</a>,
|
||||
</p>
|
||||
<h2>
|
||||
<a name="Driver" id="Driver">The libvirt drivers</a>
|
||||
</h2>
|
||||
<p></p>
|
||||
<p class="image">
|
||||
<img alt="The libvirt driver architecture" src="libvirt-driver-arch.png" /></p>
|
||||
<h2>
|
||||
<a name="Remote" id="Remote">Daemon and remote access</a>
|
||||
</h2>
|
||||
<p></p>
|
||||
<p class="image">
|
||||
<img alt="The libvirt daemon and remote architecture" src="libvirt-daemon-arch.png" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,365 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from api_extension.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Implementing a new API in Libvirt</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="active" href="internals.html">Internals</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="General hacking guidelines for contributors" class="inactive" href="hacking.html">Contributor guidelines</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">API extensions</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Implementing a new API in Libvirt</h1>
|
||||
<ul><li>
|
||||
<a href="#publicapi">Defining the public API</a>
|
||||
</li><li>
|
||||
<a href="#internalapi">Defining the internal API</a>
|
||||
</li><li>
|
||||
<a href="#implpublic">Implementing the public API</a>
|
||||
</li><li>
|
||||
<a href="#wireproto">Defining the wire protocol format</a>
|
||||
</li><li>
|
||||
<a href="#rpcclient">Implement the RPC client</a>
|
||||
</li><li>
|
||||
<a href="#serverdispatch">Implement the server side dispatcher</a>
|
||||
</li><li>
|
||||
<a href="#driverimpl">Implement the driver methods</a>
|
||||
</li><li>
|
||||
<a href="#virsh">Implement virsh commands</a>
|
||||
</li></ul>
|
||||
<p>
|
||||
This document walks you through the process of implementing a new
|
||||
API in libvirt. It uses as an example the addition of the node device
|
||||
create and destroy APIs.
|
||||
</p>
|
||||
<p>
|
||||
Before you begin coding, it is critical that you propose your
|
||||
changes on the libvirt mailing list and get feedback on your ideas to
|
||||
make sure what you're proposing fits with the general direction of the
|
||||
project. Even before doing a proof of concept implementation, send an
|
||||
email giving an overview of the functionality you think should be
|
||||
added to libvirt. Someone may already be working on the feature you
|
||||
want. Also, recognize that everything you write is likely to undergo
|
||||
significant rework as you discuss it with the other developers, so
|
||||
don't wait too long before getting feedback.
|
||||
</p>
|
||||
<p>
|
||||
Adding a new API to libvirt is not difficult, but there are quite a
|
||||
few steps. This document assumes that you are familiar with C
|
||||
programming and have checked out the libvirt code from the source code
|
||||
repository and successfully built the existing tree. Instructions on
|
||||
how to check out and build the code can be found at:
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://libvirt.org/downloads.html">http://libvirt.org/downloads.html</a>
|
||||
</p>
|
||||
<p>
|
||||
Once you have a working development environment, the steps to create a
|
||||
new API are:
|
||||
</p>
|
||||
<ol><li>define the public API</li><li>define the internal driver API</li><li>implement the public API</li><li>define the wire protocol format</li><li>implement the RPC client</li><li>implement the server side dispatcher</li><li>implement the driver methods</li><li>add virsh support</li></ol>
|
||||
<p>
|
||||
It is, of course, possible to implement the pieces in any order, but
|
||||
if the development tasks are completed in the order listed, the code
|
||||
will compile after each step. Given the number of changes required,
|
||||
verification after each step is highly recommended.
|
||||
</p>
|
||||
<p>
|
||||
Submit new code in the form shown in the example code: one patch
|
||||
per step. That's not to say submit patches before you have working
|
||||
functionality--get the whole thing working and make sure you're happy
|
||||
with it. Then use git or some other version control system that lets
|
||||
you rewrite your commit history and break patches into pieces so you
|
||||
don't drop a big blob of code on the mailing list at one go. For
|
||||
example, I didn't follow my own advice when I originally submitted the
|
||||
example code to the libvirt list but rather submitted it in several
|
||||
large chunks. I've used git's ability to rewrite my commit history to
|
||||
break the code apart into the example patches shown.
|
||||
</p>
|
||||
<p>
|
||||
Don't mix anything else into the patches you submit. The patches
|
||||
should be the minimal changes required to implement the functionality
|
||||
you're adding. If you notice a bug in unrelated code (i.e., code you
|
||||
don't have to touch to implement your API change) during development,
|
||||
create a patch that just addresses that bug and submit it
|
||||
separately.
|
||||
</p>
|
||||
<p>With that said, let's begin.</p>
|
||||
<h2>
|
||||
<a name="publicapi" id="publicapi">Defining the public API</a>
|
||||
</h2>
|
||||
<p>The first task is to define the public API and add it to:</p>
|
||||
<p>
|
||||
<code>include/libvirt/libvirt.h.in</code>
|
||||
</p>
|
||||
<p>
|
||||
This task is in many ways the most important to get right, since once
|
||||
the API has been committed to the repository, it's libvirt's policy
|
||||
never to change it. Mistakes in the implementation are bugs that you
|
||||
can fix. Make a mistake in the API definition and you're stuck with
|
||||
it, so think carefully about the interface and don't be afraid to
|
||||
rework it as you go through the process of implementing it.
|
||||
</p>
|
||||
<p>Once you have defined the API, you have to add the symbol names to:</p>
|
||||
<p>
|
||||
<code>src/libvirt_public.syms</code>
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0001-Step-1-of-8-Define-the-public-API.patch">0001-Step-1-of-8-Define-the-public-API.patch</a> for example code.</p>
|
||||
<h2>
|
||||
<a name="internalapi" id="internalapi">Defining the internal API</a>
|
||||
</h2>
|
||||
<p>
|
||||
Each public API call is associated with a driver, such as a host
|
||||
virtualization driver, a network virtualization driver, a storage
|
||||
virtualization driver, a state driver, or a device monitor. Adding
|
||||
the internal API is ordinarily a matter of adding a new member to the
|
||||
struct representing one of these drivers.
|
||||
</p>
|
||||
<p>
|
||||
Of course, it's possible that the new API will involve the creation of
|
||||
an entire new driver type, in which case the changes will include the
|
||||
creation of a new struct type to represent the new driver type.
|
||||
</p>
|
||||
<p>The driver structs are defined in:</p>
|
||||
<p>
|
||||
<code>src/driver.h</code>
|
||||
</p>
|
||||
<p>
|
||||
To define the internal API, first typedef the driver function
|
||||
prototype and then add a new field for it to the relevant driver
|
||||
struct.
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0002-Step-2-of-8-Define-the-internal-driver-API.patch">0002-Step-2-of-8-Define-the-internal-driver-API.patch</a></p>
|
||||
<h2>
|
||||
<a name="implpublic" id="implpublic">Implementing the public API</a>
|
||||
</h2>
|
||||
<p>
|
||||
Implementing the public API is largely a formality in which we wire up
|
||||
public API to the internal driver API. The public API implementation
|
||||
takes care of some basic validity checks before passing control to the
|
||||
driver implementation. In RFC 2119 vocabulary, this function:
|
||||
</p>
|
||||
<ol class="ordinarylist"><li>SHOULD log a message with VIR_DEBUG() indicating that it is
|
||||
being called and its parameters;</li><li>MUST call virResetLastError();</li><li>SHOULD confirm that the connection is valid with
|
||||
VIR_IS_CONNECT(conn);</li><li><strong>SECURITY: If the API requires a connection with write
|
||||
privileges, MUST confirm that the connection flags do not
|
||||
indicate that the connection is read-only;</strong></li><li>SHOULD do basic validation of the parameters that are being
|
||||
passed in;</li><li>MUST confirm that the driver for this connection exists and that
|
||||
it implements this function;</li><li>MUST call the internal API;</li><li>SHOULD log a message with VIR_DEBUG() indicating that it is
|
||||
returning, its return value, and status.</li><li>MUST return status to the caller.</li></ol>
|
||||
<p>The public API calls are implemented in:</p>
|
||||
<p>
|
||||
<code>src/libvirt.c</code>
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0003-Step-3-of-8-Implement-the-public-API.patch">0003-Step-3-of-8-Implement-the-public-API.patch</a></p>
|
||||
<h2>
|
||||
<a name="wireproto" id="wireproto">Defining the wire protocol format</a>
|
||||
</h2>
|
||||
<p>
|
||||
Defining the wire protocol is essentially a straightforward exercise
|
||||
which is probably most easily understood by referring to the existing
|
||||
remote protocol wire format definitions and the example patch. It
|
||||
involves making two additions to:
|
||||
</p>
|
||||
<p>
|
||||
<code>qemud/remote_protocol.x</code>
|
||||
</p>
|
||||
<p>
|
||||
First, create two new structs for each new function that you're adding
|
||||
to the API. One struct describes the parameters to be passed to the
|
||||
remote function, and a second struct describes the value returned by
|
||||
the remote function. The one exception to this rule is that functions
|
||||
that return only integer status do not require a struct for returned
|
||||
data.
|
||||
</p>
|
||||
<p>
|
||||
Second, add values to the remote_procedure enum for each new function
|
||||
added to the API.
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0004-Step-4-of-8-Define-the-wire-protocol-format.patch">0004-Step-4-of-8-Define-the-wire-protocol-format.patch</a></p>
|
||||
<p>
|
||||
Once these changes are in place, it's necessary to run 'make rpcgen'
|
||||
in the qemud directory to create the .c and .h files required by the
|
||||
remote protocol code. This must be done on a Linux host using the
|
||||
GLibC rpcgen program. Other rpcgen versions may generate code which
|
||||
results in bogus compile time warnings
|
||||
</p>
|
||||
<h2>
|
||||
<a name="rpcclient" id="rpcclient">Implement the RPC client</a>
|
||||
</h2>
|
||||
<p>
|
||||
Implementing the RPC client is also relatively mechanical, so refer to
|
||||
the exising code and example patch for guidance. The RPC client uses
|
||||
the rpcgen generated .h files. The remote method calls go in:
|
||||
</p>
|
||||
<p>
|
||||
<code>src/remote_internal.c</code>
|
||||
</p>
|
||||
<p>Each remote method invocation does the following:</p>
|
||||
<ol class="ordinarylist"><li>locks the remote driver;</li><li>sets up the method arguments;</li><li>invokes the remote function;</li><li>checks the return value, if necessary;</li><li>extracts any returned data;</li><li>frees any returned data;</li><li>unlocks the remote driver.</li></ol>
|
||||
<p>
|
||||
Once you have created the remote method calls, you have to add fields
|
||||
for them to the driver structs for the appropriate remote driver.
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0005-Step-5-of-8-Implement-the-RPC-client.patch">0005-Step-5-of-8-Implement-the-RPC-client.patch</a></p>
|
||||
<h2>
|
||||
<a name="serverdispatch" id="serverdispatch">Implement the server side dispatcher</a>
|
||||
</h2>
|
||||
<p>
|
||||
Implementing the server side of the remote function calls is simply a
|
||||
matter of deserializing the parameters passed in from the remote
|
||||
caller and passing them to the corresponding internal API function.
|
||||
The server side dispatchers are implemented in:
|
||||
</p>
|
||||
<p>
|
||||
<code>qemud/remote.c</code>
|
||||
</p>
|
||||
<p>Again, this step uses the .h files generated by make rpcgen.</p>
|
||||
<p class="example">See <a href="api_extension/0006-Step-6-of-8-Implement-the-server-side-dispatcher.patch">0006-Step-6-of-8-Implement-the-server-side-dispatcher.patch</a></p>
|
||||
<h2>
|
||||
<a name="driverimpl" id="driverimpl">Implement the driver methods</a>
|
||||
</h2>
|
||||
<p>
|
||||
So, after all that, we get to the fun part. All functionality in
|
||||
libvirt is implemented inside a driver. Thus, here is where you
|
||||
implement whatever functionality you're adding to libvirt. You'll
|
||||
either need to add additional files to the src directory or extend
|
||||
files that are already there, depending on what functionality you're
|
||||
adding.
|
||||
</p>
|
||||
<p>
|
||||
In the example code, the extension is only an additional two function
|
||||
calls in the node device API, so most of the new code is additions to
|
||||
existing files. The only new files are there for multi-platform
|
||||
implementation convenience, as some of the new code is Linux specific.
|
||||
</p>
|
||||
<p>
|
||||
The example code is probably uninteresting unless you're concerned
|
||||
with libvirt storage, but I've included it here to show how new files
|
||||
are added to the build environment.
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0007-Step-7-of-8-Implement-the-driver-methods.patch">0007-Step-7-of-8-Implement-the-driver-methods.patch</a></p>
|
||||
<h2>
|
||||
<a name="virsh" id="virsh">Implement virsh commands</a>
|
||||
</h2>
|
||||
<p>
|
||||
Once you have the new functionality in place, the easiest way to test
|
||||
it and also to provide it to end users is to implement support for it
|
||||
in virsh.
|
||||
</p>
|
||||
<p>
|
||||
A virsh command is composed of a few pieces of code. You need to
|
||||
define an array of vshCmdInfo structs for each new command that
|
||||
contain the help text and the command description text. You also need
|
||||
an array of vshCmdOptDef structs to describe the command options.
|
||||
Once you have those pieces of data in place you can write the function
|
||||
implementing the virsh command. Finally, you need to add the new
|
||||
command to the commands[] array.
|
||||
</p>
|
||||
<p class="example">See <a href="api_extension/0008-Step-8-of-8-Add-virsh-support.patch">0008-Step-8-of-8-Add-virsh-support.patch</a></p>
|
||||
<p>Once you have working functionality, run make check and make
|
||||
syntax-check before generating patches.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -38,6 +38,7 @@ ignored_functions = {
|
||||
"virDomainMigratePerform": "private function for migration",
|
||||
"virDomainMigratePrepare": "private function for migration",
|
||||
"virDomainMigratePrepare2": "private function for migration",
|
||||
"virDomainMigratePrepareTunnel": "private function for tunnelled migration",
|
||||
"virDrvSupportsFeature": "private function for remote access",
|
||||
"DllMain": "specific function for Win32",
|
||||
}
|
||||
@ -54,7 +55,9 @@ def uniq(items):
|
||||
d = {}
|
||||
for item in items:
|
||||
d[item]=1
|
||||
return d.keys()
|
||||
k = d.keys()
|
||||
k.sort()
|
||||
return k
|
||||
|
||||
class identifier:
|
||||
def __init__(self, name, header=None, module=None, type=None, lineno = 0,
|
||||
@ -838,14 +841,20 @@ class CParser:
|
||||
arg, name))
|
||||
while len(lines) > 0 and lines[0] == '*':
|
||||
del lines[0]
|
||||
desc = ""
|
||||
desc = None
|
||||
while len(lines) > 0:
|
||||
l = lines[0]
|
||||
while len(l) > 0 and l[0] == '*':
|
||||
l = l[1:]
|
||||
l = string.strip(l)
|
||||
if len(l) >= 6 and l[0:6] == "return" or l[0:6] == "Return":
|
||||
try:
|
||||
i = 0
|
||||
# Remove all leading '*', followed by at most one ' ' character
|
||||
# since we need to preserve correct identation of code examples
|
||||
while i < len(l) and l[i] == '*':
|
||||
i = i + 1
|
||||
if i > 0:
|
||||
if i < len(l) and l[i] == ' ':
|
||||
i = i + 1
|
||||
l = l[i:]
|
||||
if len(l) >= 6 and l[0:7] == "returns" or l[0:7] == "Returns":
|
||||
try:
|
||||
l = string.split(l, ' ', 1)[1]
|
||||
except:
|
||||
l = ""
|
||||
@ -859,9 +868,14 @@ class CParser:
|
||||
retdesc = retdesc + " " + l
|
||||
del lines[0]
|
||||
else:
|
||||
desc = desc + " " + l
|
||||
if desc is not None:
|
||||
desc = desc + "\n" + l
|
||||
else:
|
||||
desc = l
|
||||
del lines[0]
|
||||
|
||||
if desc is None:
|
||||
desc = ""
|
||||
retdesc = string.strip(retdesc)
|
||||
desc = string.strip(desc)
|
||||
|
||||
@ -1716,7 +1730,7 @@ class docBuilder:
|
||||
try:
|
||||
(args, desc) = id.info
|
||||
if desc != None and desc != "":
|
||||
output.write(" <info>%s</info>\n" % (escape(desc)))
|
||||
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
||||
self.indexString(name, desc)
|
||||
for arg in args:
|
||||
(name, desc) = arg
|
||||
@ -1760,7 +1774,7 @@ class docBuilder:
|
||||
try:
|
||||
desc = id.extra
|
||||
if desc != None and desc != "":
|
||||
output.write(">\n <info>%s</info>\n" % (escape(desc)))
|
||||
output.write(">\n <info><![CDATA[%s]]></info>\n" % (desc))
|
||||
output.write(" </typedef>\n")
|
||||
else:
|
||||
output.write("/>\n")
|
||||
@ -1796,7 +1810,7 @@ class docBuilder:
|
||||
output.write(" <cond>%s</cond>\n"% (apstr));
|
||||
try:
|
||||
(ret, params, desc) = id.info
|
||||
output.write(" <info>%s</info>\n" % (escape(desc)))
|
||||
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
||||
self.indexString(name, desc)
|
||||
if ret[0] != None:
|
||||
if ret[0] == "void":
|
||||
@ -2089,11 +2103,11 @@ def rebuild():
|
||||
builder = None
|
||||
if glob.glob("../src/libvirt.c") != [] :
|
||||
print "Rebuilding API description for libvirt"
|
||||
builder = docBuilder("libvirt", ["../src", "../include/libvirt"],
|
||||
builder = docBuilder("libvirt", ["../src", "../src/util", "../include/libvirt"],
|
||||
[])
|
||||
elif glob.glob("src/libvirt.c") != [] :
|
||||
print "Rebuilding API description for libvir"
|
||||
builder = docBuilder("libvirt", ["src", "include/libvirt"],
|
||||
builder = docBuilder("libvirt", ["src", "src/util", "include/libvirt"],
|
||||
[])
|
||||
else:
|
||||
print "rebuild() failed, unable to guess the module"
|
||||
|
174
docs/apps.html
174
docs/apps.html
@ -1,174 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from apps.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Applications using libvirt</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="active" href="relatedlinks.html">Related Links</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<span class="active">Applications</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Applications using <strong>libvirt</strong></h1>
|
||||
<p>
|
||||
This page provides an illustration of the wide variety of
|
||||
applications using the libvirt management API. If you know
|
||||
of interesting applications not listed on this page, send
|
||||
a message to the <a href="contact.html">mailing list</a>
|
||||
to request that it be added here. If your application uses
|
||||
libvirt as its API, the following graphic is available for
|
||||
your website to advertise support for libvirt:
|
||||
</p>
|
||||
<p class="image">
|
||||
<img src="madeWith.png" alt="Made with libvirt" /></p>
|
||||
<h2>Command line tools</h2>
|
||||
<dl><dt>virsh</dt><dd>
|
||||
An interactive shell, and batch scriptable tool for performing
|
||||
management tasks on all libvirt managed domains, networks and
|
||||
storage. This is part of the libvirt core distribution.
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-install</a></dt><dd>
|
||||
Provides a way to provision new virtual machines from a
|
||||
OS distribution install tree. It supports provisioning from
|
||||
local CD images, and the network over NFS, HTTP and FTP.
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-clone</a></dt><dd>
|
||||
Allows the disk image(s) and configuration for an existing
|
||||
virtual machine to be cloned to form a new virtual machine.
|
||||
It automates copying of data across to new disk images, and
|
||||
updates the UUID, Mac address and name in the configuration
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-image</a></dt><dd>
|
||||
Provides a way to deploy virtual appliances. It defines a
|
||||
simplified portable XML format describing the pre-requisites
|
||||
of a virtual machine. At time of deployment this is translated
|
||||
into the domain XML format for execution under any libvirt
|
||||
hypervisor meeting the pre-requisites.
|
||||
</dd><dt><a href="http://et.redhat.com/~rjones/virt-df/">virt-df</a></dt><dd>
|
||||
Examine the utilization of each filesystem in a virtual machine
|
||||
from the comfort of the host machine. This tool peeks into the
|
||||
guest disks and determines how much space is used. It can cope
|
||||
with common Linux filesystems and LVM volumes.
|
||||
</dd><dt><a href="http://et.redhat.com/~rjones/virt-top/">virt-top</a></dt><dd>
|
||||
Watch the CPU, memory, network and disk utilization of all
|
||||
virtual machines running on a host.
|
||||
</dd></dl>
|
||||
<h2>Desktop applications</h2>
|
||||
<dl><dt><a href="http://virt-manager.org/">virt-manager</a></dt><dd>
|
||||
A general purpose desktop management tool, able to manage
|
||||
virtual machines across both local and remotely accessed
|
||||
hypervisors. It is targeted at home and small office usage
|
||||
upto managing 10-20 hosts and their VMs.
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-viewer</a></dt><dd>
|
||||
A lightweight tool for accessing the graphical console
|
||||
associated with a virtual machine. It can securely connect
|
||||
to remote consoles supporting the VNC protocol. Also provides
|
||||
an optional mozilla browser plugin.
|
||||
</dd></dl>
|
||||
<h2>Web applications</h2>
|
||||
<dl><dt><a href="http://ovirt.org/">oVirt</a></dt><dd>
|
||||
oVirt provides the ability to manage large numbers of virtual
|
||||
machines across an entire data center of hosts. It integrates
|
||||
with FreeIPA for Kerberos authentication, and in the future,
|
||||
certificate management.
|
||||
</dd><dt><a href="http://community.abiquo.com/display/AbiCloud">AbiCloud</a></dt><dd>
|
||||
AbiCloud is an open source cloud platform manager which allows to
|
||||
easily deploy a private cloud in your datacenter. One of the key
|
||||
differences of AbiCloud is the web rich interface for managing the
|
||||
infrastructure. You can deploy a new service just dragging and
|
||||
dropping a VM.
|
||||
</dd></dl>
|
||||
<h2>LiveCD / Appliances</h2>
|
||||
<dl><dt><a href="http://et.redhat.com/~rjones/virt-p2v/">virt-p2v</a></dt><dd>
|
||||
A tool for converting a physical machine into a virtual machine. It
|
||||
is a LiveCD which is booted on the machine to be converted. It collects
|
||||
a little information from the user and then copies the disks over to
|
||||
a remote machine and defines the XML for a domain to run the guest.
|
||||
</dd></dl>
|
||||
<h2>Monitoring plugins</h2>
|
||||
<dl><dt><a href="http://honk.sigxcpu.org/projects/libvirt/#munin">for munin</a></dt><dd>
|
||||
The plugins provided by Guido Günther allow to monitor various things
|
||||
like network and block I/O with
|
||||
<a href="http://munin.projects.linpro.no/">Munin</a>.
|
||||
</dd><dt><a href="http://collectd.org/plugins/libvirt.shtml">for collectd</a></dt><dd>
|
||||
The libvirt-plugin is part of <a href="http://collectd.org/">collectd</a>
|
||||
and gather statistics about virtualized guests on a system. This
|
||||
way, you can collect CPU, network interface and block device usage
|
||||
for each guest without installing collectd on the guest systems.
|
||||
or a full description of available please refer to the libvirt section
|
||||
in the collectd.conf(5) manual page.
|
||||
</dd><dt><a href="http://et.redhat.com/~rjones/nagios-virt/">nagios-virt</a></dt><dd>
|
||||
Nagios-virt is a configuration tool for adding monitoring of your
|
||||
virtualised domains to <a href="http://www.nagios.org/">Nagios</a>.
|
||||
You can use this tool to either set up a new Nagios installation for
|
||||
your Xen or QEMU/KVM guests, or to integrate with your existing Nagios
|
||||
installation.
|
||||
</dd></dl>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,132 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archdomain.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Domain management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The libvirt API concepts" class="inactive" href="api.html">API concepts</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Domains</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Domain management architecture</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,157 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from architecture.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: libvirt architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>libvirt architecture</h1>
|
||||
<p>Currently libvirt supports 2 kind of virtualization, and its
|
||||
internal structure is based on a driver model which simplifies adding new
|
||||
engines:</p>
|
||||
<ul><li>
|
||||
<a href="#Xen">Xen hypervisor</a>
|
||||
</li><li>
|
||||
<a href="#QEmu">QEmu and KVM based virtualization</a>
|
||||
</li><li>
|
||||
<a href="#drivers">the driver architecture</a>
|
||||
</li></ul>
|
||||
<h3>
|
||||
<a name="Xen" id="Xen">Libvirt Xen support</a>
|
||||
</h3>
|
||||
<p>When running in a Xen environment, programs using libvirt have to execute
|
||||
in "Domain 0", which is the primary Linux OS loaded on the machine. That OS
|
||||
kernel provides most if not all of the actual drivers used by the set of
|
||||
domains. It also runs the Xen Store, a database of information shared by the
|
||||
hypervisor, the kernels, the drivers and the xen daemon. Xend. The xen daemon
|
||||
supervise the control and execution of the sets of domains. The hypervisor,
|
||||
drivers, kernels and daemons communicate though a shared system bus
|
||||
implemented in the hypervisor. The figure below tries to provide a view of
|
||||
this environment:</p>
|
||||
<img src="architecture.gif" alt="The Xen architecture" />
|
||||
<p>The library can be initialized in 2 ways depending on the level of
|
||||
privilege of the embedding program. If it runs with root access,
|
||||
virConnectOpen() can be used, it will use three different ways to connect to
|
||||
the Xen infrastructure:</p>
|
||||
<ul><li>a connection to the Xen Daemon though an HTTP RPC layer</li><li>a read/write connection to the Xen Store</li><li>use Xen Hypervisor calls</li><li>when used as non-root libvirt connect to a proxy daemon running
|
||||
as root and providing read-only support</li></ul>
|
||||
<p>The library will usually interact with the Xen daemon for any operation
|
||||
changing the state of the system, but for performance and accuracy reasons
|
||||
may talk directly to the hypervisor when gathering state information at
|
||||
least when possible (i.e. when the running program using libvirt has root
|
||||
privilege access).</p>
|
||||
<p>If it runs without root access virConnectOpenReadOnly() should be used to
|
||||
connect to initialize the library. It will then fork a libvirt_proxy
|
||||
program running as root and providing read_only access to the API, this is
|
||||
then only useful for reporting and monitoring.</p>
|
||||
<h3>
|
||||
<a name="QEmu" id="QEmu">Libvirt QEmu and KVM support</a>
|
||||
</h3>
|
||||
<p>The model for QEmu and KVM is completely similar, basically KVM is based
|
||||
on QEmu for the process controlling a new domain, only small details differs
|
||||
between the two. In both case the libvirt API is provided by a controlling
|
||||
process forked by libvirt in the background and which launch and control the
|
||||
QEmu or KVM process. That program called libvirt_qemud talks though a specific
|
||||
protocol to the library, and connects to the console of the QEmu process in
|
||||
order to control and report on its status. Libvirt tries to expose all the
|
||||
emulations models of QEmu, the selection is done when creating the new
|
||||
domain, by specifying the architecture and machine type targeted.</p>
|
||||
<p>The code controlling the QEmu process is available in the
|
||||
<code>qemud/</code> directory.</p>
|
||||
<h3>
|
||||
<a name="drivers" id="drivers">the driver based architecture</a>
|
||||
</h3>
|
||||
<p>As the previous section explains, libvirt can communicate using different
|
||||
channels with the current hypervisor, and should also be able to use
|
||||
different kind of hypervisor. To simplify the internal design, code, ease
|
||||
maintenance and simplify the support of other virtualization engine the
|
||||
internals have been structured as one core component, the libvirt.c module
|
||||
acting as a front-end for the library API and a set of hypervisor drivers
|
||||
defining a common set of routines. That way the Xen Daemon access, the Xen
|
||||
Store one, the Hypervisor hypercall are all isolated in separate C modules
|
||||
implementing at least a subset of the common operations defined by the
|
||||
drivers present in driver.h:</p>
|
||||
<ul><li>xend_internal: implements the driver functions though the Xen
|
||||
Daemon</li><li>xs_internal: implements the subset of the driver available though the
|
||||
Xen Store</li><li>xen_internal: provide the implementation of the functions possible via
|
||||
direct hypervisor access</li><li>proxy_internal: provide read-only Xen access via a proxy, the proxy code
|
||||
is in the <code>proxy/</code>directory.</li><li>xm_internal: provide support for Xen defined but not running
|
||||
domains.</li><li>qemu_internal: implement the driver functions for QEmu and
|
||||
KVM virtualization engines. It also uses a qemud/ specific daemon
|
||||
which interacts with the QEmu process to implement libvirt API.</li><li>test: this is a test driver useful for regression tests of the
|
||||
front-end part of libvirt.</li></ul>
|
||||
<p>Note that a given driver may only implement a subset of those functions,
|
||||
(for example saving a Xen domain state to disk and restoring it is only
|
||||
possible though the Xen Daemon), in that case the driver entry points for
|
||||
unsupported functions are initialized to NULL.</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,161 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archnetwork.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Network management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The libvirt API concepts" class="inactive" href="api.html">API concepts</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Network</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Network management architecture</h1>
|
||||
<h2>Architecture illustration</h2>
|
||||
<p>
|
||||
The diagrams below illustrate some of the network configurations
|
||||
enabled by the libvirt networking APIs
|
||||
</p>
|
||||
<ul><li><strong>VLAN 1</strong>. This virtual network has connectivity
|
||||
to <code>LAN 2</code> with traffic forwarded and NATed.
|
||||
</li><li><strong>VLAN 2</strong>. This virtual network is completely
|
||||
isolated from any physical LAN.
|
||||
</li><li><strong>Guest A</strong>. The first network interface is bridged
|
||||
to the physical <code>LAN 1</code>. The second interface is connected
|
||||
to a virtual network <code>VLAN 1</code>.
|
||||
</li><li><strong>Guest B</strong>. The first network interface is connected
|
||||
to a virtual network <code>VLAN 1</code>, giving it limited NAT
|
||||
based connectivity to LAN2. It has a second network interface
|
||||
connected to <code>VLAN 2</code>. It acts a router allowing limited
|
||||
traffic between the two VLANs, thus giving <code>Guest C</code>
|
||||
connectivity to the physical <code>LAN 2</code>.
|
||||
</li><li><strong>Guest C</strong>. The only network interface is connected
|
||||
to a virtual network <code>VLAN 2</code>. It has no direct connectivity
|
||||
to a physical LAN, relying on <code>Guest B</code> to route traffic
|
||||
on its behalf.
|
||||
</li></ul>
|
||||
<h3>Logical diagram</h3>
|
||||
<p class="image">
|
||||
<img src="libvirt-net-logical.png" alt="Logical network architecture" /></p>
|
||||
<h3>Physical diagram</h3>
|
||||
<p class="image">
|
||||
<img src="libvirt-net-physical.png" alt="Physical network architecture" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,132 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archnode.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Node device management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The libvirt API concepts" class="inactive" href="api.html">API concepts</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Node Devices</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Node device management architecture</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,151 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archstorage.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Storage management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The libvirt API concepts" class="inactive" href="api.html">API concepts</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Storage</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Storage management architecture</h1>
|
||||
<p>
|
||||
The storage management APIs are based around 2 core concepts
|
||||
</p>
|
||||
<ol><li>
|
||||
<strong>Volume</strong> - a single storage volume which can
|
||||
be assigned to a guest, or used for creating further pools. A
|
||||
volume is either a block device, a raw file, or a special format
|
||||
file.
|
||||
</li><li>
|
||||
<strong>Pool</strong> - provides a means for taking a chunk
|
||||
of storage and carving it up into volumes. A pool can be used to
|
||||
manage things such as a physical disk, a NFS server, a iSCSI target,
|
||||
a host adapter, an LVM group.
|
||||
</li></ol>
|
||||
<p>
|
||||
These two concepts are mapped through to two libvirt objects, a
|
||||
<code>virStorageVolPtr</code> and a <code>virStoragePoolPtr</code>,
|
||||
each with a collection of APIs for their management.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
314
docs/auth.html
314
docs/auth.html
@ -1,314 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from auth.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Access control</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="active" href="deployment.html">Deployment</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The URI formats used for connecting to libvirt" class="inactive" href="uri.html">URI format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enable remote access over TCP" class="inactive" href="remote.html">Remote access</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Authentication</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Access the libvirt daemon from a native Windows client" class="inactive" href="windows.html">Windows port</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The library and the daemon logging support" class="inactive" href="logging.html">Logging</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Access control</h1>
|
||||
<p>
|
||||
When connecting to libvirt, some connections may require client
|
||||
authentication before allowing use of the APIs. The set of possible
|
||||
authentication mechanisms is administrator controlled, independent
|
||||
of applications using libvirt.
|
||||
</p>
|
||||
<ul><li>
|
||||
<a href="#ACL_server_config">Server configuration</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_unix_perms">UNIX socket permissions/group</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_polkit">UNIX socket PolicyKit auth</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_username">Username/password auth</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_kerberos">Kerberos auth</a>
|
||||
</li></ul>
|
||||
<h3>
|
||||
<a name="ACL_server_config" id="ACL_server_config">Server configuration</a>
|
||||
</h3>
|
||||
<p>
|
||||
The libvirt daemon allows the administrator to choose the authentication
|
||||
mechanisms used for client connections on each network socket independently.
|
||||
This is primarily controlled via the libvirt daemon master config file in
|
||||
<code>/etc/libvirt/libvirtd.conf</code>. Each of the libvirt sockets can
|
||||
have its authentication mechanism configured independently. There is
|
||||
currently a choice of <code>none</code>, <code>polkit</code>, and <code>sasl</code>.
|
||||
The SASL scheme can be further configured to choose between a large
|
||||
number of different mechanisms.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="ACL_server_unix_perms" id="ACL_server_unix_perms">UNIX socket permissions/group</a>
|
||||
</h3>
|
||||
<p>
|
||||
If libvirt does not contain support for PolicyKit, then access control for
|
||||
the UNIX domain socket is done using traditional file user/group ownership
|
||||
and permissions. There are 2 sockets, one for full read-write access, the
|
||||
other for read-only access. The RW socket will be restricted (mode 0700) to
|
||||
only allow the <code>root</code> user to connect. The read-only socket will
|
||||
be open access (mode 0777) to allow any user to connect.
|
||||
</p>
|
||||
<p>
|
||||
To allow non-root users greater access, the <code>libvirtd.conf</code> file
|
||||
can be edited to change the permissions via the <code>unix_sock_rw_perms</code>,
|
||||
config parameter and to set a user group via the <code>unix_sock_group</code>
|
||||
parameter. For example, setting the former to mode <code>0770</code> and the
|
||||
latter <code>wheel</code> would let any user in the wheel group connect to
|
||||
the libvirt daemon.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="ACL_server_polkit" id="ACL_server_polkit">UNIX socket PolicyKit auth</a>
|
||||
</h3>
|
||||
<p>
|
||||
If libvirt contains support for PolicyKit, then access control options are
|
||||
more advanced. The <code>unix_sock_auth</code> parameter will default to
|
||||
<code>polkit</code>, and the file permissions will default to <code>0777</code>
|
||||
even on the RW socket. Upon connecting to the socket, the client application
|
||||
will be required to identify itself with PolicyKit. The default policy for the
|
||||
RW daemon socket will require any application running in the current desktop
|
||||
session to authenticate using the user's password. This is akin to <code>sudo</code>
|
||||
auth, but does not require that the client application ultimately run as root.
|
||||
Default policy will still allow any application to connect to the RO socket.
|
||||
</p>
|
||||
<p>
|
||||
The default policy can be overridden by the administrator using the PolicyKit
|
||||
master configuration file in <code>/etc/PolicyKit/PolicyKit.conf</code>. The
|
||||
<code>PolicyKit.conf(5)</code> manual page provides details on the syntax
|
||||
available. The two libvirt daemon actions available are named <code>org.libvirt.unix.monitor</code>
|
||||
for the RO socket, and <code>org.libvirt.unix.manage</code> for the RW socket.
|
||||
</p>
|
||||
<p>
|
||||
As an example, to allow a user <code>fred</code>full access to the RW socket,
|
||||
while requiring <code>joe</code> to authenticate with the admin password,
|
||||
would require adding the following snippet to <code>PolicyKit.conf</code>.
|
||||
</p>
|
||||
<pre>
|
||||
<match action="org.libvirt.unix.manage">
|
||||
<match user="fred">
|
||||
<return result="yes"/>
|
||||
</match>
|
||||
</match>
|
||||
<match action="org.libvirt.unix.manage">
|
||||
<match user="joe">
|
||||
<return result="auth_admin"/>
|
||||
</match>
|
||||
</match>
|
||||
</pre>
|
||||
<h3>
|
||||
<a name="ACL_server_username" id="ACL_server_username">Username/password auth</a>
|
||||
</h3>
|
||||
<p>
|
||||
The plain TCP socket of the libvirt daemon defaults to using SASL for authentication.
|
||||
The SASL mechanism configured by default is DIGEST-MD5, which provides a basic
|
||||
username+password style authentication. It also provides for encryption of the data
|
||||
stream, so the security of the plain TCP socket is on a par with that of the TLS
|
||||
socket. If desired the UNIX socket and TLS socket can also have SASL enabled by
|
||||
setting the <code>auth_unix_ro</code>, <code>auth_unix_rw</code>, <code>auth_tls</code>
|
||||
config params in <code>libvirt.conf</code>.
|
||||
</p>
|
||||
<p>
|
||||
Out of the box, no user accounts are defined, so no clients will be able to authenticate
|
||||
on the TCP socket. Adding users and setting their passwords is done with the <code>saslpasswd2</code>
|
||||
command. When running this command it is important to tell it that the appname is <code>libvirt</code>.
|
||||
As an example, to add a user <code>fred</code>, run
|
||||
</p>
|
||||
<pre>
|
||||
# saslpasswd2 -a libvirt fred
|
||||
Password: xxxxxx
|
||||
Again (for verification): xxxxxx
|
||||
</pre>
|
||||
<p>
|
||||
To see a list of all accounts the <code>sasldblistusers2</code> command can be used.
|
||||
This command expects to be given the path to the libvirt user database, which is kept
|
||||
in <code>/etc/libvirt/passwd.db</code>
|
||||
</p>
|
||||
<pre>
|
||||
# sasldblistusers2 -f /etc/libvirt/passwd.db
|
||||
fred@t60wlan.home.berrange.com: userPassword
|
||||
</pre>
|
||||
<p>
|
||||
Finally, to disable a user's access, the <code>saslpasswd2</code> command can be used
|
||||
again:
|
||||
</p>
|
||||
<pre>
|
||||
# saslpasswd2 -a libvirt -d fred
|
||||
</pre>
|
||||
<h3>
|
||||
<a name="ACL_server_kerberos" id="ACL_server_kerberos">Kerberos auth</a>
|
||||
</h3>
|
||||
<p>
|
||||
The plain TCP socket of the libvirt daemon defaults to using SASL for authentication.
|
||||
The SASL mechanism configured by default is DIGEST-MD5, which provides a basic
|
||||
username+password style authentication. To enable Kerberos single-sign-on instead,
|
||||
the libvirt SASL configuration file must be changed. This is <code>/etc/sasl2/libvirt.conf</code>.
|
||||
The <code>mech_list</code> parameter must first be changed to <code>gssapi</code>
|
||||
instead of the default <code>digest-md5</code>. If SASL is enabled on the UNIX
|
||||
and/or TLS sockets, Kerberos will also be used for them. Like DIGEST-MD5, the Kerberos
|
||||
mechanism provides data encryption of the session.
|
||||
</p>
|
||||
<p>
|
||||
Some operating systems do not install the SASL kerberos plugin by default. It
|
||||
may be necessary to install a sub-package such as <code>cyrus-sasl-gssapi</code>.
|
||||
To check whether the Kerberos plugin is installed run the <code>pluginviewer</code>
|
||||
program and verify that <code>gssapi</code> is listed,eg:
|
||||
</p>
|
||||
<pre>
|
||||
# pluginviewer
|
||||
...snip...
|
||||
Plugin "gssapiv2" [loaded], API version: 4
|
||||
SASL mechanism: GSSAPI, best SSF: 56
|
||||
security flags: NO_ANONYMOUS|NO_PLAINTEXT|NO_ACTIVE|PASS_CREDENTIALS|MUTUAL_AUTH
|
||||
features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION|NEED_SERVER_FQDN
|
||||
</pre>
|
||||
<p>
|
||||
Next is is necessary for the administrator of the Kerberos realm to issue a principle
|
||||
for the libvirt server. There needs to be one principle per host running the libvirt
|
||||
daemon. The principle should be named <code>libvirt/full.hostname@KERBEROS.REALM</code>.
|
||||
This is typically done by running the <code>kadmin.local</code> command on the Kerberos
|
||||
server, though some Kerberos servers have alternate ways of setting up service principles.
|
||||
Once created, the principle should be exported to a keytab, copied to the host running
|
||||
the libvirt daemon and placed in <code>/etc/libvirt/krb5.tab</code>
|
||||
</p>
|
||||
<pre>
|
||||
# kadmin.local
|
||||
kadmin.local: add_principal libvirt/foo.example.com
|
||||
Enter password for principal "libvirt/foo.example.com@EXAMPLE.COM":
|
||||
Re-enter password for principal "libvirt/foo.example.com@EXAMPLE.COM":
|
||||
Principal "libvirt/foo.example.com@EXAMPLE.COM" created.
|
||||
|
||||
kadmin.local: ktadd -k /root/libvirt-foo-example.tab libvirt/foo.example.com@EXAMPLE.COM
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type Triple DES cbc mode with HMAC/sha1 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type DES with HMAC/sha1 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
|
||||
kadmin.local: quit
|
||||
|
||||
# scp /root/libvirt-foo-example.tab root@foo.example.com:/etc/libvirt/krb5.tab
|
||||
# rm /root/libvirt-foo-example.tab
|
||||
</pre>
|
||||
<p>
|
||||
Any client application wishing to connect to a Kerberos enabled libvirt server
|
||||
merely needs to run <code>kinit</code> to gain a user principle. This may well
|
||||
be done automatically when a user logs into a desktop session, if PAM is setup
|
||||
to authenticate against Kerberos.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -151,7 +151,7 @@ Plugin "gssapiv2" [loaded], API version: 4
|
||||
features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION|NEED_SERVER_FQDN
|
||||
</pre>
|
||||
<p>
|
||||
Next is is necessary for the administrator of the Kerberos realm to issue a principle
|
||||
Next it is necessary for the administrator of the Kerberos realm to issue a principle
|
||||
for the libvirt server. There needs to be one principle per host running the libvirt
|
||||
daemon. The principle should be named <code>libvirt/full.hostname@KERBEROS.REALM</code>.
|
||||
This is typically done by running the <code>kadmin.local</code> command on the Kerberos
|
||||
|
@ -1,134 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from bindings.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Bindings for other languages</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Language bindings</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="overview of the python API bindings" class="inactive" href="python.html">Python</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="overview of the Java API bindings" class="inactive" href="java.html">Java</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Bindings for other languages</h1>
|
||||
<p>Libvirt comes with bindings to support other languages than
|
||||
pure <strong>C</strong>. First the headers embeds the necessary declarations to
|
||||
allow direct access from <strong>C++</strong> code, but also we have bindings for
|
||||
higher level kind of languages:</p>
|
||||
<ul><li><strong>Python</strong>: Libvirt comes with direct support for the Python language
|
||||
(just make sure you installed the libvirt-python package if not
|
||||
compiling from sources). See below for more information about
|
||||
using libvirt with python</li><li><strong>Perl</strong>: Daniel Berrange provides <a href="http://search.cpan.org/dist/Sys-Virt/">bindings for
|
||||
Perl</a>.</li><li><strong>OCaml</strong>: Richard Jones supplies <a href="http://libvirt.org/ocaml/">bindings for OCaml</a>.</li><li><strong>Ruby</strong>: David Lutterkort provides <a href="http://libvirt.org/ruby/">bindings for Ruby</a>.</li><li><strong>Java</strong>: Daniel Veillard maintains <a href="java.html">Java bindings</a>.</li><li><strong>C#</strong>: Richard Jones wrote about <a href="https://www.redhat.com/archives/libvir-list/2008-September/msg00283.html">calling libvirt from C# on the mailing list</a>.</li></ul>
|
||||
<p>For information on using libvirt on <strong>Windows</strong>
|
||||
<a href="windows.html">please see the Windows
|
||||
support page</a>.
|
||||
</p>
|
||||
<p>Support, requests or help for libvirt bindings are welcome on
|
||||
the <a href="https://www.redhat.com/mailman/listinfo/libvir-list/">mailing
|
||||
list</a>, as usual try to provide enough background information
|
||||
and make sure you use recent version, see the <a href="bugs.html">help
|
||||
page</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
120
docs/bugs.html
120
docs/bugs.html
@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from bugs.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Bug reporting</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Bug reports</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Bug reporting</h1>
|
||||
<p>
|
||||
The <a href="http://bugzilla.redhat.com">Red Hat Bugzilla Server</a>
|
||||
should be used to report bugs and request features against libvirt.
|
||||
Before submitting a ticket, check the existing tickets to see if
|
||||
the bug/feature is already tracked.
|
||||
</p>
|
||||
<h2>General libvirt bug reports</h2>
|
||||
<p>
|
||||
If you are using official libvirt binaries from a Linux distribution
|
||||
check below for distribution specific bug reporting policies first.
|
||||
For general libvirt bug reports, from self-built releases, CVS snapshots
|
||||
and any other non-distribution supported builds, enter tickets under
|
||||
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
|
||||
component.
|
||||
</p>
|
||||
<ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virtualization%20Tools">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%20Tools&component=libvirt">New libvirt ticket</a></li></ul>
|
||||
<h2>Linux Distribution specific bug reports</h2>
|
||||
<ul><li>
|
||||
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
|
||||
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
|
||||
component.
|
||||
<ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&component=libvirt">New Fedora libvirt ticket</a></li></ul></li><li>
|
||||
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
|
||||
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
|
||||
the <code>libvirt</code> component.
|
||||
<ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Red%20Hat%20Enterprise%20Linux%205">View Red Hat Enterprise Linux libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&component=libvirt">New Red Hat Enterprise Linux libvirt ticket</a></li></ul></li><li>
|
||||
If you are using official binaries from another Linux distribution first
|
||||
follow their own bug reporting guidelines.
|
||||
</li></ul>
|
||||
<h2>How to file high quality bug reports</h2>
|
||||
<p>
|
||||
To increase the likelihood of your bug report being addressed it is
|
||||
important to provide as much information as possible. When filing
|
||||
libvirt bugs use this checklist to see if you are providing enough
|
||||
information:
|
||||
</p>
|
||||
<ul><li>The version number of the libvirt build, or date of the CVS
|
||||
checkout</li><li>The hardware architecture being used</li><li>The name of the hypervisor (Xen, QEMU, KVM)</li><li>The XML config of the guest domain if relevant</li><li>For Xen hypervisor, the XenD logfile from /var/log/xen</li><li>For QEMU/KVM, the domain logfile from /var/log/libvirt/qemu</li></ul>
|
||||
<p>
|
||||
If requesting a new feature attach any available patch to the ticket
|
||||
and also email the patch to the libvirt mailing list for discussion
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from contact.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Contacting the development team</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Contact</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Contacting the development team</h1>
|
||||
<h2>Mailing list</h2>
|
||||
<p>
|
||||
There is a mailing-list <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a> for libvirt,
|
||||
with an <a href="https://www.redhat.com/archives/libvir-list/">on-line archive</a>.
|
||||
Please subscribe to this list before posting by visiting the
|
||||
<a href="https://www.redhat.com/mailman/listinfo/libvir-list">associated Web</a>
|
||||
page and follow the instructions. Patches with explanations and provided as
|
||||
attachments are really appreciated and will be discussed on the mailing list.
|
||||
If possible generate the patches by using <code>cvs diff -up</code> in a CVS
|
||||
checkout.
|
||||
</p>
|
||||
<h2>IRC discussion</h2>
|
||||
<p>
|
||||
Some of the libvirt developers may be found on IRC on the <a href="http://oftc.net">OFTC IRC</a>
|
||||
network. Use the settings:
|
||||
</p>
|
||||
<ul><li>server: irc.oftc.net</li><li>port: 6667 (the usual IRC port)</li><li>channel: #virt</li></ul>
|
||||
<p>
|
||||
NB There is no guarantee that someone will be watching or able to reply
|
||||
promptly, so use the mailing-list if you don't get an answer on the IRC
|
||||
channel.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,160 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from deployment.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Deployment</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<span class="active">Deployment</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The URI formats used for connecting to libvirt" class="inactive" href="uri.html">URI format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enable remote access over TCP" class="inactive" href="remote.html">Remote access</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Configure authentication for the libvirt daemon" class="inactive" href="auth.html">Authentication</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Access the libvirt daemon from a native Windows client" class="inactive" href="windows.html">Windows port</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The library and the daemon logging support" class="inactive" href="logging.html">Logging</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Deployment</h1>
|
||||
<h2>Pre-packaged releases</h2>
|
||||
<p>
|
||||
The libvirt API is now available in all major Linux distributions
|
||||
so the simplest deployment approach is to use your distributions'
|
||||
package management software to install the <code>libvirt</code>
|
||||
module.
|
||||
</p>
|
||||
<h2>Self-built releases</h2>
|
||||
<p>
|
||||
libvirt uses GNU autotools for its build system, so deployment
|
||||
follows the usual process of <code>configure; make ; make install</code>
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
# ./configure --prefix=$HOME/usr
|
||||
# make
|
||||
# make install
|
||||
</pre>
|
||||
<h2>Built from CVS / GIT</h2>
|
||||
<p>
|
||||
When building from CVS it is necessary to generate the autotools
|
||||
support files. This requires having <code>autoconf</code>,
|
||||
<code>automake</code>, <code>libtool</code> and <code>intltool</code>
|
||||
installed. The process can be automated with the <code>autogen.sh</code>
|
||||
script.
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
# ./autogen.sh --prefix=$HOME/usr
|
||||
# make
|
||||
# make install
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
docs/devhelp/.gitignore
vendored
1
docs/devhelp/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
libvirt.devhelp
|
||||
*.html
|
||||
|
@ -1,29 +0,0 @@
|
||||
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
|
||||
HTML_FILES=index.html general.html $(HTML_MODULES)
|
||||
HTML_MODULES= \
|
||||
libvirt-libvirt.html \
|
||||
libvirt-virterror.html
|
||||
|
||||
EXTRA_FORMAT= \
|
||||
home.png \
|
||||
left.png \
|
||||
right.png \
|
||||
up.png \
|
||||
style.css
|
||||
|
||||
EXTRA_DIST=devhelp.xsl html.xsl libvirt.devhelp $(HTML_FILES) $(EXTRA_FORMAT)
|
||||
|
||||
all: libvirt.devhelp $(HTML_FILES)
|
||||
|
||||
libvirt.devhelp $(HTML_FILES): $(srcdir)/devhelp.xsl html.xsl $(top_srcdir)/docs/libvirt-api.xml
|
||||
-@(echo Rebuilding devhelp files)
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet -o libvirt.devhelp $(srcdir)/devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
|
||||
|
||||
install-data-local: libvirt.devhelp $(HTML_FILES)
|
||||
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
|
||||
-@INSTALL@ -m 0644 libvirt.devhelp $(DESTDIR)$(DEVHELP_DIR)
|
||||
-@INSTALL@ -m 0644 $(HTML_FILES) $(DESTDIR)$(DEVHELP_DIR)
|
||||
-for file in $(EXTRA_FORMAT); do \
|
||||
@INSTALL@ -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
|
||||
done
|
@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>libvirt: </title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="start" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="up" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link rel="chapter" href="index.html" title="libvirt Reference Manual"/>
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||||
<tr valign="middle">
|
||||
<td>
|
||||
<a accesskey="u" href="index.html">
|
||||
<img src="up.png" width="24" height="24" border="0" alt="Up"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="h" href="index.html">
|
||||
<img src="home.png" width="24" height="24" border="0" alt="Home"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="n" href="libvirt-libvirt.html">
|
||||
<img src="right.png" width="24" height="24" border="0" alt="Next"/>
|
||||
</a>
|
||||
</td>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">libvirt API Modules</span>
|
||||
</h2>
|
||||
<p><a href="libvirt-libvirt.html">libvirt</a> - core interfaces for the libvirt library<br/><a href="libvirt-virterror.html">virterror</a> - error handling interfaces for the libvirt library<br/></p>
|
||||
</body>
|
||||
</html>
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>libvirt Reference Manual</title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||||
<tr valign="middle">
|
||||
<td>
|
||||
<a accesskey="h" href="index.html">
|
||||
<img src="home.png" width="24" height="24" border="0" alt="Home"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="n" href="general.html">
|
||||
<img src="right.png" width="24" height="24" border="0" alt="Next"/>
|
||||
</a>
|
||||
</td>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">libvirt Reference Manual</span>
|
||||
</h2>
|
||||
<p>Libvir is a C toolkit to interact with the virtualization capabilities of
|
||||
recent versions of Linux (and other OSes). It is free software available
|
||||
under the <a href="http://www.opensource.org/licenses/lgpl-license.html">GNU
|
||||
Lesser General Public License</a>. Virtualization of the Linux Operating
|
||||
System means the ability to run multiple instances of Operating Systems
|
||||
concurrently on a single hardware system where the basic resources are driven
|
||||
by a Linux instance. The library aim at providing long term stable C API
|
||||
initially for the <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen
|
||||
paravirtualization</a> but should be able to integrate other virtualization
|
||||
mechanisms if needed.</p>
|
||||
<p> If you get lost searching for some specific API use, try
|
||||
<a href="http://libvirt.org/search.php">the online search
|
||||
engine</a> hosted on <a href="http://libvirt.org/">libvirt.org</a>
|
||||
it indexes the project page, the APIs as well as the mailing-list archives. </p>
|
||||
</body>
|
||||
</html>
|
@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>conf: </title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="start" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="up" href="general.html" title="API"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link rel="chapter" href="general.html" title="API"/>
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||||
<tr valign="middle">
|
||||
<td>
|
||||
<a accesskey="p" href="libvirt-virterror.html">
|
||||
<img src="left.png" width="24" height="24" border="0" alt="Prev"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="u" href="general.html">
|
||||
<img src="up.png" width="24" height="24" border="0" alt="Up"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="h" href="index.html">
|
||||
<img src="home.png" width="24" height="24" border="0" alt="Home"/>
|
||||
</a>
|
||||
</td>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">conf</span>
|
||||
</h2>
|
||||
<p>conf - </p>
|
||||
<p></p>
|
||||
<p>Author(s): </p>
|
||||
<div class="refsynopsisdiv">
|
||||
<h2>Synopsis</h2>
|
||||
<pre class="synopsis">typedef <a href="libvirt-conf.html#virConfValue">virConfValue</a> * <a href="#virConfValuePtr">virConfValuePtr</a>;
|
||||
typedef enum <a href="#virConfType">virConfType</a>;
|
||||
typedef struct _virConfValue <a href="#virConfValue">virConfValue</a>;
|
||||
typedef struct _virConf <a href="#virConf">virConf</a>;
|
||||
typedef <a href="libvirt-conf.html#virConf">virConf</a> * <a href="#virConfPtr">virConfPtr</a>;
|
||||
int <a href="#virConfWriteFile">virConfWriteFile</a> (const char * filename, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf);
|
||||
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> <a href="#virConfGetValue">virConfGetValue</a> (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf, <br/> const char * setting);
|
||||
<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> <a href="#virConfReadMem">virConfReadMem</a> (const char * memory, <br/> int len);
|
||||
int <a href="#virConfFree">virConfFree</a> (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf);
|
||||
<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> <a href="#virConfReadFile">virConfReadFile</a> (const char * filename);
|
||||
int <a href="#virConfWriteMem">virConfWriteMem</a> (char * memory, <br/> int * len, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf);
|
||||
</pre>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Description</h2>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Details</h2>
|
||||
<div class="refsect2" lang="en">
|
||||
<div class="refsect2" lang="en"><h3><a name="virConf">Structure </a>virConf</h3><pre class="programlisting">struct _virConf {
|
||||
The content of this structure is not made public by the API.
|
||||
} virConf;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfPtr">Typedef </a>virConfPtr</h3><pre class="programlisting"><a href="libvirt-conf.html#virConf">virConf</a> * virConfPtr;
|
||||
</pre><p>a pointer to a parsed configuration file</p>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfType">Enum </a>virConfType</h3><pre class="programlisting">enum <a href="#virConfType">virConfType</a> {
|
||||
<a name="VIR_CONF_NONE">VIR_CONF_NONE</a> = 0 /* undefined */
|
||||
<a name="VIR_CONF_LONG">VIR_CONF_LONG</a> = 1 /* a long int */
|
||||
<a name="VIR_CONF_STRING">VIR_CONF_STRING</a> = 2 /* a string */
|
||||
<a name="VIR_CONF_LIST">VIR_CONF_LIST</a> = 3 /* a list */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfValue">Structure </a>virConfValue</h3><pre class="programlisting">struct _virConfValue {
|
||||
<a href="libvirt-conf.html#virConfType">virConfType</a> type : the <a href="libvirt-conf.html#virConfType">virConfType</a>
|
||||
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> next : next element if in a list
|
||||
long l : long integer
|
||||
char * str : pointer to 0 terminated string
|
||||
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> list : list of a list
|
||||
} virConfValue;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfValuePtr">Typedef </a>virConfValuePtr</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfValue">virConfValue</a> * virConfValuePtr;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfFree"/>virConfFree ()</h3><pre class="programlisting">int virConfFree (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br/>
|
||||
</pre><p>Frees all data associated to the handle</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>a configuration file handle</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfGetValue"/>virConfGetValue ()</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> virConfGetValue (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf, <br/> const char * setting)<br/>
|
||||
</pre><p>Lookup the value associated to this entry in the configuration file</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>a configuration file handle</td></tr><tr><td><span class="term"><i><tt>setting</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the value or NULL if the lookup failed, the data associated will be freed when virConfFree() is called</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfReadFile"/>virConfReadFile ()</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> virConfReadFile (const char * filename)<br/>
|
||||
</pre><p>Reads a configuration file.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the path to the configuration file.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an handle to lookup settings or NULL if it failed to read or parse the file, use virConfFree() to free the data.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfReadMem"/>virConfReadMem ()</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> virConfReadMem (const char * memory, <br/> int len)<br/>
|
||||
</pre><p>Reads a configuration file loaded in memory. The string can be zero terminated in which case @len can be 0</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>pointer to the content of the configuration file</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>length in byte</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an handle to lookup settings or NULL if it failed to parse the content, use virConfFree() to free the data.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfWriteFile"/>virConfWriteFile ()</h3><pre class="programlisting">int virConfWriteFile (const char * filename, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br/>
|
||||
</pre><p>Writes a configuration file back to a file.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the path to the configuration file.</td></tr><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>the conf</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfWriteMem"/>virConfWriteMem ()</h3><pre class="programlisting">int virConfWriteMem (char * memory, <br/> int * len, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br/>
|
||||
</pre><p>Writes a configuration file back to a memory area. @len is an IN/OUT parameter, it indicates the size available in bytes, and on output the size required for the configuration file (even if the call fails due to insufficient space).</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>pointer to the memory to store the config file</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>pointer to the length in byte of the store, on output the size</td></tr><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>the conf</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -1,255 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>virterror: error handling interfaces for the libvirt library</title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="start" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="up" href="general.html" title="API"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link rel="chapter" href="general.html" title="API"/>
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||||
<tr valign="middle">
|
||||
<td>
|
||||
<a accesskey="p" href="libvirt-libvirt.html">
|
||||
<img src="left.png" width="24" height="24" border="0" alt="Prev"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="u" href="general.html">
|
||||
<img src="up.png" width="24" height="24" border="0" alt="Up"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="h" href="index.html">
|
||||
<img src="home.png" width="24" height="24" border="0" alt="Home"/>
|
||||
</a>
|
||||
</td>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">virterror</span>
|
||||
</h2>
|
||||
<p>virterror - error handling interfaces for the libvirt library</p>
|
||||
<p>Provides the interfaces of the libvirt library to handle errors raised while using the library. </p>
|
||||
<p>Author(s): Daniel Veillard <veillard@redhat.com> </p>
|
||||
<div class="refsynopsisdiv">
|
||||
<h2>Synopsis</h2>
|
||||
<pre class="synopsis">typedef <a href="libvirt-virterror.html#virError">virError</a> * <a href="#virErrorPtr">virErrorPtr</a>;
|
||||
typedef enum <a href="#virErrorLevel">virErrorLevel</a>;
|
||||
typedef enum <a href="#virErrorDomain">virErrorDomain</a>;
|
||||
typedef enum <a href="#virErrorNumber">virErrorNumber</a>;
|
||||
typedef struct _virError <a href="#virError">virError</a>;
|
||||
void <a href="#virFreeError">virFreeError</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
|
||||
int <a href="#virCopyLastError">virCopyLastError</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to);
|
||||
void <a href="#virConnSetErrorFunc">virConnSetErrorFunc</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler);
|
||||
void <a href="#virResetLastError">virResetLastError</a> (void);
|
||||
typedef void <a href="#virErrorFunc">virErrorFunc</a> (void * userData, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> error);
|
||||
void <a href="#virResetError">virResetError</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
|
||||
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> <a href="#virConnGetLastError">virConnGetLastError</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
void <a href="#virDefaultErrorFunc">virDefaultErrorFunc</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
|
||||
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> <a href="#virGetLastError">virGetLastError</a> (void);
|
||||
void <a href="#virSetErrorFunc">virSetErrorFunc</a> (void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler);
|
||||
int <a href="#virConnCopyLastError">virConnCopyLastError</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to);
|
||||
void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> <a href="#virSaveLastError">virSaveLastError</a> (void);
|
||||
</pre>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Description</h2>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Details</h2>
|
||||
<div class="refsect2" lang="en">
|
||||
<div class="refsect2" lang="en"><h3><a name="virError">Structure </a>virError</h3><pre class="programlisting">struct _virError {
|
||||
int code : The error code, a <a href="libvirt-virterror.html#virErrorNumber">virErrorNumber</a>
|
||||
int domain : What part of the library raised this error
|
||||
char * message : human-readable informative error message
|
||||
<a href="libvirt-virterror.html#virErrorLevel">virErrorLevel</a> level : how consequent is the error
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn : connection if available, deprecated see note above
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom : domain if available, deprecated see note above
|
||||
char * str1 : extra string information
|
||||
char * str2 : extra string information
|
||||
char * str3 : extra string information
|
||||
int int1 : extra number information
|
||||
int int2 : extra number information
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net : network if available, deprecated see note above
|
||||
} virError;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorDomain">Enum </a>virErrorDomain</h3><pre class="programlisting">enum <a href="#virErrorDomain">virErrorDomain</a> {
|
||||
<a name="VIR_FROM_NONE">VIR_FROM_NONE</a> = 0
|
||||
<a name="VIR_FROM_XEN">VIR_FROM_XEN</a> = 1 /* Error at Xen hypervisor layer */
|
||||
<a name="VIR_FROM_XEND">VIR_FROM_XEND</a> = 2 /* Error at connection with xend daemon */
|
||||
<a name="VIR_FROM_XENSTORE">VIR_FROM_XENSTORE</a> = 3 /* Error at connection with xen store */
|
||||
<a name="VIR_FROM_SEXPR">VIR_FROM_SEXPR</a> = 4 /* Error in the S-Expression code */
|
||||
<a name="VIR_FROM_XML">VIR_FROM_XML</a> = 5 /* Error in the XML code */
|
||||
<a name="VIR_FROM_DOM">VIR_FROM_DOM</a> = 6 /* Error when operating on a domain */
|
||||
<a name="VIR_FROM_RPC">VIR_FROM_RPC</a> = 7 /* Error in the XML-RPC code */
|
||||
<a name="VIR_FROM_PROXY">VIR_FROM_PROXY</a> = 8 /* Error in the proxy code */
|
||||
<a name="VIR_FROM_CONF">VIR_FROM_CONF</a> = 9 /* Error in the configuration file handling */
|
||||
<a name="VIR_FROM_QEMU">VIR_FROM_QEMU</a> = 10 /* Error at the QEMU daemon */
|
||||
<a name="VIR_FROM_NET">VIR_FROM_NET</a> = 11 /* Error when operating on a network */
|
||||
<a name="VIR_FROM_TEST">VIR_FROM_TEST</a> = 12 /* Error from test driver */
|
||||
<a name="VIR_FROM_REMOTE">VIR_FROM_REMOTE</a> = 13 /* Error from remote driver */
|
||||
<a name="VIR_FROM_OPENVZ">VIR_FROM_OPENVZ</a> = 14 /* Error from OpenVZ driver */
|
||||
<a name="VIR_FROM_XENXM">VIR_FROM_XENXM</a> = 15 /* Error at Xen XM layer */
|
||||
<a name="VIR_FROM_STATS_LINUX">VIR_FROM_STATS_LINUX</a> = 16 /* Error in the Linux Stats code */
|
||||
<a name="VIR_FROM_LXC">VIR_FROM_LXC</a> = 17 /* Error from Linux Container driver */
|
||||
<a name="VIR_FROM_STORAGE">VIR_FROM_STORAGE</a> = 18 /* Error from storage driver */
|
||||
<a name="VIR_FROM_NETWORK">VIR_FROM_NETWORK</a> = 19 /* Error from network config */
|
||||
<a name="VIR_FROM_DOMAIN">VIR_FROM_DOMAIN</a> = 20 /* Error from domain config */
|
||||
<a name="VIR_FROM_UML">VIR_FROM_UML</a> = 21 /* Error at the UML driver */
|
||||
<a name="VIR_FROM_NODEDEV">VIR_FROM_NODEDEV</a> = 22 /* Error from node device monitor */
|
||||
<a name="VIR_FROM_XEN_INOTIFY">VIR_FROM_XEN_INOTIFY</a> = 23 /* Error from xen inotify layer */
|
||||
<a name="VIR_FROM_SECURITY">VIR_FROM_SECURITY</a> = 24 /* Error from security framework */
|
||||
<a name="VIR_FROM_VBOX">VIR_FROM_VBOX</a> = 25 /* Error from VirtualBox driver */
|
||||
<a name="VIR_FROM_INTERFACE">VIR_FROM_INTERFACE</a> = 26 /* Error when operating on an interface */
|
||||
<a name="VIR_FROM_ONE">VIR_FROM_ONE</a> = 27 /* Error from OpenNebula driver */
|
||||
<a name="VIR_FROM_ESX">VIR_FROM_ESX</a> = 28 /* Error from ESX driver */
|
||||
<a name="VIR_FROM_PHYP">VIR_FROM_PHYP</a> = 29 /* Error from IBM power hypervisor */
|
||||
<a name="VIR_FROM_SECRET">VIR_FROM_SECRET</a> = 30 /* Error from secret storage */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorLevel">Enum </a>virErrorLevel</h3><pre class="programlisting">enum <a href="#virErrorLevel">virErrorLevel</a> {
|
||||
<a name="VIR_ERR_NONE">VIR_ERR_NONE</a> = 0
|
||||
<a name="VIR_ERR_WARNING">VIR_ERR_WARNING</a> = 1 /* A simple warning */
|
||||
<a name="VIR_ERR_ERROR">VIR_ERR_ERROR</a> = 2 /* An error */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorNumber">Enum </a>virErrorNumber</h3><pre class="programlisting">enum <a href="#virErrorNumber">virErrorNumber</a> {
|
||||
<a name="VIR_ERR_OK">VIR_ERR_OK</a> = 0
|
||||
<a name="VIR_ERR_INTERNAL_ERROR">VIR_ERR_INTERNAL_ERROR</a> = 1 /* internal error */
|
||||
<a name="VIR_ERR_NO_MEMORY">VIR_ERR_NO_MEMORY</a> = 2 /* memory allocation failure */
|
||||
<a name="VIR_ERR_NO_SUPPORT">VIR_ERR_NO_SUPPORT</a> = 3 /* no support for this function */
|
||||
<a name="VIR_ERR_UNKNOWN_HOST">VIR_ERR_UNKNOWN_HOST</a> = 4 /* could not resolve hostname */
|
||||
<a name="VIR_ERR_NO_CONNECT">VIR_ERR_NO_CONNECT</a> = 5 /* can't connect to hypervisor */
|
||||
<a name="VIR_ERR_INVALID_CONN">VIR_ERR_INVALID_CONN</a> = 6 /* invalid connection object */
|
||||
<a name="VIR_ERR_INVALID_DOMAIN">VIR_ERR_INVALID_DOMAIN</a> = 7 /* invalid domain object */
|
||||
<a name="VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> = 8 /* invalid function argument */
|
||||
<a name="VIR_ERR_OPERATION_FAILED">VIR_ERR_OPERATION_FAILED</a> = 9 /* a command to hypervisor failed */
|
||||
<a name="VIR_ERR_GET_FAILED">VIR_ERR_GET_FAILED</a> = 10 /* a HTTP GET command to failed */
|
||||
<a name="VIR_ERR_POST_FAILED">VIR_ERR_POST_FAILED</a> = 11 /* a HTTP POST command to failed */
|
||||
<a name="VIR_ERR_HTTP_ERROR">VIR_ERR_HTTP_ERROR</a> = 12 /* unexpected HTTP error code */
|
||||
<a name="VIR_ERR_SEXPR_SERIAL">VIR_ERR_SEXPR_SERIAL</a> = 13 /* failure to serialize an S-Expr */
|
||||
<a name="VIR_ERR_NO_XEN">VIR_ERR_NO_XEN</a> = 14 /* could not open Xen hypervisor control */
|
||||
<a name="VIR_ERR_XEN_CALL">VIR_ERR_XEN_CALL</a> = 15 /* failure doing an hypervisor call */
|
||||
<a name="VIR_ERR_OS_TYPE">VIR_ERR_OS_TYPE</a> = 16 /* unknown OS type */
|
||||
<a name="VIR_ERR_NO_KERNEL">VIR_ERR_NO_KERNEL</a> = 17 /* missing kernel information */
|
||||
<a name="VIR_ERR_NO_ROOT">VIR_ERR_NO_ROOT</a> = 18 /* missing root device information */
|
||||
<a name="VIR_ERR_NO_SOURCE">VIR_ERR_NO_SOURCE</a> = 19 /* missing source device information */
|
||||
<a name="VIR_ERR_NO_TARGET">VIR_ERR_NO_TARGET</a> = 20 /* missing target device information */
|
||||
<a name="VIR_ERR_NO_NAME">VIR_ERR_NO_NAME</a> = 21 /* missing domain name information */
|
||||
<a name="VIR_ERR_NO_OS">VIR_ERR_NO_OS</a> = 22 /* missing domain OS information */
|
||||
<a name="VIR_ERR_NO_DEVICE">VIR_ERR_NO_DEVICE</a> = 23 /* missing domain devices information */
|
||||
<a name="VIR_ERR_NO_XENSTORE">VIR_ERR_NO_XENSTORE</a> = 24 /* could not open Xen Store control */
|
||||
<a name="VIR_ERR_DRIVER_FULL">VIR_ERR_DRIVER_FULL</a> = 25 /* too many drivers registered */
|
||||
<a name="VIR_ERR_CALL_FAILED">VIR_ERR_CALL_FAILED</a> = 26 /* not supported by the drivers (DEPRECATED) */
|
||||
<a name="VIR_ERR_XML_ERROR">VIR_ERR_XML_ERROR</a> = 27 /* an XML description is not well formed or broken */
|
||||
<a name="VIR_ERR_DOM_EXIST">VIR_ERR_DOM_EXIST</a> = 28 /* the domain already exist */
|
||||
<a name="VIR_ERR_OPERATION_DENIED">VIR_ERR_OPERATION_DENIED</a> = 29 /* operation forbidden on read-only connections */
|
||||
<a name="VIR_ERR_OPEN_FAILED">VIR_ERR_OPEN_FAILED</a> = 30 /* failed to open a conf file */
|
||||
<a name="VIR_ERR_READ_FAILED">VIR_ERR_READ_FAILED</a> = 31 /* failed to read a conf file */
|
||||
<a name="VIR_ERR_PARSE_FAILED">VIR_ERR_PARSE_FAILED</a> = 32 /* failed to parse a conf file */
|
||||
<a name="VIR_ERR_CONF_SYNTAX">VIR_ERR_CONF_SYNTAX</a> = 33 /* failed to parse the syntax of a conf file */
|
||||
<a name="VIR_ERR_WRITE_FAILED">VIR_ERR_WRITE_FAILED</a> = 34 /* failed to write a conf file */
|
||||
<a name="VIR_ERR_XML_DETAIL">VIR_ERR_XML_DETAIL</a> = 35 /* detail of an XML error */
|
||||
<a name="VIR_ERR_INVALID_NETWORK">VIR_ERR_INVALID_NETWORK</a> = 36 /* invalid network object */
|
||||
<a name="VIR_ERR_NETWORK_EXIST">VIR_ERR_NETWORK_EXIST</a> = 37 /* the network already exist */
|
||||
<a name="VIR_ERR_SYSTEM_ERROR">VIR_ERR_SYSTEM_ERROR</a> = 38 /* general system call failure */
|
||||
<a name="VIR_ERR_RPC">VIR_ERR_RPC</a> = 39 /* some sort of RPC error */
|
||||
<a name="VIR_ERR_GNUTLS_ERROR">VIR_ERR_GNUTLS_ERROR</a> = 40 /* error from a GNUTLS call */
|
||||
<a name="VIR_WAR_NO_NETWORK">VIR_WAR_NO_NETWORK</a> = 41 /* failed to start network */
|
||||
<a name="VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a> = 42 /* domain not found or unexpectedly disappeared */
|
||||
<a name="VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> = 43 /* network not found */
|
||||
<a name="VIR_ERR_INVALID_MAC">VIR_ERR_INVALID_MAC</a> = 44 /* invalid MAC address */
|
||||
<a name="VIR_ERR_AUTH_FAILED">VIR_ERR_AUTH_FAILED</a> = 45 /* authentication failed */
|
||||
<a name="VIR_ERR_INVALID_STORAGE_POOL">VIR_ERR_INVALID_STORAGE_POOL</a> = 46 /* invalid storage pool object */
|
||||
<a name="VIR_ERR_INVALID_STORAGE_VOL">VIR_ERR_INVALID_STORAGE_VOL</a> = 47 /* invalid storage vol object */
|
||||
<a name="VIR_WAR_NO_STORAGE">VIR_WAR_NO_STORAGE</a> = 48 /* failed to start storage */
|
||||
<a name="VIR_ERR_NO_STORAGE_POOL">VIR_ERR_NO_STORAGE_POOL</a> = 49 /* storage pool not found */
|
||||
<a name="VIR_ERR_NO_STORAGE_VOL">VIR_ERR_NO_STORAGE_VOL</a> = 50 /* storage pool not found */
|
||||
<a name="VIR_WAR_NO_NODE">VIR_WAR_NO_NODE</a> = 51 /* failed to start node driver */
|
||||
<a name="VIR_ERR_INVALID_NODE_DEVICE">VIR_ERR_INVALID_NODE_DEVICE</a> = 52 /* invalid node device object */
|
||||
<a name="VIR_ERR_NO_NODE_DEVICE">VIR_ERR_NO_NODE_DEVICE</a> = 53 /* node device not found */
|
||||
<a name="VIR_ERR_NO_SECURITY_MODEL">VIR_ERR_NO_SECURITY_MODEL</a> = 54 /* security model not found */
|
||||
<a name="VIR_ERR_OPERATION_INVALID">VIR_ERR_OPERATION_INVALID</a> = 55 /* operation is not applicable at this time */
|
||||
<a name="VIR_WAR_NO_INTERFACE">VIR_WAR_NO_INTERFACE</a> = 56 /* failed to start interface driver */
|
||||
<a name="VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> = 57 /* interface driver not running */
|
||||
<a name="VIR_ERR_INVALID_INTERFACE">VIR_ERR_INVALID_INTERFACE</a> = 58 /* invalid interface object */
|
||||
<a name="VIR_ERR_MULTIPLE_INTERFACES">VIR_ERR_MULTIPLE_INTERFACES</a> = 59 /* more than one matching interface found */
|
||||
<a name="VIR_WAR_NO_SECRET">VIR_WAR_NO_SECRET</a> = 60 /* failed to start secret storage */
|
||||
<a name="VIR_ERR_INVALID_SECRET">VIR_ERR_INVALID_SECRET</a> = 61 /* invalid secret */
|
||||
<a name="VIR_ERR_NO_SECRET">VIR_ERR_NO_SECRET</a> = 62 /* secret not found */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorPtr">Typedef </a>virErrorPtr</h3><pre class="programlisting"><a href="libvirt-virterror.html#virError">virError</a> * virErrorPtr;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorFunc"/>Function type virErrorFunc</h3><pre class="programlisting">void virErrorFunc (void * userData, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> error)<br/>
|
||||
</pre><p>Signature of a function to use when there is an error raised by the library.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>user provided data for the error callback</td></tr><tr><td><span class="term"><i><tt>error</tt></i>:</span></td><td>the error being raised.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnCopyLastError"/>virConnCopyLastError ()</h3><pre class="programlisting">int virConnCopyLastError (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to)<br/>
|
||||
</pre><p>Copy the content of the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability. One will need to free the result with virResetError()</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>target to receive the copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no error was found and the error code otherwise and -1 in case of parameter error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnGetLastError"/>virConnGetLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virConnGetLastError (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
|
||||
</pre><p>Provide a pointer to the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the last error or NULL if none occurred.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnResetLastError"/>virConnResetLastError ()</h3><pre class="programlisting">void virConnResetLastError (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
|
||||
</pre><p>The error object is kept in thread local storage, so separate threads can safely access this concurrently. Reset the last error caught on that connection</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnSetErrorFunc"/>virConnSetErrorFunc ()</h3><pre class="programlisting">void virConnSetErrorFunc (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
|
||||
</pre><p>Set a connection error handling function, if @handler is NULL it will reset to default which is to pass error back to the global library handler.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>pointer to the user data provided in the handler callback</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the function to get called in case of error or NULL</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virCopyLastError"/>virCopyLastError ()</h3><pre class="programlisting">int virCopyLastError (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to)<br/>
|
||||
</pre><p>Copy the content of the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently. One will need to free the result with virResetError()</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>target to receive the copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no error was found and the error code otherwise and -1 in case of parameter error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDefaultErrorFunc"/>virDefaultErrorFunc ()</h3><pre class="programlisting">void virDefaultErrorFunc (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
|
||||
</pre><p>Default routine reporting an error to stderr.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>pointer to the error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virFreeError"/>virFreeError ()</h3><pre class="programlisting">void virFreeError (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
|
||||
</pre><p>Resets and frees the given error.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>error to free</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virGetLastError"/>virGetLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virGetLastError (void)<br/>
|
||||
</pre><p>Provide a pointer to the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the last error or NULL if none occurred.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virResetError"/>virResetError ()</h3><pre class="programlisting">void virResetError (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
|
||||
</pre><p>Reset the error being pointed to</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>pointer to the <a href="libvirt-virterror.html#virError">virError</a> to clean up</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virResetLastError"/>virResetLastError ()</h3><pre class="programlisting">void virResetLastError (void)<br/>
|
||||
</pre><p>Reset the last error caught at the library level. The error object is kept in thread local storage, so separate threads can safely access this concurrently, only resetting their own error object.</p>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virSaveLastError"/>virSaveLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virSaveLastError (void)<br/>
|
||||
</pre><p>Save the last error into a new error object.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the copied error or NULL if allocation failed. It is the caller's responsibility to free the error with virFreeError().</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virSetErrorFunc"/>virSetErrorFunc ()</h3><pre class="programlisting">void virSetErrorFunc (void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
|
||||
</pre><p>Set a library global error handling function, if @handler is NULL, it will reset to default printing on stderr. The error raised there are those for which no handler at the connection level could caught.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>pointer to the user data provided in the handler callback</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the function to get called in case of error or NULL</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
107
docs/docs.html
107
docs/docs.html
@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from docs.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Documentation</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Documentation</span>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Documentation</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,148 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from downloads.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Downloads</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Downloads</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Downloads</h1>
|
||||
<h2>Official Releases</h2>
|
||||
<p>
|
||||
The latest versions of the libvirt C library can be downloaded from:
|
||||
</p>
|
||||
<ul><li><a href="ftp://libvirt.org/libvirt/">libvirt.org FTP server</a></li><li><a href="http://libvirt.org/sources/">libvirt.org HTTP server</a></li></ul>
|
||||
<h2>Hourly development snapshots</h2>
|
||||
<p>
|
||||
Once an hour, an automated snapshot is made from the git server
|
||||
source tree. These snapshots should be usable, but we make no guarantees
|
||||
about their stability:
|
||||
</p>
|
||||
<ul><li><a href="ftp://libvirt.org/libvirt/libvirt-git-snapshot.tar.gz">libvirt.org FTP server</a></li><li><a href="http://libvirt.org/sources/libvirt-git-snapshot.tar.gz">libvirt.org HTTP server</a></li></ul>
|
||||
<h2>GIT source repository</h2>
|
||||
<p> Libvirt code source is now maintained in a <a href="http://git-scm.com/">git</a> repository available on
|
||||
<a href="http://libvirt.org/git/">libvirt.org</a>:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
git clone git://libvirt.org/libvirt.git
|
||||
</pre>
|
||||
<p>
|
||||
It can also be browsed at
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
<a href="http://libvirt.org/git/?p=libvirt.git;a=summary">http://libvirt.org/git/?p=libvirt.git;a=summary</a>
|
||||
</pre>
|
||||
<h2>CVS repository access (Deprecated) </h2>
|
||||
<p>
|
||||
The master source repository used to be under <a href="http://ximbiot.com/cvs/cvshome/docs/">CVS</a>
|
||||
with anonymous access at:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
# cvs -d :pserver:anoncvs@libvirt.org:2401/data/cvs co libvirt
|
||||
</pre>
|
||||
<p> The server is maintainened temporarilly for existing uses, but all
|
||||
changes are only commited to git now and we expect to deprecate the CVS
|
||||
server during summer 2009. </p>
|
||||
<h2>Building from a source code checkout</h2>
|
||||
<p> The libvirt build process uses GNU autotools, so after obtaining a
|
||||
checkout it is necessary to generate the configure script and Makefile.in
|
||||
templates using the <code>autogen.sh</code> command, passing the extra
|
||||
arguments as as for configure. As an example, to do a complete build and
|
||||
install it into your home directory run:</p>
|
||||
<pre>
|
||||
|
||||
./autogen.sh --prefix=$HOME/usr
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
<h2>GIT repository mirror</h2>
|
||||
<p>
|
||||
Jim Mereying was maintaining a CVS to git mirror on
|
||||
<a href="http://git.et.redhat.com/?p=libvirt.git">git.et.redhat.com</a>.
|
||||
Existing users should migrate to the new libvirt.org git server, as the
|
||||
old one is now deprecated. For the sake of old links including now-
|
||||
rewritten SHA1s, we'll leave the old repository on-line for some time.
|
||||
It is available as:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
git clone git://git.et.redhat.com/libvirt.git
|
||||
</pre>
|
||||
<p>
|
||||
It can also be browsed at
|
||||
</p>
|
||||
<pre>
|
||||
<a href="http://git.et.redhat.com/?p=libvirt.git;a=summary">http://git.et.redhat.com/?p=libvirt.git;a=summary</a>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -60,7 +60,7 @@
|
||||
<p> The libvirt build process uses GNU autotools, so after obtaining a
|
||||
checkout it is necessary to generate the configure script and Makefile.in
|
||||
templates using the <code>autogen.sh</code> command, passing the extra
|
||||
arguments as as for configure. As an example, to do a complete build and
|
||||
arguments as for configure. As an example, to do a complete build and
|
||||
install it into your home directory run:</p>
|
||||
<pre>
|
||||
|
||||
|
@ -1,160 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drivers.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Internal drivers</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Drivers</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Internal drivers</h1>
|
||||
<p>
|
||||
The libvirt public API delegates its implementation to one or
|
||||
more internal drivers, depending on the <a href="uri.html">connection URI</a>
|
||||
passed when initializing the library. There is always a hypervisor driver
|
||||
active, and if the libvirt daemon is available there will usually be a
|
||||
network and storage driver active.
|
||||
</p>
|
||||
<h2>Hypervisor drivers</h2>
|
||||
<p>
|
||||
The hypervisor drivers currently supported by libvirt are:
|
||||
</p>
|
||||
<ul><li><strong><a href="drvxen.html">Xen</a></strong></li><li><strong><a href="drvqemu.html">QEMU</a></strong></li><li><strong><a href="drvlxc.html">LXC</a></strong></li><li><strong><a href="drvtest.html">Test</a></strong></li><li><strong><a href="drvopenvz.html">OpenVZ</a></strong></li><li><strong><a href="drvvbox.html">VirtualBox</a></strong></li><li><strong><a href="drvone.html">OpenNebula</a></strong></li></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
223
docs/drvlxc.html
223
docs/drvlxc.html
@ -1,223 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvlxc.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: LXC container driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Linux Container</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>LXC container driver</h1>
|
||||
<p>
|
||||
The libvirt LXC driver manages "Linux Containers". Containers are sets of processes
|
||||
with private namespaces which can (but don't always) look like separate machines, but
|
||||
do not have their own OS. Here are two example configurations. The first is a very
|
||||
light-weight "application container" which does not have it's own root image. You would
|
||||
start it using
|
||||
</p>
|
||||
<h3>Example config version 1</h3>
|
||||
<p></p>
|
||||
<pre>
|
||||
<domain type='lxc'>
|
||||
<name>vm1</name>
|
||||
<memory>500000</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/bin/sh</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
The next example assumes there is a private root filesystem
|
||||
(perhaps hand-crafted using busybox, or installed from media,
|
||||
debootstrap, whatever) under /opt/vm-1-root:
|
||||
</p>
|
||||
<p></p>
|
||||
<pre>
|
||||
<domain type='lxc'>
|
||||
<name>vm1</name>
|
||||
<memory>32768</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/init</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<filesystem type='mount'>
|
||||
<source dir='/opt/vm-1-root'/>
|
||||
<target dir='/'/>
|
||||
</filesystem>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
In both cases, you can define and start a container using:</p>
|
||||
<pre>
|
||||
virsh --connect lxc:/// define v1.xml
|
||||
virsh --connect lxc:/// start v1.xml
|
||||
</pre>
|
||||
<pre>
|
||||
virsh --connect lxc:/// console v1
|
||||
</pre>
|
||||
<p>Now doing 'ps -ef' will only show processes in the container, for
|
||||
instance.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
234
docs/drvone.html
234
docs/drvone.html
@ -1,234 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvone.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: OpenNebula Virtual Infrastructure Manager driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">OpenNebula</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>OpenNebula Virtual Infrastructure Manager driver</h1>
|
||||
<p><a name="toc" id="toc"></a><a href="http://opennebula.org/">OpenNebula</a>
|
||||
is a Virtual Infrastructure Manager that controls Virtual Machines (VM) in a pool of distributed resources
|
||||
by orchestrating network, storage and virtualization technologies. The OpenNebula driver lets you manage your private or hybrid (<a href="http://aws.amazon.com/ec2/">Amazon EC2</a> or <a href="http://www.elastichosts.com/">Elastic Hosts</a> based) cloud using a standard libvirt interface, including the API as well as the related
|
||||
tools and VM description files.</p>
|
||||
<h2>
|
||||
<a name="prereq" id="prereq"></a>Deployment pre-requisites</h2>
|
||||
<ul><li>
|
||||
<p style="margin-bottom: 0in">A working OpenNebula installation,
|
||||
version 1.2 or higher.
|
||||
</p>
|
||||
</li></ul>
|
||||
<h2>
|
||||
<a name="uris" id="uris"></a>Connections to OpenNebula driver</h2>
|
||||
<p>The Uri of the driver protocol is "one". Some example
|
||||
connection Uris for the driver are:
|
||||
</p>
|
||||
<pre> one:/// (local access)
|
||||
one+unix:/// (local access)
|
||||
one://example.com/ (remote access)
|
||||
one+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
one+ssh://user@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig"></a>Example domain XML config</h2>
|
||||
<p>There are some limitations on the XML attributes that may be
|
||||
specified when interfacing OpenNebula. The following xml example
|
||||
details the attributes and options supported by the OpenNebula
|
||||
driver:</p>
|
||||
<h3>Paravirtualized guest direct kernel boot
|
||||
</h3>
|
||||
<pre> <domain type='one'>
|
||||
<name>vm01</name>
|
||||
<memory>32768</memory>
|
||||
<vcpu>1</vcpu>
|
||||
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/boot/vmlinuz-2.6.24-17-xen</kernel>
|
||||
<initrd>/boot/initrd.img-2.6.24-17-xen</initrd>
|
||||
<cmdline></cmdline>
|
||||
<root>sda1</root>
|
||||
</os>
|
||||
|
||||
<devices>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/disk.img'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/swap.img'/>
|
||||
<target dev='sda2'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/images/iso/cdrom.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
|
||||
|
||||
<!--BRIDGE-->
|
||||
<interface type='bridge'>
|
||||
<source bridge='eth0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
</interface>
|
||||
|
||||
<!--ONE Network-->
|
||||
<interface type='network'>
|
||||
<source network='onenetwork'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
<b>Note:</b> The "<interface type='network'>" will
|
||||
attach the interface to a previously configured network (named
|
||||
<tt>onenetwork</tt>) within the <a href="http://opennebula.org/">OpenNebula</a> system, typically with the
|
||||
<tt>onevnet</tt> CLI command.</p>
|
||||
<p><b>Note</b>: OpenNebula supports the simultaneous use of different hypervisors, so you can specify any os type (linux or hvm) supported by your cluster.
|
||||
</p>
|
||||
<h2>Links</h2>
|
||||
<ul><li><a href="http://www.opennebula.org/doku.php?id=documentation">OpenNebula Documentation</a>
|
||||
</li><li><a href="http://www.opennebula.org/doku.php?id=documentation:rel1.2:ug">OpenNebula User Guide</a>
|
||||
</li></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,236 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvopenvz.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: OpenVZ container driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">OpenVZ</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>OpenVZ container driver</h1>
|
||||
<p>
|
||||
The OpenVZ driver for libvirt allows use and management of container
|
||||
based virtualization on a Linux host OS. Prior to using the OpenVZ
|
||||
driver, the OpenVZ enabled kernel must be installed & booted, and the
|
||||
OpenVZ userspace tools installed. The libvirt driver has been tested
|
||||
with OpenVZ 3.0.22, but other 3.0.x versions should also work without
|
||||
undue trouble.
|
||||
</p>
|
||||
<h2>Connections to OpenVZ driver</h2>
|
||||
<p>
|
||||
The libvirt OpenVZ driver is a single-instance privileged driver,
|
||||
with a driver name of 'openvz'. Some example conection URIs for
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
openvz:///system (local access)
|
||||
openvz+unix:///system (local access)
|
||||
openvz://example.com/system (remote access, TLS/x509)
|
||||
openvz+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
openvz+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>Notes on bridged networking</h2>
|
||||
<p>
|
||||
Bridged networking enables a guest domain (ie container) to have its
|
||||
network interface connected directly to the host's physical LAN. Before
|
||||
this can be used there are a couple of configuration pre-requisites for
|
||||
the host OS.
|
||||
</p>
|
||||
<h3>Host network devices</h3>
|
||||
<p>
|
||||
One or more of the physical devices must be attached to a bridge. The
|
||||
process for this varies according to the operating system in use, so
|
||||
for up to date notes consult the <a href="http://wiki.libvirt.org">Wiki</a>
|
||||
or your operating system's networking documentation. The basic idea is
|
||||
that the host OS should end up with a bridge device "br0" containing a
|
||||
physical device "eth0", or a bonding device "bond0".
|
||||
</p>
|
||||
<h3>OpenVZ tools configuration</h3>
|
||||
<p>
|
||||
OpenVZ releases later than 3.0.23 ship with a standard network device
|
||||
setup script that is able to setup bridging, named
|
||||
<code>/usr/sbin/vznetaddbr</code>. For releases prior to 3.0.23, this
|
||||
script must be created manually by the host OS adminstrator. The
|
||||
simplest way is to just download the latest version of this script
|
||||
from a newer OpenVZ release, or upstream source repository. Then
|
||||
a generic configuration file <code>/etc/vz/vznetctl.conf</code>
|
||||
must be created containing
|
||||
</p>
|
||||
<pre>
|
||||
#!/bin/bash
|
||||
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
|
||||
</pre>
|
||||
<p>
|
||||
The host OS is now ready to allow bridging of guest containers, which
|
||||
will work whether the container is started with libvirt, or OpenVZ
|
||||
tools.
|
||||
</p>
|
||||
<h2>Example guest domain XML configuration</h2>
|
||||
<p>
|
||||
The current libvirt OpenVZ driver has a restriction that the
|
||||
domain names must match the OpenVZ container VEID, which by
|
||||
convention start at 100, and are incremented from there. The
|
||||
choice of OS template to use inside the container is determined
|
||||
by the <code>filesystem</code> tag, and the template source name
|
||||
matches the templates known to OpenVZ tools.
|
||||
</p>
|
||||
<pre>
|
||||
<domain type='openvz' id='104'>
|
||||
<name>104</name>
|
||||
<uuid>86c12009-e591-a159-6e9f-91d18b85ef78</uuid>
|
||||
<vcpu>3</vcpu>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/sbin/init</init>
|
||||
</os>
|
||||
<devices>
|
||||
<filesystem type='template'>
|
||||
<source name='fedora-9-i386-minimal'/>
|
||||
<target dir='/'/>
|
||||
</filesystem>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:18:51:5b:ea:bf'/>
|
||||
<source bridge='br0'/>
|
||||
<target dev='veth101.0'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,628 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvqemu.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: QEMU/KVM hypervisor driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">QEMU / KVM</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>QEMU/KVM hypervisor driver</h1>
|
||||
<ul><li>
|
||||
<a href="#prereq">Deployment pre-requisites</a>
|
||||
</li><li>
|
||||
<a href="#uris">Connections to QEMU driver</a>
|
||||
</li><li>
|
||||
<a href="#security">Driver security architecture</a>
|
||||
<ul><li>
|
||||
<a href="#securitydriver">Driver instances</a>
|
||||
</li><li>
|
||||
<a href="#securitydac">POSIX users/groups</a>
|
||||
</li><li>
|
||||
<a href="#securitycap">Linux process capabilities</a>
|
||||
</li><li>
|
||||
<a href="#securityselinux">SELinux basic confinement</a>
|
||||
</li><li>
|
||||
<a href="#securitysvirt">SELinux sVirt confinement</a>
|
||||
</li><li>
|
||||
<a href="#securityacl">Cgroups device ACLs</a>
|
||||
</li></ul>
|
||||
</li><li>
|
||||
<a href="#imex">Import and export of libvirt domain XML configs</a>
|
||||
<ul><li>
|
||||
<a href="#xmlimport">Converting from QEMU args to domain XML</a>
|
||||
</li><li>
|
||||
<a href="#xmlexport">Converting from domain XML to QEMU args</a>
|
||||
</li></ul>
|
||||
</li><li>
|
||||
<a href="#xmlconfig">Example domain XML config</a>
|
||||
</li></ul>
|
||||
<p>
|
||||
The libvirt QEMU driver can manage any QEMU emulator from version 0.8.1
|
||||
or later. It can also manage anything that provides the same QEMU command
|
||||
line syntax and monitor interaction. This includes KVM, and Xenner.
|
||||
</p>
|
||||
<h2>
|
||||
<a name="prereq" id="prereq">Deployment pre-requisites</a>
|
||||
</h2>
|
||||
<ul><li>
|
||||
<strong>QEMU emulators</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu</code>, <code>qemu-system-x86_64</code>,
|
||||
<code>qemu-system-mips</code>,<code>qemu-system-mipsel</code>,
|
||||
<code>qemu-system-sparc</code>,<code>qemu-system-ppc</code>. The results
|
||||
of this can be seen from the capabilities XML output.
|
||||
</li><li>
|
||||
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then KVM fullyvirtualized, hardware accelerated
|
||||
guests will be available.
|
||||
</li><li>
|
||||
<strong>Xenner hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>xenner</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then Xen paravirtualized guests can be run using
|
||||
the KVM hardware acceleration.
|
||||
</li></ul>
|
||||
<h2>
|
||||
<a name="uris" id="uris">Connections to QEMU driver</a>
|
||||
</h2>
|
||||
<p>
|
||||
The libvirt QEMU driver is a multi-instance driver, providing a single
|
||||
system wide privileged driver (the "system" instance), and per-user
|
||||
unprivileged drivers (the "session" instance). The of the driver protocol
|
||||
is "qemu". Some example conection URIs for the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
qemu:///session (local access to per-user instance)
|
||||
qemu+unix:///session (local access to per-user instance)
|
||||
|
||||
qemu:///system (local access to system instance)
|
||||
qemu+unix:///system (local access to system instance)
|
||||
qemu://example.com/system (remote access, TLS/x509)
|
||||
qemu+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
qemu+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="security" id="security">Driver security architecture</a>
|
||||
</h2>
|
||||
<p>
|
||||
There are multiple layers to security in the QEMU driver, allowing for
|
||||
flexibility in the use of QEMU based virtual machines.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="securitydriver" id="securitydriver">Driver instances</a>
|
||||
</h3>
|
||||
<p>
|
||||
As explained above there are two ways to access the QEMU driver
|
||||
in libvirt. The "qemu:///session" family of URIs connect to a
|
||||
libvirtd instance running as the same user/group ID as the client
|
||||
application. Thus the QEMU instances spawned from this driver will
|
||||
share the same privileges as the client application. The intended
|
||||
use case for this driver is desktop virtualization, with virtual
|
||||
machines storing their disk imags in the user's home directory and
|
||||
being managed from the local desktop login session.
|
||||
</p>
|
||||
<p>
|
||||
The "qemu:///system" family of URIs connect to a
|
||||
libvirtd instance running as the privileged system account 'root'.
|
||||
Thus the QEMU instances spawned from this driver may have much
|
||||
higher privileges than the client application managing them.
|
||||
The intended use case for this driver is server virtualization,
|
||||
where the virtual machines may need to be connected to host
|
||||
resources (block, PCI, USB, network devices) whose access requires
|
||||
elevated privileges.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="securitydac" id="securitydac">POSIX users/groups</a>
|
||||
</h3>
|
||||
<p>
|
||||
In the "session" instance, the POSIX users/groups model restricts QEMU
|
||||
virtual machines (and libvirtd in general) to only have access to resources
|
||||
with the same user/group ID as the client application. There is no
|
||||
finer level of configuration possible for the "session" instances.
|
||||
</p>
|
||||
<p>
|
||||
In the "system" instance, libvirt releases from 0.7.0 onwards allow
|
||||
control over the user/group that the QEMU virtual machines are run
|
||||
as. A build of libvirt with no configuration parameters set will
|
||||
still run QEMU processes as root:root. It is possible to change
|
||||
this default by using the --with-qemu-user=$USERNAME and
|
||||
--with-qemu-group=$GROUPNAME arguments to 'configure' during
|
||||
build. It is strongly recommended that vendors build with both
|
||||
of these arguments set to 'qemu'. Regardless of this build time
|
||||
default, administrators can set a per-host default setting in
|
||||
the <code>/etc/libvirt/qemu.conf</code> configuration file via
|
||||
the <code>user=$USERNAME</code> and <code>group=$GROUPNAME</code>
|
||||
parameters. When a non-root user or group is configured, the
|
||||
libvirt QEMU driver will change uid/gid to match immediately
|
||||
before executing the QEMU binary for a virtual machine.
|
||||
</p>
|
||||
<p>
|
||||
If QEMU virtual machines from the "system" instance are being
|
||||
run as non-root, there will be greater restrictions on what
|
||||
host resources the QEMU process will be able to access. The
|
||||
libvirtd daemon will attempt to manage permissions on resources
|
||||
to minimise the likelihood of unintentional security denials,
|
||||
but the administrator / application developer must be aware of
|
||||
some of the consequences / restrictions.
|
||||
</p>
|
||||
<ul><li>
|
||||
<p>
|
||||
The directories <code>/var/run/libvirt/qemu/</code>,
|
||||
<code>/var/lib/libvirt/qemu/</code> and
|
||||
<code>/var/cache/libvirt/qemu/</code> must all have their
|
||||
ownership set to match the user / group ID that QEMU
|
||||
guests will be run as. If the vendor has set a non-root
|
||||
user/group for the QEMU driver at build time, the
|
||||
permissions should be set automatically at install time.
|
||||
If a host administrator customizes user/group in
|
||||
<code>/etc/libvirt/qemu.conf</code>, they will need to
|
||||
manually set the ownership on these directories.
|
||||
</p>
|
||||
</li><li>
|
||||
<p>
|
||||
When attaching USB and PCI devices to a QEMU guest,
|
||||
QEMU will need to access files in <code>/dev/bus/usb</code>
|
||||
and <code>/sys/bus/pci/devices</code> respectively. The libvirtd daemon
|
||||
will automatically set the ownership on specific devices
|
||||
that are assigned to a guest at start time. There should
|
||||
not be any need for administrator changes in this respect.
|
||||
</p>
|
||||
</li><li>
|
||||
<p>
|
||||
Any files/devices used as guest disk images must be
|
||||
accessible to the user/group ID that QEMU guests are
|
||||
configured to run as. The libvirtd daemon will automatically
|
||||
set the ownership of the file/device path to the correct
|
||||
user/group ID. Applications / administrators must be aware
|
||||
though that the parent directory permissions may still
|
||||
deny access. The directories containing disk images
|
||||
must either have their ownership set to match the user/group
|
||||
configured for QEMU, or their UNIX file permissions must
|
||||
have the 'execute/search' bit enabled for 'others'.
|
||||
</p>
|
||||
<p>
|
||||
The simplest option is the latter one, of just enabling
|
||||
the 'execute/search' bit. For any directory to be used
|
||||
for storing disk images, this can be achieved by running
|
||||
the following command on the directory itself, and any
|
||||
parent directories
|
||||
</p>
|
||||
<pre>
|
||||
chmod o+x /path/to/directory
|
||||
</pre>
|
||||
<p>
|
||||
In particular note that if using the "system" instance
|
||||
and attempting to store disk images in a user home
|
||||
directory, the default permissions on $HOME are typically
|
||||
too restrictive to allow access.
|
||||
</p>
|
||||
</li></ul>
|
||||
<h3>
|
||||
<a name="securitycap" id="securitycap">Linux process capabilities</a>
|
||||
</h3>
|
||||
<p>
|
||||
The libvirt QEMU driver has a build time option allowing it to use
|
||||
the <a href="http://people.redhat.com/sgrubb/libcap-ng/index.html">libcap-ng</a>
|
||||
library to manage process capabilities. If this build option is
|
||||
enabled, then the QEMU driver will use this to ensure that all
|
||||
process capabilities are dropped before executing a QEMU virtual
|
||||
machine. Process capabilities are what gives the 'root' account
|
||||
its high power, in particular the CAP_DAC_OVERRIDE capability
|
||||
is what allows a process running as 'root' to access files owned
|
||||
by any user.
|
||||
</p>
|
||||
<p>
|
||||
If the QEMU driver is configured to run virtual machines as non-root,
|
||||
then they will already loose all their process capabilities at time
|
||||
of startup. The Linux capability feature is thus aimed primarily at
|
||||
the scenario where the QEMU processes are running as root. In this
|
||||
case, before launching a QEMU virtual machine, libvirtd will use
|
||||
libcap-ng APIs to drop all process capabilities. It is important
|
||||
for administrators to note that this implies the QEMU process will
|
||||
<strong>only</strong> be able to access files owned by root, and
|
||||
not files owned by any other user.
|
||||
</p>
|
||||
<p>
|
||||
Thus, if a vendor / distributor has configured their libvirt package
|
||||
to run as 'qemu' by default, a number of changes will be required
|
||||
before an administrator can change a host to run guests as root.
|
||||
In particular it will be neccessary to change ownership on the
|
||||
directories <code>/var/run/libvirt/qemu/</code>,
|
||||
<code>/var/lib/libvirt/qemu/</code> and
|
||||
<code>/var/cache/libvirt/qemu/</code> back to root, in addition
|
||||
to changing the <code>/etc/libvirt/qemu.conf</code> settings.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="securityselinux" id="securityselinux">SELinux basic confinement</a>
|
||||
</h3>
|
||||
<p>
|
||||
The basic SELinux protection for QEMU virtual machines is intended to
|
||||
protect the host OS from a compromised virtual machine process. There
|
||||
is no protection between guests.
|
||||
</p>
|
||||
<p>
|
||||
In the basic model, all QEMU virtual machines run under the confined
|
||||
domain <code>root:system_r:qemu_t</code>. It is required that any
|
||||
disk image assigned to a QEMU virtual machine is labelled with
|
||||
<code>system_u:object_r:virt_image_t</code>. In a default deployment,
|
||||
package vendors/distributor will typically ensure that the directory
|
||||
<code>/var/lib/libvirt/images</code> has this label, such that any
|
||||
disk images created in this directory will automatically inherit the
|
||||
correct labelling. If attempting to use disk images in another
|
||||
location, the user/administrator must ensure the directory has be
|
||||
given this requisite label. Likewise physical block devices must
|
||||
be labelled <code>system_u:object_r:virt_image_t</code>.
|
||||
</p>
|
||||
<p>
|
||||
Not all filesystems allow for labelling of individual files. In
|
||||
particular NFS, VFat and NTFS have no support for labelling. In
|
||||
these cases administrators must use the 'context' option when
|
||||
mounting the filesystem to set the default label to
|
||||
<code>system_u:object_r:virt_image_t</code>. In the case of
|
||||
NFS, there is an alternative option, of enabling the <code>virt_use_nfs</code>
|
||||
SELinux boolean.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="securitysvirt" id="securitysvirt">SELinux sVirt confinement</a>
|
||||
</h3>
|
||||
<p>
|
||||
The SELinux sVirt protection for QEMU virtual machines builds to the
|
||||
basic level of protection, to also allow individual guests to be
|
||||
protected from each other.
|
||||
</p>
|
||||
<p>
|
||||
In the sVirt model, each QEMU virtual machine runs under its own
|
||||
confined domain, which is based on <code>system_u:system_r:svirt_t:s0</code>
|
||||
with a unique category appended, eg, <code>system_u:system_r:svirt_t:s0:c34,c44</code>.
|
||||
The rules are setup such that a domain can only access files which are
|
||||
labelled with the matching category level, eg
|
||||
<code>system_u:object_r:svirt_image_t:s0:c34,c44</code>. This prevents one
|
||||
QEMU process accessing any file resources that are prevent to another QEMU
|
||||
process.
|
||||
</p>
|
||||
<p>
|
||||
There are two ways of assigning labels to virtual machines under sVirt.
|
||||
In the default setup, if sVirt is enabled, guests will get an automatically
|
||||
assigned unique label each time they are booted. The libvirtd daemon will
|
||||
also automatically relabel exclusive access disk images to match this
|
||||
label. Disks that are marked as <shared> will get a generic
|
||||
label <code>system_u:system_r:svirt_image_t:s0</code> allowing all guests
|
||||
read/write access them, while disks marked as <readonly> will
|
||||
get a generic label <code>system_u:system_r:svirt_content_t:s0</code>
|
||||
which allows all guests read-only access.
|
||||
</p>
|
||||
<p>
|
||||
With statically assigned labels, the application should include the
|
||||
desired guest and file labels in the XML at time of creating the
|
||||
guest with libvirt. In this scenario the application is responsible
|
||||
for ensuring the disk images & similar resources are suitably
|
||||
labelled to match, libvirtd will not attempt any relabelling.
|
||||
</p>
|
||||
<p>
|
||||
If the sVirt security model is active, then the node capabilities
|
||||
XML will include its details. If a virtual machine is currently
|
||||
protected by the security model, then the guest XML will include
|
||||
its assigned labels. If enabled at compile time, the sVirt security
|
||||
model will always be activated if SELinux is available on the host
|
||||
OS. To disable sVirt, and revert to the basic level of SELinux
|
||||
protection (host protection only), the <code>/etc/libvirt/qemu.conf</code>
|
||||
file can be used to change the setting to <code>security_driver="none"</code>
|
||||
</p>
|
||||
<h3>
|
||||
<a name="securityacl" id="securityacl">Cgroups device ACLs</a>
|
||||
</h3>
|
||||
<p>
|
||||
Recent Linux kernels have a capability known as "cgroups" which is used
|
||||
for resource management. It is implemented via a number of "controllers",
|
||||
each controller covering a specific task/functional area. One of the
|
||||
available controllers is the "devices" controller, which is able to
|
||||
setup whitelists of block/character devices that a cgroup should be
|
||||
allowed to access. If the "devices" controller is mounted on a host,
|
||||
then libvirt will automatically create a dedicated cgroup for each
|
||||
QEMU virtual machine and setup the device whitelist so that the QEMU
|
||||
process can only access shared devices, and explicitly disks images
|
||||
backed by block devices.
|
||||
</p>
|
||||
<p>
|
||||
The list of shared devices a guest is allowed access to is
|
||||
</p>
|
||||
<pre>
|
||||
/dev/null, /dev/full, /dev/zero,
|
||||
/dev/random, /dev/urandom,
|
||||
/dev/ptmx, /dev/kvm, /dev/kqemu,
|
||||
/dev/rtc, /dev/hpet, /dev/net/tun
|
||||
</pre>
|
||||
<p>
|
||||
In the event of unanticipated needs arising, this can be customized
|
||||
via the <code>/etc/libvirt/qemu.conf</code> file.
|
||||
To mount the cgroups device controller, the following command
|
||||
should be run as root, prior to starting libvirtd
|
||||
</p>
|
||||
<pre>
|
||||
mkdir /dev/cgroup
|
||||
mount -t cgroup none /dev/cgroup -o devices
|
||||
</pre>
|
||||
<p>
|
||||
libvirt will then place each virtual machine in a cgroup at
|
||||
<code>/dev/cgroup/libvirt/qemu/$VMNAME/</code>
|
||||
</p>
|
||||
<h2>
|
||||
<a name="imex" id="imex">Import and export of libvirt domain XML configs</a>
|
||||
</h2>
|
||||
<p>The QEMU driver currently supports a single native
|
||||
config format known as <code>qemu-argv</code>. The data for this format
|
||||
is expected to be a single line first a list of environment variables,
|
||||
then the QEMu binary name, finally followed by the QEMU command line
|
||||
arguments</p>
|
||||
<h3>
|
||||
<a name="xmlimport" id="xmlimport">Converting from QEMU args to domain XML</a>
|
||||
</h3>
|
||||
<p>
|
||||
The <code>virsh domxml-from-native</code> provides a way to convert an
|
||||
existing set of QEMU args into a guest description using libvirt Domain XML
|
||||
that can then be used by libvirt.
|
||||
</p>
|
||||
<pre>$ cat > demo.args <<EOF
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test \
|
||||
LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
|
||||
-nographic -monitor pty -no-acpi -boot c -hda \
|
||||
/dev/HostVG/QEMUGuest1 -net none -serial none \
|
||||
-parallel none -usb
|
||||
EOF
|
||||
$ virsh domxml-from-native qemu-argv demo.args
|
||||
<domain type='qemu'>
|
||||
<uuid>00000000-0000-0000-0000-000000000000</uuid>
|
||||
<memory>219136</memory>
|
||||
<currentMemory>219136</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>NB, don't include the literral \ in the args, put everything on one line</p>
|
||||
<h3>
|
||||
<a name="xmlexport" id="xmlexport">Converting from domain XML to QEMU args</a>
|
||||
</h3>
|
||||
<p>
|
||||
The <code>virsh domxml-to-native</code> provides a way to convert a
|
||||
guest description using libvirt Domain XML, into a set of QEMU args
|
||||
that can be run manually.
|
||||
</p>
|
||||
<pre>$ cat > demo.xml <<EOF
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219200</memory>
|
||||
<currentMemory>219200</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
||||
EOF
|
||||
$ virsh domxml-to-native qemu-argv demo.xml
|
||||
LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
|
||||
USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
|
||||
-no-kqemu -m 214 -smp 1 -name QEMUGuest1 -nographic \
|
||||
-monitor pty -no-acpi -boot c -drive \
|
||||
file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
|
||||
-serial none -parallel none -usb
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig">Example domain XML config</a>
|
||||
</h2>
|
||||
<h3>QEMU emulated guest on x86_64</h3>
|
||||
<pre><domain type='qemu'>
|
||||
<name>QEmu-fedora-i686</name>
|
||||
<uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219200</memory>
|
||||
<currentMemory>219200</currentMemory>
|
||||
<vcpu>2</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='cdrom'/>
|
||||
</os>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/home/user/boot.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/home/user/fedora.img'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>KVM hardware accelerated guest on i686</h3>
|
||||
<pre><domain type='kvm'>
|
||||
<name>demo2</name>
|
||||
<uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa0</uuid>
|
||||
<memory>131072</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="i686">hvm</type>
|
||||
</os>
|
||||
<clock sync="localtime"/>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-kvm</emulator>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/var/lib/libvirt/images/demo2.img'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
<mac address='24:42:53:21:52:45'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1' keymap='de'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>Xen paravirtualized guests with hardware acceleration</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -208,7 +208,7 @@
|
||||
Thus, if a vendor / distributor has configured their libvirt package
|
||||
to run as 'qemu' by default, a number of changes will be required
|
||||
before an administrator can change a host to run guests as root.
|
||||
In particular it will be neccessary to change ownership on the
|
||||
In particular it will be necessary to change ownership on the
|
||||
directories <code>/var/run/libvirt/qemu/</code>,
|
||||
<code>/var/lib/libvirt/qemu/</code> and
|
||||
<code>/var/cache/libvirt/qemu/</code> back to root, in addition
|
||||
@ -296,6 +296,73 @@
|
||||
file can be used to change the setting to <code>security_driver="none"</code>
|
||||
</p>
|
||||
|
||||
<h3><a name="securitysvirtaa">AppArmor sVirt confinement</a></h3>
|
||||
|
||||
<p>
|
||||
When using basic AppArmor protection for the libvirtd daemon and
|
||||
QEMU virtual machines, the intention is to protect the host OS
|
||||
from a compromised virtual machine process. There is no protection
|
||||
between guests.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The AppArmor sVirt protection for QEMU virtual machines builds on
|
||||
this basic level of protection, to also allow individual guests to
|
||||
be protected from each other.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the sVirt model, if a profile is loaded for the libvirtd daemon,
|
||||
then each <code>qemu:///system</code> QEMU virtual machine will have
|
||||
a profile created for it when the virtual machine is started if one
|
||||
does not already exist. This generated profile uses a profile name
|
||||
based on the UUID of the QEMU virtual machine and contains rules
|
||||
allowing access to only the files it needs to run, such as its disks,
|
||||
pid file and log files. Just before the QEMU virtual machine is
|
||||
started, the libvirtd daemon will change into this unique profile,
|
||||
preventing the QEMU process from accessing any file resources that
|
||||
are present in another QEMU process or the host machine.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The AppArmor sVirt implementation is flexible in that it allows an
|
||||
administrator to customize the template file in
|
||||
<code>/etc/apparmor.d/libvirt/TEMPLATE</code> for site-specific
|
||||
access for all newly created QEMU virtual machines. Also, when a new
|
||||
profile is generated, two files are created:
|
||||
<code>/etc/apparmor.d/libvirt/libvirt-<uuid></code> and
|
||||
<code>/etc/apparmor.d/libvirt/libvirt-<uuid>.files</code>. The
|
||||
former can be fine-tuned by the administrator to allow custom access
|
||||
for this particular QEMU virtual machine, and the latter will be
|
||||
updated appropriately when required file access changes, such as when
|
||||
a disk is added. This flexibility allows for situations such as
|
||||
having one virtual machine in complain mode with all others in
|
||||
enforce mode.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
While users can define their own AppArmor profile scheme, a typical
|
||||
configuration will include a profile for <code>/usr/sbin/libvirtd</code>,
|
||||
<code>/usr/lib/libvirt/virt-aa-helper</code> (a helper program which the
|
||||
libvirtd daemon uses instead of manipulating AppArmor directly), and
|
||||
an abstraction to be included by <code>/etc/apparmor.d/libvirt/TEMPLATE</code>
|
||||
(typically <code>/etc/apparmor.d/abstractions/libvirt-qemu</code>).
|
||||
An example profile scheme can be found in the examples/apparmor
|
||||
directory of the source distribution.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the sVirt security model is active, then the node capabilities
|
||||
XML will include its details. If a virtual machine is currently
|
||||
protected by the security model, then the guest XML will include
|
||||
its assigned profile name. If enabled at compile time, the sVirt
|
||||
security model will be activated if AppArmor is available on the host
|
||||
OS and a profile for the libvirtd daemon is loaded when libvirtd is
|
||||
started. To disable sVirt, and revert to the basic level of AppArmor
|
||||
protection (host protection only), the <code>/etc/libvirt/qemu.conf</code>
|
||||
file can be used to change the setting to <code>security_driver="none"</code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="securityacl">Cgroups device ACLs</a></h3>
|
||||
|
||||
|
@ -1,148 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvremote.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Remote management driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Remote</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Remote management driver</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,164 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvtest.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Test "mock" driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Test</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Test "mock" driver</h1>
|
||||
<h2>Connections to Test driver</h2>
|
||||
<p>
|
||||
The libvirt Test driver is a per-process fake hypervisor driver,
|
||||
with a driver name of 'test'. The driver maintains all its state
|
||||
in memory. It can start with a pre-configured default config, or
|
||||
be given a path to a alternate config. Some example conection URIs
|
||||
for the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
test:///default (local access, default config)
|
||||
test:///path/to/driver/config.xml (local access, custom config)
|
||||
test+unix:///default (local access, default config, via daemon)
|
||||
test://example.com/default (remote access, TLS/x509)
|
||||
test+tcp://example.com/default (remote access, SASl/Kerberos)
|
||||
test+ssh://root@example.com/default (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
216
docs/drvuml.html
216
docs/drvuml.html
@ -1,216 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvuml.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: User Mode Linux driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">UML</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>User Mode Linux driver</h1>
|
||||
<p>
|
||||
The UML driver for libvirt allows use and management of paravirtualized
|
||||
guests built for User Mode Linux. UML requires no special support in
|
||||
the host kernel, so can be used by any user of any linux system, provided
|
||||
they have enough free RAM for their guest's needs, though there are
|
||||
certain restrictions on network connectivity unless the adminstrator
|
||||
has pre-created TAP devices.
|
||||
</p>
|
||||
<h2>Connections to UML driver</h2>
|
||||
<p>
|
||||
The libvirt UML driver follows the QEMU driver in providing two
|
||||
types of connection. There is one privileged instance per host,
|
||||
which runs as root. This is called the "system" instance, and allows
|
||||
full use of all host resources. Then, there is a per-user unprivileged
|
||||
"session", instance. This has more restricted capabilities, and may
|
||||
require the host administrator to setup certain resources ahead of
|
||||
time to allow full integration with the network. Example connection
|
||||
URIs are
|
||||
</p>
|
||||
<pre>
|
||||
uml:///session (local access to per-user instance)
|
||||
uml+unix:///session (local access to per-user instance)
|
||||
|
||||
uml:///system (local access to system instance)
|
||||
uml+unix:///system (local access to system instance)
|
||||
uml://example.com/system (remote access, TLS/x509)
|
||||
uml+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
uml+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>Example XML configuration</h2>
|
||||
<p>
|
||||
User mode Linux driver only supports directly kernel boot at
|
||||
this time. A future driver enhancement may allow a paravirt
|
||||
bootloader in a similar style to Xen's pygrub. For now though,
|
||||
the UML kernel must be stored on the host and referenced
|
||||
explicitly in the "os" element. Since UML is a paravirtualized
|
||||
technology, the kernel "type" is set to "uml"
|
||||
</p>
|
||||
<p>
|
||||
There is not yet support for networking in the driver, but
|
||||
disks can be specified in the usual libvirt manner. The main
|
||||
variation is the target device naming scheme "ubd0", and
|
||||
bus type of "uml".
|
||||
</p>
|
||||
<p>
|
||||
Once booted the primary console is connected toa PTY, and
|
||||
thus accessible with "virsh console" or equivalent tools
|
||||
</p>
|
||||
<pre>
|
||||
<domain type='uml'>
|
||||
<name>demo</name>
|
||||
<uuid>b4433fc2-a22e-ffb3-0a3d-9c173b395800</uuid>
|
||||
<memory>500000</memory>
|
||||
<currentMemory>500000</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>uml</type>
|
||||
<kernel>/home/berrange/linux-uml-2.6.26-x86_64</kernel>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/home/berrange/FedoraCore6-AMD64-root_fs'/>
|
||||
<target dev='ubd0' bus='uml'/>
|
||||
</disk>
|
||||
<console type='pty'/>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,258 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvvbox.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: VirtualBox hypervisor driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">VirtualBox</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>VirtualBox hypervisor driver</h1>
|
||||
<p>
|
||||
The libvirt VirtualBox driver can manage any VirtualBox version
|
||||
from version 2.2 onwards.
|
||||
</p>
|
||||
<h2>Connections to VirtualBox driver</h2>
|
||||
<p>
|
||||
The libvirt VirtualBox driver provides per-user drivers (the "session" instance).
|
||||
The uri of the driver protocol is "vbox". Some example connection URIs for the driver are:
|
||||
</p>
|
||||
<pre>
|
||||
vbox:///session (local access to per-user instance)
|
||||
vbox+unix:///session (local access to per-user instance)
|
||||
vbox+tcp://user@example.com/session (remote access, SASl/Kerberos)
|
||||
vbox+ssh://user@example.com/session (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig">Example domain XML config</a>
|
||||
</h2>
|
||||
<pre>
|
||||
<domain type='vbox'>
|
||||
<name>vbox</name>
|
||||
<uuid>4dab22b31d52d8f32516782e98ab3fa0</uuid>
|
||||
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<boot dev='cdrom'/>
|
||||
<boot dev='hd'/>
|
||||
<boot dev='fd'/>
|
||||
<boot dev='network'/>
|
||||
</os>
|
||||
|
||||
<memory>654321</memory>
|
||||
<vcpu>1</vcpu>
|
||||
|
||||
<features>
|
||||
<pae/>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
|
||||
<devices>
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/home/user/Downloads/slax-6.0.9.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/home/user/tmp/vbox.vdi'/>
|
||||
<target dev='hdd'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='floppy'>
|
||||
<source file='/home/user/tmp/WIN98C.IMG'/>
|
||||
<target dev='fda'/>
|
||||
</disk>
|
||||
|
||||
<!--BRIDGE-->
|
||||
<interface type='bridge'>
|
||||
<source bridge='eth0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
<model type='am79c973'/>
|
||||
</interface>
|
||||
|
||||
<!--NAT-->
|
||||
<interface type='user'>
|
||||
<mac address='56:16:3e:5d:c7:9e'/>
|
||||
<model type='82540eM'/>
|
||||
</interface>
|
||||
|
||||
<sound model='sb16'/>
|
||||
|
||||
<parallel type='dev'>
|
||||
<source path='/dev/pts/1'/>
|
||||
<target port='0'/>
|
||||
</parallel>
|
||||
|
||||
<parallel type='dev'>
|
||||
<source path='/dev/pts/2'/>
|
||||
<target port='1'/>
|
||||
</parallel>
|
||||
|
||||
<serial type="dev">
|
||||
<source path="/dev/ttyS0"/>
|
||||
<target port="0"/>
|
||||
</serial>
|
||||
|
||||
<serial type="pipe">
|
||||
<source path="/tmp/serial.txt"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
|
||||
<hostdev mode='subsystem' type='usb'>
|
||||
<source>
|
||||
<vendor id='0x1234'/>
|
||||
<product id='0xbeef'/>
|
||||
</source>
|
||||
</hostdev>
|
||||
|
||||
<hostdev mode='subsystem' type='usb'>
|
||||
<source>
|
||||
<vendor id='0x4321'/>
|
||||
<product id='0xfeeb'/>
|
||||
</source>
|
||||
</hostdev>
|
||||
|
||||
</devices>
|
||||
|
||||
</domain>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
455
docs/drvxen.html
455
docs/drvxen.html
@ -1,455 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from drvxen.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Xen hypervisor driver</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<span class="active">Xen</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Xen hypervisor driver</h1>
|
||||
<ul><li>
|
||||
<a href="#prereq">Deployment pre-requisites</a>
|
||||
</li><li>
|
||||
<a href="#uri">Connections to Xen driver</a>
|
||||
</li><li>
|
||||
<a href="#imex">Import and export of libvirt domain XML configs</a>
|
||||
<ul><li>
|
||||
<a href="#xmlimport">Converting from XM config files to domain XML</a>
|
||||
</li><li>
|
||||
<a href="#xmlexport">Converting from domain XML to XM config files</a>
|
||||
</li></ul>
|
||||
</li><li>
|
||||
<a href="#xmlconfig">Example domain XML config</a>
|
||||
</li></ul>
|
||||
<p>
|
||||
The libvirt Xen driver provides the ability to manage virtual machines
|
||||
on any Xen release from 3.0.1 onwards.
|
||||
</p>
|
||||
<h2>
|
||||
<a name="prereq" id="prereq">Deployment pre-requisites</a>
|
||||
</h2>
|
||||
<p>
|
||||
The libvirt Xen driver uses a combination of channels to manage Xen
|
||||
virtual machines.
|
||||
</p>
|
||||
<ul><li>
|
||||
<strong>XenD</strong>: Access to the Xen daemon is a mandatory
|
||||
requirement for the libvirt Xen driver. It requires that the UNIX
|
||||
socket interface be enabled in the <code>/etc/xen/xend-config.sxp</code>
|
||||
configuration file. Specifically the config settings
|
||||
<code>(xend-unix-server yes)</code>. This path is usually restricted
|
||||
to only allow the <code>root</code> user access. As an alternative,
|
||||
the HTTP interface can be used, however, this has significant security
|
||||
implications.
|
||||
</li><li>
|
||||
<strong>XenStoreD</strong>: Access to the Xenstore daemon enables
|
||||
more efficient codepaths for looking up domain information which
|
||||
lowers the CPU overhead of management.
|
||||
</li><li>
|
||||
<strong>Hypercalls</strong>: The ability to make direct hypercalls
|
||||
allows the most efficient codepaths in the driver to be used for
|
||||
monitoring domain status.
|
||||
</li><li>
|
||||
<strong>XM config</strong>: When using Xen releases prior to 3.0.4,
|
||||
there is no inactive domain management in XenD. For such releases,
|
||||
libvirt will automatically process XM configuration files kept in
|
||||
the <code>/etc/xen</code> directory. It is important not to place
|
||||
any other non-config files in this directory.
|
||||
</li></ul>
|
||||
<h2>
|
||||
<a name="uri" id="uri">Connections to Xen driver</a>
|
||||
</h2>
|
||||
<p>
|
||||
The libvirt Xen driver is a single-instance privileged driver,
|
||||
with a driver name of 'xen'. Some example conection URIs for
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
xen:/// (local access, direct)
|
||||
xen+unix:/// (local access, via daemon)
|
||||
xen://example.com/ (remote access, TLS/x509)
|
||||
xen+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
xen+ssh://root@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="imex" id="imex">Import and export of libvirt domain XML configs</a>
|
||||
</h2>
|
||||
<p>The Xen driver currently supports two native
|
||||
config formats. The first known as <code>xen-xm</code> is the format
|
||||
used by the XM tool for files in <code>/etc/xen</code>. The second
|
||||
known as <code>xen-sxpr</code>, is the format used for interacting
|
||||
with the XenD's legacy HTTP RPC service.</p>
|
||||
<h3>
|
||||
<a name="xmlimport" id="xmlimport">Converting from XM config files to domain XML</a>
|
||||
</h3>
|
||||
<p>
|
||||
The <code>virsh domxml-from-native</code> provides a way to convert an
|
||||
existing set of XM config files into a guest description using libvirt Domain XML
|
||||
that can then be used by libvirt.
|
||||
</p>
|
||||
<pre>$ virsh -c xen:/// domxml-from-native xen-xm rhel5.cfg
|
||||
<domain type='xen'>
|
||||
<name>rhel5pv</name>
|
||||
<uuid>8f07fe28-753f-2729-d76d-bdbd892f949a</uuid>
|
||||
<memory>2560000</memory>
|
||||
<currentMemory>307200</currentMemory>
|
||||
<vcpu>4</vcpu>
|
||||
<bootloader>/usr/bin/pygrub</bootloader>
|
||||
<os>
|
||||
<type arch='x86_64' machine='xenpv'>linux</type>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='tap' type='aio'/>
|
||||
<source file='/var/lib/xen/images/rhel5pv.img'/>
|
||||
<target dev='xvda' bus='xen'/>
|
||||
</disk>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='tap' type='qcow'/>
|
||||
<source file='/root/qcow1-xen.img'/>
|
||||
<target dev='xvdd' bus='xen'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:16:3e:60:36:ba'/>
|
||||
<source bridge='xenbr0'/>
|
||||
</interface>
|
||||
<console type='pty'>
|
||||
<target port='0'/>
|
||||
</console>
|
||||
<input type='mouse' bus='xen'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<h3>
|
||||
<a name="xmlexport" id="xmlexport">Converting from domain XML to XM config files</a>
|
||||
</h3>
|
||||
<p>
|
||||
The <code>virsh domxml-to-native</code> provides a way to convert a
|
||||
guest description using libvirt Domain XML, into the XM config file
|
||||
format.
|
||||
</p>
|
||||
<pre># virsh -c xen:/// domxml-to-native xen-xm rhel5pv.xml
|
||||
name = "rhel5pv"
|
||||
uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
|
||||
maxmem = 2500
|
||||
memory = 300
|
||||
vcpus = 4
|
||||
bootloader = "/usr/bin/pygrub"
|
||||
kernel = "/var/lib/xen/boot_kernel.0YK-cS"
|
||||
ramdisk = "/var/lib/xen/boot_ramdisk.vWgrxK"
|
||||
extra = "ro root=/dev/VolGroup00/LogVol00 rhgb quiet"
|
||||
on_poweroff = "destroy"
|
||||
on_reboot = "restart"
|
||||
on_crash = "restart"
|
||||
sdl = 0
|
||||
vnc = 1
|
||||
vncunused = 1
|
||||
vnclisten = "0.0.0.0"
|
||||
disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "tap:qcow:/root/qcow1-xen.img,xvdd,w" ]
|
||||
vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig">Example domain XML config</a>
|
||||
</h2>
|
||||
<p>
|
||||
Below are some example XML configurations for Xen guest domains.
|
||||
For full details of the available options, consult the <a href="formatdomain.html">domain XML format</a>
|
||||
guide.
|
||||
</p>
|
||||
<h3>Paravirtualized guest bootloader</h3>
|
||||
<p>
|
||||
Using a bootloader allows a paravirtualized guest to be booted using
|
||||
a kernel stored inside its virtual disk image
|
||||
</p>
|
||||
<pre><domain type='xen' >
|
||||
<name>fc8</name>
|
||||
<bootloader>/usr/bin/pygrub</bootloader>
|
||||
<os>
|
||||
<type>linux</type>
|
||||
</os>
|
||||
<memory>131072</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<source file='/var/lib/xen/images/fc4.img'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='aa:00:00:00:00:11'/>
|
||||
<script path='/etc/xen/scripts/vif-bridge'/>
|
||||
</interface>
|
||||
<console tty='/dev/pts/5'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>Paravirtualized guest direct kernel boot</h3>
|
||||
<p>
|
||||
For installation of paravirtualized guests it is typical to boot the
|
||||
domain using a kernel and initrd stored in the host OS
|
||||
</p>
|
||||
<pre><domain type='xen' >
|
||||
<name>fc8</name>
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/var/lib/xen/install/vmlinuz-fedora8-x86_64</kernel>
|
||||
<initrd>/var/lib/xen/install/initrd-vmlinuz-fedora8-x86_64</initrd>
|
||||
<cmdline> kickstart=http://example.com/myguest.ks </cmdline>
|
||||
</os>
|
||||
<memory>131072</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<source file='/var/lib/xen/images/fc4.img'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='aa:00:00:00:00:11'/>
|
||||
<script path='/etc/xen/scripts/vif-bridge'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1'/>
|
||||
<console tty='/dev/pts/5'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>Fullyvirtualized guest BIOS boot</h3>
|
||||
<p>
|
||||
Fullyvirtualized guests use the emulated BIOS to boot off the primary
|
||||
harddisk, CDROM or Network PXE ROM.
|
||||
</p>
|
||||
<pre><domain type='xen' id='3'>
|
||||
<name>fv0</name>
|
||||
<uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<memory>524288</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<features>
|
||||
<pae/>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock sync="localtime"/>
|
||||
<devices>
|
||||
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
<script path='vif-bridge'/>
|
||||
</interface>
|
||||
<disk type='file'>
|
||||
<source file='/var/lib/xen/images/fv0'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/var/lib/xen/images/fc5-x86_64-boot.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<disk type='file' device='floppy'>
|
||||
<source file='/root/fd.img'/>
|
||||
<target dev='fda'/>
|
||||
</disk>
|
||||
<graphics type='vnc' port='5904'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>Fullyvirtualized guest direct kernel boot</h3>
|
||||
<p>
|
||||
With Xen 3.2.0 or later it is possible to bypass the BIOS and directly
|
||||
boot a Linux kernel and initrd as a fullyvirtualized domain. This allows
|
||||
for complete automation of OS installation, for example using the Anaconda
|
||||
kickstart support.
|
||||
</p>
|
||||
<pre><domain type='xen' id='3'>
|
||||
<name>fv0</name>
|
||||
<uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
||||
<kernel>/var/lib/xen/install/vmlinuz-fedora8-x86_64</kernel>
|
||||
<initrd>/var/lib/xen/install/initrd-vmlinuz-fedora8-x86_64</initrd>
|
||||
<cmdline> kickstart=http://example.com/myguest.ks </cmdline>
|
||||
</os>
|
||||
<memory>524288</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<features>
|
||||
<pae/>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock sync="localtime"/>
|
||||
<devices>
|
||||
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
<script path='vif-bridge'/>
|
||||
</interface>
|
||||
<disk type='file'>
|
||||
<source file='/var/lib/xen/images/fv0'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/var/lib/xen/images/fc5-x86_64-boot.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<disk type='file' device='floppy'>
|
||||
<source file='/root/fd.img'/>
|
||||
<target dev='fda'/>
|
||||
</disk>
|
||||
<graphics type='vnc' port='5904'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
138
docs/errors.html
138
docs/errors.html
@ -1,138 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from errors.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Handling of errors</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Handling of errors</h1>
|
||||
<p>The main goals of libvirt when it comes to error handling are:</p>
|
||||
<ul><li>provide as much detail as possible</li><li>provide the information as soon as possible</li><li>dont force the library user into one style of error handling</li></ul>
|
||||
<p>As result the library provide both synchronous, callback based and
|
||||
asynchronous error reporting. When an error happens in the library code the
|
||||
error is logged, allowing to retrieve it later and if the user registered an
|
||||
error callback it will be called synchronously. Once the call to libvirt ends
|
||||
the error can be detected by the return value and the full information for
|
||||
the last logged error can be retrieved.</p>
|
||||
<p>To avoid as much as possible troubles with a global variable in a
|
||||
multithreaded environment, libvirt will associate when possible the errors to
|
||||
the current connection they are related to, that way the error is stored in a
|
||||
dynamic structure which can be made thread specific. Error callback can be
|
||||
set specifically to a connection with</p>
|
||||
<p>So error handling in the code is the following:</p>
|
||||
<ol><li>if the error can be associated to a connection for example when failing
|
||||
to look up a domain
|
||||
<ol><li>if there is a callback associated to the connection set with <a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a>,
|
||||
call it with the error information</li><li>otherwise if there is a global callback set with <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a>,
|
||||
call it with the error information</li><li>otherwise call <a href="html/libvirt-virterror.html#virDefaultErrorFunc">virDefaultErrorFunc</a>
|
||||
which is the default error function of the library issuing the error
|
||||
on stderr</li><li>save the error in the connection for later retrieval with <a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a></li></ol></li><li>otherwise like when failing to create an hypervisor connection:
|
||||
<ol><li>if there is a global callback set with <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a>,
|
||||
call it with the error information</li><li>otherwise call <a href="html/libvirt-virterror.html#virDefaultErrorFunc">virDefaultErrorFunc</a>
|
||||
which is the default error function of the library issuing the error
|
||||
on stderr</li><li>save the error in the connection for later retrieval with <a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a></li></ol></li></ol>
|
||||
<p>In all cases the error information is provided as a <a href="html/libvirt-virterror.html#virErrorPtr">virErrorPtr</a> pointer to
|
||||
read-only structure <a href="html/libvirt-virterror.html#virError">virError</a> containing the
|
||||
following fields:</p>
|
||||
<ul><li>code: an error number from the <a href="html/libvirt-virterror.html#virErrorNumber">virErrorNumber</a>
|
||||
enum</li><li>domain: an enum indicating which part of libvirt raised the error see
|
||||
<a href="html/libvirt-virterror.html#virErrorDomain">virErrorDomain</a></li><li>level: the error level, usually VIR_ERR_ERROR, though there is room for
|
||||
warnings like VIR_ERR_WARNING</li><li>message: the full human-readable formatted string of the error</li><li>conn: if available a pointer to the <a href="html/libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>
|
||||
connection to the hypervisor where this happened</li><li>dom: if available a pointer to the <a href="html/libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain
|
||||
targeted in the operation</li></ul>
|
||||
<p>and then extra raw information about the error which may be initialized
|
||||
to 0 or NULL if unused</p>
|
||||
<ul><li>str1, str2, str3: string information, usually str1 is the error
|
||||
message format</li><li>int1, int2: integer information</li></ul>
|
||||
<p>So usually, setting up specific error handling with libvirt consist of
|
||||
registering an handler with with <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a> or
|
||||
with <a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a>,
|
||||
check the value of the code value, take appropriate action, if needed let
|
||||
libvirt print the error on stderr by calling <a href="html/libvirt-virterror.html#virDefaultErrorFunc">virDefaultErrorFunc</a>.
|
||||
For asynchronous error handing, set such a function doing nothing to avoid
|
||||
the error being reported on stderr, and call virConnGetLastError or
|
||||
virGetLastError when an API call returned an error value. It can be a good
|
||||
idea to use <a href="html/libvirt-virterror.html#virResetLastError">virResetError</a> or <a href="html/libvirt-virterror.html#virConnResetLastError">virConnResetLastError</a>
|
||||
once an error has been processed fully.</p>
|
||||
<p>At the python level, there only a global reporting callback function at
|
||||
this point, see the error.py example about it:</p>
|
||||
<pre>def handler(ctxt, err):
|
||||
global errno
|
||||
|
||||
#print "handler(%s, %s)" % (ctxt, err)
|
||||
errno = err
|
||||
|
||||
libvirt.registerErrorHandler(handler, 'context') </pre>
|
||||
<p>the second argument to the registerErrorHandler function is passed as the
|
||||
first argument of the callback like in the C version. The error is a tuple
|
||||
containing the same field as a virError in C, but cast to Python.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -58,7 +58,7 @@ to 0 or NULL if unused</p>
|
||||
<li>int1, int2: integer information</li>
|
||||
</ul>
|
||||
<p>So usually, setting up specific error handling with libvirt consist of
|
||||
registering an handler with with <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a> or
|
||||
registering a handler with <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a> or
|
||||
with <a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a>,
|
||||
check the value of the code value, take appropriate action, if needed let
|
||||
libvirt print the error on stderr by calling <a href="html/libvirt-virterror.html#virDefaultErrorFunc">virDefaultErrorFunc</a>.
|
||||
|
@ -1,45 +0,0 @@
|
||||
# -*- buffer-read-only: t -*- vi: set ro:
|
||||
# Beware this is autogenerated by index.py
|
||||
SUBDIRS=python
|
||||
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
|
||||
DEPS = $(top_builddir)/src/libvirt.la
|
||||
LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la $(COVERAGE_LDFLAGS)
|
||||
|
||||
rebuild: examples.xml index.html
|
||||
|
||||
examples.xml: index.py info1.c suspend.c
|
||||
-@($(srcdir)/index.py)
|
||||
|
||||
index.html: examples.xml examples.xsl $(top_srcdir)/docs/site.xsl
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) examples.xsl examples.xml \
|
||||
&& echo "Rebuilt web page" \
|
||||
&& xmllint --valid --noout index.html; \
|
||||
fi)
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
||||
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \
|
||||
$(srcdir)/*.xsl $(DESTDIR)$(HTML_DIR)
|
||||
|
||||
EXTRA_DIST=examples.xsl index.py examples.xml
|
||||
|
||||
noinst_PROGRAMS=info1 suspend
|
||||
|
||||
info1_SOURCES=info1.c
|
||||
info1_LDFLAGS=
|
||||
info1_DEPENDENCIES= $(DEPS)
|
||||
info1_LDADD= $(LDADDS)
|
||||
|
||||
suspend_SOURCES=suspend.c
|
||||
suspend_LDFLAGS=
|
||||
suspend_DEPENDENCIES= $(DEPS)
|
||||
suspend_LDADD= $(LDADDS)
|
||||
|
||||
valgrind:
|
||||
$(MAKE) CHECKER='valgrind' tests
|
||||
|
||||
tests: $(noinst_PROGRAMS)
|
||||
@(echo '## examples regression tests')
|
||||
@($(CHECKER) ./info1)
|
||||
@($(CHECKER) ./suspend)
|
@ -1,86 +0,0 @@
|
||||
<examples>
|
||||
<example filename='info1.c'>
|
||||
<synopsis>Extract information about Xen domain 0</synopsis>
|
||||
<purpose>Demonstrate the basic use of the library to connect to the hypervisor and extract domain information.</purpose>
|
||||
<usage>info1</usage>
|
||||
<test>info1</test>
|
||||
<author>Daniel Veillard</author>
|
||||
<copy>see Copyright for the status of this software. </copy>
|
||||
<section>Informations</section>
|
||||
<includes>
|
||||
</includes>
|
||||
<uses>
|
||||
<function line='43' file='libvirt' name='virDomainGetInfo'/>
|
||||
<function line='53' file='libvirt' name='virDomainFree'/>
|
||||
<function line='36' file='libvirt' name='virDomainLookupByID'/>
|
||||
<function line='55' file='libvirt' name='virConnectClose'/>
|
||||
<struct line='25' file='libvirt' name='virDomainInfo'/>
|
||||
<function line='29' file='libvirt' name='virConnectOpenReadOnly'/>
|
||||
</uses>
|
||||
</example>
|
||||
<example filename='suspend.c'>
|
||||
<synopsis>Suspend a domain and then resume its execution</synopsis>
|
||||
<purpose>Demonstrate the basic use of the library to suspend and resume a domain. If no id is given on the command line this script will suspend and resume the first domain found which is not Domain 0.</purpose>
|
||||
<usage>suspend [id]</usage>
|
||||
<test>suspend</test>
|
||||
<author>Daniel Veillard</author>
|
||||
<copy>see Copyright for the status of this software. </copy>
|
||||
<section>Scheduling</section>
|
||||
<includes>
|
||||
</includes>
|
||||
<uses>
|
||||
<function line='31' file='libvirt' name='virDomainGetInfo'/>
|
||||
<function line='111' file='libvirt' name='virConnectListDomains'/>
|
||||
<function line='93' file='libvirt' name='virDomainFree'/>
|
||||
<function line='73' file='libvirt' name='virDomainResume'/>
|
||||
<function line='50' file='libvirt' name='virDomainLookupByID'/>
|
||||
<function line='132' file='libvirt' name='virConnectClose'/>
|
||||
<struct line='28' file='libvirt' name='virDomainInfo'/>
|
||||
<function line='62' file='libvirt' name='virDomainSuspend'/>
|
||||
<function line='100' file='libvirt' name='virConnectOpenReadOnly'/>
|
||||
</uses>
|
||||
</example>
|
||||
<symbols>
|
||||
<symbol name='virConnectClose'>
|
||||
<ref filename='info1.c'/>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virConnectListDomains'>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virConnectOpenReadOnly'>
|
||||
<ref filename='info1.c'/>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virDomainFree'>
|
||||
<ref filename='info1.c'/>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virDomainGetInfo'>
|
||||
<ref filename='info1.c'/>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virDomainInfo'>
|
||||
<ref filename='info1.c'/>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virDomainLookupByID'>
|
||||
<ref filename='info1.c'/>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virDomainResume'>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
<symbol name='virDomainSuspend'>
|
||||
<ref filename='suspend.c'/>
|
||||
</symbol>
|
||||
</symbols>
|
||||
<sections>
|
||||
<section name='Informations'>
|
||||
<example filename='info1.c'/>
|
||||
</section>
|
||||
<section name='Scheduling'>
|
||||
<example filename='suspend.c'/>
|
||||
</section>
|
||||
</sections>
|
||||
</examples>
|
@ -1,144 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
extension-element-prefixes="exsl"
|
||||
exclude-result-prefixes="exsl">
|
||||
|
||||
<xsl:import href="../site.xsl"/>
|
||||
|
||||
<xsl:variable name="href_base">../</xsl:variable>
|
||||
<xsl:variable name="menu_name">Examples Menu</xsl:variable>
|
||||
|
||||
<xsl:variable name="toc">
|
||||
<form action="../search.php"
|
||||
enctype="application/x-www-form-urlencoded" method="get">
|
||||
<input name="query" type="text" size="20" value=""/>
|
||||
<input name="submit" type="submit" value="Search ..."/>
|
||||
</form>
|
||||
<ul><!-- style="margin-left: -1em" -->
|
||||
<li><a href="{$href_base}index.html">Home</a></li>
|
||||
<li><a style="font-weight:bold"
|
||||
href="{$href_base}docs.html">Developer Menu</a></li>
|
||||
<li><a style="font-weight:bold"
|
||||
href="{$href_base}html/index.html">API Menu</a></li>
|
||||
<xsl:for-each select="/examples/sections/section">
|
||||
<li><a href="#{@name}"><xsl:value-of select="@name"/> Examples</a></li>
|
||||
</xsl:for-each>
|
||||
<li><a href="{$href_base}guidelines.html">XML Guidelines</a></li>
|
||||
</ul>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:template match="include">
|
||||
<xsl:variable name="header" select="substring-before(substring-after(., '/'), '>')"/>
|
||||
<xsl:variable name="doc" select="concat('../html/libvirt-', $header, 'tml')"/>
|
||||
<li><a href="{$doc}"><xsl:value-of select="."/></a></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="typedef">
|
||||
<xsl:variable name="name" select="@name"/>
|
||||
<xsl:variable name="header" select="concat(@file, '.h')"/>
|
||||
<xsl:variable name="doc" select="concat('../html/libvirt-', @file, '.html#', $name)"/>
|
||||
<li> line <xsl:value-of select="@line"/>: Type <a href="{$doc}"><xsl:value-of select="$name"/></a> from <xsl:value-of select="$header"/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="function">
|
||||
<xsl:variable name="name" select="@name"/>
|
||||
<xsl:variable name="header" select="concat(@file, '.h')"/>
|
||||
<xsl:variable name="doc" select="concat('../html/libvirt-', @file, '.html#', $name)"/>
|
||||
<li> line <xsl:value-of select="@line"/>: Function <a href="{$doc}"><xsl:value-of select="$name"/></a> from <xsl:value-of select="$header"/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="macro">
|
||||
<xsl:variable name="name" select="@name"/>
|
||||
<xsl:variable name="header" select="concat(@file, '.h')"/>
|
||||
<xsl:variable name="doc" select="concat('../html/libvirt-', @file, '.html#', $name)"/>
|
||||
<li> line <xsl:value-of select="@line"/>: Macro <a href="{$doc}"><xsl:value-of select="$name"/></a> from <xsl:value-of select="$header"/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="example">
|
||||
<xsl:variable name="filename" select="string(@filename)"/>
|
||||
<h3><a name="{$filename}" href="{$filename}"><xsl:value-of select="$filename"/></a>: <xsl:value-of select="synopsis"/></h3>
|
||||
<p><xsl:value-of select="purpose"/></p>
|
||||
<p>Uses:</p>
|
||||
<ul>
|
||||
<xsl:for-each select="uses/*">
|
||||
<xsl:sort select="@line" data-type="number"/>
|
||||
<xsl:apply-templates select='.'/>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
<p>Usage:</p>
|
||||
<p><xsl:value-of select="usage"/></p>
|
||||
<p>Author: <xsl:value-of select="author"/></p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section">
|
||||
<li><p> <a href="#{@name}"><xsl:value-of select="@name"/></a> :</p>
|
||||
<ul>
|
||||
<xsl:for-each select="example">
|
||||
<xsl:sort select='.'/>
|
||||
<xsl:variable name="filename" select="@filename"/>
|
||||
<li> <a href="#{$filename}"><xsl:value-of select="$filename"/></a>: <xsl:value-of select="/examples/example[@filename = $filename]/synopsis"/></li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sections">
|
||||
<p> The examples are stored per section depending on the main focus
|
||||
of the example:</p>
|
||||
<ul>
|
||||
<xsl:for-each select="section">
|
||||
<xsl:sort select='.'/>
|
||||
<xsl:apply-templates select='.'/>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
<p> Getting the compilation options and libraries dependancies needed
|
||||
to generate binaries from the examples is best done on Linux/Unix by using
|
||||
the pkg-config data which should have been installed as part of <i>make
|
||||
install</i> step or when installing the libvirt development package:</p>
|
||||
<pre>gcc -o example example.c `pkg-config libvirt --libs`</pre>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="sections-list">
|
||||
<xsl:for-each select="sections/section">
|
||||
<xsl:variable name="section" select="@name"/>
|
||||
<h2> <a name="{$section}"></a><xsl:value-of select="$section"/> Examples</h2>
|
||||
<xsl:apply-templates select='/examples/example[section = $section]'/>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="examples">
|
||||
<xsl:variable name="title">Libvirt set of C code examples</xsl:variable>
|
||||
<xsl:document href="index.html" method="xml" encoding="ISO-8859-1"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<xsl:call-template name="style"/>
|
||||
<xsl:element name="title">
|
||||
<xsl:value-of select="$title"/>
|
||||
</xsl:element>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="intro">
|
||||
<div id="adjustments"/>
|
||||
<div id="pageHeader"/>
|
||||
<div id="content2">
|
||||
<xsl:call-template name="titlebox">
|
||||
<xsl:with-param name="title" select="$title"/>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="sections"/>
|
||||
<xsl:call-template name="sections-list"/>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:call-template name="linkList2"/>
|
||||
<xsl:call-template name="bottom"/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:document>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Libvirt set of C code examples</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Libvirt set of C code examples</h1><p> The examples are stored per section depending on the main focus
|
||||
of the example:</p><ul><li><p><a href="#Informations">Informations</a> :</p><ul><li><a href="#info1.c">info1.c</a>: Extract information about Xen domain 0</li></ul></li><li><p><a href="#Scheduling">Scheduling</a> :</p><ul><li><a href="#suspend.c">suspend.c</a>: Suspend a domain and then resume its execution</li></ul></li></ul><p> Getting the compilation options and libraries dependancies needed
|
||||
to generate binaries from the examples is best done on Linux/Unix by using
|
||||
the pkg-config data which should have been installed as part of <i>make
|
||||
install</i> step or when installing the libvirt development package:</p><pre>gcc -o example example.c `pkg-config libvirt --libs`</pre><h2><a name="Informations" id="Informations"></a>Informations Examples</h2><h3><a name="info1.c" href="info1.c" id="info1.c">info1.c</a>: Extract information about Xen domain 0</h3><p>Demonstrate the basic use of the library to connect to the hypervisor and extract domain information.</p><p>Uses:</p><ul><li> line 29: Function <a href="../html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a> from libvirt.h</li><li> line 36: Function <a href="../html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a> from libvirt.h</li><li> line 43: Function <a href="../html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a> from libvirt.h</li><li> line 53: Function <a href="../html/libvirt-libvirt.html#virDomainFree">virDomainFree</a> from libvirt.h</li><li> line 55: Function <a href="../html/libvirt-libvirt.html#virConnectClose">virConnectClose</a> from libvirt.h</li></ul><p>Usage:</p><p>info1</p><p>Author: Daniel Veillard</p><h2><a name="Scheduling" id="Scheduling"></a>Scheduling Examples</h2><h3><a name="suspend.c" href="suspend.c" id="suspend.c">suspend.c</a>: Suspend a domain and then resume its execution</h3><p>Demonstrate the basic use of the library to suspend and resume a domain. If no id is given on the command line this script will suspend and resume the first domain found which is not Domain 0.</p><p>Uses:</p><ul><li> line 31: Function <a href="../html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a> from libvirt.h</li><li> line 50: Function <a href="../html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a> from libvirt.h</li><li> line 62: Function <a href="../html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a> from libvirt.h</li><li> line 73: Function <a href="../html/libvirt-libvirt.html#virDomainResume">virDomainResume</a> from libvirt.h</li><li> line 93: Function <a href="../html/libvirt-libvirt.html#virDomainFree">virDomainFree</a> from libvirt.h</li><li> line 100: Function <a href="../html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a> from libvirt.h</li><li> line 111: Function <a href="../html/libvirt-libvirt.html#virConnectListDomains">virConnectListDomains</a> from libvirt.h</li><li> line 132: Function <a href="../html/libvirt-libvirt.html#virConnectClose">virConnectClose</a> from libvirt.h</li></ul><p>Usage:</p><p>suspend [id]</p><p>Author: Daniel Veillard</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr">Open bugs</a></li><li><a href="http://virt-manager.et.redhat.com/">virt-manager</a></li><li><a href="http://search.cpan.org/~danberr/Sys-Virt-0.1.0/">Perl bindings</a></li><li><a href="http://libvirt.org/ocaml/">OCaml bindings</a></li><li><a href="http://libvirt.org/ruby/">Ruby bindings</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
|
@ -1,305 +0,0 @@
|
||||
#!/usr/bin/python -u
|
||||
#
|
||||
# Indexes the examples and build an XML description
|
||||
#
|
||||
import string
|
||||
import glob
|
||||
import sys
|
||||
try:
|
||||
import libxml2
|
||||
except:
|
||||
sys.exit(1)
|
||||
sys.path.insert(0, "..")
|
||||
from apibuild import CParser, escape
|
||||
|
||||
examples = []
|
||||
extras = ['examples.xsl', 'index.py']
|
||||
tests = []
|
||||
sections = {}
|
||||
symbols = {}
|
||||
api_dict = None
|
||||
api_doc = None
|
||||
|
||||
def load_api():
|
||||
global api_dict
|
||||
global api_doc
|
||||
|
||||
if api_dict != None:
|
||||
return
|
||||
api_dict = {}
|
||||
try:
|
||||
print "loading ../libvirt-api.xml"
|
||||
api_doc = libxml2.parseFile("../libvirt-api.xml")
|
||||
except:
|
||||
print "failed to parse ../libvirt-api.xml"
|
||||
sys.exit(1)
|
||||
|
||||
def find_symbol(name):
|
||||
global api_dict
|
||||
global api_doc
|
||||
|
||||
if api_doc == None:
|
||||
load_api()
|
||||
|
||||
if name == None:
|
||||
return
|
||||
if api_dict.has_key(name):
|
||||
return api_dict[name]
|
||||
ctxt = api_doc.xpathNewContext()
|
||||
res = ctxt.xpathEval("/api/symbols/*[@name = '%s']" % (name))
|
||||
if type(res) == type([]) and len(res) >= 1:
|
||||
if len(res) > 1:
|
||||
print "Found %d references to %s in the API" % (len(res), name)
|
||||
node = res[0]
|
||||
typ = node.name
|
||||
file = node.xpathEval("string(@file)")
|
||||
info = node.xpathEval("string(info)")
|
||||
else:
|
||||
print "Reference %s not found in the API" % (name)
|
||||
return None
|
||||
ret = (typ, file, info)
|
||||
api_dict[name] = ret
|
||||
return ret
|
||||
|
||||
def parse_top_comment(filename, comment):
|
||||
res = {}
|
||||
lines = string.split(comment, "\n")
|
||||
item = None
|
||||
for line in lines:
|
||||
while line != "" and (line[0] == ' ' or line[0] == '\t'):
|
||||
line = line[1:]
|
||||
while line != "" and line[0] == '*':
|
||||
line = line[1:]
|
||||
while line != "" and (line[0] == ' ' or line[0] == '\t'):
|
||||
line = line[1:]
|
||||
try:
|
||||
(it, line) = string.split(line, ":", 1)
|
||||
item = it
|
||||
while line != "" and (line[0] == ' ' or line[0] == '\t'):
|
||||
line = line[1:]
|
||||
if res.has_key(item):
|
||||
res[item] = res[item] + " " + line
|
||||
else:
|
||||
res[item] = line
|
||||
except:
|
||||
if item != None:
|
||||
if res.has_key(item):
|
||||
res[item] = res[item] + " " + line
|
||||
else:
|
||||
res[item] = line
|
||||
return res
|
||||
|
||||
def parse(filename, output):
|
||||
global symbols
|
||||
global sections
|
||||
|
||||
parser = CParser(filename)
|
||||
parser.collect_references()
|
||||
idx = parser.parse()
|
||||
info = parse_top_comment(filename, parser.top_comment)
|
||||
output.write(" <example filename='%s'>\n" % filename)
|
||||
try:
|
||||
synopsis = info['synopsis']
|
||||
output.write(" <synopsis>%s</synopsis>\n" % escape(synopsis));
|
||||
except:
|
||||
print "Example %s lacks a synopsis description" % (filename)
|
||||
try:
|
||||
purpose = info['purpose']
|
||||
output.write(" <purpose>%s</purpose>\n" % escape(purpose));
|
||||
except:
|
||||
print "Example %s lacks a purpose description" % (filename)
|
||||
try:
|
||||
usage = info['usage']
|
||||
output.write(" <usage>%s</usage>\n" % escape(usage));
|
||||
except:
|
||||
print "Example %s lacks an usage description" % (filename)
|
||||
try:
|
||||
test = info['test']
|
||||
output.write(" <test>%s</test>\n" % escape(test));
|
||||
progname=filename[0:-2]
|
||||
command=string.replace(test, progname, './' + progname, 1)
|
||||
tests.append(command)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
author = info['author']
|
||||
output.write(" <author>%s</author>\n" % escape(author));
|
||||
except:
|
||||
print "Example %s lacks an author description" % (filename)
|
||||
try:
|
||||
copy = info['copy']
|
||||
output.write(" <copy>%s</copy>\n" % escape(copy));
|
||||
except:
|
||||
print "Example %s lacks a copyright description" % (filename)
|
||||
try:
|
||||
section = info['section']
|
||||
output.write(" <section>%s</section>\n" % escape(section));
|
||||
if sections.has_key(section):
|
||||
sections[section].append(filename)
|
||||
else:
|
||||
sections[section] = [filename]
|
||||
except:
|
||||
print "Example %s lacks a section description" % (filename)
|
||||
for topic in info.keys():
|
||||
if topic != "purpose" and topic != "usage" and \
|
||||
topic != "author" and topic != "copy" and \
|
||||
topic != "section" and topic != "synopsis" and topic != "test":
|
||||
str = info[topic]
|
||||
output.write(" <extra topic='%s'>%s</extra>\n" % (
|
||||
escape(topic), escape(str)))
|
||||
output.write(" <includes>\n")
|
||||
for include in idx.includes.keys():
|
||||
if include.find("libxml") != -1:
|
||||
output.write(" <include>%s</include>\n" % (escape(include)))
|
||||
output.write(" </includes>\n")
|
||||
output.write(" <uses>\n")
|
||||
for ref in idx.references.keys():
|
||||
id = idx.references[ref]
|
||||
name = id.get_name()
|
||||
line = id.get_lineno()
|
||||
if symbols.has_key(name):
|
||||
sinfo = symbols[name]
|
||||
refs = sinfo[0]
|
||||
# gather at most 5 references per symbols
|
||||
if refs > 5:
|
||||
continue
|
||||
sinfo.append(filename)
|
||||
sinfo[0] = refs + 1
|
||||
else:
|
||||
symbols[name] = [1, filename]
|
||||
info = find_symbol(name)
|
||||
if info != None:
|
||||
type = info[0]
|
||||
file = info[1]
|
||||
output.write(" <%s line='%d' file='%s' name='%s'/>\n" % (type,
|
||||
line, file, name))
|
||||
else:
|
||||
type = id.get_type()
|
||||
output.write(" <%s line='%d' name='%s'/>\n" % (type,
|
||||
line, name))
|
||||
|
||||
output.write(" </uses>\n")
|
||||
output.write(" </example>\n")
|
||||
|
||||
return idx
|
||||
|
||||
def dump_symbols(output):
|
||||
global symbols
|
||||
|
||||
output.write(" <symbols>\n")
|
||||
keys = symbols.keys()
|
||||
keys.sort()
|
||||
for symbol in keys:
|
||||
output.write(" <symbol name='%s'>\n" % (symbol))
|
||||
info = symbols[symbol]
|
||||
i = 1
|
||||
while i < len(info):
|
||||
output.write(" <ref filename='%s'/>\n" % (info[i]))
|
||||
i = i + 1
|
||||
output.write(" </symbol>\n")
|
||||
output.write(" </symbols>\n")
|
||||
|
||||
def dump_sections(output):
|
||||
global sections
|
||||
|
||||
output.write(" <sections>\n")
|
||||
keys = sections.keys()
|
||||
keys.sort()
|
||||
for section in keys:
|
||||
output.write(" <section name='%s'>\n" % (section))
|
||||
info = sections[section]
|
||||
i = 0
|
||||
while i < len(info):
|
||||
output.write(" <example filename='%s'/>\n" % (info[i]))
|
||||
i = i + 1
|
||||
output.write(" </section>\n")
|
||||
output.write(" </sections>\n")
|
||||
|
||||
def dump_Makefile():
|
||||
for file in glob.glob('*.xml'):
|
||||
extras.append(file)
|
||||
Makefile="""# -*- buffer-read-only: t -*- vi: set ro:
|
||||
# Beware this is autogenerated by index.py
|
||||
SUBDIRS=python
|
||||
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
|
||||
DEPS = $(top_builddir)/src/libvirt.la
|
||||
LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
|
||||
$(COVERAGE_LDFLAGS)
|
||||
|
||||
rebuild: examples.xml index.html
|
||||
|
||||
examples.xml: index.py __C_SOURCES__
|
||||
-@($(srcdir)/index.py)
|
||||
|
||||
index.html: examples.xml examples.xsl $(top_srcdir)/docs/site.xsl
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \\
|
||||
$(XSLTPROC) examples.xsl examples.xml \\
|
||||
&& echo "Rebuilt web page" \\
|
||||
&& xmllint --valid --noout index.html; \\
|
||||
fi)
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
||||
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \\
|
||||
$(srcdir)/*.xsl $(DESTDIR)$(HTML_DIR)
|
||||
|
||||
"""
|
||||
EXTRA_DIST= string.join(extras, ' ')
|
||||
Makefile = Makefile + "EXTRA_DIST=%s\n\n" % (EXTRA_DIST)
|
||||
noinst_PROGRAMS= string.join(examples, ' ')
|
||||
Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS)
|
||||
for example in examples:
|
||||
Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= $(LDADDS)\n\n" % (example, example, example,
|
||||
example, example)
|
||||
Makefile = Makefile + "valgrind:\n\t$(MAKE) CHECKER='valgrind' tests\n\n"
|
||||
Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n"
|
||||
Makefile = Makefile + "\t@(echo '## examples regression tests')\n"
|
||||
# Makefile = Makefile + "\t@(echo > .memdump)\n"
|
||||
for test in tests:
|
||||
Makefile = Makefile + "\t@($(CHECKER) %s)\n" % (test)
|
||||
# Makefile = Makefile + '\t@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)\n'
|
||||
|
||||
c_src = [("%s.c" % x) for x in examples]
|
||||
Makefile = Makefile.replace("__C_SOURCES__", string.join(c_src, ' '))
|
||||
try:
|
||||
old = open("Makefile.am", "r").read()
|
||||
if old != Makefile:
|
||||
n = open("Makefile.am", "w").write(Makefile)
|
||||
print "Updated Makefile.am"
|
||||
except:
|
||||
print "Failed to read or save Makefile.am"
|
||||
#
|
||||
# Autogenerate the .cvsignore too ...
|
||||
#
|
||||
ignore = """.memdump
|
||||
Makefile.in
|
||||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
"""
|
||||
for example in examples:
|
||||
ignore = ignore + "%s\n" % (example)
|
||||
try:
|
||||
old = open(".cvsignore", "r").read()
|
||||
if old != ignore:
|
||||
n = open(".cvsignore", "w").write(ignore)
|
||||
print "Updated .cvsignore"
|
||||
except:
|
||||
print "Failed to read or save .cvsignore"
|
||||
|
||||
if __name__ == "__main__":
|
||||
load_api()
|
||||
output = open("examples.xml", "w")
|
||||
output.write("<examples>\n")
|
||||
|
||||
c_src = glob.glob('*.c')
|
||||
c_src.sort()
|
||||
for file in c_src:
|
||||
parse(file, output)
|
||||
examples.append(file[:-2])
|
||||
|
||||
dump_symbols(output)
|
||||
dump_sections(output)
|
||||
output.write("</examples>\n")
|
||||
output.close()
|
||||
dump_Makefile()
|
@ -1,4 +0,0 @@
|
||||
EXTRA_DIST= \
|
||||
README \
|
||||
dominfo.py domrestore.py domsave.py domstart.py \
|
||||
guava.xml papaya.xml
|
@ -1,22 +0,0 @@
|
||||
<domain type='xen'>
|
||||
<name>guava</name>
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/var/xen/boot/vmlinuz-2.6.15-1.33_FC5guest</kernel>
|
||||
<initrd>/var/xen/boot/initrd-2.6.15-1.33_FC5guest.img</initrd>
|
||||
<cmdline>ro root=/dev/VolGroup00/LogVol00 rhgb quiet</cmdline>
|
||||
</os>
|
||||
<memory>262144</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<source file='/var/xen/guava'/>
|
||||
<target dev='xvda'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:16:3e:78:a2:42'/>
|
||||
<script path='/etc/xen/scripts/vif-bridge'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
@ -1,26 +0,0 @@
|
||||
<domain type='xen'>
|
||||
<name>papaya</name>
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/var/xen/boot/vmlinuz-2.6.15-1.33_FC5guest</kernel>
|
||||
<initrd>/var/xen/boot/initrd-2.6.15-1.33_FC5guest.img</initrd>
|
||||
<cmdline>ro root=/dev/VolGroup00/LogVol00 rhgb quiet single</cmdline>
|
||||
</os>
|
||||
<memory>262144</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<source file='/var/xen/papaya'/>
|
||||
<target dev='xvda'/>
|
||||
</disk>
|
||||
<disk type='block'>
|
||||
<source dev='/dev/mapper/vg00-lv02'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:16:3e:78:a2:0c'/>
|
||||
<script path='/etc/xen/scripts/vif-bridge'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
136
docs/format.html
136
docs/format.html
@ -1,136 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from format.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: XML Format</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">XML format</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The domain XML format" class="inactive" href="formatdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The virtual network XML format" class="inactive" href="formatnetwork.html">Networks</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The storage pool and volume XML format" class="inactive" href="formatstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Storage volume encryption XML format" class="inactive" href="formatstorageencryption.html">Storage Encryption</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The driver capabilities XML format" class="inactive" href="formatcaps.html">Capabilities</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The host device XML format" class="inactive" href="formatnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The secret XML format" class="inactive" href="formatsecret.html">Secrets</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>XML Format</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,199 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from formatcaps.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Driver capabilities XML format</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="active" href="format.html">XML format</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The domain XML format" class="inactive" href="formatdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The virtual network XML format" class="inactive" href="formatnetwork.html">Networks</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The storage pool and volume XML format" class="inactive" href="formatstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Storage volume encryption XML format" class="inactive" href="formatstorageencryption.html">Storage Encryption</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Capabilities</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The host device XML format" class="inactive" href="formatnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The secret XML format" class="inactive" href="formatsecret.html">Secrets</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Driver capabilities XML format</h1>
|
||||
<p>As new virtualization engine support gets added to libvirt, and to handle
|
||||
cases like QEmu supporting a variety of emulations, a query interface has
|
||||
been added in 0.2.1 allowing to list the set of supported virtualization
|
||||
capabilities on the host:</p>
|
||||
<pre> char * virConnectGetCapabilities (virConnectPtr conn);</pre>
|
||||
<p>The value returned is an XML document listing the virtualization
|
||||
capabilities of the host and virtualization engine to which
|
||||
<code>@conn</code> is connected. One can test it using <code>virsh</code>
|
||||
command line tool command '<code>capabilities</code>', it dumps the XML
|
||||
associated to the current connection. For example in the case of a 64 bits
|
||||
machine with hardware virtualization capabilities enabled in the chip and
|
||||
BIOS you will see</p>
|
||||
<pre><capabilities>
|
||||
<span style="color: #E50000"><host>
|
||||
<cpu>
|
||||
<arch>x86_64</arch>
|
||||
<features>
|
||||
<vmx/>
|
||||
</features>
|
||||
</cpu>
|
||||
</host></span>
|
||||
|
||||
<!-- xen-3.0-x86_64 -->
|
||||
<span style="color: #0000E5"><guest>
|
||||
<os_type>xen</os_type>
|
||||
<arch name="x86_64">
|
||||
<wordsize>64</wordsize>
|
||||
<domain type="xen"></domain>
|
||||
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
|
||||
</arch>
|
||||
<features>
|
||||
</features>
|
||||
</guest></span>
|
||||
|
||||
<!-- hvm-3.0-x86_32 -->
|
||||
<span style="color: #00B200"><guest>
|
||||
<os_type>hvm</os_type>
|
||||
<arch name="i686">
|
||||
<wordsize>32</wordsize>
|
||||
<domain type="xen"></domain>
|
||||
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
|
||||
<machine>pc</machine>
|
||||
<machine>isapc</machine>
|
||||
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
||||
</arch>
|
||||
<features>
|
||||
</features>
|
||||
</guest></span>
|
||||
...
|
||||
</capabilities></pre>
|
||||
<p>The first block (in red) indicates the host hardware capabilities, currently
|
||||
it is limited to the CPU properties but other information may be available,
|
||||
it shows the CPU architecture, and the features of the chip (the feature
|
||||
block is similar to what you will find in a Xen fully virtualized domain
|
||||
description).</p>
|
||||
<p>The second block (in blue) indicates the paravirtualization support of the
|
||||
Xen support, you will see the os_type of xen to indicate a paravirtual
|
||||
kernel, then architecture information and potential features.</p>
|
||||
<p>The third block (in green) gives similar information but when running a
|
||||
32 bit OS fully virtualized with Xen using the hvm support.</p>
|
||||
<p>This section is likely to be updated and augmented in the future, see <a href="https://www.redhat.com/archives/libvir-list/2007-March/msg00215.html">the
|
||||
discussion</a> which led to the capabilities format in the mailing-list
|
||||
archives.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -500,7 +500,7 @@
|
||||
</interface>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSBridge">Bridge to to LAN</a></h5>
|
||||
<h5><a name="elementsNICSBridge">Bridge to LAN</a></h5>
|
||||
|
||||
<p>
|
||||
<strong><em>
|
||||
@ -687,26 +687,81 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
|
||||
<pre>
|
||||
...
|
||||
<graphics type='sdl' display=':0.0'/>
|
||||
<graphics type='vnc' port='5904'/>
|
||||
<graphics type='rdp' autoport='yes' multiUser='yes' />
|
||||
<graphics type='desktop' fullscreen='yes'/>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>graphics</code></dt>
|
||||
<dd>The <code>graphics</code> element has a mandatory <code>type</code>
|
||||
attribute which takes the value "sdl" or "vnc". The former displays
|
||||
a window on the host desktop, while the latter activates a VNC server.
|
||||
The former accepts 3 optional arguments: a <code>display</code>
|
||||
attribute for the display to use, an <code>xauth</code> attribute for
|
||||
the authentication identifier, and an optional <code>fullscreen</code>
|
||||
attribute accepting values 'yes' or 'no'.
|
||||
If the latter is used the <code>port</code> attribute specifies the TCP
|
||||
port number (with -1 as legacy syntax indicating that it should be
|
||||
auto-allocated). The <code>autoport</code> attribute is the new
|
||||
preferred syntax for indicating autoallocation of the TCP port to use.
|
||||
The <code>listen</code> attribute is an IP address for the server to
|
||||
listen on. The <code>passwd</code> attribute provides a VNC password
|
||||
in clear text. The <code>keymap</code> attribute specifies the keymap
|
||||
to use.</dd>
|
||||
attribute which takes the value "sdl", "vnc", "rdp" or "desktop":
|
||||
<dl>
|
||||
<dt><code>"sdl"</code></dt>
|
||||
<dd>
|
||||
This displays a window on the host desktop, it can take 3 optional arguments:
|
||||
a <code>display</code> attribute for the display to use, an <code>xauth</code>
|
||||
attribute for the authentication identifier, and an optional <code>fullscreen</code>
|
||||
attribute accepting values 'yes' or 'no'.
|
||||
</dd>
|
||||
<dt><code>"vnc"</code></dt>
|
||||
<dd>
|
||||
Starts a VNC server. The <code>port</code> attribute specifies the TCP
|
||||
port number (with -1 as legacy syntax indicating that it should be
|
||||
auto-allocated). The <code>autoport</code> attribute is the new
|
||||
preferred syntax for indicating autoallocation of the TCP port to use.
|
||||
The <code>listen</code> attribute is an IP address for the server to
|
||||
listen on. The <code>passwd</code> attribute provides a VNC password
|
||||
in clear text. The <code>keymap</code> attribute specifies the keymap
|
||||
to use.
|
||||
</dd>
|
||||
<dt><code>"rdp"</code></dt>
|
||||
<dd>
|
||||
Starts a RDP server. The <code>port</code> attribute
|
||||
specifies the TCP port number (with -1 as legacy syntax indicating
|
||||
that it should be auto-allocated). The <code>autoport</code> attribute
|
||||
is the new preferred syntax for indicating autoallocation of the TCP
|
||||
port to use. The <code>replaceUser</code> attribute is a boolean deciding
|
||||
whether multiple simultaneous connections to the VM are permitted.
|
||||
The <code>multiUser</code> whether the existing connection must be dropped
|
||||
and a new connection must be established by the VRDP server, when a new
|
||||
client connects in single connection mode.
|
||||
|
||||
</dd>
|
||||
<dt><code>"desktop"</code></dt>
|
||||
<dd>
|
||||
This value is reserved for VirtualBox domains for the moment. It displays
|
||||
a window on the host desktop, similarly to "sdl", but using the VirtualBox
|
||||
viewer. Just like "sdl", it accepts the optional attributes <code>display</code>
|
||||
and <code>fullscreen</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsVideo">Video devices</a></h4>
|
||||
<p>
|
||||
A video device.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<video type='vga' nvram='8192' heads='1'>
|
||||
<acceleration accel3d='yes' accel3d='yes' />
|
||||
</video>
|
||||
...
|
||||
</pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>video</code></dt>
|
||||
<dd>The <code>video</code> element has a mandatory <code>type</code>
|
||||
attribute which takes the value "vga", "cirrus", "vmvga", "xen" or "vbox".
|
||||
You can also provide the amount of video memory using <code>nvram</code>,
|
||||
the number of screen with <code>heads</code>, and whether acceleration
|
||||
should be enabled (if supported) using the <code>accel3d</code> and
|
||||
<code>accel2d</code> attributes in the <code>acceleration</code> element.
|
||||
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsConsole">Consoles, serial & parallel devices</a></h4>
|
||||
|
@ -1,332 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from formatnetwork.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Network XML format</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="active" href="format.html">XML format</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The domain XML format" class="inactive" href="formatdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Networks</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The storage pool and volume XML format" class="inactive" href="formatstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Storage volume encryption XML format" class="inactive" href="formatstorageencryption.html">Storage Encryption</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The driver capabilities XML format" class="inactive" href="formatcaps.html">Capabilities</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The host device XML format" class="inactive" href="formatnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The secret XML format" class="inactive" href="formatsecret.html">Secrets</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Network XML format</h1>
|
||||
<ul><li>
|
||||
<a href="#elements">Element and attribute overview</a>
|
||||
<ul><li>
|
||||
<a href="#elementsMetadata">General metadata</a>
|
||||
</li><li>
|
||||
<a href="#elementsConnect">Connectivity</a>
|
||||
</li><li>
|
||||
<a href="#elementsAddress">Addressing</a>
|
||||
</li></ul>
|
||||
</li><li>
|
||||
<a href="#examples">Example configuration</a>
|
||||
<ul><li>
|
||||
<a href="#examplesNAT">NAT based network</a>
|
||||
</li><li>
|
||||
<a href="#examplesRoute">Routed network config</a>
|
||||
</li><li>
|
||||
<a href="#examplesPrivate">Isolated network config</a>
|
||||
</li></ul>
|
||||
</li></ul>
|
||||
<p>
|
||||
This page provides an introduction to the network XML format. For background
|
||||
information on the concepts referred to here, consult the <a href="archnetwork.html">network driver architecture</a>
|
||||
page.
|
||||
</p>
|
||||
<h2>
|
||||
<a name="elements" id="elements">Element and attribute overview</a>
|
||||
</h2>
|
||||
<p>
|
||||
The root element required for all virtual networks is
|
||||
named <code>network</code> and has no attributes.
|
||||
The network XML format is available <span class="since">since 0.3.0</span>
|
||||
</p>
|
||||
<h3>
|
||||
<a name="elementsMetadata" id="elementsMetadata">General metadata</a>
|
||||
</h3>
|
||||
<p>
|
||||
The first elements provide basic metadata about the virtual
|
||||
network.
|
||||
</p>
|
||||
<pre>
|
||||
<network>
|
||||
<name>default</name>
|
||||
<uuid>3e3fce45-4f53-4fa7-bb32-11f34168b82b</uuid>
|
||||
...</pre>
|
||||
<dl><dt><code>name</code></dt><dd>The content of the <code>name</code> element provides
|
||||
a short name for the virtual network. This name should
|
||||
consist only of alpha-numeric characters and is required
|
||||
to be unique within the scope of a single host. It is
|
||||
used to form the filename for storing the persistent
|
||||
configuration file. <span class="since">Since 0.3.0</span></dd><dt><code>uuid</code></dt><dd>The content of the <code>uuid</code> element provides
|
||||
a globally unique identifier for the virtual network.
|
||||
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
|
||||
If omitted when defining/creating a new network, a random
|
||||
UUID is generated. <span class="since">Since 0.3.0</span></dd></dl>
|
||||
<h3>
|
||||
<a name="elementsConnect" id="elementsConnect">Connectivity</a>
|
||||
</h3>
|
||||
<p>
|
||||
The next set of elements control how a virtual network is
|
||||
provided connectivity to the physical LAN (if at all).
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
<bridge name="virbr0" />
|
||||
<forward mode="nat" dev="eth0"/>
|
||||
...</pre>
|
||||
<dl><dt><code>bridge</code></dt><dd>The <code>name</code> attribute on the <code>bridge</code> element
|
||||
defines the name of a bridge device which will be used to construct
|
||||
the virtual network. The virtual machines will be connected to this
|
||||
bridge device allowing them to talk to each other. The bridge device
|
||||
may also be connected to the LAN. It is recommended that bridge
|
||||
device names started with the prefix <code>vir</code>, but the name
|
||||
<code>virbr0</code> is reserved for the "default" virtual network.
|
||||
This element should always be provided when defining a new network.
|
||||
<span class="since">Since 0.3.0</span>
|
||||
</dd><dt><code>forward</code></dt><dd>Inclusion of the <code>forward</code> element indicates that
|
||||
the virtual network is to be connected to the physical LAN. If
|
||||
no attributes are set, NAT forwarding will be used for connectivity.
|
||||
Firewall rules will allow forwarding to any other network device whether
|
||||
ethernet, wireless, dialup, or VPN. If the <code>dev</code> attribute
|
||||
is set, the firewall rules will restrict forwarding to the named
|
||||
device only. If the <code>mode</code> attribute is set to <code>route</code>
|
||||
then the traffic will not have NAT applied. This presumes that the
|
||||
local LAN router has suitable routing table entries to return traffic
|
||||
to this host. <span class="since">Since 0.3.0; 'mode' attribute since
|
||||
0.4.2</span></dd></dl>
|
||||
<h3>
|
||||
<a name="elementsAddress" id="elementsAddress">Addressing</a>
|
||||
</h3>
|
||||
<p>
|
||||
The final set of elements define the IPv4 address range available,
|
||||
and optionally enable DHCP sevices.
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0">
|
||||
<dhcp>
|
||||
<range start="192.168.122.100" end="192.168.122.254" />
|
||||
<host mac="00:16:3e:77:e2:ed" name="foo.example.com" ip="192.168.122.10" />
|
||||
<host mac="00:16:3e:3e:a9:1a" name="bar.example.com" ip="192.168.122.11" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
<dl><dt><code>ip</code></dt><dd>The <code>address</code> attribute defines an IPv4 address in
|
||||
dotted-decimal format, that will be configured on the bridge
|
||||
device associated with the virtual network. To the guests this
|
||||
address will be their default route. The <code>netmask</code>
|
||||
attribute defines the significant bits of the network address,
|
||||
again specified in dotted-decimal format. <span class="since">Since 0.3.0</span>
|
||||
</dd><dt><code>dhcp</code></dt><dd>Immediately within the <code>ip</code> element there is an
|
||||
optional <code>dhcp</code> element. The presence of this element
|
||||
enables DHCP services on the virtual network. It will further
|
||||
contain one or more <code>range</code> elements.
|
||||
<span class="since">Since 0.3.0</span>
|
||||
</dd><dt><code>range</code></dt><dd>The <code>start</code> and <code>end</code> attributes on the
|
||||
<code>range</code> element specify the boundaries of a pool of
|
||||
IPv4 addresses to be provided to DHCP clients. These two addresses
|
||||
must lie within the scope of the network defined on the parent
|
||||
<code>ip</code> element. <span class="since">Since 0.3.0</span>
|
||||
</dd><dt><code>host</code></dt><dd>Within the <code>dhcp</code> element there may be zero or more
|
||||
<code>host</code> elements; these specify hosts which will be given
|
||||
names and predefined IP addresses by the built-in DHCP server. Any
|
||||
such element must specify the MAC address of the host to be assigned
|
||||
a given name (via the <code>mac</code> attribute), the IP to be
|
||||
assigned to that host (via the <code>ip</code> attribute), and the
|
||||
name to be given that host by the DHCP server (via the
|
||||
<code>name</code> attribute). <span class="since">Since 0.4.5</span>
|
||||
</dd></dl>
|
||||
<h2>
|
||||
<a name="examples" id="examples">Example configuration</a>
|
||||
</h2>
|
||||
<h3>
|
||||
<a name="examplesNAT" id="examplesNAT">NAT based network</a>
|
||||
</h3>
|
||||
<p>
|
||||
This example is the so called "default" virtual network. It is
|
||||
provided and enabled out-of-the-box for all libvirt installations.
|
||||
This is a configuration that allows guest OS to get outbound
|
||||
connectivity regardless of whether the host uses ethernet, wireless,
|
||||
dialup, or VPN networking without requiring any specific admin
|
||||
configuration. In the absence of host networking, it at least allows
|
||||
guests to talk directly to each other.
|
||||
</p>
|
||||
<pre>
|
||||
<network>
|
||||
<name>default</name>
|
||||
<bridge name="virbr0" />
|
||||
<forward mode="nat"/>
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0">
|
||||
<dhcp>
|
||||
<range start="192.168.122.2" end="192.168.122.254" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
<h3>
|
||||
<a name="examplesRoute" id="examplesRoute">Routed network config</a>
|
||||
</h3>
|
||||
<p>
|
||||
This is a variant on the default network which routes traffic
|
||||
from the virtual network to the LAN without applying any NAT.
|
||||
It requires that the IP address range be pre-configured in the
|
||||
routing tables of the router on the host network. This example
|
||||
further specifies that guest traffic may only go out via the
|
||||
<code>eth1</code> host network device.
|
||||
</p>
|
||||
<pre>
|
||||
<network>
|
||||
<name>local</name>
|
||||
<bridge name="virbr1" />
|
||||
<forward mode="route" dev="eth1"/>
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0">
|
||||
<dhcp>
|
||||
<range start="192.168.122.2" end="192.168.122.254" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
<h3>
|
||||
<a name="examplesPrivate" id="examplesPrivate">Isolated network config</a>
|
||||
</h3>
|
||||
<p>
|
||||
This variant provides a completely isolated private network
|
||||
for guests. The guests can talk to each other, and the host
|
||||
OS, but cannot reach any other machines on the LAN, due to
|
||||
the omission of the <code>forward</code> element in the XML
|
||||
description.
|
||||
</p>
|
||||
<pre>
|
||||
<network>
|
||||
<name>private</name>
|
||||
<bridge name="virbr2" />
|
||||
<ip address="192.168.152.1" netmask="255.255.255.0">
|
||||
<dhcp>
|
||||
<range start="192.168.152.2" end="192.168.152.254" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user