1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-11-19 16:28:10 +03:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Jiri Denemark
7ea825672e qemu: Let empty default VNC password work as documented
CVE-2016-5008

Setting an empty graphics password is documented as a way to disable
VNC/SPICE access, but QEMU does not always behaves like that. VNC would
happily accept the empty password. Let's enforce the behavior by setting
password expiration to "now".

https://bugzilla.redhat.com/show_bug.cgi?id=1180092

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit bb848feec0)
(cherry picked from commit d933f68ee6)
2016-07-04 10:14:59 +01:00
1551 changed files with 686193 additions and 960829 deletions

28
.gitignore vendored
View File

@@ -63,7 +63,6 @@
/docs/devhelp/libvirt.devhelp
/docs/hvsupport.html.in
/docs/libvirt-api.xml
/docs/libvirt-lxc-*.xml
/docs/libvirt-qemu-*.xml
/docs/libvirt-refs.xml
/docs/search.php
@@ -93,13 +92,10 @@
/python/generated.stamp
/python/generator.py.stamp
/python/libvirt-export.c
/python/libvirt-lxc-export.c
/python/libvirt-lxc.[ch]
/python/libvirt-qemu-export.c
/python/libvirt-qemu.[ch]
/python/libvirt.[ch]
/python/libvirt.py
/python/libvirt_lxc.py
/python/libvirt_qemu.py
/run
/sc_*
@@ -112,16 +108,12 @@
/src/libvirt_*helper
/src/libvirt_*probes.h
/src/libvirt_lxc
/src/locking/lock_daemon_dispatch_stubs.h
/src/locking/lock_protocol.[ch]
/src/locking/qemu-lockd.conf
/src/locking/qemu-sanlock.conf
/src/locking/test_libvirt_sanlock.aug
/src/lxc/lxc_controller_dispatch.h
/src/lxc/lxc_monitor_dispatch.h
/src/lxc/lxc_monitor_protocol.c
/src/lxc/lxc_monitor_protocol.h
/src/lxc/lxc_protocol.[ch]
/src/lxc/lxc_protocol.c
/src/lxc/lxc_protocol.h
/src/lxc/test_libvirtd_lxc.aug
/src/qemu/test_libvirtd_qemu.aug
/src/remote/*_client_bodies.h
@@ -131,11 +123,8 @@
/src/test_libvirt*.aug
/src/util/virkeymaps.h
/src/virt-aa-helper
/src/virtlockd
/src/virtlockd.init
/tests/*.log
/tests/*.pid
/tests/*.trs
/tests/*xml2*test
/tests/commandhelper
/tests/commandtest
@@ -163,7 +152,6 @@
/tests/reconnect
/tests/secaatest
/tests/seclabeltest
/tests/securityselinuxlabeltest
/tests/securityselinuxtest
/tests/sexpr2xmltest
/tests/shunloadtest
@@ -171,26 +159,17 @@
/tests/ssh
/tests/statstest
/tests/storagebackendsheepdogtest
/tests/sysinfotest
/tests/test_conf
/tests/utiltest
/tests/viratomictest
/tests/virauthconfigtest
/tests/virbitmaptest
/tests/virbuftest
/tests/vircgrouptest
/tests/virdrivermoduletest
/tests/virendiantest
/tests/virhashtest
/tests/viridentitytest
/tests/virkeycodetest
/tests/virkeyfiletest
/tests/virlockspacetest
/tests/virnet*test
/tests/virportallocatortest
/tests/virshtest
/tests/virstoragetest
/tests/virstringtest
/tests/virtimetest
/tests/viruritest
/tests/vmx2xmltest
@@ -199,7 +178,6 @@
/tools/*.[18]
/tools/libvirt-guests.init
/tools/libvirt-guests.service
/tools/libvirt-guests.sh
/tools/virsh
/tools/virsh-*-edit.c
/tools/virt-*-validate
@@ -210,9 +188,7 @@ Makefile.in
TAGS
coverage
cscope.files
cscope.in.out
cscope.out
cscope.po.out
results.log
stamp-h
stamp-h.in

Submodule .gnulib updated: 92f3a4c8e5...d245e6ddd6

View File

@@ -11,20 +11,15 @@ Alex Jia <ajia@redhat.com>
Anthony Liguori <aliguori@us.ibm.com>
Chris Lalancette <clalance@redhat.com>
Christophe Fergeau <cfergeau@redhat.com>
Claudio Bley <cbley@av-test.de>
Cole Robinson <crobinso@redhat.com>
Daniel Berrange <berrange@redhat.com>
Daniel Veillard <veillard@redhat.com>
Dave Allan <dallan@redhat.com>
Doug Goldstein <cardoe@gentoo.org>
Eric Blake <eblake@redhat.com>
Guannan Ren <gren@redhat.com>
Guido Günther <agx@sigxcpu.org>
Ján Tomko <jtomko@redhat.com>
Jim Fehlig <jfehlig@suse.com>
Jim Meyering <meyering@redhat.com>
Jiří Denemark <jdenemar@redhat.com>
John Ferlan <jferlan@redhat.com>
John Levon <john.levon@sun.com>
Justin Clift <jclift@redhat.com>
Laine Stump <laine@redhat.com>

View File

@@ -1,8 +1,9 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -22,7 +23,8 @@ specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
@@ -55,7 +57,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
^L
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@@ -87,9 +89,9 @@ libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
encourage the widest possible use of a certain library, so that it
becomes a de-facto standard. To achieve this, non-free programs must
be allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
@@ -111,7 +113,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
^L
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -136,8 +138,8 @@ included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
interface definition files, plus the scripts used to control
compilation and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
@@ -216,7 +218,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
^L
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -267,7 +269,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
^L
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@@ -303,10 +305,10 @@ of these things:
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
@@ -329,7 +331,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
^L
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -370,7 +372,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
^L
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -384,9 +386,10 @@ all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
@@ -404,11 +407,11 @@ be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
@@ -422,7 +425,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
^L
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -456,19 +459,21 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
^L
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
@@ -485,16 +490,17 @@ convey the exclusion of warranty; and each file should have at least the
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the library,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice

166
HACKING
View File

@@ -14,12 +14,7 @@ General tips for contributing patches
(1) Discuss any large changes on the mailing list first. Post patches early and
listen to feedback.
(2) Post patches in unified diff format, with git rename detection enabled. You
need a one-time setup of:
git config diff.renames true
After that, a command similar to this should work:
(2) Post patches in unified diff format. A command similar to this should work:
diff -urp libvirt.orig/ libvirt.modified/ > libvirt-myfeature.patch
@@ -27,9 +22,7 @@ or:
git diff > libvirt-myfeature.patch
Also, for code motion patches, you may find that "git diff --patience"
provides an easier-to-read patch. However, the usual workflow of libvirt
developer is:
However, the usual workflow of libvirt developer is:
git checkout master
git pull
@@ -65,19 +58,7 @@ though).
(3) In your commit message, make the summary line reasonably short (60 characters
is typical), followed by a blank line, followed by any longer description of
why your patch makes sense. If the patch fixes a regression, and you know what
commit introduced the problem, mentioning that is useful. If the patch
resolves a bugzilla report, mentioning the URL of the bug number is useful;
but also summarize the issue rather than making all readers follow the link.
You can use 'git shortlog -30' to get an idea of typical summary lines.
Libvirt does not currently attach any meaning to Signed-off-by: lines, so it
is up to you if you want to include or omit them in the commit message.
(4) Split large changes into a series of smaller patches, self-contained if
(3) Split large changes into a series of smaller patches, self-contained if
possible, with an explanation of each patch and an explanation of how the
sequence of patches fits together. Moreover, please keep in mind that it's
required to be able to compile cleanly (*including* "make check" and "make
@@ -88,10 +69,10 @@ things).
(5) Make sure your patches apply against libvirt GIT. Developers only follow GIT
(4) Make sure your patches apply against libvirt GIT. Developers only follow GIT
and don't care much about released versions.
(6) Run the automated tests on your code before submitting any changes. In
(5) Run the automated tests on your code before submitting any changes. In
particular, configure with compile warnings set to -Werror. This is done
automatically for a git checkout; from a tarball, use:
@@ -103,11 +84,7 @@ and run the tests:
make syntax-check
make -C tests valgrind
Valgrind
http://valgrind.org/is a test that checks for memory management issues, such as leaks or use of
uninitialized variables.
The latter test checks for memory leaks.
If you encounter any failing tests, the VIR_TEST_DEBUG environment variable
may provide extra information to debug the failures. Larger values of
@@ -120,92 +97,7 @@ Also, individual tests can be run from inside the "tests/" directory, like:
./qemuxml2xmltest
There is also a "./run" script at the top level, to make it easier to run
programs that have not yet been installed, as well as to wrap invocations of
various tests under gdb or Valgrind.
(7) The Valgrind test should produce similar output to "make check". If the output
has traces within libvirt API's, then investigation is required in order to
determine the cause of the issue. Output such as the following indicates some
sort of leak:
==5414== 4 bytes in 1 blocks are definitely lost in loss record 3 of 89
==5414== at 0x4A0881C: malloc (vg_replace_malloc.c:270)
==5414== by 0x34DE0AAB85: xmlStrndup (in /usr/lib64/libxml2.so.2.7.8)
==5414== by 0x4CC97A6: virDomainVideoDefParseXML (domain_conf.c:7410)
==5414== by 0x4CD581D: virDomainDefParseXML (domain_conf.c:10188)
==5414== by 0x4CD8C73: virDomainDefParseNode (domain_conf.c:10640)
==5414== by 0x4CD8DDB: virDomainDefParse (domain_conf.c:10590)
==5414== by 0x41CB1D: testCompareXMLToArgvHelper (qemuxml2argvtest.c:100)
==5414== by 0x41E20F: virtTestRun (testutils.c:161)
==5414== by 0x41C7CB: mymain (qemuxml2argvtest.c:866)
==5414== by 0x41E84A: virtTestMain (testutils.c:723)
==5414== by 0x34D9021734: (below main) (in /usr/lib64/libc-2.15.so)
In this example, the "virDomainDefParseXML()" had an error path where the
"virDomainVideoDefPtr video" pointer was not properly disposed. By simply
adding a "virDomainVideoDefFree(video);" in the error path, the issue was
resolved.
Another common mistake is calling a printing function, such as "VIR_DEBUG()"
without initializing a variable to be printed. The following example involved
a call which could return an error, but not set variables passed by reference
to the call. The solution was to initialize the variables prior to the call.
==4749== Use of uninitialised value of size 8
==4749== at 0x34D904650B: _itoa_word (in /usr/lib64/libc-2.15.so)
==4749== by 0x34D9049118: vfprintf (in /usr/lib64/libc-2.15.so)
==4749== by 0x34D9108F60: __vasprintf_chk (in /usr/lib64/libc-2.15.so)
==4749== by 0x4CAEEF7: virVasprintf (stdio2.h:199)
==4749== by 0x4C8A55E: virLogVMessage (virlog.c:814)
==4749== by 0x4C8AA96: virLogMessage (virlog.c:751)
==4749== by 0x4DA0056: virNetTLSContextCheckCertKeyUsage (virnettlscontext.c:225)
==4749== by 0x4DA06DB: virNetTLSContextCheckCert (virnettlscontext.c:439)
==4749== by 0x4DA1620: virNetTLSContextNew (virnettlscontext.c:562)
==4749== by 0x4DA26FC: virNetTLSContextNewServer (virnettlscontext.c:927)
==4749== by 0x409C39: testTLSContextInit (virnettlscontexttest.c:467)
==4749== by 0x40AB8F: virtTestRun (testutils.c:161)
Valgrind will also find some false positives or code paths which cannot be
resolved by making changes to the libvirt code. For these paths, it is
possible to add a filter to avoid the errors. For example:
==4643== 7 bytes in 1 blocks are possibly lost in loss record 4 of 20
==4643== at 0x4A0881C: malloc (vg_replace_malloc.c:270)
==4643== by 0x34D90853F1: strdup (in /usr/lib64/libc-2.15.so)
==4643== by 0x34EEC2C08A: ??? (in /usr/lib64/libnl.so.1.1)
==4643== by 0x34EEC15B81: ??? (in /usr/lib64/libnl.so.1.1)
==4643== by 0x34D8C0EE15: call_init.part.0 (in /usr/lib64/ld-2.15.so)
==4643== by 0x34D8C0EECF: _dl_init (in /usr/lib64/ld-2.15.so)
==4643== by 0x34D8C01569: ??? (in /usr/lib64/ld-2.15.so)
In this instance, it is acceptible to modify the "tests/.valgrind.supp" file
in order to add a suppression filter. The filter should be unique enough to
not suppress real leaks, but it should be generic enough to cover multiple
code paths. The format of the entry can be found in the documentation found at
the
Valgrind home page.
http://valgrind.org/The following trace was added to "tests/.valgrind.supp" in order to suppress
the warning:
{
dlInitMemoryLeak1
Memcheck:Leak
fun:?alloc
...
fun:call_init.part.0
fun:_dl_init
...
obj:*/lib*/ld-2.*so*
}
(8) Update tests and/or documentation, particularly if you are adding a new
(6) Update tests and/or documentation, particularly if you are adding a new
feature or changing the output of a program.
@@ -287,37 +179,6 @@ otherwise. For example, it is preferable to use "/* */" comments rather than
declare them at the beginning of a scope, rather than immediately before use.
Bracket spacing
===============
The keywords "if", "for", "while", and "switch" must have a single space
following them before the opening bracket. E.g.
if(foo) // Bad
if (foo) // Good
Function implementations mustnothave any whitespace between the function name and the opening bracket. E.g.
int foo (int wizz) // Bad
int foo(int wizz) // Good
Function calls mustnothave any whitespace between the function name and the opening bracket. E.g.
bar = foo (wizz); // Bad
bar = foo(wizz); // Good
Function typedefs mustnothave any whitespace between the closing bracket of the function name and
opening bracket of the arg list. E.g.
typedef int (*foo) (int wizz); // Bad
typedef int (*foo)(int wizz); // Good
There must not be any whitespace immediately following any opening bracket, or
immediately prior to any closing bracket. E.g.
int foo( int wizz ); // Bad
int foo(int wizz); // Good
Curly braces
============
Omit the curly braces around an "if", "while", "for" etc. body only when that
@@ -330,7 +191,7 @@ Omitting braces with a single-line body is fine:
while (expr) // one-line body -> omitting curly braces is ok
single_line_stmt();
However, the moment your loop/if/else body extends on to a second line, for
However, the moment your loop/if/else body extends onto a second line, for
whatever reason (even if it's just an added comment), then you should add
braces. Otherwise, it would be too easy to insert a statement just before that
comment (without adding braces), thinking it is already a multi-statement loop:
@@ -772,7 +633,7 @@ stick to the following general plan for all *.c source files:
#include <string.h>
#include <limits.h>
#if WITH_NUMACTL Some system includes aren't supported
#if HAVE_NUMACTL Some system includes aren't supported
# include <numa.h> everywhere so need these #if guards.
#endif
@@ -786,12 +647,9 @@ stick to the following general plan for all *.c source files:
{
...
Of particular note: *Do not* include libvirt/libvirt.h, libvirt/virterror.h,
libvirt/libvirt-qemu.h, or libvirt/libvirt-lxc.h. They are included by
"internal.h" already and there are some special reasons why you cannot include
these files explicitly. One of the special cases, "libvirt/libvirt.h" is
included prior to "internal.h" in "remote_protocol.x", to avoid exposing
*_LAST enum elements.
Of particular note: *Do not* include libvirt/libvirt.h or libvirt/virterror.h.
It is included by "internal.h" already and there are some special reasons why
you cannot include these files explicitly.
Printf-style functions

View File

@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
## Copyright (C) 2005-2012 Red Hat, Inc.
## Copyright (C) 2005-2011 Red Hat, Inc.
## See COPYING.LIB for the License of this software
LCOV = lcov
@@ -35,20 +35,20 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libvirt.pc
NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
-@(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
> $@-t && mv $@-t $@ ; fi );
$(top_srcdir)/HACKING: $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking2.xsl \
$(top_srcdir)/docs/wrapstring.xsl $(top_srcdir)/docs/hacking.html.in
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
-@(if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) --nonet $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking.html.in | \
$(XSLTPROC) --nonet $(top_srcdir)/docs/hacking2.xsl - \
| perl -0777 -pe 's/\n\n+$$/\n/' \
> $@-t && mv $@-t $@ ; fi;
> $@-t && mv $@-t $@ ; fi );
rpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
@@ -86,7 +86,7 @@ dist-hook: gen-ChangeLog gen-AUTHORS
gen_start_date = 2009-07-04
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d .git; then \
if test -d .git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--since=$(gen_start_date) > $(distdir)/cl-t; \
rm -f $(distdir)/ChangeLog; \
@@ -95,9 +95,9 @@ gen-ChangeLog:
.PHONY: gen-AUTHORS
gen-AUTHORS:
$(AM_V_GEN)if test -d $(srcdir)/.git; then \
out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \
perl -p -e "s/#authorslist#// and print '$$out'" \
< $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp && \
if test -d .git; then \
out="`git log --pretty=format:'%aN <%aE>' | sort -u`" && \
cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#/$$out/" > \
$(distdir)/AUTHORS-tmp && \
mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ; \
fi

View File

@@ -20,8 +20,7 @@ cd build
../autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \
--enable-test-coverage \
--disable-nls \
--enable-werror \
--enable-static
--enable-werror
# If the MAKEFLAGS envvar does not yet include a -j option,
# add -jN where N depends on the number of processors.

View File

@@ -61,10 +61,8 @@ bootstrap_hash()
# the required file po/Makevars.
# Only run bootstrap from a git checkout, never from a tarball.
if test -d .git; then
curr_status=.git-module-status t=
if test -d .gnulib; then
t=$(bootstrap_hash; git diff .gnulib)
fi
curr_status=.git-module-status
t=$(bootstrap_hash; git diff .gnulib)
case $t:${CLEAN_SUBMODULE+set} in
*:set) ;;
*-dirty*)
@@ -72,9 +70,8 @@ if test -d .git; then
echo "set env-var CLEAN_SUBMODULE to discard gnulib changes" 2>&1
exit 1 ;;
esac
# Keep this test in sync with cfg.mk:_update_required
if test "$t" = "$(cat $curr_status 2>/dev/null)" \
&& test -f "po/Makevars" && test -f AUTHORS; then
&& test -f "po/Makevars"; then
# good, it's up to date, all we need is autoreconf
autoreconf -if
else

View File

@@ -1,10 +1,10 @@
#! /bin/sh
# Print a version string.
scriptversion=2013-03-08.16; # UTC
scriptversion=2012-07-19.14; # UTC
# Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
# Copyright (C) 2003-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -306,34 +306,34 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
die "Bootstrapping from a non-checked-out distribution is risky."
fi
# Strip blank and comment lines to leave significant entries.
gitignore_entries() {
sed '/^#/d; /^$/d' "$@"
# Ensure that lines starting with ! sort last, per gitignore conventions
# for whitelisting exceptions after a more generic blacklist pattern.
sort_patterns() {
sort -u "$@" | sed '/^!/ {
H
d
}
$ {
P
x
s/^\n//
}' | sed '/^$/d'
}
# If $STR is not already on a line by itself in $FILE, insert it at the start.
# Entries are inserted at the start of the ignore list to ensure existing
# entries starting with ! are not overridden. Such entries support
# whitelisting exceptions after a more generic blacklist pattern.
insert_if_absent() {
# If $STR is not already on a line by itself in $FILE, insert it,
# sorting the new contents of the file and replacing $FILE with the result.
insert_sorted_if_absent() {
file=$1
str=$2
test -f $file || touch $file
test -r $file || die "Error: failed to read ignore file: $file"
duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
if [ "$duplicate_entries" ] ; then
die "Error: Duplicate entries in $file: " $duplicate_entries
fi
linesold=$(gitignore_entries $file | wc -l)
linesnew=$(echo "$str" | gitignore_entries - $file | sort -u | wc -l)
if [ $linesold != $linesnew ] ; then
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|| die "insert_if_absent $file $str: failed"
fi
echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
|| { echo "$str" | sort_patterns - $file > $file.bak \
&& mv $file.bak $file; } \
|| die "insert_sorted_if_absent $file $str: failed"
}
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
# insert_if_absent.
# insert_sorted_if_absent.
insert_vc_ignore() {
vc_ignore_file="$1"
pattern="$2"
@@ -344,7 +344,7 @@ insert_vc_ignore() {
# .gitignore entry.
pattern=$(echo "$pattern" | sed s,^,/,);;
esac
insert_if_absent "$vc_ignore_file" "$pattern"
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
}
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
@@ -630,13 +630,9 @@ esac
if $bootstrap_sync; then
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
echo "$0: updating bootstrap and restarting..."
case $(sh -c 'echo "$1"' -- a) in
a) ignored=--;;
*) ignored=ignored;;
esac
exec sh -c \
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
$ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
-- "$GNULIB_SRCDIR/build-aux/bootstrap" \
"$0" "$@" --no-bootstrap-sync
}
fi
@@ -893,21 +889,20 @@ find "$m4_base" "$source_base" \
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
-type l -xtype l -delete > /dev/null 2>&1
# Invoke autoreconf with --force --install to ensure upgrades of tools
# such as ylwrap.
AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
# Some systems (RHEL 5) are using ancient autotools, for which the
# --no-recursive option had not been invented. Detect that lack and
# omit the option when it's not supported. FIXME in 2017: remove this
# hack when RHEL 5 autotools are updated, or when they become irrelevant.
no_recursive=
case $($AUTORECONF --help) in
*--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
*--no-recursive*) no_recursive=--no-recursive;;
esac
# Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS"
AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \
echo "running: AUTOPOINT=true LIBTOOLIZE=true " \
"$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS"
AUTOPOINT=true LIBTOOLIZE=true \
$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS \
|| die "autoreconf failed"
# Get some extra files from gnulib, overriding existing files.

View File

@@ -1,6 +1,6 @@
# Bootstrap configuration.
# Copyright (C) 2010-2013 Red Hat, Inc.
# Copyright (C) 2010-2012 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
@@ -20,7 +20,6 @@
gnulib_modules='
accept
areadlink
autobuild
base64
bind
bitrotate
@@ -37,7 +36,6 @@ connect
configmake
count-one-bits
crypto/md5
crypto/sha256
dirname-lgpl
environ
execinfo
@@ -92,7 +90,6 @@ regex
random_r
sched
send
setenv
setsockopt
sigaction
sigpipe

View File

@@ -1,116 +0,0 @@
#!/usr/bin/perl
#
# bracket-spacing.pl: Report any usage of 'function (..args..)'
#
# 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, see
# <http://www.gnu.org/licenses/>.
#
# Authors:
# Daniel P. Berrange <berrange@redhat.com>
use strict;
use warnings;
my $ret = 0;
my $incomment = 0;
foreach my $file (@ARGV) {
open FILE, $file;
while (defined (my $line = <FILE>)) {
my $data = $line;
# Kill any quoted strongs
$data =~ s,".*?","XXX",g;
# Kill any C++ style comments
$data =~ s,//.*$,//,;
next if $data =~ /^#/;
# Kill contents of multi-line comments
# and detect end of multi-line comments
if ($incomment) {
if ($data =~ m,\*/,) {
$incomment = 0;
$data =~ s,^.*\*/,*/,;
} else {
$data = "";
}
}
# Kill single line comments, and detect
# start of multi-line comments
if ($data =~ m,/\*.*\*/,) {
$data =~ s,/\*.*\*/,/* */,;
} elsif ($data =~ m,/\*,) {
$incomment = 1;
$data =~ s,/\*.*,/*,;
}
# We need to match things like
#
# int foo (int bar, bool wizz);
# foo (bar, wizz);
#
# but not match things like:
#
# typedef int (*foo)(bar wizz)
#
# we can't do this (efficiently) without
# missing things like
#
# foo (*bar, wizz);
#
while ($data =~ /(\w+)\s\((?!\*)/) {
my $kw = $1;
# Allow space after keywords only
if ($kw =~ /^(if|for|while|switch|return)$/) {
$data =~ s/($kw\s\()/XXX(/;
} else {
print "$file:$.: $line";
$ret = 1;
last;
}
}
# Require whitespace immediately after keywords,
# but none after the opening bracket
while ($data =~ /(if|for|while|switch|return)\(/ ||
$data =~ /(if|for|while|switch|return)\s+\(\s/) {
print "$file:$.: $line";
$ret = 1;
last;
}
# Forbid whitespace between )( of a function typedef
while ($data =~ /\(\*\w+\)\s+\(/) {
print "$file:$.: $line";
$ret = 1;
last;
}
# Forbid whitespace following ( or prior to )
while ($data =~ /\S\s+\)/ ||
$data =~ /\(\s+\S/) {
print "$file:$.: $line";
$ret = 1;
last;
}
}
close FILE;
}
exit $ret;

155
cfg.mk
View File

@@ -1,5 +1,5 @@
# Customize Makefile.maint. -*- makefile -*-
# Copyright (C) 2008-2013 Red Hat, Inc.
# Copyright (C) 2008-2012 Red Hat, Inc.
# Copyright (C) 2003-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -93,15 +93,11 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = \
# Functions like free() that are no-ops on NULL arguments.
useless_free_options = \
--name=VBOX_UTF16_FREE \
--name=VBOX_UTF8_FREE \
--name=VBOX_COM_UNALLOC_MEM \
--name=VIR_FREE \
--name=qemuCapsFree \
--name=qemuMigrationCookieFree \
--name=qemuMigrationCookieGraphicsFree \
--name=sexpr_free \
--name=usbFreeDevice \
--name=virBandwidthDefFree \
--name=virBitmapFree \
--name=virCPUDefFree \
@@ -306,7 +302,6 @@ sc_flags_usage:
@test "$$(cat $(srcdir)/include/libvirt/libvirt.h.in \
$(srcdir)/include/libvirt/virterror.h \
$(srcdir)/include/libvirt/libvirt-qemu.h \
$(srcdir)/include/libvirt/libvirt-lxc.h \
| grep -c '\(long\|unsigned\) flags')" != 4 && \
{ echo '$(ME): new API should use "unsigned int flags"' 1>&2; \
exit 1; } || :
@@ -319,14 +314,14 @@ sc_flags_usage:
# Avoid functions that should only be called via macro counterparts.
sc_prohibit_internal_functions:
@prohibit='vir(Free|AllocN?|ReallocN|(Insert|Delete)ElementsN|File(Close|Fclose|Fdopen)) *\(' \
@prohibit='vir(Free|AllocN?|ReallocN|File(Close|Fclose|Fdopen)) *\(' \
halt='use VIR_ macros instead of internal functions' \
$(_sc_search_regexp)
# Avoid raw malloc and free, except in documentation comments.
sc_prohibit_raw_allocation:
@prohibit='^.[^*].*\<((m|c|re)alloc|free) *\([^)]' \
halt='use VIR_ macros from viralloc.h instead of malloc/free' \
halt='use VIR_ macros from memory.h instead of malloc/free' \
$(_sc_search_regexp)
# Avoid functions that can lead to double-close bugs.
@@ -389,12 +384,6 @@ sc_prohibit_setuid:
halt='use virSetUIDGID, not raw set*id' \
$(_sc_search_regexp)
# Don't compare *id_t against raw -1.
sc_prohibit_risky_id_promotion:
@prohibit='\b(user|group|[ug]id) *[=!]= *-' \
halt='cast -1 to ([ug]id_t) before comparing against id' \
$(_sc_search_regexp)
# Use snprintf rather than s'printf, even if buffer is provably large enough,
# since gnulib has more guarantees for snprintf portability
sc_prohibit_sprintf:
@@ -493,12 +482,6 @@ sc_prohibit_gethostby:
halt='use getaddrinfo, not gethostby*' \
$(_sc_search_regexp)
# dirname and basename from <libgen.h> are not required to be thread-safe
sc_prohibit_libgen:
@prohibit='( (base|dir)name *\(|include .libgen\.h)' \
halt='use functions from gnulib "dirname.h", not <libgen.h>' \
$(_sc_search_regexp)
# raw xmlGetProp requires some nasty casts
sc_prohibit_xmlGetProp:
@prohibit='\<xmlGetProp *\(' \
@@ -638,23 +621,6 @@ sc_preprocessor_indentation:
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
fi
# Enforce similar spec file indentation style, by running cppi on a
# (comment-only) C file that mirrors the same layout as the spec file.
sc_spec_indentation:
@if cppi --version >/dev/null 2>&1; then \
for f in $$($(VC_LIST_EXCEPT) | grep '\.spec\.in$$'); do \
sed -e 's|#|// #|; s|%ifn*\(arch\)* |#if a // |' \
-e 's/%\(else\|endif\|define\)/#\1/' \
-e 's/^\( *\)\1\1\1#/#\1/' \
-e 's|^\( *[^#/ ]\)|// \1|; s|^\( */[^/]\)|// \1|' $$f \
| cppi -a -c 2>&1 | sed "s|standard input|$$f|"; \
done | { if grep . >&2; then false; else :; fi; } \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
exit 1; }; \
else \
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
fi
sc_copyright_format:
@require='Copyright .*Red 'Hat', Inc\.' \
containing='Copyright .*Red 'Hat \
@@ -689,8 +655,6 @@ sc_prohibit_cross_inclusion:
@for dir in $(cross_dirs); do \
case $$dir in \
util/) safe="util";; \
locking/) \
safe="($$dir|util|conf|rpc)";; \
cpu/ | locking/ | network/ | rpc/ | security/) \
safe="($$dir|util|conf)";; \
xenapi/ | xenxs/ ) safe="($$dir|util|conf|xen)";; \
@@ -714,59 +678,6 @@ sc_require_enum_last_marker:
{ echo '$(ME): enum impl needs to use _LAST marker' 1>&2; \
exit 1; } || :
# In Python files we don't want to end lines with a semicolon like in C
sc_prohibit_semicolon_at_eol_in_python:
@prohibit='^[^#].*\;$$' \
in_vc_files='\.py$$' \
halt="Don't use semicolon at eol in python files" \
$(_sc_search_regexp)
# mymain() in test files should use return, not exit, for nicer output
sc_prohibit_exit_in_tests:
@prohibit='\<exit *\(' \
in_vc_files='^tests/' \
halt='use return, not exit(), in tests' \
$(_sc_search_regexp)
# Don't include duplicate header in the source (either *.c or *.h)
sc_prohibit_duplicate_header:
@fail=0; for i in $$($(VC_LIST_EXCEPT) | grep '\.[chx]$$'); do \
awk '/# *include.*\.h/ { \
match($$0, /[<"][^>"]*[">]/); \
arr[substr($$0, RSTART + 1, RLENGTH - 2)]++; \
} \
END { \
for (key in arr) { \
if (arr[key] > 1) { \
fail=1; \
printf("%d %s are included\n", arr[key], key); \
} \
} \
if (fail == 1) { \
printf("duplicate header(s) in " FILENAME "\n"); \
exit 1; \
} \
}' $$i || fail=1; \
done; \
if test $$fail -eq 1; then \
{ echo "$(ME)": avoid duplicate headers >&2; exit 1; } \
fi;
# Don't include "libvirt/*.h" in "" form.
sc_prohibit_include_public_headers_quote:
@prohibit='# *include *"libvirt/.*\.h"' \
in_vc_files='\.[ch]$$' \
halt='Do not include libvirt/*.h in internal source' \
$(_sc_search_regexp)
# Don't include "libvirt/*.h" in <> form. Except for external tools,
# e.g. Python binding, examples and tools subdirectories.
sc_prohibit_include_public_headers_brackets:
@prohibit='# *include *<libvirt/.*\.h>' \
in_vc_files='\.[ch]$$' \
halt='Do not include libvirt/*.h in internal source' \
$(_sc_search_regexp)
# We don't use this feature of maint.mk.
prev_version_file = /dev/null
@@ -780,14 +691,11 @@ ifeq (0,$(MAKELEVEL))
# b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda)
# $ cat .git-module-status
# b653eda3ac4864de205419d9f41eec267cb89eeb
#
# Keep this logic in sync with autogen.sh.
_submodule_hash = sed 's/^[ +-]//;s/ .*//'
_update_required := $(shell \
cd '$(srcdir)'; \
test -d .git || { echo 0; exit; }; \
test -f po/Makevars || { echo 1; exit; }; \
test -f AUTHORS || { echo 1; exit; }; \
actual=$$(git submodule status | $(_submodule_hash); \
git hash-object bootstrap.conf; \
git ls-tree -d HEAD gnulib/local | awk '{print $$3}'; \
@@ -810,12 +718,7 @@ _autogen:
./config.status
# regenerate HACKING as part of the syntax-check
syntax-check: $(top_srcdir)/HACKING bracket-spacing-check
bracket-spacing-check:
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.c$$'`; \
$(PERL) $(top_srcdir)/build-aux/bracket-spacing.pl $$files || \
(echo $(ME): incorrect whitespace around brackets, see HACKING for rules && exit 1)
syntax-check: $(top_srcdir)/HACKING
# sc_po_check can fail if generated files are not built first
sc_po_check: \
@@ -832,17 +735,16 @@ $(srcdir)/src/remote/remote_client_bodies.h: $(srcdir)/src/remote/remote_protoco
# List all syntax-check exemptions:
exclude_file_name_regexp--sc_avoid_strcase = ^tools/virsh\.h$$
_src1=libvirt|fdstream|qemu/qemu_monitor|util/(vircommand|virutil)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller|locking/lock_daemon
_test1=shunloadtest|virnettlscontexttest|vircgroupmock
_src1=libvirt|fdstream|qemu/qemu_monitor|util/(command|util)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller
exclude_file_name_regexp--sc_avoid_write = \
^(src/($(_src1))|daemon/libvirtd|tools/console|tests/($(_test1)))\.c$$
^(src/($(_src1))|daemon/libvirtd|tools/console|tests/(shunload|virnettlscontext)test)\.c$$
exclude_file_name_regexp--sc_bindtextdomain = ^(tests|examples)/
exclude_file_name_regexp--sc_copyright_address = \
^COPYING\.LIB$$
exclude_file_name_regexp--sc_flags_usage = ^(docs/|src/util/virnetdevtap\.c$$|tests/vircgroupmock\.c$$)
exclude_file_name_regexp--sc_flags_usage = ^(docs/|src/util/virnetdevtap\.c$$)
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
^(src/rpc/gendispatch\.pl$$|tests/)
@@ -850,54 +752,54 @@ exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$)
exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \
^(include/libvirt/virterror\.h|daemon/dispatch\.c|src/util/virerror\.c)$$
^(include/libvirt/virterror\.h|daemon/dispatch\.c|src/util/virterror\.c)$$
exclude_file_name_regexp--sc_prohibit_access_xok = ^src/util/virutil\.c$$
exclude_file_name_regexp--sc_prohibit_access_xok = ^src/util/util\.c$$
exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
^python/(libvirt-(lxc-|qemu-)?override|typewrappers)\.c$$
^python/(libvirt-(qemu-)?override|typewrappers)\.c$$
exclude_file_name_regexp--sc_prohibit_asprintf = \
^(bootstrap.conf$$|src/util/virutil\.c$$|examples/domain-events/events-c/event-test\.c$$|tests/vircgroupmock\.c$$)
^(bootstrap.conf$$|src/util/util\.c$$|examples/domain-events/events-c/event-test\.c$$)
exclude_file_name_regexp--sc_prohibit_close = \
(\.p[yl]$$|^docs/|^(src/util/virfile\.c|src/libvirt\.c|tests/vircgroupmock\.c)$$)
(\.p[yl]$$|^docs/|^(src/util/virfile\.c|src/libvirt\.c)$$)
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
(^tests/(qemuhelp|nodeinfo)data/|\.(gif|ico|png|diff)$$)
_src2=src/(util/vircommand|libvirt|lxc/lxc_controller|locking/lock_daemon)
_src2=src/(util/command|libvirt|lxc/lxc_controller)
exclude_file_name_regexp--sc_prohibit_fork_wrappers = \
(^($(_src2)|tests/testutils|daemon/libvirtd)\.c$$)
exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/virutil\.c$$
exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/util\.c$$
exclude_file_name_regexp--sc_prohibit_internal_functions = \
^src/(util/(viralloc|virutil|virfile)\.[hc]|esx/esx_vi\.c)$$
^src/(util/(memory|util|virfile)\.[hc]|esx/esx_vi\.c)$$
exclude_file_name_regexp--sc_prohibit_newline_at_end_of_diagnostic = \
^src/rpc/gendispatch\.pl$$
exclude_file_name_regexp--sc_prohibit_nonreentrant = \
^((po|tests)/|docs/.*(py|html\.in)|run.in$$)
^((po|tests)/|docs/.*py|run.in$$)
exclude_file_name_regexp--sc_prohibit_raw_allocation = \
^(docs/hacking\.html\.in)|(src/util/viralloc\.[ch]|examples/.*|tests/securityselinuxhelper\.c|tests/vircgroupmock\.c)$$
^(src/util/memory\.[ch]|examples/.*)$$
exclude_file_name_regexp--sc_prohibit_readlink = \
^src/(util/virutil|lxc/lxc_container)\.c$$
^src/(util/util|lxc/lxc_container)\.c$$
exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c$$
exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/util\.c$$
exclude_file_name_regexp--sc_prohibit_sprintf = \
^(docs/hacking\.html\.in)|(examples/systemtap/.*stp)|(src/dtrace2systemtap\.pl)|(src/rpc/gensystemtap\.pl)$$
exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/virutil\.c$$
exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/util\.c$$
exclude_file_name_regexp--sc_prohibit_strtol = \
^src/(util/virsexpr|(vbox|xen|xenxs)/.*)\.c$$
^src/(util/sexpr|(vbox|xen|xenxs)/.*)\.c$$
exclude_file_name_regexp--sc_prohibit_xmlGetProp = ^src/util/virxml\.c$$
exclude_file_name_regexp--sc_prohibit_xmlGetProp = ^src/util/xml\.c$$
exclude_file_name_regexp--sc_prohibit_xmlURI = ^src/util/viruri\.c$$
@@ -909,20 +811,9 @@ exclude_file_name_regexp--sc_require_config_h = ^(examples/|tools/virsh-$(_virsh
exclude_file_name_regexp--sc_require_config_h_first = ^(examples/|tools/virsh-$(_virsh_includes)\.c$$)
exclude_file_name_regexp--sc_trailing_blank = \
(/qemuhelpdata/|/sysinfodata/.*\.data|\.(fig|gif|ico|png)$$)
(/qemuhelpdata/|\.(fig|gif|ico|png)$$)
exclude_file_name_regexp--sc_unmarked_diagnostics = \
^(docs/apibuild.py|tests/virt-aa-helper-test)$$
exclude_file_name_regexp--sc_size_of_brackets = cfg.mk
exclude_file_name_regexp--sc_correct_id_types = \
(^src/locking/lock_protocol.x$$)
exclude_file_name_regexp--sc_m4_quote_check = m4/virt-lib.m4
exclude_file_name_regexp--sc_prohibit_include_public_headers_quote = \
^src/internal\.h$$
exclude_file_name_regexp--sc_prohibit_include_public_headers_brackets = \
^(python/|tools/|examples/|include/libvirt/(virterror|libvirt-(qemu|lxc))\.h$$)

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
## Copyright (C) 2005-2013 Red Hat, Inc.
## Copyright (C) 2005-2012 Red Hat, Inc.
## See COPYING.LIB for the License of this software
INCLUDES = \
@@ -17,9 +17,7 @@ CLEANFILES =
DAEMON_GENERATED = \
$(srcdir)/remote_dispatch.h \
$(srcdir)/lxc_dispatch.h \
$(srcdir)/qemu_dispatch.h \
$(NULL)
$(srcdir)/qemu_dispatch.h
DAEMON_SOURCES = \
libvirtd.c libvirtd.h \
@@ -27,21 +25,18 @@ DAEMON_SOURCES = \
remote.c remote.h \
stream.c stream.h \
../src/remote/remote_protocol.c \
../src/remote/lxc_protocol.c \
../src/remote/qemu_protocol.c \
$(DAEMON_GENERATED)
DISTCLEANFILES =
EXTRA_DIST = \
remote_dispatch.h \
lxc_dispatch.h \
qemu_dispatch.h \
libvirtd.conf \
libvirtd.init.in \
libvirtd.upstart \
libvirtd.policy.in \
libvirtd.sasl \
libvirtd.service.in \
libvirtd.sysconf \
libvirtd.sysctl \
libvirtd.aug \
@@ -58,23 +53,17 @@ EXTRA_DIST = \
BUILT_SOURCES =
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
LXC_PROTOCOL = $(top_srcdir)/src/remote/lxc_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL)
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
--mode=server remote REMOTE $(REMOTE_PROTOCOL) > $@
$(srcdir)/lxc_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
$(LXC_PROTOCOL)
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
--mode=server lxc LXC $(LXC_PROTOCOL) > $@
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b remote REMOTE \
$(REMOTE_PROTOCOL) > $@
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
$(QEMU_PROTOCOL)
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
--mode=server qemu QEMU $(QEMU_PROTOCOL) > $@
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu QEMU \
$(QEMU_PROTOCOL) > $@
if WITH_LIBVIRTD
@@ -95,8 +84,8 @@ CLEANFILES += test_libvirtd.aug
libvirtd.8: $(srcdir)/libvirtd.8.in
$(AM_V_GEN)sed \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's!SYSCONFDIR!$(sysconfdir)!g' \
-e 's!LOCALSTATEDIR!$(localstatedir)!g' \
< $< > $@-t && \
mv $@-t $@
@@ -106,14 +95,12 @@ libvirtd_SOURCES = $(DAEMON_SOURCES)
libvirtd_CFLAGS = \
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
$(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
$(WARN_CFLAGS) $(PIE_CFLAGS) \
$(WARN_CFLAGS) \
$(COVERAGE_CFLAGS) \
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
libvirtd_LDFLAGS = \
$(WARN_LDFLAGS) \
$(PIE_LDFLAGS) \
$(RELRO_LDFLAGS) \
$(WARN_CFLAGS) \
$(COVERAGE_LDFLAGS)
libvirtd_LDADD = \
@@ -129,7 +116,6 @@ libvirtd_LDADD += ../src/libvirt_probes.lo
endif
libvirtd_LDADD += \
../src/libvirt-lxc.la \
../src/libvirt-qemu.la
if ! WITH_DRIVER_MODULES
@@ -183,8 +169,8 @@ endif
libvirtd_LDADD += ../src/libvirt.la
if WITH_POLKIT
if WITH_POLKIT0
if HAVE_POLKIT
if HAVE_POLKIT0
policydir = $(datadir)/PolicyKit/policy
policyauth = auth_admin_keep_session
else
@@ -195,7 +181,7 @@ endif
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
$(AM_V_GEN) sed \
-e 's|[@]authaction[@]|$(policyauth)|g' \
-e 's![@]authaction[@]!$(policyauth)!g' \
< $< > $@-t && \
mv $@-t $@
BUILT_SOURCES += libvirtd.policy
@@ -214,7 +200,7 @@ uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-up
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
if WITH_POLKIT
if HAVE_POLKIT
install-data-polkit::
$(MKDIR_P) $(DESTDIR)$(policydir)
$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
@@ -236,25 +222,25 @@ BUILT_SOURCES += $(LOGROTATE_CONFS)
libvirtd.logrotate: libvirtd.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
< $< > $@-t && \
mv $@-t $@
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
< $< > $@-t && \
mv $@-t $@
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
< $< > $@-t && \
mv $@-t $@
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
< $< > $@-t && \
mv $@-t $@
@@ -287,16 +273,14 @@ uninstall-sysconfig:
rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
if WITH_SYSCTL
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
install-sysctl:
$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
$(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
$(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
uninstall-sysctl:
rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
else
install-sysctl:
uninstall-sysctl:
@@ -336,6 +320,7 @@ uninstall-init-upstart:
endif # LIBVIRT_INIT_SCRIPT_UPSTART
EXTRA_DIST += libvirtd.service.in
if LIBVIRT_INIT_SCRIPT_SYSTEMD
SYSTEMD_UNIT_DIR = /lib/systemd/system
@@ -355,20 +340,21 @@ uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
$(AM_V_GEN)sed \
-e s!\@localstatedir\@!$(localstatedir)!g \
-e s!\@sbindir\@!$(sbindir)!g \
-e s!\@sysconfdir\@!$(sysconfdir)!g \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
$(AM_V_GEN)sed \
-e s!\@localstatedir\@!$(localstatedir)!g \
-e s!\@sbindir\@!$(sbindir)!g \
-e s!\@sysconfdir\@!$(sysconfdir)!g \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
@@ -397,13 +383,13 @@ endif # WITH_LIBVIRTD
POD2MAN = pod2man -c "Virtualization Support" \
-r "$(PACKAGE)-$(VERSION)" -s 8
$(srcdir)/libvirtd.8.in: libvirtd.pod.in $(top_srcdir)/configure.ac
$(srcdir)/libvirtd.8.in: libvirtd.pod.in
$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@ \
&& if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if WITH_SASL
if HAVE_SASL
install-data-sasl:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

View File

@@ -40,7 +40,7 @@ The server lock is used in conjunction with a condition variable
to pass jobs from the event loop thread to the workers. The main
event loop thread handles I/O from the client socket, and once a
complete RPC message has been read off the wire (and optionally
decrypted), it will be placed on the 'dx' job queue for the
decrypted), it will be placed onto the 'dx' job queue for the
associated client object. The job condition will be signalled and
a worker will wakup and process it.

View File

@@ -24,10 +24,10 @@
#include <config.h>
#include "libvirtd-config.h"
#include "virconf.h"
#include "viralloc.h"
#include "virerror.h"
#include "virlog.h"
#include "conf.h"
#include "memory.h"
#include "virterror_internal.h"
#include "logging.h"
#include "rpc/virnetserver.h"
#include "configmake.h"
#include "remote/remote_protocol.h"
@@ -45,7 +45,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
const char *filename)
{
char **list;
virConfValuePtr p = virConfGetValue(conf, key);
virConfValuePtr p = virConfGetValue (conf, key);
if (!p)
return 0;
@@ -57,7 +57,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
key);
return -1;
}
list[0] = strdup(p->str);
list[0] = strdup (p->str);
list[1] = NULL;
if (list[0] == NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -88,7 +88,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
VIR_FREE(list);
return -1;
}
list[i] = strdup(pp->str);
list[i] = strdup (pp->str);
if (list[i] == NULL) {
int j;
for (j = 0 ; j < i ; j++)
@@ -119,15 +119,15 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
/* A helper function used by each of the following macros. */
static int
checkType(virConfValuePtr p, const char *filename,
const char *key, virConfType required_type)
checkType (virConfValuePtr p, const char *filename,
const char *key, virConfType required_type)
{
if (p->type != required_type) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("remoteReadConfigFile: %s: %s: invalid type:"
" got %s; expected %s"), filename, key,
virConfTypeName(p->type),
virConfTypeName(required_type));
virConfTypeName (p->type),
virConfTypeName (required_type));
return -1;
}
return 0;
@@ -139,12 +139,12 @@ checkType(virConfValuePtr p, const char *filename,
failure), give a diagnostic and "goto" the cleanup-and-fail label. */
#define GET_CONF_STR(conf, filename, var_name) \
do { \
virConfValuePtr p = virConfGetValue(conf, #var_name); \
virConfValuePtr p = virConfGetValue (conf, #var_name); \
if (p) { \
if (checkType(p, filename, #var_name, VIR_CONF_STRING) < 0) \
if (checkType (p, filename, #var_name, VIR_CONF_STRING) < 0) \
goto error; \
VIR_FREE(data->var_name); \
if (!(data->var_name = strdup(p->str))) { \
if (!(data->var_name = strdup (p->str))) { \
virReportOOMError(); \
goto error; \
} \
@@ -154,9 +154,9 @@ checkType(virConfValuePtr p, const char *filename,
/* Like GET_CONF_STR, but for integral values. */
#define GET_CONF_INT(conf, filename, var_name) \
do { \
virConfValuePtr p = virConfGetValue(conf, #var_name); \
virConfValuePtr p = virConfGetValue (conf, #var_name); \
if (p) { \
if (checkType(p, filename, #var_name, VIR_CONF_LONG) < 0) \
if (checkType (p, filename, #var_name, VIR_CONF_LONG) < 0) \
goto error; \
data->var_name = p->l; \
} \
@@ -166,11 +166,11 @@ checkType(virConfValuePtr p, const char *filename,
static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, const char *filename) {
virConfValuePtr p;
p = virConfGetValue(conf, key);
p = virConfGetValue (conf, key);
if (!p)
return 0;
if (checkType(p, filename, key, VIR_CONF_STRING) < 0)
if (checkType (p, filename, key, VIR_CONF_STRING) < 0)
return -1;
if (!p->str)
@@ -178,7 +178,7 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
if (STREQ(p->str, "none")) {
*auth = VIR_NET_SERVER_SERVICE_AUTH_NONE;
#if WITH_SASL
#if HAVE_SASL
} else if (STREQ(p->str, "sasl")) {
*auth = VIR_NET_SERVER_SERVICE_AUTH_SASL;
#endif
@@ -242,7 +242,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
goto no_memory;
/* Only default to PolicyKit if running as root */
#if WITH_POLKIT
#if HAVE_POLKIT
if (privileged) {
data->auth_unix_rw = REMOTE_AUTH_POLKIT;
data->auth_unix_ro = REMOTE_AUTH_POLKIT;
@@ -250,7 +250,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
#endif
data->auth_unix_rw = REMOTE_AUTH_NONE;
data->auth_unix_ro = REMOTE_AUTH_NONE;
#if WITH_POLKIT
#if HAVE_POLKIT
}
#endif
@@ -263,7 +263,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
!data->unix_sock_rw_perms)
goto no_memory;
#if WITH_SASL
#if HAVE_SASL
data->auth_tcp = REMOTE_AUTH_SASL;
#else
data->auth_tcp = REMOTE_AUTH_NONE;
@@ -366,15 +366,15 @@ daemonConfigLoadOptions(struct daemonConfig *data,
const char *filename,
virConfPtr conf)
{
GET_CONF_INT(conf, filename, listen_tcp);
GET_CONF_INT(conf, filename, listen_tls);
GET_CONF_STR(conf, filename, tls_port);
GET_CONF_STR(conf, filename, tcp_port);
GET_CONF_STR(conf, filename, listen_addr);
GET_CONF_INT (conf, filename, listen_tcp);
GET_CONF_INT (conf, filename, listen_tls);
GET_CONF_STR (conf, filename, tls_port);
GET_CONF_STR (conf, filename, tcp_port);
GET_CONF_STR (conf, filename, listen_addr);
if (remoteConfigGetAuth(conf, "auth_unix_rw", &data->auth_unix_rw, filename) < 0)
goto error;
#if WITH_POLKIT
#if HAVE_POLKIT
/* Change default perms to be wide-open if PolicyKit is enabled.
* Admin can always override in config file
*/
@@ -393,22 +393,22 @@ daemonConfigLoadOptions(struct daemonConfig *data,
if (remoteConfigGetAuth(conf, "auth_tls", &data->auth_tls, filename) < 0)
goto error;
GET_CONF_STR(conf, filename, unix_sock_group);
GET_CONF_STR(conf, filename, unix_sock_ro_perms);
GET_CONF_STR(conf, filename, unix_sock_rw_perms);
GET_CONF_STR (conf, filename, unix_sock_group);
GET_CONF_STR (conf, filename, unix_sock_ro_perms);
GET_CONF_STR (conf, filename, unix_sock_rw_perms);
GET_CONF_STR(conf, filename, unix_sock_dir);
GET_CONF_STR (conf, filename, unix_sock_dir);
GET_CONF_INT(conf, filename, mdns_adv);
GET_CONF_STR(conf, filename, mdns_name);
GET_CONF_INT (conf, filename, mdns_adv);
GET_CONF_STR (conf, filename, mdns_name);
GET_CONF_INT(conf, filename, tls_no_sanity_certificate);
GET_CONF_INT(conf, filename, tls_no_verify_certificate);
GET_CONF_INT (conf, filename, tls_no_sanity_certificate);
GET_CONF_INT (conf, filename, tls_no_verify_certificate);
GET_CONF_STR(conf, filename, key_file);
GET_CONF_STR(conf, filename, cert_file);
GET_CONF_STR(conf, filename, ca_file);
GET_CONF_STR(conf, filename, crl_file);
GET_CONF_STR (conf, filename, key_file);
GET_CONF_STR (conf, filename, cert_file);
GET_CONF_STR (conf, filename, ca_file);
GET_CONF_STR (conf, filename, crl_file);
if (remoteConfigGetStringList(conf, "tls_allowed_dn_list",
&data->tls_allowed_dn_list, filename) < 0)
@@ -420,28 +420,28 @@ daemonConfigLoadOptions(struct daemonConfig *data,
goto error;
GET_CONF_INT(conf, filename, min_workers);
GET_CONF_INT(conf, filename, max_workers);
GET_CONF_INT(conf, filename, max_clients);
GET_CONF_INT (conf, filename, min_workers);
GET_CONF_INT (conf, filename, max_workers);
GET_CONF_INT (conf, filename, max_clients);
GET_CONF_INT(conf, filename, prio_workers);
GET_CONF_INT (conf, filename, prio_workers);
GET_CONF_INT(conf, filename, max_requests);
GET_CONF_INT(conf, filename, max_client_requests);
GET_CONF_INT (conf, filename, max_requests);
GET_CONF_INT (conf, filename, max_client_requests);
GET_CONF_INT(conf, filename, audit_level);
GET_CONF_INT(conf, filename, audit_logging);
GET_CONF_INT (conf, filename, audit_level);
GET_CONF_INT (conf, filename, audit_logging);
GET_CONF_STR(conf, filename, host_uuid);
GET_CONF_STR (conf, filename, host_uuid);
GET_CONF_INT(conf, filename, log_level);
GET_CONF_STR(conf, filename, log_filters);
GET_CONF_STR(conf, filename, log_outputs);
GET_CONF_INT(conf, filename, log_buffer_size);
GET_CONF_INT (conf, filename, log_level);
GET_CONF_STR (conf, filename, log_filters);
GET_CONF_STR (conf, filename, log_outputs);
GET_CONF_INT (conf, filename, log_buffer_size);
GET_CONF_INT(conf, filename, keepalive_interval);
GET_CONF_INT(conf, filename, keepalive_count);
GET_CONF_INT(conf, filename, keepalive_required);
GET_CONF_INT (conf, filename, keepalive_interval);
GET_CONF_INT (conf, filename, keepalive_count);
GET_CONF_INT (conf, filename, keepalive_required);
return 0;

View File

@@ -33,7 +33,7 @@
#include <locale.h>
#include "libvirt_internal.h"
#include "virerror.h"
#include "virterror_internal.h"
#include "virfile.h"
#include "virpidfile.h"
#include "virprocess.h"
@@ -43,15 +43,18 @@
#include "libvirtd.h"
#include "libvirtd-config.h"
#include "virutil.h"
#include "viruuid.h"
#include "util.h"
#include "uuid.h"
#include "remote_driver.h"
#include "viralloc.h"
#include "virconf.h"
#include "memory.h"
#include "conf.h"
#include "virnetlink.h"
#include "virnetserver.h"
#include "threads.h"
#include "remote.h"
#include "virhook.h"
#include "remote_driver.h"
#include "hooks.h"
#include "uuid.h"
#include "viraudit.h"
#include "locking/lock_manager.h"
@@ -95,14 +98,11 @@
#include "configmake.h"
#include "virdbus.h"
#if WITH_SASL
#if HAVE_SASL
virNetSASLContextPtr saslCtxt = NULL;
#endif
virNetServerProgramPtr remoteProgram = NULL;
virNetServerProgramPtr qemuProgram = NULL;
virNetServerProgramPtr lxcProgram = NULL;
enum {
VIR_DAEMON_ERR_NONE = 0,
@@ -449,9 +449,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
virNetServerServicePtr svc = NULL;
virNetServerServicePtr svcRO = NULL;
virNetServerServicePtr svcTCP = NULL;
#if WITH_GNUTLS
virNetServerServicePtr svcTLS = NULL;
#endif
gid_t unix_sock_gid = 0;
int unix_sock_ro_mask = 0;
int unix_sock_rw_mask = 0;
@@ -476,11 +474,9 @@ static int daemonSetupNetworking(virNetServerPtr srv,
unix_sock_rw_mask,
unix_sock_gid,
config->auth_unix_rw,
#if WITH_GNUTLS
NULL,
#endif
false,
config->max_client_requests)))
config->max_client_requests,
NULL)))
goto error;
if (sock_path_ro) {
VIR_DEBUG("Registering unix socket %s", sock_path_ro);
@@ -488,11 +484,9 @@ static int daemonSetupNetworking(virNetServerPtr srv,
unix_sock_ro_mask,
unix_sock_gid,
config->auth_unix_ro,
#if WITH_GNUTLS
NULL,
#endif
true,
config->max_client_requests)))
config->max_client_requests,
NULL)))
goto error;
}
@@ -513,11 +507,9 @@ static int daemonSetupNetworking(virNetServerPtr srv,
if (!(svcTCP = virNetServerServiceNewTCP(config->listen_addr,
config->tcp_port,
config->auth_tcp,
#if WITH_GNUTLS
NULL,
#endif
false,
config->max_client_requests)))
config->max_client_requests,
NULL)))
goto error;
if (virNetServerAddService(srv, svcTCP,
@@ -525,7 +517,6 @@ static int daemonSetupNetworking(virNetServerPtr srv,
goto error;
}
#if WITH_GNUTLS
if (config->listen_tls) {
virNetTLSContextPtr ctxt = NULL;
@@ -555,9 +546,9 @@ static int daemonSetupNetworking(virNetServerPtr srv,
virNetServerServiceNewTCP(config->listen_addr,
config->tls_port,
config->auth_tls,
ctxt,
false,
config->max_client_requests))) {
config->max_client_requests,
ctxt))) {
virObjectUnref(ctxt);
goto error;
}
@@ -568,23 +559,13 @@ static int daemonSetupNetworking(virNetServerPtr srv,
virObjectUnref(ctxt);
}
#else
(void)privileged;
if (config->listen_tls) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This libvirtd build does not support TLS"));
goto error;
}
#endif
}
#if WITH_SASL
#if HAVE_SASL
if (config->auth_unix_rw == REMOTE_AUTH_SASL ||
config->auth_unix_ro == REMOTE_AUTH_SASL ||
# if WITH_GNUTLS
config->auth_tls == REMOTE_AUTH_SASL ||
# endif
config->auth_tcp == REMOTE_AUTH_SASL) {
config->auth_tcp == REMOTE_AUTH_SASL ||
config->auth_tls == REMOTE_AUTH_SASL) {
saslCtxt = virNetSASLContextNewServer(
(const char *const*)config->sasl_allowed_username_list);
if (!saslCtxt)
@@ -595,9 +576,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
return 0;
error:
#if WITH_GNUTLS
virObjectUnref(svcTLS);
#endif
virObjectUnref(svcTCP);
virObjectUnref(svc);
virObjectUnref(svcRO);
@@ -605,6 +584,16 @@ error:
}
static int daemonShutdownCheck(virNetServerPtr srv ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
if (virStateActive())
return 0;
return 1;
}
/*
* Set up the logging environment
* By default if daemonized all errors go to the logfile libvirtd.log,
@@ -724,23 +713,23 @@ error:
static void
daemonVersion(const char *argv0)
{
printf("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION);
}
#ifdef __sun
static int
daemonSetupPrivs(void)
{
chown("/var/run/libvirt", SYSTEM_UID, SYSTEM_UID);
chown ("/var/run/libvirt", SYSTEM_UID, SYSTEM_UID);
if (__init_daemon_priv(PU_RESETGROUPS | PU_CLEARLIMITSET,
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
VIR_ERROR(_("additional privileges are required"));
return -1;
}
if (priv_set(PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
VIR_ERROR(_("failed to set reduced privileges"));
return -1;
}
@@ -783,128 +772,24 @@ static int daemonSetupSignals(virNetServerPtr srv)
return 0;
}
static void daemonInhibitCallback(bool inhibit, void *opaque)
{
virNetServerPtr srv = opaque;
if (inhibit)
virNetServerAddShutdownInhibition(srv);
else
virNetServerRemoveShutdownInhibition(srv);
}
#ifdef HAVE_DBUS
static DBusConnection *sessionBus;
static DBusConnection *systemBus;
static void daemonStopWorker(void *opaque)
{
virNetServerPtr srv = opaque;
VIR_DEBUG("Begin stop srv=%p", srv);
ignore_value(virStateStop());
VIR_DEBUG("Completed stop srv=%p", srv);
/* Exit libvirtd cleanly */
virNetServerQuit(srv);
}
/* We do this in a thread to not block the main loop */
static void daemonStop(virNetServerPtr srv)
{
virThread thr;
virObjectRef(srv);
if (virThreadCreate(&thr, false, daemonStopWorker, srv) < 0)
virObjectUnref(srv);
}
static DBusHandlerResult
handleSessionMessageFunc(DBusConnection *connection ATTRIBUTE_UNUSED,
DBusMessage *message,
void *opaque)
{
virNetServerPtr srv = opaque;
VIR_DEBUG("srv=%p", srv);
if (dbus_message_is_signal(message,
DBUS_INTERFACE_LOCAL,
"Disconnected"))
daemonStop(srv);
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
static DBusHandlerResult
handleSystemMessageFunc(DBusConnection *connection ATTRIBUTE_UNUSED,
DBusMessage *message,
void *opaque)
{
virNetServerPtr srv = opaque;
VIR_DEBUG("srv=%p", srv);
if (dbus_message_is_signal(message,
"org.freedesktop.login1.Manager",
"PrepareForShutdown"))
daemonStop(srv);
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
#endif
static void daemonRunStateInit(void *opaque)
{
virNetServerPtr srv = opaque;
/* Since driver initialization can take time inhibit daemon shutdown until
we're done so clients get a chance to connect */
daemonInhibitCallback(true, srv);
/* Start the stateful HV drivers
* This is deliberately done after telling the parent process
* we're ready, since it can take a long time and this will
* seriously delay OS bootup process */
if (virStateInitialize(virNetServerIsPrivileged(srv),
daemonInhibitCallback,
srv) < 0) {
if (virStateInitialize(virNetServerIsPrivileged(srv)) < 0) {
VIR_ERROR(_("Driver state initialization failed"));
/* Ensure the main event loop quits */
kill(getpid(), SIGTERM);
goto cleanup;
virObjectUnref(srv);
return;
}
#ifdef HAVE_DBUS
/* Tie the non-priviledged libvirtd to the session/shutdown lifecycle */
if (!virNetServerIsPrivileged(srv)) {
sessionBus = virDBusGetSessionBus();
if (sessionBus != NULL)
dbus_connection_add_filter(sessionBus,
handleSessionMessageFunc, srv, NULL);
systemBus = virDBusGetSystemBus();
if (systemBus != NULL) {
dbus_connection_add_filter(systemBus,
handleSystemMessageFunc, srv, NULL);
dbus_bus_add_match(systemBus,
"type='signal',sender='org.freedesktop.login1', interface='org.freedesktop.login1.Manager'",
NULL);
}
}
#endif
/* Only now accept clients from network */
virNetServerUpdateServices(srv, true);
cleanup:
daemonInhibitCallback(false, srv);
virObjectUnref(srv);
}
@@ -999,43 +884,42 @@ static int migrateProfile(void)
static void
daemonUsage(const char *argv0, bool privileged)
{
fprintf(stderr,
_("\n"
"Usage:\n"
" %s [options]\n"
"\n"
"Options:\n"
" -v | --verbose Verbose messages.\n"
" -d | --daemon Run as a daemon & write PID file.\n"
" -l | --listen Listen for TCP/IP connections.\n"
" -t | --timeout <secs> Exit after timeout period.\n"
" -f | --config <file> Configuration file.\n"
" | --version Display version information.\n"
" -p | --pid-file <file> Change name of PID file.\n"
"\n"
"libvirt management daemon:\n"),
argv0);
fprintf (stderr,
_("\n\
Usage:\n\
%s [options]\n\
\n\
Options:\n\
-v | --verbose Verbose messages.\n\
-d | --daemon Run as a daemon & write PID file.\n\
-l | --listen Listen for TCP/IP connections.\n\
-t | --timeout <secs> Exit after timeout period.\n\
-f | --config <file> Configuration file.\n\
| --version Display version information.\n\
-p | --pid-file <file> Change name of PID file.\n\
\n\
libvirt management daemon:\n"), argv0);
if (privileged) {
fprintf(stderr,
_("\n"
" Default paths:\n"
"\n"
" Configuration file (unless overridden by -f):\n"
" %s/libvirt/libvirtd.conf\n"
"\n"
" Sockets:\n"
" %s/run/libvirt/libvirt-sock\n"
" %s/run/libvirt/libvirt-sock-ro\n"
"\n"
" TLS:\n"
" CA certificate: %s/pki/CA/caert.pem\n"
" Server certificate: %s/pki/libvirt/servercert.pem\n"
" Server private key: %s/pki/libvirt/private/serverkey.pem\n"
"\n"
" PID file (unless overridden by -p):\n"
" %s/run/libvirtd.pid\n"
"\n"),
_("\n\
Default paths:\n\
\n\
Configuration file (unless overridden by -f):\n\
%s/libvirt/libvirtd.conf\n\
\n\
Sockets:\n\
%s/run/libvirt/libvirt-sock\n\
%s/run/libvirt/libvirt-sock-ro\n\
\n\
TLS:\n\
CA certificate: %s/pki/CA/caert.pem\n\
Server certificate: %s/pki/libvirt/servercert.pem\n\
Server private key: %s/pki/libvirt/private/serverkey.pem\n\
\n\
PID file (unless overridden by -p):\n\
%s/run/libvirtd.pid\n\
\n"),
SYSCONFDIR,
LOCALSTATEDIR,
LOCALSTATEDIR,
@@ -1044,24 +928,24 @@ daemonUsage(const char *argv0, bool privileged)
SYSCONFDIR,
LOCALSTATEDIR);
} else {
fprintf(stderr, "%s",
_("\n"
" Default paths:\n"
"\n"
" Configuration file (unless overridden by -f):\n"
" $XDG_CONFIG_HOME/libvirt/libvirtd.conf\n"
"\n"
" Sockets:\n"
" $XDG_RUNTIME_DIR/libvirt/libvirt-sock\n"
"\n"
" TLS:\n"
" CA certificate: $HOME/.pki/libvirt/cacert.pem\n"
" Server certificate: $HOME/.pki/libvirt/servercert.pem\n"
" Server private key: $HOME/.pki/libvirt/serverkey.pem\n"
"\n"
" PID file:\n"
" $XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n"
"\n"));
fprintf(stderr,
"%s", _("\n\
Default paths:\n\
\n\
Configuration file (unless overridden by -f):\n\
$XDG_CONFIG_HOME/libvirt/libvirtd.conf\n\
\n\
Sockets:\n\
$XDG_RUNTIME_DIR/libvirt/libvirt-sock\n\
\n\
TLS:\n\
CA certificate: $HOME/.pki/libvirt/cacert.pem\n\
Server certificate: $HOME/.pki/libvirt/servercert.pem\n\
Server private key: $HOME/.pki/libvirt/serverkey.pem\n\
\n\
PID file:\n\
$XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n\
\n"));
}
}
@@ -1101,8 +985,8 @@ int main(int argc, char **argv) {
{0, 0, 0, 0}
};
if (setlocale(LC_ALL, "") == NULL ||
bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
if (setlocale (LC_ALL, "") == NULL ||
bindtextdomain (PACKAGE, LOCALEDIR) == NULL ||
textdomain(PACKAGE) == NULL ||
virInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
@@ -1197,7 +1081,7 @@ int main(int argc, char **argv) {
default:
VIR_ERROR(_("%s: internal error: unknown flag: %c"),
argv[0], c);
exit(EXIT_FAILURE);
exit (EXIT_FAILURE);
}
}
@@ -1370,18 +1254,6 @@ int main(int argc, char **argv) {
goto cleanup;
}
if (!(lxcProgram = virNetServerProgramNew(LXC_PROGRAM,
LXC_PROTOCOL_VERSION,
lxcProcs,
lxcNProcs))) {
ret = VIR_DAEMON_ERR_INIT;
goto cleanup;
}
if (virNetServerAddProgram(srv, lxcProgram) < 0) {
ret = VIR_DAEMON_ERR_INIT;
goto cleanup;
}
if (!(qemuProgram = virNetServerProgramNew(QEMU_PROGRAM,
QEMU_PROTOCOL_VERSION,
qemuProcs,
@@ -1397,7 +1269,9 @@ int main(int argc, char **argv) {
if (timeout != -1) {
VIR_DEBUG("Registering shutdown timeout %d", timeout);
virNetServerAutoShutdown(srv,
timeout);
timeout,
daemonShutdownCheck,
NULL);
}
if ((daemonSetupSignals(srv)) < 0) {
@@ -1487,7 +1361,6 @@ int main(int argc, char **argv) {
cleanup:
virNetlinkEventServiceStopAll();
virObjectUnref(remoteProgram);
virObjectUnref(lxcProgram);
virObjectUnref(qemuProgram);
virNetServerClose(srv);
virObjectUnref(srv);
@@ -1513,7 +1386,5 @@ cleanup:
daemonConfigFree(config);
virStateCleanup();
return ret;
}

View File

@@ -32,11 +32,10 @@
# include <rpc/types.h>
# include <rpc/xdr.h>
# include "remote_protocol.h"
# include "lxc_protocol.h"
# include "qemu_protocol.h"
# include "virlog.h"
# include "virthread.h"
# if WITH_SASL
# include "logging.h"
# include "threads.h"
# if HAVE_SASL
# include "virnetsaslcontext.h"
# endif
# include "virnetserverprogram.h"
@@ -53,7 +52,7 @@ struct daemonClientPrivate {
int domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LAST];
# if WITH_SASL
# if HAVE_SASL
virNetSASLSessionPtr sasl;
# endif
@@ -67,7 +66,7 @@ struct daemonClientPrivate {
bool keepalive_supported;
};
# if WITH_SASL
# if HAVE_SASL
extern virNetSASLContextPtr saslCtxt;
# endif
extern virNetServerProgramPtr remoteProgram;

View File

@@ -7,8 +7,6 @@
Description=Virtualization daemon
Before=libvirt-guests.service
After=network.target
After=dbus.service
After=iscsid.service
[Service]
EnvironmentFile=-/etc/sysconfig/libvirtd

View File

@@ -22,9 +22,9 @@
#include <config.h>
#include "virerror.h"
#include "virterror_internal.h"
#if WITH_POLKIT0
#if HAVE_POLKIT0
# include <polkit/polkit.h>
# include <polkit-dbus/polkit-dbus.h>
#endif
@@ -33,12 +33,13 @@
#include "libvirtd.h"
#include "libvirt_internal.h"
#include "datatypes.h"
#include "viralloc.h"
#include "virlog.h"
#include "virutil.h"
#include "memory.h"
#include "logging.h"
#include "util.h"
#include "stream.h"
#include "viruuid.h"
#include "vircommand.h"
#include "uuid.h"
#include "libvirt/libvirt-qemu.h"
#include "command.h"
#include "intprops.h"
#include "virnetserverservice.h"
#include "virnetserver.h"
@@ -48,7 +49,6 @@
#include "virprocess.h"
#include "remote_protocol.h"
#include "qemu_protocol.h"
#include "lxc_protocol.h"
#define VIR_FROM_THIS VIR_FROM_RPC
@@ -104,7 +104,6 @@ remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors,
#include "remote_dispatch.h"
#include "qemu_dispatch.h"
#include "lxc_dispatch.h"
/* Prototypes */
@@ -719,11 +718,11 @@ void *remoteClientInitHook(virNetServerClientPtr client,
/*----- Functions. -----*/
static int
remoteDispatchConnectOpen(virNetServerPtr server,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
struct remote_connect_open_args *args)
remoteDispatchOpen(virNetServerPtr server,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
struct remote_open_args *args)
{
const char *name;
unsigned int flags;
@@ -772,10 +771,10 @@ cleanup:
static int
remoteDispatchConnectClose(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED)
remoteDispatchClose(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED)
{
virNetServerClientDelayedClose(client);
return 0;
@@ -985,8 +984,8 @@ remoteDeserializeTypedParameters(remote_typed_param *args_params_val,
cleanup:
if (rv < 0) {
virTypedParamsFree(params, i);
params = NULL;
virTypedParameterArrayClear(params, i);
VIR_FREE(params);
}
return params;
}
@@ -1035,7 +1034,8 @@ remoteDispatchDomainGetSchedulerParameters(virNetServerPtr server ATTRIBUTE_UNUS
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -1144,7 +1144,8 @@ remoteDispatchDomainGetSchedulerParametersFlags(virNetServerPtr server ATTRIBUTE
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -1332,7 +1333,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -1961,7 +1963,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -2025,7 +2028,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -2089,7 +2093,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -2350,7 +2355,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -2389,8 +2395,10 @@ remoteDispatchAuthList(virNetServerPtr server ATTRIBUTE_UNUSED,
goto cleanup;
}
VIR_INFO("Bypass polkit auth for privileged client %s", ident);
virNetServerClientSetAuth(client, 0);
auth = VIR_NET_SERVER_SERVICE_AUTH_NONE;
if (virNetServerClientSetIdentity(client, ident) < 0)
virResetLastError();
else
auth = VIR_NET_SERVER_SERVICE_AUTH_NONE;
VIR_FREE(ident);
}
}
@@ -2424,7 +2432,7 @@ cleanup:
}
#ifdef WITH_SASL
#ifdef HAVE_SASL
/*
* Initializes the SASL session in prepare for authentication
* and gives the client a list of allowed mechanisms to choose
@@ -2456,7 +2464,6 @@ remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED,
if (!sasl)
goto authfail;
# if WITH_GNUTLS
/* Inform SASL that we've got an external SSF layer from TLS */
if (virNetServerClientHasTLSSession(client)) {
int ssf;
@@ -2470,7 +2477,6 @@ remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED,
if (virNetSASLSessionExtKeySize(sasl, ssf) < 0)
goto authfail;
}
# endif
if (virNetServerClientIsSecure(client))
/* If we've got TLS or UNIX domain sock, we don't care about SSF */
@@ -2531,7 +2537,9 @@ remoteSASLFinish(virNetServerClientPtr client)
if (!virNetSASLContextCheckIdentity(saslCtxt, identity))
return -2;
virNetServerClientSetAuth(client, 0);
if (virNetServerClientSetIdentity(client, identity) < 0)
goto error;
virNetServerClientSetSASLSession(client, priv->sasl);
VIR_DEBUG("Authentication successful %d", virNetServerClientGetFD(client));
@@ -2792,7 +2800,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED,
#if WITH_POLKIT1
#if HAVE_POLKIT1
static int
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
@@ -2863,7 +2871,7 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
action, (long long) callerPid, callerUid);
ret->complete = 1;
virNetServerClientSetAuth(client, 0);
virNetServerClientSetIdentity(client, ident);
virMutexUnlock(&priv->lock);
virCommandFree(cmd);
VIR_FREE(pkout);
@@ -2879,10 +2887,9 @@ error:
if (authdismissed) {
virReportError(VIR_ERR_AUTH_CANCELLED, "%s",
_("authentication cancelled by user"));
} else if (pkout && *pkout) {
virReportError(VIR_ERR_AUTH_FAILED, _("polkit: %s"), pkout);
} else {
virReportError(VIR_ERR_AUTH_FAILED, "%s", _("authentication failed"));
virReportError(VIR_ERR_AUTH_FAILED, "%s",
pkout && *pkout ? pkout : _("authentication failed"));
}
VIR_FREE(pkout);
@@ -2902,7 +2909,7 @@ authdeny:
client, REMOTE_AUTH_POLKIT, ident);
goto error;
}
#elif WITH_POLKIT0
#elif HAVE_POLKIT0
static int
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
@@ -3018,8 +3025,8 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
action, (long long) callerPid, callerUid,
polkit_result_to_string_representation(pkresult));
ret->complete = 1;
virNetServerClientSetIdentity(client, ident);
virNetServerClientSetAuth(client, 0);
virMutexUnlock(&priv->lock);
VIR_FREE(ident);
return 0;
@@ -3046,7 +3053,7 @@ authdeny:
goto error;
}
#else /* !WITH_POLKIT0 & !HAVE_POLKIT1*/
#else /* !HAVE_POLKIT0 & !HAVE_POLKIT1*/
static int
remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
@@ -3061,7 +3068,7 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetMessageSaveError(rerr);
return -1;
}
#endif /* WITH_POLKIT1 */
#endif /* HAVE_POLKIT1 */
/***************************************************************
@@ -3124,11 +3131,11 @@ cleanup:
* Register / deregister events
***************************/
static int
remoteDispatchConnectDomainEventRegister(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_connect_domain_event_register_ret *ret ATTRIBUTE_UNUSED)
remoteDispatchDomainEventsRegister(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_domain_events_register_ret *ret ATTRIBUTE_UNUSED)
{
int callbackID;
int rv = -1;
@@ -3166,11 +3173,11 @@ cleanup:
}
static int
remoteDispatchConnectDomainEventDeregister(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_connect_domain_event_deregister_ret *ret ATTRIBUTE_UNUSED)
remoteDispatchDomainEventsDeregister(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_domain_events_deregister_ret *ret ATTRIBUTE_UNUSED)
{
int rv = -1;
struct daemonClientPrivate *priv =
@@ -3313,11 +3320,11 @@ cleanup:
}
static int
remoteDispatchConnectDomainEventRegisterAny(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_connect_domain_event_register_any_args *args)
remoteDispatchDomainEventsRegisterAny(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_domain_events_register_any_args *args)
{
int callbackID;
int rv = -1;
@@ -3362,11 +3369,11 @@ cleanup:
static int
remoteDispatchConnectDomainEventDeregisterAny(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_connect_domain_event_deregister_any_args *args)
remoteDispatchDomainEventsDeregisterAny(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
remote_domain_events_deregister_any_args *args)
{
int callbackID = -1;
int rv = -1;
@@ -3407,12 +3414,12 @@ cleanup:
}
static int
qemuDispatchDomainMonitorCommand(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
qemu_domain_monitor_command_args *args,
qemu_domain_monitor_command_ret *ret)
qemuDispatchMonitorCommand(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
qemu_monitor_command_args *args,
qemu_monitor_command_ret *ret)
{
virDomainPtr dom = NULL;
int rv = -1;
@@ -3699,12 +3706,13 @@ cleanup:
}
static int remoteDispatchConnectSupportsFeature(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
remote_connect_supports_feature_args *args,
remote_connect_supports_feature_ret *ret)
static int remoteDispatchSupportsFeature(
virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
remote_supports_feature_args *args,
remote_supports_feature_ret *ret)
{
int rv = -1;
int supported;
@@ -3732,7 +3740,7 @@ static int remoteDispatchConnectSupportsFeature(virNetServerPtr server ATTRIBUTE
break;
default:
if ((supported = virConnectSupportsFeature(priv->conn, args->feature)) < 0)
if ((supported = virDrvSupportsFeature(priv->conn, args->feature)) < 0)
goto cleanup;
break;
}
@@ -3848,7 +3856,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -3922,7 +3931,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, args->ncpus * args->nparams);
virTypedParameterArrayClear(params, args->ncpus * args->nparams);
VIR_FREE(params);
if (dom)
virDomainFree(dom);
return rv;
@@ -4226,8 +4236,6 @@ cleanup:
virStorageVolFree(vols[i]);
VIR_FREE(vols);
}
if (pool)
virStoragePoolFree(pool);
return rv;
}
@@ -4556,7 +4564,8 @@ success:
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
virTypedParameterArrayClear(params, nparams);
VIR_FREE(params);
return rv;
}
@@ -4607,100 +4616,6 @@ cleanup:
return rv;
}
static int
lxcDispatchDomainOpenNamespace(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
lxc_domain_open_namespace_args *args)
{
int rv = -1;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);
int *fdlist = NULL;
int ret;
virDomainPtr dom = NULL;
size_t i;
if (!priv->conn) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
goto cleanup;
ret = virDomainLxcOpenNamespace(dom,
&fdlist,
args->flags);
if (ret < 0)
goto cleanup;
/* We shouldn't have received any from the client,
* but in case they're playing games with us, prevent
* a resource leak
*/
for (i = 0 ; i < msg->nfds ; i++)
VIR_FORCE_CLOSE(msg->fds[i]);
VIR_FREE(msg->fds);
msg->nfds = 0;
msg->fds = fdlist;
msg->nfds = ret;
rv = 1;
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virDomainFree(dom);
return rv;
}
static int
remoteDispatchDomainGetJobStats(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
remote_domain_get_job_stats_args *args,
remote_domain_get_job_stats_ret *ret)
{
virDomainPtr dom = NULL;
virTypedParameterPtr params = NULL;
int nparams = 0;
int rv = -1;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);
if (!priv->conn) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
goto cleanup;
if (virDomainGetJobStats(dom, &ret->type, &params,
&nparams, args->flags) < 0)
goto cleanup;
if (remoteSerializeTypedParameters(params, nparams,
&ret->params.params_val,
&ret->params.params_len,
0) < 0)
goto cleanup;
rv = 0;
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virTypedParamsFree(params, nparams);
if (dom)
virDomainFree(dom);
return rv;
}
/*----- Helpers. -----*/
/* get_nonnull_domain and get_nonnull_network turn an on-wire
@@ -4736,16 +4651,14 @@ get_nonnull_interface(virConnectPtr conn, remote_nonnull_interface iface)
static virStoragePoolPtr
get_nonnull_storage_pool(virConnectPtr conn, remote_nonnull_storage_pool pool)
{
return virGetStoragePool(conn, pool.name, BAD_CAST pool.uuid,
NULL, NULL);
return virGetStoragePool(conn, pool.name, BAD_CAST pool.uuid);
}
static virStorageVolPtr
get_nonnull_storage_vol(virConnectPtr conn, remote_nonnull_storage_vol vol)
{
virStorageVolPtr ret;
ret = virGetStorageVol(conn, vol.pool, vol.name, vol.key,
NULL, NULL);
ret = virGetStorageVol(conn, vol.pool, vol.name, vol.key);
return ret;
}

View File

@@ -32,9 +32,6 @@
extern virNetServerProgramProc remoteProcs[];
extern size_t remoteNProcs;
extern virNetServerProgramProc lxcProcs[];
extern size_t lxcNProcs;
extern virNetServerProgramProc qemuProcs[];
extern size_t qemuNProcs;

View File

@@ -25,10 +25,10 @@
#include "stream.h"
#include "remote.h"
#include "viralloc.h"
#include "virlog.h"
#include "memory.h"
#include "logging.h"
#include "virnetserverclient.h"
#include "virerror.h"
#include "virterror_internal.h"
#define VIR_FROM_THIS VIR_FROM_STREAMS
@@ -148,14 +148,6 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
virNetServerClientClose(client);
goto cleanup;
}
/* If we detected EOF during read processing,
* then clear hangup/error conditions, since
* we want the client to see the EOF message
* we just sent them
*/
if (stream->recvEOF)
events = events & ~(VIR_STREAM_EVENT_HANGUP |
VIR_STREAM_EVENT_ERROR);
}
/* If we have a completion/abort message, always process it */

View File

@@ -95,12 +95,8 @@ qemu_xml = \
libvirt-qemu-api.xml \
libvirt-qemu-refs.xml
lxc_xml = \
libvirt-lxc-api.xml \
libvirt-lxc-refs.xml
apidir = $(pkgdatadir)/api
api_DATA = libvirt-api.xml libvirt-qemu-api.xml libvirt-lxc-api.xml
api_DATA = libvirt-api.xml libvirt-qemu-api.xml
fig = \
libvirt-net-logical.fig \
@@ -120,7 +116,7 @@ EXTRA_DIST= \
hacking1.xsl hacking2.xsl wrapstring.xsl \
$(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
$(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
$(xml) $(qemu_xml) $(lxc_xml) $(fig) $(png) $(css) \
$(xml) $(qemu_xml) $(fig) $(png) $(css) \
$(patches) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
$(internals_html_in) $(internals_html) \
sitemap.html.in \
@@ -137,7 +133,6 @@ all-am: web
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
lxc_api: $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html \
$(dot_php)
@@ -157,8 +152,7 @@ todo:
$(MAKE) todo.html
hvsupport.html.in: $(srcdir)/hvsupport.pl $(srcdir)/../src/libvirt_public.syms \
$(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/libvirt_lxc.syms \
$(srcdir)/../src/driver.h
$(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/driver.h
$(AM_V_GEN)$(PERL) $(srcdir)/hvsupport.pl $(srcdir)/../src > $@ || { rm $@ && exit 1; }
.PHONY: todo
@@ -226,16 +220,12 @@ $(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
python_generated_files = \
$(srcdir)/html/libvirt-libvirt.html \
$(srcdir)/html/libvirt-libvirt-lxc.html \
$(srcdir)/html/libvirt-libvirt-qemu.html \
$(srcdir)/html/libvirt-virterror.html \
$(srcdir)/libvirt-api.xml \
$(srcdir)/libvirt-refs.xml \
$(srcdir)/libvirt-lxc-api.xml \
$(srcdir)/libvirt-lxc-refs.xml \
$(srcdir)/libvirt-qemu-api.xml \
$(srcdir)/libvirt-qemu-refs.xml \
$(NULL)
$(srcdir)/libvirt-qemu-refs.xml
APIBUILD=$(srcdir)/apibuild.py
APIBUILD_STAMP=$(APIBUILD).stamp
@@ -245,15 +235,11 @@ $(python_generated_files): $(APIBUILD_STAMP)
$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
$(srcdir)/../include/libvirt/libvirt.h.in \
$(srcdir)/../include/libvirt/libvirt-lxc.h \
$(srcdir)/../include/libvirt/libvirt-qemu.h \
$(srcdir)/../include/libvirt/virterror.h \
$(srcdir)/../src/libvirt.c \
$(srcdir)/../src/libvirt-lxc.c \
$(srcdir)/../src/libvirt-qemu.c \
$(srcdir)/../src/util/virerror.c \
$(srcdir)/../src/util/virevent.c \
$(srcdir)/../src/util/virtypedparam.c
$(srcdir)/../src/util/virterror.c
$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD)
touch $@
@@ -266,10 +252,9 @@ clean-local:
maintainer-clean-local: clean-local
rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
rm -rf $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
rm -rf $(APIBUILD_STAMP)
rebuild: api qemu_api lxc_api all
rebuild: api qemu_api all
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
@@ -287,7 +272,6 @@ install-data-local:
for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
$(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
done
$(INSTALL_DATA) $(srcdir)/libvirtLogo.png $(DESTDIR)$(pkgdatadir)
uninstall-local:
for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done

View File

@@ -8,28 +8,26 @@
<ul id="toc"></ul>
<h2><a name="Objects">Objects Exposed</a></h2>
<p> As defined in the <a href="goals.html">goals section</a>, the libvirt
API is designed to expose all the resources needed to manage the
virtualization support of recent operating systems. The first object
manipulated through the API is the <code>virConnectPtr</code>, which
represents the connection to a hypervisor. Any application using libvirt
is likely to start using the
<h2><a name="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 a <a href="uri.html">connection URI</a>
to select the right hypervisor to open.
A URI 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
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> Once the application obtains a <code class='docref'>virConnectPtr</code>
connection to the hypervisor it can then use it to manage the hypervisor's
available domains and related virtualization
resources, such as storage and networking. All those are
exposed as first class objects and connected to the hypervisor connection
<p> Once the application obtained a <code class='docref'>virConnectPtr</code>
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"
@@ -37,201 +35,92 @@
</p>
<p> The figure above shows the five main objects exported by the API:</p>
<ul>
<li><code class='docref'>virConnectPtr</code>
<p>Represents the connection to a hypervisor. Use one of the
<a href="html/libvirt-libvirt.html#virConnectOpen">virConnectOpen</a>
functions to obtain connection to the hypervisor which is then used
as a parameter to other connection API's.</p></li>
<li><code class='docref'>virDomainPtr</code>
<p>Represents one domain either active or defined (i.e. existing as
permanent config file and storage but not currently running on that
node). The function <code class='docref'>virConnectListAllDomains</code>
lists all the domains for the hypervisor.</p></li>
<li><code class='docref'>virNetworkPtr</code>
<p>Represents one network either active or defined (i.e. existing
as permanent config file and storage but not currently activated).
The function <code class='docref'>virConnectListAllNetworks</code>
lists all the virtualization networks for the hypervisor.</p></li>
<li><code class='docref'>virStorageVolPtr</code>
<p>Represents one storage volume generally used
<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 <code class='docref'>virConnectListDomains</code>
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 <code class='docref'>virConnectListNetworks</code>
allows to list all the virtualization networks activated 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
<code class="docref">virStorageVolLookupByPath</code> finds
the storage volume object based on its path on the node.</p></li>
<li><code class='docref'>virStoragePoolPtr</code>
<p>Represents a storage pool, which is a logical area
used to allocate and store storage volumes. The function
<code class='docref'>virConnectListAllStoragePools</code> lists
all of the virtualization storage pools on the hypervisor. The function
<code class="docref">virStoragePoolLookupByVolume</code> finds
the storage pool containing a given storage volume.</p></li>
<code class="docref">virStorageVolLookupByPath</code> 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
<code class="docref">virStoragePoolLookupByVolume</code> allows to find
the storage pool containing a given storage volume.</li>
</ul>
<p> Most objects manipulated by the library can also be represented using
<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, networks, and storage pools can be either <code>active</code>
<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
they can be activated dynamically in order to be used.</p>
<p> Most objects can also be named in various ways:</p>
thay can be activated dynamically in order to be used.</p>
<p> Most kind of object can also be named in various ways:</p>
<ul>
<li><code>name</code>
<p>A user friendly identifier but whose uniqueness
cannot be guaranteed between two nodes.</p></li>
<li><code>ID</code>
<p>A runtime unique identifier
provided by the hypervisor for one given activation of the object;
however, it becomes invalid once the resource is deactivated.</p></li >
<li><code>UUID</code>
<p> A 16 byte unique identifier
<li>by their <code>name</code>, an user friendly identifier but
whose unicity cannot be guaranteed 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 guaranteed to be unique for long term usage and across a
set of nodes.</p></li>
set of nodes.</li>
</ul>
<h2><a name="Functions">Functions and Naming Conventions</a></h2>
<h2><a name="Functions">Functions and naming
conventions</a></h2>
<p> The naming of the functions present in the library is usually
composed by a prefix describing the object associated to the function
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
<p> For each first class object you will find apis
for the following actions:</p>
<ul>
<li><b>Lookup</b> [...LookupBy...]
<p>Used to perform lookups on objects by some type of identifier,
such as:</p>
<ul>
<li><code class='docref'>virDomainLookupByID</code></li>
<li><code class='docref'>virDomainLookupByName</code></li>
<li><code class='docref'>virDomainLookupByUUID</code></li>
<li><code class='docref'>virDomainLookupByUUIDString</code></li>
</ul>
</li>
<li><b>Enumeration</b> [virConnectList..., virConnectNumOf...]
<p>Used to enumerate a set of object available to an given
hypervisor connection such as:</p>
<ul>
<li><code class='docref'>virConnectListDomains</code></li>
<li><code class='docref'>virConnectNumOfDomains</code></li>
<li><code class='docref'>virConnectListNetworks</code></li>
<li><code class='docref'>virConnectListStoragePools</code></li>
</ul>
</li>
<li><b>Description</b> [...GetInfo]
<p>Generic accessor providing a set of generic information about an
object, such as: </p>
<ul>
<li><code class='docref'>virNodeGetInfo</code></li>
<li><code class='docref'>virDomainGetInfo</code></li>
<li><code class='docref'>virStoragePoolGetInfo</code></li>
<li><code class='docref'>virStorageVolGetInfo</code></li>
</ul>
</li>
<li><b>Accessors</b> [...Get..., ...Set...]
<p>Specific accessors used to query or modify data for the given object,
such as: </p>
<ul>
<li><code class='docref'>virConnectGetType</code></li>
<li><code class='docref'>virDomainGetMaxMemory</code></li>
<li><code class='docref'>virDomainSetMemory</code></li>
<li><code class='docref'>virDomainGetVcpus</code></li>
<li><code class='docref'>virStoragePoolSetAutostart</code></li>
<li><code class='docref'>virNetworkGetBridgeName</code></li>
</ul>
</li>
<li><b>Creation</b> [...Create, ...CreateXML]
<p>Used to create and start objects. The ...CreateXML APIs will create
the object based on an XML description, while the ...Create APIs will
create the object based on existing object pointer, such as: </p>
<ul>
<li><code class='docref'>virDomainCreate</code></li>
<li><code class='docref'>virDomainCreateXML</code></li>
<li><code class='docref'>virNetworkCreate</code></li>
<li><code class='docref'>virNetworkCreateXML</code></li>
</ul>
</li>
<li><b>Destruction</b> [...Destroy]
<p>Used to shutdown or deactivate and destroy objects, such as: </p>
<ul>
<li><code class='docref'>virDomainDestroy</code></li>
<li><code class='docref'>virNetworkDestroy</code></li>
<li><code class='docref'>virStoragePoolDestroy</code></li>
</ul>
</li>
<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:
<code class='docref'>virConnectListDomains</code>,
<code class='docref'>virConnectNumOfDomains</code>,
<code class='docref'>virConnectListNetworks</code>,
<code class='docref'>virConnectListStoragePools</code>, etc.</li>
<li><b>Description</b>: ...GetInfo: those are generic accessor providing
a set of informations about an object, they are
<code class='docref'>virNodeGetInfo</code>,
<code class='docref'>virDomainGetInfo</code>,
<code class='docref'>virStoragePoolGetInfo</code>,
<code class='docref'>virStorageVolGetInfo</code>.</li>
<li><b>Accessors</b>: ...Get... and ...Set...: those are more specific
accessors to query or modify the given object, like
<code class='docref'>virConnectGetType</code>,
<code class='docref'>virDomainGetMaxMemory</code>,
<code class='docref'>virDomainSetMemory</code>,
<code class='docref'>virDomainGetVcpus</code>,
<code class='docref'>virStoragePoolSetAutostart</code>,
<code class='docref'>virNetworkGetBridgeName</code>, 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="Drivers">The libvirt Drivers</a></h2>
<p>Drivers are the basic building block for libvirt functionality
to support the capability to handle specific hypervisor driver calls.
Drivers are discovered and registered during connection processing as
part of the <code class='docref'>virInitialize</code> API. Each driver
has a registration API which loads up the driver specific function
references for the libvirt APIs to call. The following is a simplistic
view of the hypervisor driver mechanism. Consider the stacked list of
drivers as a series of modules that can be plugged into the architecture
depending on how libvirt is configured to be built.</p>
<h2><a name="Driver">The libvirt drivers</a></h2>
<p></p>
<p class="image">
<img alt="The libvirt driver architecture"
src="libvirt-driver-arch.png"/>
</p>
<p>The driver architecture is also used to support other virtualization
components such as storage, storage pools, host device, networking,
network interfaces, and network filters.</p>
<p>See the <a href="drivers.html">libvirt drivers</a> page for more
information on hypervisor and storage specific drivers.</p>
<p>Not all drivers support every virtualization function possible.
The <a href="hvsupport.html">libvirt API support matrix</a> lists
the various functions and support found in each driver by the version
support was added into libvirt.
</p>
<h2><a name="Remote">Daemon and Remote Access</a></h2>
<p>Access to libvirt drivers is primarily handled by the libvirtd
daemon through the <a href="remote.html">remote</a> driver via an
<a href="internals/rpc.html">RPC</a>. Some hypervisors do support
client-side connections and responses, such as Test, OpenVZ, VMware,
Power VM (phyp), VirtualBox (vbox), ESX, Hyper-V, Xen, and Parallels.
The libvirtd daemon service is started on the host at system boot
time and can also be restarted at any time by a properly privileged
user, such as root. The libvirtd daemon uses the same libvirt API
<code class='docref'>virInitialize</code> sequence as applications
for client-side driver registrations, but then extends the registered
driver list to encompass all known drivers supported for all driver
types supported on the host. </p>
<p>The libvirt client <a href="apps.html">applications</a> use a
<a href="uri.html">URI</a> to obtain the <code>virConnectPtr</code>.
The <code>virConnectPtr</code> keeps track of the driver connection
plus a variety of other connections (network, interface, storage, etc.).
The <code>virConnectPtr</code> is then used as a parameter to other
virtualization <a href="#Functions">functions</a>. Depending upon the
driver being used, calls will be routed through the remote driver to
the libvirtd daemon. The daemon will reference the connection specific
driver in order to retreive the requested information and then pass
back status and/or data through the connection back to the application.
The application can then decide what to do with that data, such as
display, write log data, etc. <a href="migration.html">Migration</a>
is an example of many facets of the architecture in use.</p>
<h2><a name="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>
<p>
The key takeaway from the above diagram is that there is a remote driver
which handles transactions for a majority of the drivers. The libvirtd
daemon running on the host will receive transaction requests from the
remote driver and will then query the hypervisor driver as specified in
the <code>virConnectPtr</code> in order to fetch the data. The data will
then be returned through the remote driver to the client application
for processing.
</p>
<p>If you are interested in contributing to libvirt, read the
<a href="http://wiki.libvirt.org/page/FAQ">FAQ</a> and
<a href="hacking.html">hacking</a> guidelines to gain an understanding
of basic rules and guidelines. In order to add new API functionality
follow the instructions regarding
<a href="api_extension.html">implementing a new API in libvirt</a>.
</p>
</body>
</html>

View File

@@ -10,7 +10,6 @@
import os, sys
import string
import glob
import re
quiet=True
warnings=0
@@ -24,9 +23,8 @@ included_files = {
"libvirt.h": "header with general libvirt API definitions",
"virterror.h": "header with error specific API definitions",
"libvirt.c": "Main interfaces for the libvirt library",
"virerror.c": "implements error handling and reporting code for libvirt",
"virevent.c": "event loop for monitoring file handles",
"virtypedparam.c": "virTypedParameters APIs",
"virterror.c": "implements error handling and reporting code for libvirt",
"event.c": "event loop for monitoring file handles",
}
qemu_included_files = {
@@ -34,11 +32,6 @@ qemu_included_files = {
"libvirt-qemu.c": "Implementations for the QEMU specific APIs",
}
lxc_included_files = {
"libvirt-lxc.h": "header with LXC specific API definitions",
"libvirt-lxc.c": "Implementations for the LXC specific APIs",
}
ignored_words = {
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
"ATTRIBUTE_SENTINEL": (0, "macro keyword"),
@@ -50,7 +43,6 @@ ignored_words = {
}
ignored_functions = {
"virConnectSupportsFeature": "private function for remote access",
"virDomainMigrateFinish": "private function for migration",
"virDomainMigrateFinish2": "private function for migration",
"virDomainMigratePerform": "private function for migration",
@@ -63,10 +55,14 @@ ignored_functions = {
"virDomainMigratePrepare3": "private function for migration",
"virDomainMigrateConfirm3": "private function for migration",
"virDomainMigratePrepareTunnel3": "private function for tunnelled migration",
"virDrvSupportsFeature": "private function for remote access",
"DllMain": "specific function for Win32",
"virTypedParameterArrayValidate": "internal function in virtypedparam.c",
"virTypedParameterAssign": "internal function in virtypedparam.c",
"virTypedParameterAssignFromStr": "internal function in virtypedparam.c",
"virEventAddHandle": "internal function in event.c",
"virEventUpdateHandle": "internal function in event.c",
"virEventRemoveHandle": "internal function in event.c",
"virEventAddTimeout": "internal function in event.c",
"virEventUpdateTimeout": "internal function in event.c",
"virEventRemoveTimeout": "internal function in event.c",
}
ignored_macros = {
@@ -244,6 +240,8 @@ class index:
self.includes[name] = d
elif type == "struct":
self.structs[name] = d
elif type == "struct":
self.structs[name] = d
elif type == "union":
self.unions[name] = d
elif type == "enum":
@@ -409,7 +407,7 @@ class CLexer:
return self.lineno
def push(self, token):
self.tokens.insert(0, token)
self.tokens.insert(0, token);
def debug(self):
print "Last token: ", self.last
@@ -429,7 +427,7 @@ class CLexer:
if line[0] == '#':
self.tokens = map((lambda x: ('preproc', x)),
string.split(line))
break
break;
l = len(line)
if line[0] == '"' or line[0] == "'":
end = line[0]
@@ -658,18 +656,27 @@ class CParser:
lines = string.split(comment, "\n")
item = None
for line in lines:
line = line.lstrip().lstrip('*').lstrip()
m = re.match('([_.a-zA-Z0-9]+):(.*)', line)
if m:
item = m.group(1)
line = m.group(2).lstrip()
if item:
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
self.index.info = res
def strip_lead_star(self, line):
@@ -699,7 +706,7 @@ class CParser:
if self.top_comment == "":
self.top_comment = com
if self.comment == None or com[0] == '*':
self.comment = com
self.comment = com;
else:
self.comment = self.comment + com
token = self.lexer.token()
@@ -897,7 +904,7 @@ class CParser:
while i < nbargs:
if args[i][1] == arg:
args[i] = (args[i][0], arg, desc)
break
break;
i = i + 1
if i >= nbargs:
if not quiet:
@@ -1141,10 +1148,10 @@ class CParser:
type = type + token[1]
token = self.token()
elif token != None and token[0] == 'sep' and token[1] == ';':
break
break;
elif token != None and token[0] == 'name':
type = base_type
continue
continue;
else:
self.error("parsing typedef: expecting ';'", token)
return token
@@ -1239,7 +1246,7 @@ class CParser:
else:
self.error("parseStruct: name", token)
token = self.token()
self.type = base_type
self.type = base_type;
self.struct_fields = fields
#self.debug("end parseStruct", token)
#print fields
@@ -1289,7 +1296,7 @@ class CParser:
else:
self.error("parseUnion: name", token)
token = self.token()
self.type = base_type
self.type = base_type;
self.union_fields = fields
# self.debug("end parseUnion", token)
# print fields
@@ -1633,7 +1640,7 @@ class CParser:
self.type = self.type + token[1]
token = self.token()
if token == None or token[0] != "name" :
self.error("parsing function type, name expected", token)
self.error("parsing function type, name expected", token);
return token
self.type = self.type + token[1]
nametok = token
@@ -1643,14 +1650,14 @@ class CParser:
token = self.token()
if token != None and token[0] == "sep" and token[1] == '(':
token = self.token()
type = self.type
token = self.parseSignature(token)
self.type = type
type = self.type;
token = self.parseSignature(token);
self.type = type;
else:
self.error("parsing function type, '(' expected", token)
self.error("parsing function type, '(' expected", token);
return token
else:
self.error("parsing function type, ')' expected", token)
self.error("parsing function type, ')' expected", token);
return token
self.lexer.push(token)
token = nametok
@@ -1675,7 +1682,7 @@ class CParser:
self.type = self.type + token[1]
token = self.token()
else:
self.error("parsing array type, ']' expected", token)
self.error("parsing array type, ']' expected", token);
return token
elif token != None and token[0] == "sep" and token[1] == ':':
# remove :12 in case it's a limited int size
@@ -1904,7 +1911,7 @@ class CParser:
self.index_add(self.name, self.filename, static,
"function", d)
token = self.token()
token = self.parseBlock(token)
token = self.parseBlock(token);
elif token[1] == ',':
self.comment = None
self.index_add(self.name, self.filename, static,
@@ -1948,25 +1955,18 @@ class docBuilder:
self.includes = includes + included_files.keys()
elif name == "libvirt-qemu":
self.includes = includes + qemu_included_files.keys()
elif name == "libvirt-lxc":
self.includes = includes + lxc_included_files.keys()
self.modules = {}
self.headers = {}
self.idx = index()
self.xref = {}
self.index = {}
self.basename = name
self.errors = 0
def warning(self, msg):
global warnings
warnings = warnings + 1
print msg
def error(self, msg):
self.errors += 1
print >>sys.stderr, "Error:", msg
def indexString(self, id, str):
if str == None:
return
@@ -2014,7 +2014,7 @@ class docBuilder:
for header in self.headers.keys():
parser = CParser(header)
idx = parser.parse()
self.headers[header] = idx
self.headers[header] = idx;
self.idx.merge(idx)
def scanModules(self):
@@ -2032,19 +2032,19 @@ class docBuilder:
skip = 1
for incl in self.includes:
if string.find(file, incl) != -1:
skip = 0
skip = 0;
break
if skip == 0:
self.modules[file] = None
self.modules[file] = None;
files = glob.glob(directory + "/*.h")
for file in files:
skip = 1
for incl in self.includes:
if string.find(file, incl) != -1:
skip = 0
skip = 0;
break
if skip == 0:
self.headers[file] = None
self.headers[file] = None;
self.scanHeaders()
self.scanModules()
@@ -2067,11 +2067,11 @@ class docBuilder:
val = eval(info[0])
except:
val = info[0]
output.write(" value='%s'" % (val))
output.write(" value='%s'" % (val));
if info[2] != None and info[2] != '':
output.write(" type='%s'" % info[2])
output.write(" type='%s'" % info[2]);
if info[1] != None and info[1] != '':
output.write(" info='%s'" % escape(info[1]))
output.write(" info='%s'" % escape(info[1]));
output.write("/>\n")
def serialize_macro(self, output, name):
@@ -2119,7 +2119,7 @@ class docBuilder:
if self.idx.structs.has_key(name) and ( \
type(self.idx.structs[name].info) == type(()) or
type(self.idx.structs[name].info) == type([])):
output.write(">\n")
output.write(">\n");
try:
for field in self.idx.structs[name].info:
desc = field[2]
@@ -2136,7 +2136,7 @@ class docBuilder:
self.warning("Failed to serialize struct %s" % (name))
output.write(" </struct>\n")
else:
output.write("/>\n")
output.write("/>\n");
else :
output.write(" <typedef name='%s' file='%s' type='%s'" % (
name, self.modulename_file(id.header), id.info))
@@ -2176,7 +2176,7 @@ class docBuilder:
if apstr != "":
apstr = apstr + " &amp;&amp; "
apstr = apstr + cond
output.write(" <cond>%s</cond>\n"% (apstr))
output.write(" <cond>%s</cond>\n"% (apstr));
try:
(ret, params, desc) = id.info
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
@@ -2184,8 +2184,6 @@ class docBuilder:
if ret[0] != None:
if ret[0] == "void":
output.write(" <return type='void'/>\n")
elif (ret[1] == None or ret[1] == '') and not ignored_functions.has_key(name):
self.error("Missing documentation for return of function `%s'" % name)
else:
output.write(" <return type='%s' info='%s'/>\n" % (
ret[0], escape(ret[1])))
@@ -2193,17 +2191,13 @@ class docBuilder:
for param in params:
if param[0] == 'void':
continue
if (param[2] == None or param[2] == ''):
if ignored_functions.has_key(name):
output.write(" <arg name='%s' type='%s' info=''/>\n" % (param[1], param[0]))
else:
self.error("Missing documentation for arg `%s' of function `%s'" % (param[1], name))
if param[2] == None:
output.write(" <arg name='%s' type='%s' info=''/>\n" % (param[1], param[0]))
else:
output.write(" <arg name='%s' type='%s' info='%s'/>\n" % (param[1], param[0], escape(param[2])))
self.indexString(name, param[2])
except:
print >>sys.stderr, "Exception:", sys.exc_info()[1]
self.warning("Failed to save function %s info: %s" % (name, `id.info`))
self.warning("Failed to save function %s info: " % name, `id.info`)
output.write(" </%s>\n" % (id.type))
def serialize_exports(self, output, file):
@@ -2388,7 +2382,7 @@ class docBuilder:
letter = id[0]
output.write(" <letter name='%s'>\n" % (letter))
output.write(" <word name='%s'>\n" % (id))
tokens = index[id]
tokens = index[id];
tokens.sort()
tok = None
for token in tokens:
@@ -2467,10 +2461,6 @@ class docBuilder:
output.write("</api>\n")
output.close()
if self.errors > 0:
print >>sys.stderr, "apibuild.py: %d error(s) encountered during generation" % self.errors
sys.exit(3)
filename = "%s/%s-refs.xml" % (self.path, self.name)
if not quiet:
print "Saving XML Cross References %s" % (filename)
@@ -2483,7 +2473,7 @@ class docBuilder:
def rebuild(name):
if name not in ["libvirt", "libvirt-qemu", "libvirt-lxc"]:
if name not in ["libvirt", "libvirt-qemu"]:
self.warning("rebuild() failed, unknown module %s") % name
return None
builder = None
@@ -2526,7 +2516,6 @@ if __name__ == "__main__":
else:
rebuild("libvirt")
rebuild("libvirt-qemu")
rebuild("libvirt-lxc")
if warnings > 0:
sys.exit(2)
else:

View File

@@ -25,7 +25,7 @@ for the authentication file using the following sequence:
variable.</li>
<li>The file path specified by the "authfile=/some/file" URI
query parameter</li>
<li>The file $XDG_CONFIG_HOME/libvirt/auth.conf</li>
<li>The file $XDG_CONFIG_DIR/libvirt/auth.conf</li>
<li>The file /etc/libvirt/auth.conf</li>
</ol>
@@ -253,15 +253,13 @@ Plugin "gssapiv2" [loaded], API version: 4
features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION|NEED_SERVER_FQDN
</pre>
<p>
Next it is necessary for the administrator of the Kerberos realm to
issue a principal for the libvirt server. There needs to be one
principal per host running the libvirt daemon. The principal 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 principals. Once created, the principal should be
exported to a keytab, copied to the host running the libvirt daemon
and placed in <code>/etc/libvirt/krb5.tab</code>
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
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
@@ -283,7 +281,7 @@ kadmin.local: quit
</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 principal. This may well
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>

View File

@@ -30,7 +30,6 @@
<li><strong><a href="drvxen.html">Xen</a></strong></li>
<li><strong><a href="drvhyperv.html">Microsoft Hyper-V</a></strong></li>
<li><strong><a href="drvphyp.html">IBM PowerVM (phyp)</a></strong></li>
<li><strong><a href="drvparallels.html">Parallels</a></strong></li>
</ul>
<h2><a name="storage">Storage drivers</a></h2>

View File

@@ -53,14 +53,6 @@
the <code>/etc/xen</code> directory. It is important not to place
any other non-config files in this directory.
</li>
<li>
<strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
toolstack is deprecated in favor of libxl, also commonly called
libxenlight. libvirt supports this new Xen toolstack via the
libxl driver. If XenD is enabled, the legacy xen driver consisting
of the above mentioned channels will be used. If XenD is disabled,
the libxl driver will be used.
</li>
</ul>
<h2><a name="uri">Connections to Xen driver</a></h2>

View File

@@ -198,7 +198,7 @@ using an XML format. At a high level the format looks like this:
</p>
<p>The <code>&lt;rule&gt;</code> element is where all the interesting stuff
happens. It has three attributes, an action, a traffic direction and an
optional priority. E.g.:
optional priority. eg:
</p>
<pre>&lt;rule action='drop' direction='out' priority='500'&gt;</pre>
<p>Within the rule there are a wide variety of elements allowed, which

View File

@@ -232,7 +232,6 @@
&lt;kernel&gt;/root/f8-i386-vmlinuz&lt;/kernel&gt;
&lt;initrd&gt;/root/f8-i386-initrd&lt;/initrd&gt;
&lt;cmdline&gt;console=ttyS0 ks=http://example.com/f8-i386/os/&lt;/cmdline&gt;
&lt;dtb&gt;/root/ppc.dtb&lt;/dtb&gt;
&lt;/os&gt;
...</pre>
@@ -254,10 +253,6 @@
the kernel (or installer) at boottime. This is often used to
specify an alternate primary console (eg serial port), or the
installation media source / kickstart file</dd>
<dt><code>dtb</code></dt>
<dd>The contents of this element specify the fully-qualified path
to the (optional) device tree binary (dtb) image in the host OS.
<span class="since">Since 1.0.4</span></dd>
</dl>
<h4><a name="eleemntsOSContainer">Container boot</a></h4>
@@ -716,35 +711,6 @@
</dl>
<h3><a name="resPartition">Resource partitioning</a></h3>
<p>
Hypervisors may allow for virtual machines to be placed into
resource partitions, potentially with nesting of said partitions.
The <code>resource</code> element groups together configuration
related to resource partitioning. It currently supports a child
element <code>partition</code> whose content defines the path
of the resource partition in which to place the domain. If no
partition is listed, then the domain will be placed in a default
partition. It is the responsibility of the app/admin to ensure
that the partition exists prior to starting the guest. Only the
(hypervisor specific) default partition can be assumed to exist
by default.
</p>
<pre>
...
&lt;resource&gt;
&lt;partition&gt;/virtualmachines/production&lt;/partition&gt;
&lt;/resource&gt;
...
</pre>
<p>
Resource partitions are currently supported by the QEMU and
LXC drivers, which map partition paths to cgroups directories,
in all mounted controllers. <span class="since">Since 1.0.5</span>
</p>
<h3><a name="elementsCPU">CPU model and topology</a></h3>
<p>
@@ -1082,7 +1048,7 @@
&lt;hap/&gt;
&lt;privnet/&gt;
&lt;hyperv&gt;
&lt;relaxed state='on'/&gt;
&lt;relaxed state='on'&gt;
&lt;/hyperv&gt;
&lt;/features&gt;
@@ -1401,11 +1367,6 @@
&lt;blockio logical_block_size='512' physical_block_size='4096'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt;
&lt;disk type='volume' device='disk'&gt;
&lt;driver name='qemu' type='raw'/&gt;
&lt;source pool='blk-pool0' volume='blk-pool0-vol0'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt;
&lt;/devices&gt;
...</pre>
@@ -1434,18 +1395,7 @@
rawio='yes', rawio capability will be enabled for all disks in
the domain (because, in the case of QEMU, this capability can
only be set on a per-process basis). This attribute is only
valid when device is "lun". NB, <code>rawio</code> intends to
confine the capability per-device, however, current QEMU
implementation gives the domain process broader capability
than that (per-process basis, affects all the domain disks).
To confine the capability as much as possible for QEMU driver
as this stage, <code>sgio</code> is recommended, it's more
secure than <code>rawio</code>.
The optional <code>sgio</code> (<span class="since">since 1.0.2</span>)
attribute indicates whether the kernel will filter unprivileged
SG_IO commands for the disk, valid settings are "filtered" or
"unfiltered". Defaults to "filtered". Similar to <code>rawio</code>,
<code>sgio</code> is only valid for device 'lun'.
valid when device is "lun".
The optional <code>snapshot</code> attribute indicates the default
behavior of the disk during disk snapshots: "internal"
requires a file format such as qcow2 that can store both the
@@ -1468,42 +1418,29 @@
path to the file holding the disk. If the disk
<code>type</code> is "block", then the <code>dev</code>
attribute specifies the path to the host device to serve as
the disk. With "file", "block", and "volume", one or more optional
the disk. With both "file" and "block", one or more optional
sub-elements <code>seclabel</code>, <a href="#seclabel">described
below</a> (and <span class="since">since 0.9.9</span>), can be
used to override the domain security labeling policy for just
that source file. (NB, for "volume" type disk, <code>seclabel</code>
is only valid when the specified storage volume is of 'file' or
'block' type). If the disk <code>type</code> is "dir", then the
that source file. If the disk <code>type</code> is "dir", then the
<code>dir</code> attribute specifies the fully-qualified path
to the directory to use as the disk. If the disk <code>type</code>
is "network", then the <code>protocol</code> attribute specifies
the protocol to access to the requested image; possible values
are "nbd", "iscsi", "rbd", "sheepdog" or "gluster". If the
<code>protocol</code> attribute is "rbd", "sheepdog" or "gluster", an
additional attribute <code>name</code> is mandatory to specify which
volume/image will be used; for "nbd" it is optional. For "iscsi",
the <code>name</code> attribute may include a logical unit number,
separated from the target's name by a slash (for example,
<code>iqn.1992-01.com.example/1</code>); the default LUN is zero.
When the disk <code>type</code> is "network", the <code>source</code>
may have zero or more <code>host</code> sub-elements used to
specify the hosts to connect. If the disk <code>type</code> is
"volume", the underlying disk source is represented by attributes
<code>pool</code> and <code>volume</code>. Attribute <code>pool</code>
specifies the name of storage pool (managed by libvirt) where the disk
source resides, and attribute <code>volume</code> specifies the name of
storage volume (managed by libvirt) used as the disk source.
are "nbd", "rbd", and "sheepdog". If the <code>protocol</code>
attribute is "rbd" or "sheepdog", an additional
attribute <code>name</code> is mandatory to specify which
image will be used. When the disk <code>type</code> is
"network", the <code>source</code> may have zero or
more <code>host</code> sub-elements used to specify the hosts
to connect.
<span class="since">Since 0.0.3; <code>type='dir'</code> since
0.7.5; <code>type='network'</code> since
0.8.7; <code>protocol='iscsi'</code> since 1.0.4;
<code>type='volume'</code> since 1.0.5;</span><br/>
For a "file" or "volume" disk type which represents a cdrom or floppy
0.7.5; <code>type='network'</code> since 0.8.7</span><br/>
For a "file" disk type which represents a cdrom or floppy
(the <code>device</code> attribute), it is possible to define
policy what to do with the disk if the source file is not accessible.
(NB, <code>startupPolicy</code> is not valid for "volume" disk unless
the specified storage volume is of "file" type). This is done by the
<code>startupPolicy</code> attribute, accepting these values:
This is done by the <code>startupPolicy</code> attribute, accepting
these values:
<table class="top_table">
<tr>
<td> mandatory </td>
@@ -1544,8 +1481,8 @@
attribute specifies the type of disk device to emulate;
possible values are driver specific, with typical values being
"ide", "scsi", "virtio", "xen", "usb" or "sata". If omitted, the bus
type is inferred from the style of the device name (e.g. a device named
'sda' will typically be exported using a SCSI bus). The optional
type is inferred from the style of the device name. eg, a device named
'sda' will typically be exported using a SCSI bus. The optional
attribute <code>tray</code> indicates the tray status of the
removable disks (i.e. CDROM or Floppy disk), the value can be either
"open" or "closed", defaults to "closed". NB, the value of
@@ -1694,7 +1631,7 @@
<dt><code>readonly</code></dt>
<dd>If present, this indicates the device cannot be modified by
the guest. For now, this is the default for disks with
attribute <code>device='cdrom'</code>.
attribute <code>type='cdrom'</code>.
</dd>
<dt><code>shareable</code></dt>
<dd>If present, this indicates the device is expected to be shared
@@ -1720,67 +1657,32 @@
of 16 hexadecimal digits.
<span class='since'>Since 0.10.1</span>
</dd>
<dt><code>vendor</code></dt>
<dd>If present, this element specifies the vendor of a virtual hard
disk or CD-ROM device. It must not be longer than 8 printable
characters.
<span class='since'>Since 1.0.1</span>
</dd>
<dt><code>product</code></dt>
<dd>If present, this element specifies the product of a virtual hard
disk or CD-ROM device. It must not be longer than 16 printable
characters.
<span class='since'>Since 1.0.1</span>
</dd>
<dt><code>host</code></dt>
<dd>The <code>host</code> element supports 4 attributes, viz. "name",
"port", "transport" and "socket", which specify the hostname, the port
number, transport type and path to socket, respectively. The meaning
of this element and the number of the elements depend on the protocol
attribute.
<dd>The <code>host</code> element has two attributes "name" and "port",
which specify the hostname and the port number. The meaning of this
element and the number of the elements depend on the protocol attribute.
<table class="top_table">
<tr>
<th> Protocol </th>
<th> Meaning </th>
<th> Number of hosts </th>
<th> Default port </th>
</tr>
<tr>
<td> nbd </td>
<td> a server running nbd-server </td>
<td> only one </td>
<td> 10809 </td>
</tr>
<tr>
<td> iscsi </td>
<td> an iSCSI server </td>
<td> only one </td>
<td> 3260 </td>
</tr>
<tr>
<td> rbd </td>
<td> monitor servers of RBD </td>
<td> one or more </td>
<td> 6789 </td>
</tr>
<tr>
<td> sheepdog </td>
<td> one of the sheepdog servers (default is localhost:7000) </td>
<td> zero or one </td>
<td> 7000 </td>
</tr>
<tr>
<td> gluster </td>
<td> a server running glusterd daemon </td>
<td> only one </td>
<td> 24007 </td>
</tr>
</table>
gluster supports "tcp", "rdma", "unix" as valid values for the
transport attribute. nbd supports "tcp" and "unix". Others only
support "tcp". If nothing is specified, "tcp" is assumed. If the
transport is "unix", the socket attribute specifies the path to an
AF_UNIX socket.
</dd>
<dt><code>address</code></dt>
<dd>If present, the <code>address</code> element ties the disk
@@ -1811,12 +1713,12 @@
holds the actual password or other credentials (the domain XML
intentionally does not expose the password, only the reference
to the object that does manage the password). For now, the
known secret <code>type</code>s are "ceph", for Ceph RBD
network sources, and "iscsi", for CHAP authentication of iSCSI
targets. Both require either a <code>uuid</code> attribute
with the UUID of the secret object, or a <code>usage</code>
attribute matching the key that was specified in the
secret object. <span class="since">libvirt 0.9.7</span>
only known secret <code>type</code> is "ceph", for Ceph RBD
network sources, and requires either an
attribute <code>uuid</code> with the UUID of the Ceph secret
object, or an attribute <code>usage</code> with the name
associated with the Ceph secret
object. <span class="since">libvirt 0.9.7</span>
</dd>
<dt><code>geometry</code></dt>
<dd>The optional <code>geometry</code> element provides the
@@ -2083,20 +1985,6 @@
of the starting register). <span class="since">Since
0.9.9.</span>
</dd>
<dt><code>type='ccw'</code></dt>
<dd>s390 guests with a <code>machine</code> value of
s390-ccw-virtio use the native CCW bus for I/O devices.
CCW bus addresses have the following additional attributes:
<code>cssid</code> (a hex value between 0 and 0xfe, inclusive),
<code>ssid</code> (a value between 0 and 3, inclusive) and
<code>devno</code> (a hex value between 0 and 0xffff, inclusive).
Partially specified bus addresses are not allowed.
If omitted, libvirt will assign a free bus address with
cssid=0xfe and ssid=0. Virtio devices for s390 must have their
cssid set to 0xfe in order to be recognized by the guest
operating system.
<span class="since">Since 1.0.4</span>
</dd>
</dl>
<h4><a name="elementsControllers">Controllers</a></h4>
@@ -2124,7 +2012,7 @@
<p>
Each controller has a mandatory attribute <code>type</code>,
which must be one of "ide", "fdc", "scsi", "sata", "usb",
"ccid", "virtio-serial" or "pci", and a mandatory
"ccid", or "virtio-serial", and a mandatory
attribute <code>index</code> which is the decimal integer
describing in which order the bus controller is encountered (for
use in <code>controller</code> attributes
@@ -2134,16 +2022,14 @@
control how many devices can be connected through the
controller. A "scsi" controller has an optional
attribute <code>model</code>, which is one of "auto", "buslogic",
"ibmvscsi", "lsilogic", "lsisas1068", "lsisas1078", "virtio-scsi" or
"vmpvscsi". A "usb" controller has an optional attribute
<code>model</code>, which is one of "piix3-uhci", "piix4-uhci", "ehci",
"ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3", "vt82c686b-uhci",
"pci-ohci" or "nec-xhci". Additionally,
"ibmvscsi", "lsilogic", "lsias1068", "virtio-scsi" or "vmpvscsi".
A "usb" controller has an optional attribute <code>model</code>,
which is one of "piix3-uhci", "piix4-uhci", "ehci",
"ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3",
"vt82c686b-uhci", "pci-ohci" or "nec-xhci". Additionally,
<span class="since">since 0.10.0</span>, if the USB bus needs to be
explicitly disabled for the guest, <code>model='none'</code> may be
used. <span class="since">Since 1.0.5</span>, no default USB controller
will be built on s390. The PowerPC64 "spapr-vio" addresses do not have an
associated controller.
explicitly disabled for the guest, <code>model='none'</code> may be used.
The PowerPC64 "spapr-vio" addresses do not have an associated controller.
</p>
<p>
@@ -2153,13 +2039,6 @@
semantics <a href="#elementsAddress">given above</a>.
</p>
<p>
An optional sub-element <code>driver</code> can specify the driver
specific options. Currently it only supports attribute <code>queues</code>
(<span class="since">1.0.5</span>, QEMU and KVM only), which specifies the
number of queues for the controller. For best performance, it's recommended
to specify a value matching the number of vCPUs.
</p>
<p>
USB companion controllers have an optional
sub-element <code>&lt;master&gt;</code> to specify the exact
@@ -2180,31 +2059,6 @@
&lt;/controller&gt;
...
&lt;/devices&gt;
...</pre>
<p>
PCI controllers have an optional <code>model</code> attribute with
possible values <code>pci-root</code> or <code>pci-bridge</code>.
For machine types which provide an implicit pci bus, the pci-root
controller with index=0 is auto-added and required to use PCI devices.
PCI root has no address.
PCI bridges are auto-added if there are too many devices to fit on
the one bus provided by pci-root, or a PCI bus number greater than zero
was specified.
PCI bridges can also be specified manually, but their addresses should
only refer to PCI buses provided by already specified PCI controllers.
Leaving gaps in the PCI controller indexes might lead to an invalid
configuration.
(<span class="since">since 1.0.5</span>)
</p>
<pre>
...
&lt;devices&gt;
&lt;controller type='pci' index='0' model='pci-root'/&gt;
&lt;controller type='pci' index='1' model='pci-bridge'&gt;
&lt;address type='pci' domain='0' bus='0' slot='5' function='0' multifunction=off'/&gt;
&lt;/controller&gt;
&lt;/devices&gt;
...</pre>
<h4><a name="elementsLease">Device leases</a></h4>
@@ -2247,15 +2101,13 @@
</dd>
</dl>
<h4><a name="elementsHostDev">Host device assignment</a></h4>
<h5><a href="elementsHostDevSubsys">USB / PCI devices</a></h5>
<h4><a name="elementsUSB">USB and PCI devices</a></h4>
<p>
USB and PCI devices attached to the host can be passed through
to the guest using the <code>hostdev</code> element.
<span class="since">since after 0.4.4 for USB and 0.6.0 for PCI
(KVM only)</span>:
to the guest using
the <code>hostdev</code> element. <span class="since">since after
0.4.4 for USB and 0.6.0 for PCI (KVM only)</span>:
</p>
<pre>
@@ -2340,8 +2192,7 @@
boot sequence. The per-device <code>boot</code> elements cannot be
used together with general boot elements in
<a href="#elementsOSBIOS">BIOS bootloader</a> section.
<span class="since">Since 0.8.8</span> for PCI devices,
<span class="since">Since 1.0.1</span> for USB devices.
<span class="since">Since 0.8.8</span></dd>
<dt><code>rom</code></dt>
<dd>The <code>rom</code> element is used to change how a PCI
device's ROM is presented to the guest. The optional <code>bar</code>
@@ -2370,79 +2221,7 @@
the device as can be found with the <code>lspci</code> or
with <code>virsh
nodedev-list</code>. <a href="#elementsAddress">See above</a> for
more details on the address element.</dd>
<dt><code>driver</code></dt>
<dd>
PCI devices can have an optional <code>driver</code>
subelement that specifies which backend driver to use for PCI
device assignment. Use the <code>name</code> attribute to
select either "vfio" (for the new VFIO device assignment
backend, which is compatible with UEFI SecureBoot) or "kvm"
(for the legacy device assignment handled directly by the KVM
kernel module)<span class="since">Since 1.0.5 (QEMU and KVM
only, requires kernel 3.6 or newer)</span>. Currently, "kvm"
is the default used by libvirt when not explicitly provided,
but since the two are functionally equivalent, this default
could be changed in the future with no impact to domains that
don't specify anything.
</dd>
</dl>
<h5><a href="elementsHostDevCaps">Block / character devices</a></h5>
<p>
Block / character devices from the host can be passed through
to the guest using the <code>hostdev</code> element. This is
only possible with container based virtualization.
<span class="since">since after 1.0.1 for LXC</span>:
</p>
<pre>
...
&lt;hostdev mode='capabilities' type='storage'&gt;
&lt;source&gt;
&lt;block&gt;/dev/sdf1&lt;/block&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...
</pre>
<pre>
...
&lt;hostdev mode='capabilities' type='misc'&gt;
&lt;source&gt;
&lt;char&gt;/dev/input/event3&lt;/char&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...
</pre>
<pre>
...
&lt;hostdev mode='capabilities' type='net'&gt;
&lt;source&gt;
&lt;interface&gt;eth0&lt;/interface&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...
</pre>
<dl>
<dt><code>hostdev</code></dt>
<dd>The <code>hostdev</code> element is the main container for describing
host devices. For block/character device passthrough <code>mode</code> is
always "capabilities" and <code>type</code> is "block" for a block
device, "char" for a character device and "net" for a host network
interface.
</dd>
<dt><code>source</code></dt>
<dd>The source element describes the device as seen from the host.
For block devices, the path to the block device in the host
OS is provided in the nested "block" element, while for character
devices the "char" element is used. For network interfaces, the
name of the interface is provided in the "interface" element.
</dd>
more details on the address element.
</dl>
<h4><a name="elementsRedir">Redirected devices</a></h4>
@@ -2458,7 +2237,6 @@
&lt;devices&gt;
&lt;redirdev bus='usb' type='tcp'&gt;
&lt;source mode='connect' host='localhost' service='4000'/&gt;
&lt;boot order='1'/&gt;
&lt;/redirdev&gt;
&lt;redirfilter&gt;
&lt;usbdev class='0x08' vendor='0x1234' product='0xbeef' version='2.00' allow='yes'/&gt;
@@ -2480,33 +2258,24 @@
tunnel; <code>type='tcp'</code>
or <code>type='spicevmc'</code> (which uses the usbredir
channel of a <a href="#elementsGraphics">SPICE graphics
device</a>) are typical. The redirdev element has an optional
sub-element <code>&lt;address&gt;</code> which can tie the
device</a>) are typical.The redirdev element has an optional
sub-element<code>&lt;address&gt;</code> which can tie the
device to a particular controller. Further sub-elements,
such as <code>&lt;source&gt;</code>, may be required according
to the given type, although a <code>&lt;target&gt;</code> sub-element
is not required (since the consumer of the character device is
the hypervisor itself, rather than a device visible in the guest).
</dd>
<dt><code>boot</code></dt>
<dd>Specifies that the device is bootable.
The <code>order</code> attribute determines the order in which
devices will be tried during boot sequence. The per-device
<code>boot</code> elements cannot be used together with general
boot elements in <a href="#elementsOSBIOS">BIOS bootloader</a> section.
(<span class="since">Since 1.0.1</span>)
the hypervisor itself,rather than a device visible in the guest).
</dd>
<dt><code>redirfilter</code></dt>
<dd>The<code> redirfilter </code>element is used for creating the
filter rule to filter out certain devices from redirection.
It uses sub-element <code>&lt;usbdev&gt;</code> to define each filter rule.
<code>class</code> attribute is the USB Class code, for example,
It uses sub-element <code>&lt;usbdev&gt;</code>to define each filter rule.
<code>class</code>attribute is the USB Class code, for example,
0x08 represents mass storage devices. The USB device can be addressed by
vendor / product id using the <code>vendor</code> and <code>product</code> attributes.
vendor / product id using the<code>vendor</code> and <code>product</code> attributes.
<code>version</code> is the bcdDevice value of USB device, such as 1.00, 1.10 and 2.00.
These four attributes are optional and <code>-1</code> can be used to allow
any value for them. <code>allow</code> attribute is mandatory,
any value for them. <code>allow</code>attribute is mandatory,
'yes' means allow, 'no' for deny.
</dd>
</dl>
@@ -2697,15 +2466,12 @@
virtualport types (and also to leave out certain attributes); at
domain startup time, a complete <code>&lt;virtualport&gt;</code>
element will be constructed by merging together the type and
attributes defined in the network and the portgroup referenced
by the interface. The newly-constructed virtualport is a combination
of them. The attributes from lower virtualport can't make change
on the ones defined in higher virtualport.
Interface takes the highest priority, portgroup is lowest priority.
attributes found in the which will be filled in from the network
or portgroup <code>&lt;virtualport&gt;</code>)
(<span class="since">Since 0.10.0</span>). For example, in order
to work properly with both an 802.1Qbh switch and an Open vSwitch
switch, you may choose to specify no type, but both
an <code>profileid</code> (in case the switch is 802.1Qbh) and
an <code>instanceid</code> (in case the switch is 802.1Qbh) and
an <code>interfaceid</code> (in case the switch is Open vSwitch)
(you may also omit the other attributes, such as managerid,
typeid, or profileid, to be filled in from the
@@ -2746,7 +2512,7 @@
</p>
<p>
Provides a bridge from the VM directly to the LAN. This assumes
Provides a bridge from the VM directly onto the LAN. This assumes
there is a bridge device on the host which has one or more of the hosts
physical NICs enslaved. The guest VM will have an associated tun device
created with a name of vnetN, which can also be overridden with the
@@ -2785,7 +2551,7 @@
&lt;/interface&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='ovsbr'/&gt;
&lt;virtualport type='openvswitch'&gt;
&lt;virtualport type='openvswitch'/&gt;
&lt;parameters profileid='menial' interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/&gt;
&lt;/virtualport&gt;
&lt;/interface&gt;
@@ -2953,7 +2719,7 @@
<dl>
<dt><code>profileid</code></dt>
<dd>The profile ID contains the name of the port profile that is to
be applied to this interface. This name is resolved by the port
be applied onto this interface. This name is resolved by the port
profile database into the network parameters from the port profile,
and those network parameters will be applied to this interface.
</dd>
@@ -2991,18 +2757,6 @@
<span class="since">Since 0.9.11</span>
</p>
<p>
To use VFIO device assignment rather than traditional/legacy KVM
device assignment (VFIO is a new method of device assignment
that is compatible with UEFI Secure Boot), a type='hostdev'
interface can have an optional <code>driver</code> sub-element
with a <code>name</code> attribute set to "vfio". To use legacy
KVM device assignment you can set <code>name</code> to "kvm" (or
simply omit the <code>&lt;driver&gt;</code> element, since "kvm"
is currently the default).
<span class="since">Since 1.0.5 (QEMU and KVM only, requires kernel 3.6 or newer)</span>
</p>
<p>
Note that this "intelligent passthrough" of network devices is
very similar to the functionality of a standard &lt;hostdev&gt;
@@ -3021,7 +2775,6 @@
...
&lt;devices&gt;
&lt;interface type='hostdev'&gt;
&lt;driver name='vfio'/&gt;
&lt;source&gt;
&lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/&gt;
&lt;/source&gt;
@@ -3153,19 +2906,6 @@ qemu-kvm -net nic,model=? /dev/null
to 'qemu' without error.
<span class="since">Since 0.8.8 (QEMU and KVM only)</span>
</dd>
<dd>
For interfaces of type='hostdev' (PCI passthrough devices)
the <code>name</code> attribute can optionally be set to
"vfio" or "kvm". "vfio" tells libvirt to use VFIO device
assignment rather than traditional KVM device assignment (VFIO
is a new method of device assignment that is compatible with
UEFI Secure Boot), and "kvm" tells libvirt to use the legacy
device assignment performed directly by the kvm kernel module
(the default is currently "kvm", but is subject to change).
<span class="since">Since 1.0.5 (QEMU and KVM only, requires
kernel 3.6 or newer)</span>
</dd>
<dt><code>txmode</code></dt>
<dd>
The <code>txmode</code> attribute specifies how to handle
@@ -3307,7 +3047,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;source network='default'/&gt;
&lt;target dev='vnet0'/&gt;
<b>&lt;bandwidth&gt;
&lt;inbound average='1000' peak='5000' floor='200' burst='1024'/&gt;
&lt;inbound average='1000' peak='5000' burst='1024'/&gt;
&lt;outbound average='128' peak='256' burst='256'/&gt;
&lt;/bandwidth&gt;</b>
&lt;/interface&gt;
@@ -3322,29 +3062,14 @@ qemu-kvm -net nic,model=? /dev/null
children element out result in no QoS applied on that traffic direction.
So, when you want to shape only domain's incoming traffic, use
<code>inbound</code> only, and vice versa. Each of these elements have one
mandatory attribute <code>average</code> (or <code>floor</code> as
described below). <code>average</code> specifies average bit rate on
the interface being shaped. Then there are two optional attributes:
mandatory attribute <code>average</code>. It specifies average bit rate on
interface being shaped. Then there are two optional attributes:
<code>peak</code>, which specifies maximum rate at which interface can send
data, and <code>burst</code>, amount of bytes that can be burst at
<code>peak</code> speed. Accepted values for attributes are integer
numbers. The units for <code>average</code> and <code>peak</code> attributes
are kilobytes per second, and for the <code>burst</code> just kilobytes.
<span class="since">Since 0.9.4</span> The <code>inbound</code> can
optionally have <code>floor</code> attribute. This is there for
guaranteeing minimal throughput for shaped interfaces. This, however,
requires that all traffic goes through one point where QoS decisions can
take place. That's why this attribute works only for virtual networks for
now (that is <code>&lt;interface type='network'/&gt;</code> with a
forward type of route, nat, or no forward at all). Moreover, the
virtual network the interface is connected to is required to have at least
inbound QoS set (<code>average</code> at least). Moreover, with
<code>floor<code> attribute users don't need to specify
<code>average</code>. However, <code>peak</code> and <code>burst</code>
attributes still require <code>average</code>. Currently, linux kernel
doesn't allow ingress qdiscs to have any classes therefore
<code>floor</code> can be applied only on <code>inbound</code> and not
</code>outbound</code>. <span class="since">Since 1.0.1</span>
<span class="since">Since 0.9.4</span>
</p>
<h5><a name="elementVlanTag">Setting VLAN tag (on supported network types only)</a></h5>
@@ -3541,7 +3266,7 @@ qemu-kvm -net nic,model=? /dev/null
while <code>tlsPort</code> gives an alternative secure
port number. The <code>autoport</code> attribute is the
new preferred syntax for indicating autoallocation of
needed port numbers. The <code>listen</code> attribute is
both port numbers. The <code>listen</code> attribute is
an IP address for the server to listen
on. The <code>passwd</code> attribute provides a SPICE
password in clear text. The <code>keymap</code>
@@ -3636,10 +3361,10 @@ qemu-kvm -net nic,model=? /dev/null
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> attribute is a boolean deciding
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.
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>
@@ -3727,16 +3452,7 @@ qemu-kvm -net nic,model=? /dev/null
will add a default <code>video</code> according to the guest type.
For a guest of type "kvm", the default <code>video</code> for it is:
<code>type</code> with value "cirrus", <code>vram</code> with value
"9216", and <code>heads</code> with value "1". By default, the first
video device in domain xml is the primary one, but the optional
attribute <code>primary</code> (<span class="since">since 1.0.2</span>)
with value 'yes' can be used to mark the primary in cases of mutiple
video device. The non-primary must be type of "qxl". The optional
attribute <code>ram</code> (<span class="since">since
1.0.2</span>) is allowed for "qxl" type only and specifies
the size of the primary bar, while <code>vram</code> specifies the
secondary bar size. If "ram" or "vram" are not supplied a default
value is used.
"9216", and <code>heads</code> with value "1".
</dd>
<dt><code>model</code></dt>
@@ -3862,14 +3578,7 @@ qemu-kvm -net nic,model=? /dev/null
<p>
<code>target</code> can have a <code>port</code> attribute, which
specifies the port number. Ports are numbered starting from 0. There are
usually 0, 1 or 2 serial ports. There is also an optional
<code>type</code> attribute <span class="since">since 1.0.2</span>
which has two choices for its value, one is <code>isa-serial</code>,
the other is <code>usb-serial</code>. If <code>type</code> is missing,
<code>isa-serial</code> will be used by default. For <code>usb-serial</code>
an optional sub-element <code>&lt;address&gt;</code> with
<code>type='usb'</code> can tie the device to a particular controller,
<a href="#elementsAddress">documented above</a>.
usually 0, 1 or 2 serial ports.
</p>
<h6><a name="elementCharConsole">Console</a></h6>
@@ -3882,7 +3591,7 @@ qemu-kvm -net nic,model=? /dev/null
</p>
<ul>
<li>If no <code>targetType</code> attribute is set, then the default
<li>If no <code>targetType</code> attribue is set, then the default
device type is according to the hypervisor's rules. The default
type will be added when re-querying the XML fed into libvirt.
For fully virtualized guests, the default device type will usually
@@ -3896,12 +3605,6 @@ qemu-kvm -net nic,model=? /dev/null
<li>Only the first <code>console</code> element may use a <code>targetType</code>
of <code>serial</code>. Secondary consoles must all be paravirtualized.
</li>
<li>On s390, the <code>console</code> element may use a
<code>targetType</code> of <code>sclp</code> or <code>sclplm</code>
(line mode). SCLP is the native console type for s390. There's no
controller associated to SCLP consoles.
<span class="since">Since 1.0.2</span>
</li>
</ul>
<p>
@@ -3927,17 +3630,6 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/devices&gt;
...</pre>
<pre>
...
&lt;devices&gt;
&lt;!-- KVM s390 sclp console --&gt;
&lt;console type='pty'&gt;
&lt;source path='/dev/pts/1'/&gt;
&lt;target type='sclp' port='0'/&gt;
&lt;/console&gt;
&lt;/devices&gt;
...</pre>
<p>
If the console is presented as a serial port, the <code>target</code>
element has the same attributes as for a serial port. There is usually
@@ -4131,7 +3823,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;serial type="dev"&gt;
&lt;source path="/dev/ttyS0"/&gt;
&lt;target port="1"/&gt;
&lt;/serial&gt;
&lt;/serial&gt;
&lt;/devices&gt;
...</pre>
@@ -4397,7 +4089,7 @@ qemu-kvm -net nic,model=? /dev/null
</p>
<p>
Example: automatically added device with KVM
Example automatically added device with KVM
</p>
<pre>
...
@@ -4407,14 +4099,13 @@ qemu-kvm -net nic,model=? /dev/null
...</pre>
<p>
Example: manually added device with static PCI slot 2 requested
Example manually added device with static PCI slot 2 requested
</p>
<pre>
...
&lt;devices&gt;
&lt;memballoon model='virtio'&gt;
&lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/&gt;
&lt;/memballoon&gt;
&lt;watchdog model='virtio'/&gt;
&lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/&gt;
&lt;/devices&gt;
&lt;/domain&gt;</pre>
@@ -4432,181 +4123,6 @@ qemu-kvm -net nic,model=? /dev/null
</ul>
</dd>
</dl>
<h4><a name="elementsRng">Random number generator device</a></h4>
<p>
The virtual random number generator device allows the host to pass
through entropy to guest operating systems.
<span class="since">Since 1.0.3</span>
</p>
<p>
Example: usage of the RNG device:
</p>
<pre>
...
&lt;devices&gt;
&lt;rng model='virtio'&gt;
&lt;rate period="2000" bytes="1234"/&gt;
&lt;backend model='random'&gt;/dev/random&lt;/backend&gt;
&lt;!-- OR --&gt;
&lt;backend model='egd' type='udp'&gt;
&lt;source mode='bind' service='1234'&gt;
&lt;source mode='connect' host='1.2.3.4' service='1234'&gt;
&lt;/backend&gt;
&lt;/rng&gt;
&lt;/devices&gt;
...
</pre>
<dl>
<dt><code>model</code></dt>
<dd>
<p>
The required <code>model</code> attribute specifies what type
of RNG device is provided. Valid values are specific to
the virtualization platform:
</p>
<ul>
<li>'virtio' &mdash; supported by qemu and virtio-rng kernel module</li>
</ul>
</dd>
<dt><code>rate</code></dt>
<dd>
<p>
The optional <code>rate</code> element allows limiting the rate at
which entropy can be consumed from the source. The mandatory
attribute <code>bytes</code> specifies how many bytes are permitted
to be consumed per period. An optional <code>period</code> attribute
specifies the duration of a period in milliseconds; if omitted, the
period is taken as 1000 milliseconds (1 second).
<span class='since'>Since 1.0.4</span>
</p>
</dd>
<dt><code>backend</code></dt>
<dd>
<p>
The <code>backend</code> element specifies the source of entropy
to be used for the domain. The source model is configured using the
<code>model</code> attribute. Supported source models are:
</p>
<ul>
<li>'random' &mdash; /dev/random (default) or /dev/hwrng
device as source (for now, no other sources are permitted)</li>
<li>'egd' &mdash; a EGD protocol backend</li>
</ul>
</dd>
<dt><code>backend model='random'</code></dt>
<dd>
<p>
This backend type expects a non-blocking character device as input.
Examples of such devices are /dev/random and /dev/urandom. The file
name is specified as contents of the <code>backend</code> element.
When no file name is specified the hypervisor default is used.
</p>
</dd>
<dt><code>backend model='egd'</code></dt>
<dd>
<p>
This backend connects to a source using the EGD protocol.
The source is specified as a character device. Refer to
<a href='#elementsCharHostInterface'>character device host interface</a>
for more information.
</p>
</dd>
</dl>
<h4><a name="elementsTpm">TPM device</a></h4>
<p>
The TPM device enables a QEMU guest to have access to TPM
functionality.
</p>
<p>
The TPM passthrough device type provides access to the host's TPM
for one QEMU guest. No other software may be is using the TPM device,
typically /dev/tpm0, at the time the QEMU guest is started.
<span class="since">'passthrough' since 1.0.5</span>
</p>
<p>
Example: usage of the TPM passthrough device
</p>
<pre>
...
&lt;devices&gt;
&lt;tpm model='tpm-tis'&gt;
&lt;backend type='passthrough'&gt;
&lt;backend path='/dev/tpm0'/&gt;
&lt;/backend&gt;
&lt;/tpm&gt;
&lt;/devices&gt;
...
</pre>
<dl>
<dt><code>model</code></dt>
<dd>
<p>
The <code>model</code> attribute specifies what device
model QEMU provides to the guest. If no model name is provided,
<code>tpm-tis</code> will automatically be chosen.
</p>
</dd>
<dt><code>backend</code></dt>
<dd>
<p>
The <code>backend</code> element specifies the type of
TPM device. The following types are supported:
</p>
<ul>
<li>'passthrough' &mdash; use the host's TPM device.
</ul>
</dd>
<dt><code>backend type='passthrough'</code></dt>
<dd>
<p>
This backend type requires exclusive access to a TPM device on
the host.
An example for such a device is /dev/tpm0. The filename is
specified as path attribute of the <code>source</code> element.
If no file name is specified then /dev/tpm0 is automatically used.
</p>
</dd>
</dl>
<h4><a name="elementsNVRAM">NVRAM device</a></h4>
<p>
nvram device is always added to pSeries guest on PPC64, and its address
is allowed to be changed. Element <code>nvram</code> (only valid for
pSeries guest, <span class="since">since 1.0.5</span>) is provided to
enable the address setting.
</p>
<p>
Example: usage of NVRAM configuration
</p>
<pre>
...
&lt;devices&gt;
&lt;nvram&gt;
&lt;address type='spapr-vio' reg='0x3000'/&gt;
&lt;/nvram&gt;
&lt;/devices&gt;
...
</pre>
<dl>
<dt><code>spapr-vio</code></dt>
<dd>
<p>
VIO device address type, only valid for PPC64.
</p>
</dd>
<dt><code>reg</code></dt>
<dd>
<p>
Device address
</p>
</dd>
</dl>
<h3><a name="seclabel">Security label</a></h3>
@@ -4702,16 +4218,8 @@ qemu-kvm -net nic,model=? /dev/null
</dd>
<dt><code>baselabel</code></dt>
<dd>If dynamic labelling is used, this can optionally be
used to specify the base security label that will be used to generate
the actual label. The format of the content depends on the security
driver in use.
The SELinux driver uses only the <code>type</code> field of the
baselabel in the generated label. Other fields are inherited from
the parent process when using SELinux baselabels.
(The example above demonstrates the use of <code>my_svirt_t</code>
as the value for the <code>type</code> field.)
used to specify the base security label. The format
of the content depends on the security driver in use.
</dd>
<dt><code>imagelabel</code></dt>
<dd>This is an output only element, which shows the

View File

@@ -33,7 +33,7 @@
</p>
<pre>
&lt;network ipv6='yes'&gt;
&lt;network&gt;
&lt;name&gt;default&lt;/name&gt;
&lt;uuid&gt;3e3fce45-4f53-4fa7-bb32-11f34168b82b&lt;/uuid&gt;
...</pre>
@@ -52,12 +52,6 @@
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>
<dt><code>ipv6='yes'</code></dt>
<dd>The new, optional parameter <code>ipv6='yes'</code> enables
a network definition with no IPv6 gateway addresses specified
to have guest-to-guest communications. For further information,
see the example below for the example with no gateway addresses.
<span class="since">Since 1.0.1</span></dd>
</dl>
<h3><a name="elementsConnect">Connectivity</a></h3>
@@ -136,39 +130,6 @@
network, and to/from the host to the guests, are
unrestricted and not NATed.<span class="since">Since
0.4.2</span>
<p><span class="since">Since 1.0.3</span> it is possible to
specify a public IPv4 address and port range to be used for
the NAT by using the <code>&lt;nat&gt;</code> subelement.
The address range is set with the <code>&lt;address&gt;</code>
subelements and <code>start</code> and <code>stop</code>
attributes:
</p>
<pre>
...
&lt;forward mode='nat'&gt;
&lt;nat&gt;
&lt;address start='1.2.3.4' end='1.2.3.10'/&gt;
&lt;/nat&gt;
&lt;/forward&gt;
...</pre>
<p>
An singe IPv4 address can be set by setting
<code>start</code> and <code>end</code> attributes to
the same value.
</p>
<p>
The port range to be used for the <code>&lt;nat&gt;</code> can
be set via the subelement <code>&lt;port&gt;</code>:
</p>
<pre>
...
&lt;forward mode='nat'&gt;
&lt;nat&gt;
&lt;port start='500' end='1000'/&gt;
&lt;/nat&gt;
&lt;/forward&gt;
...</pre>
</dd>
<dt><code>route</code></dt>
@@ -279,20 +240,6 @@
use the traditional <code>&lt; hostdev&gt;</code> device
definition. <span class="since"> Since 0.10.0</span>
<p>
To use VFIO device assignment rather than
traditional/legacy KVM device assignment (VFIO is a new
method of device assignment that is compatible with UEFI
Secure Boot), a &lt;forward type='hostdev'&gt; interface
can have an optional <code>driver</code> sub-element
with a <code>name</code> attribute set to "vfio". To use
legacy KVM device assignment you can
set <code>name</code> to "kvm" (or simply omit the
&lt;driver&gt; element, since "kvm" is currently the
default).
<span class="since">Since 1.0.5 (QEMU and KVM only, requires kernel 3.6 or newer)</span>
</p>
<p>Note that this "intelligent passthrough" of network
devices is very similar to the functionality of a
standard <code>&lt; hostdev&gt;</code> device, the
@@ -374,7 +321,6 @@
<pre>
...
&lt;forward mode='hostdev' managed='yes'&gt;
&lt;driver name='vfio'/&gt;
&lt;address type='pci' domain='0' bus='4' slot='0' function='1'/&gt;
&lt;address type='pci' domain='0' bus='4' slot='0' function='2'/&gt;
&lt;address type='pci' domain='0' bus='4' slot='0' function='3'/&gt;
@@ -631,10 +577,8 @@
dotted-decimal format, or an IPv6 address in standard
colon-separated hexadecimal format, that will be configured on
the bridge
device associated with the virtual network. To the guests this IPv4
address will be their IPv4 default route. For IPv6, the default route is
established via Router Advertisement.
For IPv4 addresses, the <code>netmask</code>
device associated with the virtual network. To the guests this
address will be their default route. For IPv4 addresses, the <code>netmask</code>
attribute defines the significant bits of the network address,
again specified in dotted-decimal format. For IPv6 addresses,
and as an alternate method for IPv4 addresses, you can specify
@@ -643,13 +587,10 @@
could also be given as <code>prefix='24'</code>. The <code>family</code>
attribute is used to specify the type of address - 'ipv4' or 'ipv6'; if no
<code>family</code> is given, 'ipv4' is assumed. A network can have more than
one of each family of address defined, but only a single IPv4 address can have a
<code>dhcp</code> or <code>tftp</code> element. <span class="since">Since 0.3.0 </span>
one of each family of address defined, but only a single address can have a
<code>dhcp</code> or <code>tftp</code> element. <span class="since">Since 0.3.0;
IPv6, multiple addresses on a single network, <code>family</code>, and
<code>prefix</code> are support <span class="since">Since 0.8.7</span>.
Similar to IPv4, one IPv6 address per network can also have
a <code>dhcp</code> definition. <span class="since">Since 1.0.1</span>
<code>prefix</code> since 0.8.7</span>
<dl>
<dt><code>tftp</code></dt>
<dd>Immediately within
@@ -667,44 +608,30 @@
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. The
<code>dhcp</code> element supported for both
IPv4 <span class="since">Since 0.3.0</span>
and IPv6 <span class="since">Since 1.0.1</span>, but
only for one IP address of each type per network.
<code>dhcp</code> element is not supported for IPv6, and
is only supported on a single IP address per network for IPv4.
<span class="since">Since 0.3.0</span>
<dl>
<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
addresses to be provided to DHCP clients. These two addresses
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. There may be zero or more
<code>range</code> elements specified.
<span class="since">Since 0.3.0</span>
<code>range</code> can be specified for one IPv4 address,
one IPv6 address, or both. <span class="since">Since 1.0.1</span>
<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
<code>host</code> elements; these specify hosts which will be given
names and predefined IP addresses by the built-in DHCP server. Any
IPv4 <code>host</code> element must specify the MAC address of the host to be assigned
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>
An IPv6 <code>host</code> element differs slightly from that for IPv4:
there is no <code>mac</code> attribute since a MAC address has no
defined meaning in IPv6. Instead, the <code>name</code> attribute is
used to identify the host to be assigned the IPv6 address. For DHCPv6,
the name is the plain name of the client host sent by the
client to the server. Note that this method of assigning a
specific IP address can also be used instead of the <code>mac</code>
attribute for IPv4. <span class="since">Since 1.0.1</span>
</dd>
<dt><code>bootp</code></dt>
<dd>The optional <code>bootp</code>
element specifies BOOTP options to be provided by the DHCP
server for IPv4 only.
element specifies BOOTP options to be provided by the DHCP server.
Two attributes are supported: <code>file</code> is mandatory and
gives the file to be used for the boot image; <code>server</code> is
optional and gives the address of the TFTP server from which the boot
@@ -747,29 +674,6 @@
&lt;ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" /&gt;
&lt;/network&gt;</pre>
<p>
Below is a variation of the above example which adds an IPv6
dhcp range definition.
</p>
<pre>
&lt;network&gt;
&lt;name&gt;default6&lt;/name&gt;
&lt;bridge name="virbr0" /&gt;
&lt;forward mode="nat"/&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" &gt;
&lt;dhcp&gt;
&lt;range start="2001:db8:ca2:2:1::10" end="2001:db8:ca2:2:1::ff" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesRoute">Routed network config</a></h3>
<p>
@@ -794,36 +698,6 @@
&lt;ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" /&gt;
&lt;/network&gt;</pre>
<p>
Below is another IPv6 variation. Instead of a dhcp range being
specified, this example has a couple of IPv6 host definitions.
Note that most of the dhcp host definitions use an "id" (client
id or DUID) since this has proven to be a more reliable way
of specifying the interface and its association with an IPv6
address. The first is a DUID-LLT, the second a DUID-LL, and
the third a DUID-UUID. <span class="since">Since 1.0.3</span>
</p>
<pre>
&lt;network&gt;
&lt;name&gt;local6&lt;/name&gt;
&lt;bridge name="virbr1" /&gt;
&lt;forward mode="route" dev="eth1"/&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" &gt;
&lt;dhcp&gt;
&lt;host name="paul" ip="2001:db8:ca2:2:3::1" /&gt;
&lt;host id="0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66" ip="2001:db8:ca2:2:3::2" /&gt;
&lt;host id="0:3:0:1:0:16:3e:11:22:33" name="ralph" ip="2001:db8:ca2:2:3::3" /&gt;
&lt;host id="0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63" name="badbob" ip="2001:db8:ca2:2:3::4" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesPrivate">Isolated network config</a></h3>
<p>
@@ -846,31 +720,6 @@
&lt;ip family="ipv6" address="2001:db8:ca2:3::1" prefix="64" /&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesPrivate6">Isolated IPv6 network config</a></h3>
<p>
This variation of an isolated network defines only IPv6.
Note that most of the dhcp host definitions use an "id" (client
id or DUID) since this has proven to be a more reliable way
of specifying the interface and its association with an IPv6
address. The first is a DUID-LLT, the second a DUID-LL, and
the third a DUID-UUID. <span class="since">Since 1.0.3</span>
</p>
<pre>
&lt;network&gt;
&lt;name&gt;sixnet&lt;/name&gt;
&lt;bridge name="virbr6" /&gt;
&lt;ip family="ipv6" address="2001:db8:ca2:6::1" prefix="64" &gt;
&lt;dhcp&gt;
&lt;host name="peter" ip="2001:db8:ca2:6:6::1" /&gt;
&lt;host id="0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66" ip="2001:db8:ca2:6:6::2" /&gt;
&lt;host id="0:3:0:1:0:16:3e:11:22:33" name="dariusz" ip="2001:db8:ca2:6:6::3" /&gt;
&lt;host id="0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63" name="anita" ip="2001:db8:ca2:6:6::4" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesBridge">Using an existing host bridge</a></h3>
<p>
@@ -924,25 +773,5 @@
&lt;/forward&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesNoGateway">Network config with no gateway addresses</a></h3>
<p>
A valid network definition can contain no IPv4 or IPv6 addresses. Such a definition
can be used for a "very private" or "very isolated" network since it will not be
possible to communicate with the virtualization host via this network. However,
this virtual network interface can be used for communication between virtual guest
systems. This works for IPv4 and <span class="since">(Since 1.0.1)</span> IPv6.
However, the new ipv6='yes' must be added for guest-to-guest IPv6
communication.
</p>
<pre>
&lt;network ipv6='yes'&gt;
&lt;name&gt;nogw&lt;/name&gt;
&lt;uuid&gt;7a3b7497-1ec7-8aef-6d5c-38dff9109e93&lt;/uuid&gt;
&lt;bridge name="virbr2" stp="on" delay="0" /&gt;
&lt;mac address='00:16:3E:5D:C7:9E'/&gt;
&lt;/network&gt;</pre>
</body>
</html>

View File

@@ -136,13 +136,9 @@
<dd>The SCSI host number.</dd>
<dt><code>capability</code></dt>
<dd>Current capabilities include "vports_ops" (indicates
vport operations are supported) and "fc_host". "vport_ops"
could contain two optional sub-elements: <code>vports</code>,
and <code>max_vports</code>. <code>vports</code> shows the
number of vport in use. <code>max_vports</code> shows the
maximum vports the HBA supports. "fc_host" implies following
sub-elements: <code>wwnn</code>, <code>wwpn</code>, and
<code>fabric_wwn</code>.
vport operations are supported) and "fc_host", the later
implies following sub-elements: <code>wwnn</code>,
<code>wwpn</code>, <code>fabric_wwn</code>.
</dd>
</dl>
</dd>

View File

@@ -66,18 +66,6 @@
device</a>. <span class="since">Since 0.9.7</span>.
</p>
<h3>Usage type "iscsi"</h3>
<p>
This secret is associated with an iSCSI target for CHAP authentication.
The <code>&lt;usage type='iscsi'&gt;</code> element must contain
a single <code>target</code> element that specifies a usage name
for the secret. The iSCSI secret can then be used by UUID or by
this usage name via the <code>&lt;auth&gt;</code> element of
a <a href="domain.html#elementsDisks">disk
device</a>. <span class="since">Since 1.0.4</span>.
</p>
<h2><a name="example">Example</a></h2>
<pre>

View File

@@ -24,7 +24,7 @@
since the snapshot in a single file) and external (the
snapshot is one file, and the changes since the snapshot are
in another file).</dd>
<dt>memory state (or VM state)</dt>
<dt>VM state</dt>
<dd>Tracks only the state of RAM and all other resources in use
by the VM. If the disks are unmodified between the time a VM
state snapshot is taken and restored, then the guest will
@@ -33,7 +33,7 @@
corruption.</dd>
<dt>system checkpoint</dt>
<dd>A combination of disk snapshots for all disks as well as VM
memory state, which can be used to resume the guest from where it
state, which can be used to resume the guest from where it
left off with symptoms similar to hibernation (that is, TCP
connections in the guest may have timed out, but no files or
processes are lost).</dd>
@@ -41,7 +41,7 @@
<p>
Libvirt can manage all three types of snapshots. For now, VM
state (memory) snapshots are created only by
state snapshots are created only by
the <code>virDomainSave()</code>, <code>virDomainSaveFlags</code>,
and <code>virDomainManagedSave()</code> functions, and restored
via the <code>virDomainRestore()</code>,
@@ -106,17 +106,6 @@
description is omitted when initially creating the snapshot,
then this field will be empty.
</dd>
<dt><code>memory</code></dt>
<dd>On input, this is an optional request for how to handle VM
memory state. For an offline domain or a disk-only snapshot,
attribute <code>snapshot</code> must be <code>no</code>, since
there is no VM state saved; otherwise, the attribute can
be <code>internal</code> if the memory state is piggy-backed with
other internal disk state, or <code>external</code> along with
a second attribute <code>file</code> giving the absolute path
of the file holding the VM memory state. <span class="since">Since
1.0.1</span>
</dd>
<dt><code>disks</code></dt>
<dd>On input, this is an optional listing of specific
instructions for disk snapshots; it is needed when making a
@@ -146,9 +135,8 @@
the <a href="formatdomain.html#elementsDisks">disk
devices</a> specified for the domain at the time of the
snapshot. The attribute <code>snapshot</code> is
optional, and the possible values are the same as the
<code>snapshot</code> attribute for
<a href="formatdomain.html#elementsDisks">disk devices</a>
optional, and has the same values of the disk device
element for a domain
(<code>no</code>, <code>internal</code>,
or <code>external</code>). Some hypervisors like ESX
require that if specified, the snapshot mode must not
@@ -184,7 +172,7 @@
to <code>virDomainRevertToSnapshot()</code>. Additionally,
this field can be the value "disk-snapshot"
(<span class="since">since 0.9.5</span>) when it represents
only a disk snapshot (no VM memory state), and reverting to this
only a disk snapshot (no VM state), and reverting to this
snapshot will default to an inactive guest. Readonly.
</dd>
<dt><code>parent</code></dt>
@@ -234,7 +222,6 @@
&lt;parent&gt;
&lt;name&gt;bare-os-install&lt;/name&gt;
&lt;/parent&gt;
&lt;memory snapshot='no'/&gt;
&lt;disks&gt;
&lt;disk name='vda' snapshot='external'&gt;
&lt;driver type='qcow2'/&gt;

View File

@@ -75,14 +75,6 @@
&lt;/source&gt;
...</pre>
<pre>
...
&lt;source&gt;
&lt;source&gt;
&lt;adapter type='fc_host' parent='scsi_host5' wwnn='20000000c9831b4b' wwpn='10000000c9831b4b'/&gt;
&lt;/source&gt;
...</pre>
<dl>
<dt><code>device</code></dt>
<dd>Provides the source for pools backed by physical devices.
@@ -92,27 +84,12 @@
<dt><code>directory</code></dt>
<dd>Provides the source for pools backed by directories. May
only occur once. Contains a single attribute <code>path</code>
which is the fully qualified path to the backing directory.
which is the fully qualified path to the block device node.
<span class="since">Since 0.4.1</span></dd>
<dt><code>adapter</code></dt>
<dd>Provides the source for pools backed by SCSI adapters. May
only occur once. Attribute <code>name</code> is the SCSI adapter
name (ex. "scsi_host1". NB, although a name such as "host1" is
still supported for backwards compatibility, it is not recommended).
Attribute <code>type</code> (<span class="since">1.0.5</span>)
specifies the adapter type. Valid values are "fc_host" and "scsi_host".
If omitted and the <code>name</code> attribute is specified, then it
defaults to "scsi_host". To keep backwards compatibility, the attribute
<code>type</code> is optional for the "scsi_host" adapter, but
mandatory for the "fc_host" adapter. Attributes <code>wwnn</code>
(Word Wide Node Name) and <code>wwpn</code> (Word Wide Port Name)
(<span class="since">1.0.4</span>) are used by the "fc_host" adapter
to uniquely identify the device in the Fibre Channel storage fabric
(the device can be either a HBA or vHBA). Both wwnn and wwpn should
be specified (See command 'virsh nodedev-dumpxml' to known how to get
wwnn/wwpn of a (v)HBA). The optional attribute <code>parent</code>
(<span class="since">1.0.4</span>) specifies the parent device for
the "fc_host" adapter.
only occur once. Contains a single attribute <code>name</code>
which is the SCSI adapter name (ex. "host1").
<span class="since">Since 0.6.2</span></dd>
<dt><code>host</code></dt>
<dd>Provides the source for pools backed by storage from a
@@ -124,7 +101,7 @@
<dt><code>name</code></dt>
<dd>Provides the source for pools backed by storage from a
named element (e.g., a logical volume group name).
Contains a string identifier.
remote server. Contains a string identifier.
<span class="since">Since 0.4.5</span></dd>
<dt><code>format</code></dt>
<dd>Provides information about the format of the pool. This
@@ -273,11 +250,7 @@
allocated at time of creation. If set to a value smaller than the
capacity, the pool has the <strong>option</strong> of deciding
to sparsely allocate a volume. It does not have to honour requests
for sparse allocation though. Different types of pools may treat
sparse volumes differently. For example, the <code>logical</code>
pool will not automatically expand volume's allocation when it
gets full; the user is responsible for doing that or configuring
dmeventd to do so automatically.<br/>
for sparse allocation though.<br/>
<br/>
By default this is specified in bytes, but an optional attribute
<code>unit</code> can be specified to adjust the passed value.

View File

@@ -4,7 +4,7 @@ body {
padding: 0px;
color: rgb(0,0,0);
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: smaller;
font-size: 80%;
background: #ffffff;
}
@@ -64,6 +64,8 @@ h6 {
dl dt {
margin-left: 1em;
margin-right: 2em;
font-weight: bold;
font-size: larger;
}
dl dd {

View File

@@ -9,12 +9,8 @@
<li>Discuss any large changes on the mailing list first. Post patches
early and listen to feedback.</li>
<li><p>Post patches in unified diff format, with git rename
detection enabled. You need a one-time setup of:</p>
<pre>
git config diff.renames true
</pre>
<p>After that, a command similar to this should work:</p>
<li><p>Post patches in unified diff format. A command similar to this
should work:</p>
<pre>
diff -urp libvirt.orig/ libvirt.modified/ &gt; libvirt-myfeature.patch
</pre>
@@ -24,9 +20,7 @@
<pre>
git diff &gt; libvirt-myfeature.patch
</pre>
<p>Also, for code motion patches, you may find that <code>git
diff --patience</code> provides an easier-to-read patch.
However, the usual workflow of libvirt developer is:</p>
<p>However, the usual workflow of libvirt developer is:</p>
<pre>
git checkout master
git pull
@@ -65,21 +59,6 @@
version if needed though).</p>
</li>
<li><p>In your commit message, make the summary line reasonably
short (60 characters is typical), followed by a blank line,
followed by any longer description of why your patch makes
sense. If the patch fixes a regression, and you know what
commit introduced the problem, mentioning that is useful.
If the patch resolves a bugzilla report, mentioning the URL
of the bug number is useful; but also summarize the issue
rather than making all readers follow the link. You can use
'git shortlog -30' to get an idea of typical summary lines.
Libvirt does not currently attach any meaning to
Signed-off-by: lines, so it is up to you if you want to
include or omit them in the commit message.
</p>
</li>
<li><p>Split large changes into a series of smaller patches,
self-contained if possible, with an explanation of each patch
and an explanation of how the sequence of patches fits
@@ -109,9 +88,8 @@
make syntax-check
make -C tests valgrind
</pre>
<p><a href="http://valgrind.org/">Valgrind</a> is a test that checks
for memory management issues, such as leaks or use of uninitialized
variables.
<p>
The latter test checks for memory leaks.
</p>
<p>
@@ -132,99 +110,7 @@
<pre>
./qemuxml2xmltest
</pre>
<p>There is also a <code>./run</code> script at the top level,
to make it easier to run programs that have not yet been
installed, as well as to wrap invocations of various tests
under gdb or Valgrind.
</p>
</li>
<li><p>The Valgrind test should produce similar output to
<code>make check</code>. If the output has traces within libvirt
API's, then investigation is required in order to determine the
cause of the issue. Output such as the following indicates some
sort of leak:
</p>
<pre>
==5414== 4 bytes in 1 blocks are definitely lost in loss record 3 of 89
==5414== at 0x4A0881C: malloc (vg_replace_malloc.c:270)
==5414== by 0x34DE0AAB85: xmlStrndup (in /usr/lib64/libxml2.so.2.7.8)
==5414== by 0x4CC97A6: virDomainVideoDefParseXML (domain_conf.c:7410)
==5414== by 0x4CD581D: virDomainDefParseXML (domain_conf.c:10188)
==5414== by 0x4CD8C73: virDomainDefParseNode (domain_conf.c:10640)
==5414== by 0x4CD8DDB: virDomainDefParse (domain_conf.c:10590)
==5414== by 0x41CB1D: testCompareXMLToArgvHelper (qemuxml2argvtest.c:100)
==5414== by 0x41E20F: virtTestRun (testutils.c:161)
==5414== by 0x41C7CB: mymain (qemuxml2argvtest.c:866)
==5414== by 0x41E84A: virtTestMain (testutils.c:723)
==5414== by 0x34D9021734: (below main) (in /usr/lib64/libc-2.15.so)
</pre>
<p>In this example, the <code>virDomainDefParseXML()</code> had
an error path where the <code>virDomainVideoDefPtr video</code>
pointer was not properly disposed. By simply adding a
<code>virDomainVideoDefFree(video);</code> in the error path,
the issue was resolved.
</p>
<p>Another common mistake is calling a printing function, such as
<code>VIR_DEBUG()</code> without initializing a variable to be
printed. The following example involved a call which could return
an error, but not set variables passed by reference to the call.
The solution was to initialize the variables prior to the call.
</p>
<pre>
==4749== Use of uninitialised value of size 8
==4749== at 0x34D904650B: _itoa_word (in /usr/lib64/libc-2.15.so)
==4749== by 0x34D9049118: vfprintf (in /usr/lib64/libc-2.15.so)
==4749== by 0x34D9108F60: __vasprintf_chk (in /usr/lib64/libc-2.15.so)
==4749== by 0x4CAEEF7: virVasprintf (stdio2.h:199)
==4749== by 0x4C8A55E: virLogVMessage (virlog.c:814)
==4749== by 0x4C8AA96: virLogMessage (virlog.c:751)
==4749== by 0x4DA0056: virNetTLSContextCheckCertKeyUsage (virnettlscontext.c:225)
==4749== by 0x4DA06DB: virNetTLSContextCheckCert (virnettlscontext.c:439)
==4749== by 0x4DA1620: virNetTLSContextNew (virnettlscontext.c:562)
==4749== by 0x4DA26FC: virNetTLSContextNewServer (virnettlscontext.c:927)
==4749== by 0x409C39: testTLSContextInit (virnettlscontexttest.c:467)
==4749== by 0x40AB8F: virtTestRun (testutils.c:161)
</pre>
<p>Valgrind will also find some false positives or code paths
which cannot be resolved by making changes to the libvirt code.
For these paths, it is possible to add a filter to avoid the
errors. For example:
</p>
<pre>
==4643== 7 bytes in 1 blocks are possibly lost in loss record 4 of 20
==4643== at 0x4A0881C: malloc (vg_replace_malloc.c:270)
==4643== by 0x34D90853F1: strdup (in /usr/lib64/libc-2.15.so)
==4643== by 0x34EEC2C08A: ??? (in /usr/lib64/libnl.so.1.1)
==4643== by 0x34EEC15B81: ??? (in /usr/lib64/libnl.so.1.1)
==4643== by 0x34D8C0EE15: call_init.part.0 (in /usr/lib64/ld-2.15.so)
==4643== by 0x34D8C0EECF: _dl_init (in /usr/lib64/ld-2.15.so)
==4643== by 0x34D8C01569: ??? (in /usr/lib64/ld-2.15.so)
</pre>
<p>In this instance, it is acceptible to modify the
<code>tests/.valgrind.supp</code> file in order to add a
suppression filter. The filter should be unique enough to
not suppress real leaks, but it should be generic enough to
cover multiple code paths. The format of the entry can be
found in the documentation found at the
<a href="http://valgrind.org/">Valgrind home page.</a>
The following trace was added to <code>tests/.valgrind.supp</code>
in order to suppress the warning:
</p>
<pre>
{
dlInitMemoryLeak1
Memcheck:Leak
fun:?alloc
...
fun:call_init.part.0
fun:_dl_init
...
obj:*/lib*/ld-2.*so*
}
</pre>
</li>
<li>Update tests and/or documentation, particularly if you are adding
a new feature or changing the output of a program.</li>
@@ -326,55 +212,6 @@
</p>
<h2><a name="bracket_spacing">Bracket spacing</a></h2>
<p>
The keywords <code>if</code>, <code>for</code>, <code>while</code>,
and <code>switch</code> must have a single space following them
before the opening bracket. E.g.
</p>
<pre>
if(foo) // Bad
if (foo) // Good
</pre>
<p>
Function implementations must <strong>not</strong> have any whitespace
between the function name and the opening bracket. E.g.
</p>
<pre>
int foo (int wizz) // Bad
int foo(int wizz) // Good
</pre>
<p>
Function calls must <strong>not</strong> have any whitespace
between the function name and the opening bracket. E.g.
</p>
<pre>
bar = foo (wizz); // Bad
bar = foo(wizz); // Good
</pre>
<p>
Function typedefs must <strong>not</strong> have any whitespace
between the closing bracket of the function name and opening
bracket of the arg list. E.g.
</p>
<pre>
typedef int (*foo) (int wizz); // Bad
typedef int (*foo)(int wizz); // Good
</pre>
<p>
There must not be any whitespace immediately following any
opening bracket, or immediately prior to any closing bracket. E.g.
</p>
<pre>
int foo( int wizz ); // Bad
int foo(int wizz); // Good
</pre>
<h2><a name="curly_braces">Curly braces</a></h2>
<p>
@@ -394,7 +231,7 @@
</pre>
<p>
However, the moment your loop/if/else body extends on to a second
However, the moment your loop/if/else body extends onto a second
line, for whatever reason (even if it's just an added comment), then
you should add braces. Otherwise, it would be too easy to insert a
statement just before that comment (without adding braces), thinking
@@ -913,7 +750,7 @@
#include &lt;string.h&gt;
#include &lt;limits.h&gt;
#if WITH_NUMACTL Some system includes aren't supported
#if HAVE_NUMACTL Some system includes aren't supported
# include &lt;numa.h&gt; everywhere so need these #if guards.
#endif
@@ -929,12 +766,10 @@
</pre>
<p>
Of particular note: <b>Do not</b> include libvirt/libvirt.h,
libvirt/virterror.h, libvirt/libvirt-qemu.h, or libvirt/libvirt-lxc.h.
They are included by "internal.h" already and there are some special reasons
why you cannot include these files explicitly. One of the special cases,
"libvirt/libvirt.h" is included prior to "internal.h" in "remote_protocol.x",
to avoid exposing *_LAST enum elements.
Of particular note: <b>Do not</b> include libvirt/libvirt.h or
libvirt/virterror.h. It is included by "internal.h" already and there
are some special reasons why you cannot include these files
explicitly.
</p>

View File

@@ -239,14 +239,13 @@
<p>If a hook script returns with an exit code of 0, the libvirt daemon
regards this as successful and performs no logging of it.</p>
<p>However, if a hook script returns with a non zero exit code, the libvirt
daemon regards this as a failure, logs its return code, and
daemon regards this as a failure, logs it with return code 256, and
additionally logs anything on stderr the hook script returns.</p>
<p>For example, a hook script might use this code to indicate failure,
and send a text string to stderr:</p>
<pre>echo "Could not find required XYZZY" &gt;&amp;2
exit 1</pre>
<p>The resulting entry in the libvirt log will appear as:</p>
<pre>20:02:40.297: error : virHookCall:285 : Hook script execution failed: internal error Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOME=/root USER=root LOGNAME=root /etc/libvirt/hooks/qemu qemu prepare begin -) unexpected exit status 1: Could not find required XYZZY</pre>
<pre>20:02:40.297: error : virHookCall:416 : Hook script execution failed: Hook script /etc/libvirt/hooks/qemu qemu failed with error code 256:Could not find required XYZZY</pre>
</body>
</html>

View File

@@ -11,14 +11,13 @@ my $srcdir = shift @ARGV;
my $symslibvirt = "$srcdir/libvirt_public.syms";
my $symsqemu = "$srcdir/libvirt_qemu.syms";
my $symslxc = "$srcdir/libvirt_lxc.syms";
my $drivertable = "$srcdir/driver.h";
my %groupheaders = (
"virDriver" => "Hypervisor APIs",
"virNetworkDriver" => "Virtual Network APIs",
"virInterfaceDriver" => "Host Interface APIs",
"virNodeDeviceDriver" => "Host Device APIs",
"virDeviceMonitor" => "Host Device APIs",
"virStorageDriver" => "Storage Pool APIs",
"virSecretDriver" => "Secret APIs",
"virNWFilterDriver" => "Network Filter APIs",
@@ -113,48 +112,9 @@ while (defined($line = <FILE>)) {
close FILE;
# And the same for the LXC specific APIs
open FILE, "<$symslxc"
or die "cannot read $symslxc: $!";
$prevvers = undef;
$vers = undef;
while (defined($line = <FILE>)) {
chomp $line;
next if $line =~ /^\s*#/;
next if $line =~ /^\s*$/;
next if $line =~ /^\s*(global|local):/;
if ($line =~ /^\s*LIBVIRT_LXC_(\d+\.\d+\.\d+)\s*{\s*$/) {
if (defined $vers) {
die "malformed syms file";
}
$vers = $1;
} elsif ($line =~ /\s*}\s*;\s*$/) {
if (defined $prevvers) {
die "malformed syms file";
}
$prevvers = $vers;
$vers = undef;
} elsif ($line =~ /\s*}\s*LIBVIRT_LXC_(\d+\.\d+\.\d+)\s*;\s*$/) {
if ($1 ne $prevvers) {
die "malformed syms file $1 != $vers";
}
$prevvers = $vers;
$vers = undef;
} elsif ($line =~ /\s*(\w+)\s*;\s*$/) {
$apis{$1} = $vers;
} else {
die "unexpected data $line\n";
}
}
close FILE;
# Some special things which aren't public APIs,
# but we want to report
$apis{virConnectSupportsFeature} = "0.3.2";
$apis{virConnectDrvSupportsFeature} = "0.3.2";
$apis{virDomainMigratePrepare} = "0.3.2";
$apis{virDomainMigratePerform} = "0.3.2";
$apis{virDomainMigrateFinish} = "0.3.2";
@@ -182,7 +142,7 @@ open FILE, "<$drivertable"
my %groups;
my $ingrp;
while (defined($line = <FILE>)) {
if ($line =~ /struct _(vir\w*Driver)/) {
if ($line =~ /struct _(vir\w*(?:Driver|Monitor))/) {
my $grp = $1;
if ($grp ne "virStateDriver" &&
$grp ne "virStreamDriver") {
@@ -190,15 +150,17 @@ while (defined($line = <FILE>)) {
$groups{$ingrp} = { apis => {}, drivers => {} };
}
} elsif ($ingrp) {
if ($line =~ /^\s*vir(?:Drv)(\w+)\s+(\w+);\s*$/) {
if ($line =~ /^\s*vir(?:Drv|DevMon)(\w+)\s+(\w+);\s*$/) {
my $field = $2;
my $name = $1;
my $api;
if (exists $apis{"vir$name"}) {
$api = "vir$name";
} elsif ($name =~ /\w+(Open|Close)/) {
next;
} elsif (exists $apis{"virConnect$name"}) {
$api = "virConnect$name";
} elsif (exists $apis{"virNode$name"}) {
$api = "virNode$name";
} else {
die "driver $name does not have a public API";
}
@@ -256,8 +218,6 @@ foreach my $src (@srcs) {
die "Driver method for $api is NULL in $src" if $meth eq "NULL";
if (!exists($groups{$ingrp}->{apis}->{$api})) {
next if $api =~ /\w(Open|Close)/;
die "Found unexpected method $api in $ingrp\n";
}
@@ -290,24 +250,24 @@ $groups{virDriver}->{apis}->{"domainMigrate"} = "virDomainMigrate";
my $openAuthVers = (0 * 1000 * 1000) + (4 * 1000) + 0;
foreach my $drv (keys %{$groups{"virDriver"}->{drivers}}) {
my $openVersStr = $groups{"virDriver"}->{drivers}->{$drv}->{"connectOpen"};
my $openVersStr = $groups{"virDriver"}->{drivers}->{$drv}->{"open"};
my $openVers;
if ($openVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
$openVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
}
# virConnectOpenReadOnly always matches virConnectOpen version
$groups{"virDriver"}->{drivers}->{$drv}->{"connectOpenReadOnly"} =
$groups{"virDriver"}->{drivers}->{$drv}->{"connectOpen"};
$groups{"virDriver"}->{drivers}->{$drv}->{"openReadOnly"} =
$groups{"virDriver"}->{drivers}->{$drv}->{"open"};
# virConnectOpenAuth is always 0.4.0 if the driver existed
# before this time, otherwise it matches the version of
# the driver's virConnectOpen entry
if ($openVersStr eq "Y" ||
$openVers >= $openAuthVers) {
$groups{"virDriver"}->{drivers}->{$drv}->{"connectOpenAuth"} = $openVersStr;
$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = $openVersStr;
} else {
$groups{"virDriver"}->{drivers}->{$drv}->{"connectOpenAuth"} = "0.4.0";
$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = "0.4.0";
}
}

View File

@@ -62,12 +62,6 @@
<li>
The <a href="http://libvirt.org/drvhyperv.html">Microsoft Hyper-V</a> hypervisor
</li>
<li>
The <a href="http://libvirt.org/drvphyp.html">IBM PowerVM</a> hypervisor
</li>
<li>
The <a href="http://libvirt.org/drvparallels.html">Parallels</a> hypervisor
</li>
<li>
Virtual networks using bridging, NAT, VEPA and VN-LINK.
</li>

View File

@@ -166,15 +166,15 @@ def checkTables(db, verbose = 1):
print "table %s missing" % (table)
createTable(db, table)
try:
ret = c.execute("SELECT count(*) from %s" % table)
ret = c.execute("SELECT count(*) from %s" % table);
row = c.fetchone()
if verbose:
print "Table %s contains %d records" % (table, row[0])
except:
print "Troubles with table %s : repairing" % (table)
ret = c.execute("repair table %s" % table)
ret = c.execute("repair table %s" % table);
print "repairing returned %d" % (ret)
ret = c.execute("SELECT count(*) from %s" % table)
ret = c.execute("SELECT count(*) from %s" % table);
row = c.fetchone()
print "Table %s contains %d records" % (table, row[0])
if verbose:
@@ -600,7 +600,7 @@ def addWordHTML(word, resource, id, section, relevance):
pass
else:
wordsDictHTML[word] = {}
d = wordsDictHTML[word]
d = wordsDictHTML[word];
d[resource] = (relevance, id, section)
return relevance
@@ -647,7 +647,7 @@ def addWordArchive(word, id, relevance):
pass
else:
wordsDictArchive[word] = {}
d = wordsDictArchive[word]
d = wordsDictArchive[word];
d[id] = relevance
return relevance
@@ -989,7 +989,7 @@ def analyzeHTML(doc, resource, p, section, id):
return words
def analyzeHTML(doc, resource):
para = 0
para = 0;
ctxt = doc.xpathNewContext()
try:
res = ctxt.xpathEval("//head/title")
@@ -1079,7 +1079,7 @@ def scanXMLMsgArchive(url, title, force = 0):
try:
print "Loading %s" % (url)
doc = libxml2.htmlParseFile(url, None)
doc = libxml2.htmlParseFile(url, None);
except:
doc = None
if doc == None:
@@ -1102,7 +1102,7 @@ def scanXMLDateArchive(t = None, force = 0):
url = getXMLDateArchive(t)
print "loading %s" % (url)
try:
doc = libxml2.htmlParseFile(url, None)
doc = libxml2.htmlParseFile(url, None);
except:
doc = None
if doc == None:
@@ -1150,7 +1150,7 @@ def analyzeArchives(t = None, force = 0):
refs = wordsDictArchive[word]
if refs == None:
skipped = skipped + 1
continue
continue;
for id in refs.keys():
relevance = refs[id]
updateWordArchive(word, id, relevance)
@@ -1170,7 +1170,7 @@ def analyzeHTMLTop():
refs = wordsDictHTML[word]
if refs == None:
skipped = skipped + 1
continue
continue;
for resource in refs.keys():
(relevance, id, section) = refs[resource]
updateWordHTML(word, resource, section, id, relevance)
@@ -1199,7 +1199,7 @@ def analyzeAPITop():
refs = wordsDict[word]
if refs == None:
skipped = skipped + 1
continue
continue;
for (module, symbol) in refs.keys():
updateWord(word, symbol, refs[(module, symbol)])
i = i + 1
@@ -1228,26 +1228,26 @@ def main():
elif args[i] == '--archive':
analyzeArchives(None, force)
elif args[i] == '--archive-year':
i = i + 1
i = i + 1;
year = args[i]
months = ["January" , "February", "March", "April", "May",
"June", "July", "August", "September", "October",
"November", "December"]
"November", "December"];
for month in months:
try:
str = "%s-%s" % (year, month)
T = time.strptime(str, "%Y-%B")
t = time.mktime(T) + 3600 * 24 * 10
t = time.mktime(T) + 3600 * 24 * 10;
analyzeArchives(t, force)
except:
print "Failed to index month archive:"
print sys.exc_type, sys.exc_value
elif args[i] == '--archive-month':
i = i + 1
i = i + 1;
month = args[i]
try:
T = time.strptime(month, "%Y-%B")
t = time.mktime(T) + 3600 * 24 * 10
t = time.mktime(T) + 3600 * 24 * 10;
analyzeArchives(t, force)
except:
print "Failed to index month archive:"

View File

@@ -9,106 +9,12 @@
</p>
<ul>
<li>Introduction to basic rules and guidelines for
<a href="hacking.html">hacking</a> on libvirt code</li>
<li>Introduction to basic rules and guidelines for <a href="hacking.html">hacking</a>
on libvirt code</li>
<li>Guide to adding <a href="api_extension.html">public APIs</a></li>
<li>Approach for <a href="internals/command.html">spawning commands</a>
from libvirt driver code</li>
<li>The libvirt <a href="internals/rpc.html">RPC infrastructure</a></li>
<li>The <a href="internals/locking.html">Resource Lock Manager</a></li>
<li>Approach for <a href="internals/command.html">spawning commands</a> from
libvirt driver code</li>
</ul>
<p>Before adding new code it will be important to get a basic understanding
of the many elements involved with making any call or change to the libvirt
code. The architecture <a href="goals.html">goals</a> must be adhered to
when submitting new code. Understanding the many places that need to be
touched and the interactions between various subsystems within libvirt
will directly correlate to the ability to be successful in getting new
code accepted.</p>
<p>The following diagram depicts code flow from a client application, in
this case the libvirt provided <code>virsh</code> command through the
various layers to elicit a response from some chosen hypervisor.
</p>
<p class="image">
<img alt="virConnectOpen calling sequence"
src="libvirt-virConnect-example.png"/>
</p>
<ul>
<li>"virsh -c qemu:///system list --all"
<p>After the virsh code processes the input arguments, it eventually
will make a call to open the connection using a default set of
authentication credentials (virConnectAuthDefault). </p></li>
<li>virConnectOpenAuth()
<p>Each of the virConnectOpen APIs will first call virInitialize() and
then revector through the local "do_open():" call.</p>
<ul>
<li>virInitialize()
<p>Calls the registration API for each of the drivers with
client-side only capabilities and then call the remoteRegister()
API last. This ensures the virDriverTab[] tries local drivers
first before using the remote driver.</p></li>
<li>Loop through virDriverTab[] entries trying to call their
respective "open" entry point (in our case remoteOpen())</li>
<li>After successful return from the virDriverTab[] open()
API, attempt to find and open other drivers (network, interface,
storage, etc.)</li>
</ul>
</li>
<li>remoteOpen()
<p>After a couple of URI checks, a call to doRemoteOpen() is made</p>
<ul>
<li>Determine network transport and host/port to use from URI
<p>The transport will be either tls, unix, ssh, libssh2, ext,
or tcp with the default of tls. Decode the host/port if provided
or default to "localhost".</p></li>
<li>virNetClientRegisterAsyncIO()
<p>Register an I/O callback mechanism to get returned data via
virNetClientIncomingEvent()</p></li>
<li>"call(...REMOTE_PROC_OPEN...)"
<p>Eventually routes into virNetClientProgramCall() which will
call virNetClientSendWithReply() and eventually uses
virNetClientIO()to send the message to libvirtd and
then waits for a response using virNetClientIOEventLoop()</p></li>
<li>virNetClientIncomingEvent()
<p>Receives the returned packet and processes through
virNetClientIOUpdateCallback()</p></li>
</ul>
</li>
<li>libvirtd Daemon
<p></p>
<ul>
<li>Daemon Startup
<p>The daemon initialization processing will declare itself
as a server via a virNetServerNew() call, then use
virDriverLoadModule() to find/load all known drivers,
set up an RPC server program using the <code>remoteProcs[]</code>
table via a virNetServerProgramNew() call. The table is the
corollary to the <code>remote_procedure</code> enum list in
the client. It lists all the functions to be called in
the same order. Once RPC is set up, networking server sockets
are opened, the various driver state initialization routines
are run from the <code>virStateDriverTab[]</code>, the network
links are enabled, and the daemon waits for work.</p></li>
<li>RPC
<p>When a message is received, the <code>remoteProcs[]</code>
table is referenced for the 'REMOTE_PROC_OPEN' call entry.
This results in remoteDispatchOpen() being called via the
virNetServerProgramDispatchCall().</p></li>
<li>remoteDispatchOpen()
<p>The API will read the argument passed picking out the
<code>name</code> of the driver to be opened. The code
will then call virConnectOpen() or virConnectOpenReadOnly()
depending on the argument <code>flags</code>.</p></li>
<li>virConnectOpen() or virConnectOpenReadOnly()
<p>Just like the client except that upon entry the URI
is what was passed from the client and will be found
and opened to process the data.</p>
<p>The returned structure data is returned via the
virNetServer interfaces to the remote driver which then
returns it to the client application.</p></li>
</ul>
</li>
</ul>
</body>
</html>

View File

@@ -418,7 +418,7 @@
After a complete packet has been read, the header must be decoded
and all 6 fields fully validated, before attempting to dispatch
the payload. Once dispatched, the payload can be decoded and passed
on to the appropriate API for execution. The RPC code must not take
onto the appropriate API for execution. The RPC code must not take
any action based on the payload, since it has no way to validate
the semantics of the payload data. It must delegate this to the
execution API (e.g. corresponding libvirt public API).
@@ -785,7 +785,7 @@
return value and output parameters, or error object and encode
them into a reply packet. Again it does not attempt to do any
semantic validation of output data, aside from variable length
field limit checks. The worker thread puts the reply packet on
field limit checks. The worker thread puts the reply packet onto
the transmission queue for the client. The worker is now finished
and goes back to wait for another incoming method call.
</p>
@@ -811,10 +811,10 @@
for the worker threads, it is sidetracked into a per-stream
processing queue. When the stream becomes writable, queued
incoming stream packets will be processed, passing their data
payload on the stream. Conversely when the stream becomes
payload onto the stream. Conversely when the stream becomes
readable, chunks of data will be read from it, encoded into
new outgoing packets, and placed on the client's transmit
queue.
queue
</p>
<h4><a name="apiserverdispatchex1">Example with overlapping methods</a></h4>

View File

@@ -1,58 +0,0 @@
#FIG 3.2 Produced by xfig version 3.2.5b
Landscape
Center
Inches
Letter
100.00
Single
-2
1200 2
2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
450 375 4575 375 4575 1725 450 1725 450 375
2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
1125 2475 4950 2475 4950 3600 1125 3600 1125 2475
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 0 1.00 60.00 120.00
1725 1725 2175 2475
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
3150 5700 6525 5700 6525 6900 3150 6900 3150 5700
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
7875 6825 10125 6825 10125 7725 7875 7725 7875 6825
2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
2550 4725 10350 4725 10350 7800 2550 7800 2550 4725
2 2 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5
8850 1950 11550 1950 11550 3360 8850 3360 8850 1950
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 0 1.00 60.00 120.00
3975 3600 5025 4425
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 0 1.00 60.00 120.00
8925 3225 5400 4425
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 0 1.00 60.00 120.00
5625 6900 7875 7425
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3
1 0 1.00 60.00 120.00
11400 3375 11400 7575 10125 7575
2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
8400 975 12450 975 12450 4125 8400 4125 8400 975
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 6
1 0 1.00 60.00 120.00
10125 7125 10725 7125 10725 4425 7725 4425 7725 2700 8850 2700
4 0 0 50 -1 16 12 0.0000 4 180 2430 1350 2895 virConnectOpenReadOnly(uri)\001
4 0 0 50 -1 16 12 0.0000 4 180 3240 1350 3090 virConnectOpenAuth(uri, auth, flags)\001
4 0 0 50 -1 0 12 0.0000 4 165 1350 3300 5850 virConnectOpen:\001
4 0 0 50 -1 0 12 0.0000 4 165 2070 3300 6045 virConnectOpenReadOnly:\001
4 0 0 50 -1 0 12 0.0000 4 165 1710 3300 6240 virConnectOpenAuth:\001
4 0 0 50 -1 0 12 0.0000 4 180 900 3975 6600 do_open():\001
4 0 0 50 -1 0 14 0.0000 4 135 1260 8025 7125 Rremote driver\001
4 0 0 50 -1 16 24 0.0000 4 135 630 5025 4650 libvirt\001
4 0 0 50 -1 0 14 0.0000 4 180 1890 9000 2175 remoteDispatchOpen():\001
4 0 0 50 -1 0 12 0.0000 4 45 270 9300 2475 ...\001
4 0 0 50 -1 0 12 0.0000 4 180 1440 9300 2670 virConnectOpen()\001
4 0 0 50 -1 0 12 0.0000 4 180 2160 9300 2865 virConnectOpenReadOnly()\001
4 0 0 50 -1 0 12 0.0000 4 45 270 9300 3060 ...\001
4 0 0 50 -1 0 12 0.0000 4 180 1080 8250 7350 remoteOpen()\001
4 0 0 50 -1 16 16 0.0000 4 165 3240 600 1050 "virsh -c qemu:///system list --all"\001
4 0 0 50 -1 16 12 0.0000 4 180 1710 1350 2700 virConnectOpen(uri)\001
4 0 0 50 -1 16 24 0.0000 4 135 720 9750 825 libvirtd\001

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -184,25 +184,23 @@ div.api {
border: 1px solid #999999;
background: #eeeeee;
color: black;
padding: 3px;
}
div.api pre {
margin: 0px;
border: 0px;
background: inherit;
padding: inherit;
}
div.api table {
margin: 0px;
padding-left: 2em;
border-spacing: 0px;
font-family: fixed;
whitespace: pre;
}
div.api table td, div.variablelist table td {
vertical-align: top;
padding-left: 1em;
}
@@ -414,66 +412,3 @@ table.data tbody td.n {
background: rgb(255,220,220);
text-align: center;
}
.api {
font-family: monospace;
}
.api .type {
font-weight: bold;
white-space: nowrap;
color: darkslateblue;
}
.api .keyword {
font-weight: bold;
color: #A2F;
}
.api .comment {
color: #080;
margin-left: 2em;
position: relative;
}
.api .comment:before {
content: ": ";
position: absolute;
left: -1.3em;
}
.api .undisclosed {
font-style: italic;
letter-spacing: .3ex;
font-weight: bolder;
text-transform: uppercase;
margin-left: 2em;
}
.api .directive {
color: teal;
}
.api :link:hover, .api :link:focus {
color: blue;
border-color: blue;
}
.api :link {
text-decoration: none;
}
dl.variablelist > dt {
display: block;
float: left;
font-style: italic;
font-weight: inherit;
}
.variablelist dd {
padding-left: 10em;
}
dl.variablelist > dt:after {
content: ": ";
}

View File

@@ -136,20 +136,6 @@
facility should be used.
</p>
<h2><a name="offline">Offline migration</a></h2>
<p>
Offline migration transfers inactive the definition of a domain
(which may or may not be active). After successful completion, the
domain remains in its current state on the source host and is defined
but inactive on the destination host. It's a bit more clever than
<code>virsh dumpxml</code> on source host followed by
<code>virsh define</code> on destination host, as offline migration
will run the pre-migration hook to update the domain XML on
destination host. Currently, copying non-shared storage is not
supported during offline migration.
</p>
<h2><a name="uris">Migration URIs</a></h2>
<p>
@@ -192,12 +178,12 @@
should specify the hypervisor specific URI, using an IP address
associated with the network to be used.</li>
<li>The firewall restricts what ports are available. When libvirt
generates a migration URI it will pick a port number using hypervisor
generates a migration URI will pick a port number using hypervisor
specific rules. Some hypervisors only require a single port to be
open in the firewalls, while others require a whole range of port
numbers. In the latter case the management application may wish
to choose a specific port number outside the default range in order
to comply with local firewall policies.</li>
to comply with local firewall policies</li>
</ol>
<h2><a name="config">Configuration file handling</a></h2>

View File

@@ -83,51 +83,17 @@
</xsl:for-each>
</xsl:template>
<xsl:template name="formattext">
<xsl:param name="text" />
<xsl:if test="$text">
<xsl:variable name="head" select="substring-before($text, '&#xA;&#xA;')"/>
<xsl:variable name="rest" select="substring-after($text, '&#xA;&#xA;')"/>
<xsl:choose>
<xsl:when test="$head">
<p>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="$head"/>
</xsl:call-template>
</p>
</xsl:when>
<xsl:when test="not($rest)">
<p>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</p>
</xsl:when>
</xsl:choose>
<xsl:if test="$rest">
<xsl:call-template name="formattext">
<xsl:with-param name="text" select="$rest"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="macro" mode="toc">
<span class="directive">#define</span><xsl:text> </xsl:text>
<xsl:text>#define </xsl:text>
<a href="#{@name}"><xsl:value-of select="@name"/></a>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="variable" mode="toc">
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="string(@type)"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="string(@type)"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<a name="{@name}"></a>
<xsl:value-of select="@name"/>
@@ -136,21 +102,18 @@
</xsl:template>
<xsl:template match="typedef" mode="toc">
<span class="keyword">typedef</span>
<xsl:text> </xsl:text><xsl:variable name="name" select="string(@name)"/>
<xsl:text>typedef </xsl:text><xsl:variable name="name" select="string(@name)"/>
<xsl:choose>
<xsl:when test="@type = 'enum'">
<span class="keyword">enum</span><xsl:text> </xsl:text>
<xsl:text>enum </xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
<xsl:text>
</xsl:text>
</xsl:when>
<xsl:otherwise>
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<a name="{$name}"><xsl:value-of select="$name"/></a>
<xsl:text>
@@ -164,7 +127,7 @@
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<div class="api">
<pre>
<span class="keyword">enum</span><xsl:text> </xsl:text>
<xsl:text>enum </xsl:text>
<xsl:value-of select="$name"/>
<xsl:text> {
</xsl:text>
@@ -178,11 +141,10 @@
<td><xsl:value-of select="@value"/></td>
<xsl:if test="@info != ''">
<td>
<div class="comment">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</div>
<xsl:text> : </xsl:text>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</td>
</xsl:if>
</tr>
@@ -196,8 +158,8 @@
</xsl:template>
<xsl:template match="struct" mode="toc">
<span class="keyword">typedef</span><xsl:text> </xsl:text>
<span class="type"><xsl:value-of select="@type"/></span>
<xsl:text>typedef </xsl:text>
<xsl:value-of select="@type"/>
<xsl:text> </xsl:text>
<a href="#{@name}"><xsl:value-of select="@name"/></a>
<xsl:text>
@@ -208,83 +170,78 @@
<h3><a name="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
<div class="api">
<pre>
<span class="keyword">struct </span>
<xsl:text>struct </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text> {
<xsl:text>{
</xsl:text>
</pre>
<xsl:if test="field">
<table>
<xsl:for-each select="field">
<xsl:choose>
<xsl:when test='@type = "union"'>
<tr><td><span class="keyword">union</span> {</td></tr>
<tr>
<td><table>
<xsl:for-each select="union/field">
<tr>
<td>
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
</td>
<td><xsl:value-of select="@name"/></td>
<xsl:if test="@info != ''">
<td>
<div class="comment">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</div>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table></td>
<td></td></tr>
<tr><td>}</td>
<td><xsl:value-of select="@name"/></td>
<xsl:if test="@info != ''">
<td>
<div class="comment">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</div>
</td>
</xsl:if>
<td></td></tr>
</xsl:when>
<xsl:otherwise>
<table>
<xsl:for-each select="field">
<xsl:choose>
<xsl:when test='@type = "union"'>
<tr><td>union {</td></tr>
<tr>
<td><table>
<xsl:for-each select="union/field">
<tr>
<td>
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</td>
<td><xsl:value-of select="@name"/></td>
<xsl:if test="@info != ''">
<td>
<div class="comment">
<xsl:call-template name="dumptext">
<xsl:text> : </xsl:text>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</div>
</xsl:call-template>
</td>
</xsl:if>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</table>
</xsl:if>
<xsl:if test="not(field)">
<div class="undisclosed">The content of this structure is not made public by the API</div>
</xsl:if>
</xsl:for-each>
</table></td>
<td></td></tr>
<tr><td>}</td>
<td><xsl:value-of select="@name"/></td>
<xsl:if test="@info != ''">
<td>
<xsl:text> : </xsl:text>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</td>
</xsl:if>
<td></td></tr>
</xsl:when>
<xsl:otherwise>
<tr>
<td>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</td>
<td><xsl:value-of select="@name"/></td>
<xsl:if test="@info != ''">
<td>
<xsl:text> : </xsl:text>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</td>
</xsl:if>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:if test="not(field)">
<tr>
<td colspan="3">
<xsl:text>The content of this structure is not made public by the API</xsl:text>
</td>
</tr>
</xsl:if>
</table>
<pre>
<xsl:text>
}
@@ -296,12 +253,12 @@
<xsl:template match="macro">
<xsl:variable name="name" select="string(@name)"/>
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api"><span class="directive">#define</span><xsl:text> </xsl:text><xsl:value-of select="$name"/></pre>
<div>
<xsl:call-template name="formattext">
<pre><xsl:text>#define </xsl:text><xsl:value-of select="$name"/></pre>
<p>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="info"/>
</xsl:call-template>
</div><xsl:text>
</p><xsl:text>
</xsl:text>
</xsl:template>
@@ -310,11 +267,9 @@
<xsl:variable name="nlen" select="string-length($name)"/>
<xsl:variable name="tlen" select="string-length(return/@type)"/>
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
<xsl:text>&#9;</xsl:text>
<a href="#{@name}"><xsl:value-of select="@name"/></a>
<xsl:if test="$blen - 40 &lt; -8">
@@ -325,14 +280,12 @@
</xsl:if>
<xsl:text>&#9;(</xsl:text>
<xsl:if test="not(arg)">
<span class="type">void</span>
<xsl:text>void</xsl:text>
</xsl:if>
<xsl:for-each select="arg">
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="position() != last()">
@@ -355,15 +308,13 @@
<xsl:variable name="nlen" select="string-length($name)"/>
<xsl:variable name="tlen" select="string-length(return/@type)"/>
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
<span class="keyword">typedef</span><xsl:text> </xsl:text>
<xsl:text>typedef </xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
<xsl:text>
</xsl:text>
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
<xsl:text>&#9;</xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
<xsl:if test="$blen - 40 &lt; -8">
@@ -374,14 +325,12 @@
</xsl:if>
<xsl:text>&#9;(</xsl:text>
<xsl:if test="not(arg)">
<span class="type">void</span>
<xsl:text>void</xsl:text>
</xsl:if>
<xsl:for-each select="arg">
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="position() != last()">
@@ -407,13 +356,11 @@
<xsl:variable name="tlen" select="string-length(return/@type)"/>
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api">
<span class="keyword">typedef</span><xsl:text> </xsl:text>
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
</span>
<pre class="programlisting">
<xsl:text>typedef </xsl:text>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
<xsl:text>&#9;(*</xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="$blen - 40 &lt; -8">
@@ -424,19 +371,16 @@
</xsl:if>
<xsl:text>)&#9;(</xsl:text>
<xsl:if test="not(arg)">
<span class="type">void</span>
<xsl:text>void</xsl:text>
</xsl:if>
<xsl:for-each select="arg">
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="position() != last()">
<xsl:text>,
</xsl:text>
<xsl:text>, </xsl:text><br/>
<xsl:if test="$blen - 40 &gt; 8">
<xsl:text>&#9;</xsl:text>
</xsl:if>
@@ -449,30 +393,34 @@
<xsl:text>)
</xsl:text>
</pre>
<div>
<xsl:call-template name="formattext">
<p>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="info"/>
</xsl:call-template>
</div>
</p>
<xsl:if test="arg | return">
<dl class="variablelist">
<div class="variablelist"><table border="0"><col align="left"/><tbody>
<xsl:for-each select="arg">
<dt><xsl:value-of select="@name"/></dt>
<dd>
<xsl:call-template name="dumptext">
<tr>
<td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
<td>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</dd>
</td>
</tr>
</xsl:for-each>
<xsl:if test="return/@info">
<dt>Returns</dt>
<dd>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@info"/>
</xsl:call-template>
</dd>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@info"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
</dl>
</tbody></table></div>
</xsl:if>
<br/>
<xsl:text>
@@ -485,12 +433,10 @@
<xsl:variable name="tlen" select="string-length(return/@type)"/>
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api">
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
</span>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
</xsl:call-template>
<xsl:text>&#9;</xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="$blen - 40 &lt; -8">
@@ -501,19 +447,16 @@
</xsl:if>
<xsl:text>&#9;(</xsl:text>
<xsl:if test="not(arg)">
<span class="type">void</span>
<xsl:text>void</xsl:text>
</xsl:if>
<xsl:for-each select="arg">
<span class="type">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
</span>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@type"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="position() != last()">
<xsl:text>,
</xsl:text>
<xsl:text>, </xsl:text><br/>
<xsl:if test="$blen - 40 &gt; 8">
<xsl:text>&#9;</xsl:text>
</xsl:if>
@@ -523,33 +466,39 @@
<xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:text>)</xsl:text><br/>
<xsl:text>
</xsl:text>
</pre>
<div>
<xsl:call-template name="formattext">
<p>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="info"/>
</xsl:call-template>
</div><xsl:text>
</p><xsl:text>
</xsl:text>
<xsl:if test="arg | return/@info">
<dl class="variablelist">
<xsl:for-each select="arg">
<dt><xsl:value-of select="@name"/></dt>
<dd>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</dd>
</xsl:for-each>
<xsl:if test="return/@info">
<dt>Returns</dt>
<dd>
<div class="variablelist"><table border="0"><col align="left"/><tbody>
<xsl:for-each select="arg">
<tr>
<td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
<td>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="@info"/>
</xsl:call-template>
</td>
</tr>
</xsl:for-each>
<xsl:if test="return/@info">
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@info"/>
</xsl:call-template>
</dd>
</xsl:if>
</dl>
</td>
</tr>
</xsl:if>
</tbody></table></div>
</xsl:if>
</xsl:template>
@@ -598,20 +547,20 @@
<h2>Table of Contents</h2>
<xsl:if test="count(exports[@type='macro']) > 0">
<h3><a href="#macros">Macros</a></h3>
<pre class="api">
<pre>
<xsl:apply-templates select="exports[@type='macro']" mode="toc">
<xsl:sort select='@symbol'/>
</xsl:apply-templates>
</pre>
</xsl:if>
<h3><a href="#types">Types</a></h3>
<pre class="api">
<pre>
<xsl:apply-templates select="exports[@type='typedef']" mode="toc">
<xsl:sort select='@symbol'/>
</xsl:apply-templates>
</pre>
<h3><a href="#functions">Functions</a></h3>
<pre class="api">
<pre>
<xsl:apply-templates select="exports[@type='function']" mode="toc">
<xsl:sort select='@symbol'/>
</xsl:apply-templates>

File diff suppressed because it is too large Load Diff

View File

@@ -20,12 +20,6 @@
</data>
</define>
<define name='octalMode'>
<data type="unsignedInt">
<param name='pattern'>[0-7]+</param>
</data>
</define>
<define name="uint8range">
<choice>
<data type="string">
@@ -107,65 +101,6 @@
</data>
</define>
<!--====================================================================-->
<!--The duid is a unique identifier used in DHCPv6 to identity an -->
<!--interface on a device (system). The duid is often used by servers -->
<!--such as dnsmasq to assign a specific IP address (and optionally a -->
<!--name to an interface. The applicable standards are RFC3315 and -->
<!--RFC6355. These standards actualy require the duid to be fixed for -->
<!--the hardward device and applicable to all network interfaces on -->
<!--that device. It is not clear that any software currently enforces -->
<!--this requirement although it could be implemented manually. -->
<!--====================================================================-->
<!--There are currently four types of duids defined: -->
<!-- type 1, duid-LLT, link-layer (MAC) plus 32 bit time when the -->
<!-- duid-LLT was created in seconds from January 1, 2000 -->
<!-- type 2, duid-EN, 32 bit "enterprise number" followed by a -->
<!-- variable length unique identifier. -->
<!-- type 3, duid-LL, link-layer (MAC) -->
<!-- type 4, duid-UUID, a 128 bit UUID (16 bytes) -->
<!--RFC3315 states that the maximum length of a duid is 128 bytes plus -->
<!--the 16 bit type field. Often, the machine type is "1" which is the -->
<!--number assigned to ethernet. -->
<define name="duidLLT">
<data type="string">
<!-- 0======| type======| 0======| machine type======| time================| link-layer============| -->
<param name="pattern">[0]{1,2}:[0]{0,1}[1]:[0]{1,2}:[0]{0,1}[a-fA-F1-9](:[a-fA-F0-9]{1,2}){4}(:[a-fA-F0-9]{1,2}){6,8}</param>
</data>
</define>
<define name="duidEN">
<data type="string">
<!-- 0======| type======| Enterprise number===| unique id ==============| -->
<param name="pattern">[0]{1,2}:[0]{0,1}[2](:[a-fA-F0-9]{1,2}){4}(:[a-fA-F0-9]{1,2}){1,124}</param>
</data>
</define>
<define name="duidLL">
<data type="string">
<!-- 0======| type======| 0======| machine type======| link-layer============| -->
<param name="pattern">[0]{1,2}:[0]{0,1}[3]:[0]{1,2}:[0]{0,1}[a-fA-F1-9](:[a-fA-F0-9]{1,2}){6,8}</param>
</data>
</define>
<define name="duidUUID">
<data type="string">
<!-- 0======| type======| UUID=================| -->
<param name="pattern">[0]{1,2}:[0]{0,1}[4](:[a-fA-F0-9]{1,2}){16}</param>
</data>
</define>
<define name="DUID">
<choice>
<ref name="duidLLT"/>
<ref name="duidEN"/>
<ref name="duidLL"/>
<ref name="duidUUID"/>
</choice>
</define>
<!--======================================================================-->
<!-- An ipv4 "dotted quad" address -->
<define name="ipv4Addr">
<data type="string">
@@ -280,96 +215,8 @@
<define name='wwn'>
<data type='string'>
<param name='pattern'>(0x)?[0-9a-fA-F]{16}</param>
<param name='pattern'>[0-9a-fA-F]{16}</param>
</data>
</define>
<define name="cpuset">
<data type="string">
<param name="pattern">([0-9]+(-[0-9]+)?|\^[0-9]+)(,([0-9]+(-[0-9]+)?|\^[0-9]+))*</param>
</data>
</define>
<define name='volName'>
<data type='string'>
<param name="pattern">[a-zA-Z0-9_\+\-\.]+</param>
</data>
</define>
<define name='archnames'>
<choice>
<value>alpha</value>
<value>armv7l</value>
<value>cris</value>
<value>i686</value>
<value>ia64</value>
<value>lm32</value>
<value>m68k</value>
<value>microblaze</value>
<value>microblazeel</value>
<value>mips</value>
<value>mipsel</value>
<value>mips64</value>
<value>mips64el</value>
<value>openrisc</value>
<value>parisc</value>
<value>parisc64</value>
<value>ppc</value>
<value>ppc64</value>
<value>ppcemb</value>
<value>s390</value>
<value>s390x</value>
<value>sh4</value>
<value>sh4eb</value>
<value>sparc</value>
<value>sparc64</value>
<value>unicore32</value>
<value>x86_64</value>
<value>xtensa</value>
<value>xtensaeb</value>
</choice>
</define>
<define name="PortNumber">
<data type="short">
<param name="minInclusive">-1</param>
</data>
</define>
<define name='sourceinfoadapter'>
<element name='adapter'>
<choice>
<group>
<!-- To keep back-compat, 'type' is not mandatory for
scsi_host adapter -->
<optional>
<attribute name='type'>
<value>scsi_host</value>
</attribute>
</optional>
<attribute name='name'>
<text/>
</attribute>
</group>
<group>
<attribute name='type'>
<value>fc_host</value>
</attribute>
<optional>
<attribute name='parent'>
<text/>
</attribute>
</optional>
<attribute name='wwnn'>
<ref name='wwn'/>
</attribute>
<attribute name='wwpn'>
<ref name='wwn'/>
</attribute>
</group>
</choice>
<empty/>
</element>
</define>
</grammar>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt capabilities XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
@@ -176,10 +175,6 @@
<ref name='unsignedInt'/>
</attribute>
<optional>
<ref name='memory'/>
</optional>
<optional>
<element name='cpus'>
<attribute name='num'>
@@ -193,28 +188,11 @@
</element>
</define>
<define name='memory'>
<element name='memory'>
<ref name='scaledInteger'/>
</element>
</define>
<define name='cpu'>
<element name='cpu'>
<attribute name='id'>
<ref name='unsignedInt'/>
</attribute>
<optional>
<attribute name='socket_id'>
<ref name='unsignedInt'/>
</attribute>
<attribute name='core_id'>
<ref name='unsignedInt'/>
</attribute>
<attribute name='siblings'>
<ref name='cpuset'/>
</attribute>
</optional>
</element>
</define>
@@ -377,6 +355,23 @@
</attribute>
</define>
<define name='archnames'>
<choice>
<value>arm</value>
<value>i686</value>
<value>ia64</value>
<value>microblaze</value>
<value>microblazeel</value>
<value>mips</value>
<value>mipsel</value>
<value>ppc64</value>
<value>ppc</value>
<value>s390</value>
<value>sparc</value>
<value>x86_64</value>
</choice>
</define>
<define name='featureName'>
<data type='string'>
<param name='pattern'>[a-zA-Z0-9\-_]+</param>

File diff suppressed because it is too large Load Diff

View File

@@ -30,29 +30,6 @@
<text/>
</element>
</optional>
<optional>
<element name='memory'>
<choice>
<attribute name='snapshot'>
<choice>
<value>no</value>
<value>internal</value>
</choice>
</attribute>
<group>
<optional>
<attribute name='snapshot'>
<value>external</value>
</attribute>
</optional>
<attribute name='file'>
<ref name='absFilePath'/>
</attribute>
</group>
</choice>
<empty/>
</element>
</optional>
<optional>
<element name='disks'>
<zeroOrMore>

View File

@@ -17,16 +17,6 @@
<data type="unsignedInt"/>
</attribute>
</optional>
<!-- Enables IPv6 guest-to-guest communications on a network
with no gateways addresses specified -->
<optional>
<attribute name="ipv6">
<choice>
<value>yes</value>
<value>no</value>
</choice>
</attribute>
</optional>
<interleave>
<!-- The name of the network, used to refer to it through the API
@@ -149,17 +139,6 @@
</attribute>
</element>
</optional>
<optional>
<element name="driver">
<attribute name="name">
<choice>
<value>kvm</value>
<value>vfio</value>
</choice>
</attribute>
<empty/>
</element>
</optional>
</interleave>
</element>
</optional>
@@ -229,7 +208,7 @@
</zeroOrMore>
<zeroOrMore>
<element name="host">
<attribute name="ip"><ref name="ipAddr"/></attribute>
<attribute name="ip"><ref name="ipv4Addr"/></attribute>
<oneOrMore>
<element name="hostname"><ref name="dnsName"/></element>
</oneOrMore>
@@ -283,25 +262,15 @@
<element name="dhcp">
<zeroOrMore>
<element name="range">
<attribute name="start"><ref name="ipAddr"/></attribute>
<attribute name="end"><ref name="ipAddr"/></attribute>
<attribute name="start"><ref name="ipv4Addr"/></attribute>
<attribute name="end"><ref name="ipv4Addr"/></attribute>
</element>
</zeroOrMore>
<zeroOrMore>
<element name="host">
<choice>
<group>
<choice>
<attribute name="mac"><ref name="uniMacAddr"/></attribute>
<attribute name="id"><ref name="DUID"/></attribute>
</choice>
<optional>
<attribute name="name"><text/></attribute>
</optional>
</group>
<attribute name="name"><text/></attribute>
</choice>
<attribute name="ip"><ref name="ipAddr"/></attribute>
<attribute name="mac"><ref name="uniMacAddr"/></attribute>
<attribute name="name"><text/></attribute>
<attribute name="ip"><ref name="ipv4Addr"/></attribute>
</element>
</zeroOrMore>
<optional>

View File

@@ -148,11 +148,6 @@
<ref name="speed"/>
</attribute>
</optional>
<optional>
<attribute name="floor">
<ref name="speed"/>
</attribute>
</optional>
<optional>
<attribute name='burst'>
<ref name="BurstSize"/>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt node device XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
@@ -268,12 +267,6 @@
<attribute name='type'>
<value>vports_ops</value>
</attribute>
<element name='max_vports'>
<ref name='unsignedInt'/>
</element>
<element name='vports'>
<ref name='unsignedInt'/>
</element>
</define>
<define name='capscsihost'>

View File

@@ -308,25 +308,25 @@
<choice>
<value>root</value>
<data type="string">
<param name="pattern">mac[a-zA-Z0-9_\.:\-]{0,9}</param>
<param name="pattern">mac[a-zA-Z0-9_\.:-]{0,9}</param>
</data>
<data type="string">
<param name="pattern">stp[a-zA-Z0-9_\.:\-]{0,9}</param>
<param name="pattern">stp[a-zA-Z0-9_\.:-]{0,9}</param>
</data>
<data type="string">
<param name="pattern">vlan[a-zA-Z0-9_\.:\-]{0,8}</param>
<param name="pattern">vlan[a-zA-Z0-9_\.:-]{0,8}</param>
</data>
<data type="string">
<param name="pattern">arp[a-zA-Z0-9_\.:\-]{0,9}</param>
<param name="pattern">arp[a-zA-Z0-9_\.:-]{0,9}</param>
</data>
<data type="string">
<param name="pattern">rarp[a-zA-Z0-9_\.:\-]{0,8}</param>
<param name="pattern">rarp[a-zA-Z0-9_\.:-]{0,8}</param>
</data>
<data type="string">
<param name="pattern">ipv4[a-zA-Z0-9_\.:\-]{0,8}</param>
<param name="pattern">ipv4[a-zA-Z0-9_\.:-]{0,8}</param>
</data>
<data type="string">
<param name="pattern">ipv6[a-zA-Z0-9_\.:\-]{0,8}</param>
<param name="pattern">ipv6[a-zA-Z0-9_\.:-]{0,8}</param>
</data>
</choice>
</attribute>
@@ -950,7 +950,10 @@
<param name="pattern">0x[0-9a-fA-F]{1,8}</param>
</data>
<data type="unsignedInt"/>
<data type="int">
<param name="minInclusive">0</param>
<param name="maxInclusive">4294967295</param>
</data>
</choice>
</define>

View File

@@ -41,7 +41,6 @@
<choice>
<ref name='usagevolume'/>
<ref name='usageceph'/>
<ref name='usageiscsi'/>
<!-- More choices later -->
</choice>
</element>
@@ -68,13 +67,4 @@
</element>
</define>
<define name='usageiscsi'>
<attribute name='type'>
<value>iscsi</value>
</attribute>
<element name='target'>
<ref name='genericName'/>
</element>
</define>
</grammar>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt volume encryption XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

View File

@@ -144,7 +144,7 @@
<define name='commonmetadata'>
<element name='name'>
<ref name='genericName'/>
<ref name='name'/>
</element>
<optional>
<element name='uuid'>
@@ -175,7 +175,7 @@
<optional>
<element name='permissions'>
<element name='mode'>
<ref name='octalMode'/>
<ref name='unsignedInt'/>
</element>
<element name='owner'>
<choice>
@@ -230,8 +230,7 @@
<attribute name='path'>
<choice>
<ref name='absFilePath'/>
<ref name='genericName'/>
<ref name='IscsiQualifiedName'/>
<ref name='name'/>
</choice>
</attribute>
<choice>
@@ -274,6 +273,15 @@
</element>
</define>
<define name='sourceinfoadapter'>
<element name='adapter'>
<attribute name='name'>
<text/>
</attribute>
<empty/>
</element>
</define>
<define name='sourceinfoname'>
<element name='name'>
<text/>
@@ -484,6 +492,7 @@
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
@@ -510,9 +519,15 @@
</element>
</define>
<define name='IscsiQualifiedName'>
<define name='name'>
<data type='string'>
<param name="pattern">iqn\.[0-9]{4}-(0[1-9]|1[0-2])\.[a-zA-Z0-9\.\-]+(:.+)?</param>
<param name="pattern">[a-zA-Z0-9_\+\-]+</param>
</data>
</define>
<define name="PortNumber">
<data type="short">
<param name="minInclusive">-1</param>
</data>
</define>

View File

@@ -13,7 +13,7 @@
<define name='vol'>
<element name='volume'>
<element name='name'>
<ref name='volName'/>
<ref name='name'/>
</element>
<optional>
<element name='key'>
@@ -46,7 +46,7 @@
<optional>
<element name='permissions'>
<element name='mode'>
<ref name='octalMode'/>
<ref name='unsignedInt'/>
</element>
<element name='owner'>
<ref name='unsignedInt'/>
@@ -173,10 +173,11 @@
<value>vfat</value>
<value>hfs+</value>
<value>xfs</value>
<value>ocfs2</value>
</choice>
</define>
<define name='formatfile'>
<choice>
<value>unknown</value>
@@ -195,19 +196,6 @@
</choice>
</define>
<define name='formatdisk'>
<choice>
<value>none</value>
<value>linux</value>
<value>fat16</value>
<value>fat32</value>
<value>linux-swap</value>
<value>linux-lvm</value>
<value>linux-raid</value>
<value>extended</value>
</choice>
</define>
<define name='format'>
<optional>
<element name='format'>
@@ -215,11 +203,16 @@
<choice>
<ref name='formatfile'/>
<ref name='formatdev'/>
<ref name='formatdisk'/>
</choice>
</attribute>
</element>
</optional>
</define>
<define name='name'>
<data type='string'>
<param name="pattern">[a-zA-Z0-9_\+\-\.]+</param>
</data>
</define>
</grammar>

View File

@@ -216,14 +216,6 @@
<a href="drvhyperv.html">Microsoft Hyper-V</a>
<span>Driver for Microsoft Hyper-V</span>
</li>
<li>
<a href="drvphyp.html">IBM PowerVM</a>
<span>Driver for IBM PowerVM</span>
</li>
<li>
<a href="drvparallels.html">Parallels</a>
<span>Driver for Parallels Cloud Server</span>
</li>
</ul>
</li>
<li>

View File

@@ -153,7 +153,6 @@
<li><code>iso</code>: CDROM disk image format</li>
<li><code>qcow</code>: QEMU v1 disk image format</li>
<li><code>qcow2</code>: QEMU v2 disk image format</li>
<li><code>qed</code>: QEMU Enhanced Disk image format</li>
<li><code>vmdk</code>: VMWare disk image format</li>
<li><code>vpc</code>: VirtualPC disk image format</li>
</ul>
@@ -230,9 +229,6 @@
<li>
<code>xfs</code>
</li>
<li>
<code>ocfs2</code>
</li>
</ul>
<h3>Valid volume format types</h3>
@@ -273,12 +269,6 @@
<li>
<code>nfs</code>
</li>
<li>
<code>glusterfs</code>
</li>
<li>
<code>cifs</code>
</li>
</ul>
<h3>Valid volume format types</h3>
@@ -314,14 +304,8 @@
<h3>Valid pool format types</h3>
<p>
The logical volume pool supports the following formats:
The logical volume pool does not use the pool format type element.
</p>
<ul>
<li><code>auto</code> - automatically determine format</li>
<li>
<code>lvm2</code>
</li>
</ul>
<h3>Valid volume format types</h3>
<p>
@@ -332,7 +316,7 @@
<h2><a name="StorageBackendDisk">Disk volume pools</a></h2>
<p>
This provides a pool based on a physical disk. Volumes are created
by adding partitions to the disk. Disk pools have constraints
by adding partitions to the disk. Disk pools are have constraints
on the size and placement of volumes. The 'free extents'
information will detail the regions which are available for creating
new volumes. A volume cannot span across 2 different free extents.
@@ -377,9 +361,6 @@
<li>
<code>sun</code>
</li>
<li>
<code>lvm2</code>
</li>
</ul>
<p>
The <code>dos</code> or <code>gpt</code> formats are recommended for

View File

@@ -30,7 +30,7 @@ virConnectPtr conn = virConnectOpenReadOnly (<b>"test:///default"</b>);
<p>
To simplify life for administrators, it is possible to setup URI aliases in a
libvirt client configuration file. The configuration file is <code>/etc/libvirt/libvirt.conf</code>
for the root user, or <code>$XDG_CONFIG_HOME/libvirt/libvirt.conf</code> for any unprivileged user.
for the root user, or <code>$XDG_CONFIG_DIR/libvirt/libvirt.conf</code> for any unprivileged user.
In this file, the following syntax can be used to setup aliases
</p>

View File

@@ -149,9 +149,6 @@ static const char *eventDetailToString(int event, int detail) {
case VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT:
ret = "Snapshot";
break;
case VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR:
ret = "API error";
break;
}
break;
case VIR_DOMAIN_EVENT_RESUMED:

View File

@@ -289,7 +289,7 @@ class virEventLoopPure:
def update_timer(self, timerID, interval):
for h in self.timers:
if h.get_id() == timerID:
h.set_interval(interval)
h.set_interval(interval);
self.interrupt()
debug("Update timer %d interval %d" % (timerID, interval))
@@ -325,25 +325,25 @@ class virEventLoopPure:
if events & libvirt.VIR_EVENT_HANDLE_WRITABLE:
ret |= select.POLLOUT
if events & libvirt.VIR_EVENT_HANDLE_ERROR:
ret |= select.POLLERR
ret |= select.POLLERR;
if events & libvirt.VIR_EVENT_HANDLE_HANGUP:
ret |= select.POLLHUP
ret |= select.POLLHUP;
return ret
# Convert from poll() event constants, to libvirt events constants
def events_from_poll(self, events):
ret = 0
ret = 0;
if events & select.POLLIN:
ret |= libvirt.VIR_EVENT_HANDLE_READABLE
ret |= libvirt.VIR_EVENT_HANDLE_READABLE;
if events & select.POLLOUT:
ret |= libvirt.VIR_EVENT_HANDLE_WRITABLE
ret |= libvirt.VIR_EVENT_HANDLE_WRITABLE;
if events & select.POLLNVAL:
ret |= libvirt.VIR_EVENT_HANDLE_ERROR
ret |= libvirt.VIR_EVENT_HANDLE_ERROR;
if events & select.POLLERR:
ret |= libvirt.VIR_EVENT_HANDLE_ERROR
ret |= libvirt.VIR_EVENT_HANDLE_ERROR;
if events & select.POLLHUP:
ret |= libvirt.VIR_EVENT_HANDLE_HANGUP
return ret
ret |= libvirt.VIR_EVENT_HANDLE_HANGUP;
return ret;
###########################################################################
@@ -437,15 +437,15 @@ def eventToString(event):
"Resumed",
"Stopped",
"Shutdown",
"PMSuspended" )
return eventStrings[event]
"PMSuspended" );
return eventStrings[event];
def detailToString(event, detail):
eventStrings = (
( "Added", "Updated" ),
( "Removed", ),
( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot", "API error" ),
( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ),
( "Unpaused", "Migrated", "Snapshot" ),
( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
( "Finished", ),
@@ -490,21 +490,11 @@ def myDomainEventPMWakeupCallback(conn, dom, reason, opaque):
def myDomainEventPMSuspendCallback(conn, dom, reason, opaque):
print "myDomainEventPMSuspendCallback: Domain %s(%s) system pmsuspend" % (
dom.name(), dom.ID())
def myDomainEventBalloonChangeCallback(conn, dom, actual, opaque):
def myDomainEventBalloonChangeCallback(conn, dom, utcoffset, actual):
print "myDomainEventBalloonChangeCallback: Domain %s(%s) %d" % (dom.name(), dom.ID(), actual)
def myDomainEventPMSuspendDiskCallback(conn, dom, reason, opaque):
print "myDomainEventPMSuspendDiskCallback: Domain %s(%s) system pmsuspend_disk" % (
dom.name(), dom.ID())
run = True
def myConnectionCloseCallback(conn, reason, opaque):
reasonStrings = (
"Error", "End-of-file", "Keepalive", "Client",
)
print "myConnectionCloseCallback: %s: %s" % (conn.getURI(), reasonStrings[reason])
run = False
def usage(out=sys.stderr):
print >>out, "usage: "+os.path.basename(sys.argv[0])+" [-hdl] [uri]"
print >>out, " uri will default to qemu:///system"
@@ -554,8 +544,6 @@ def main():
if (old_exitfunc): old_exitfunc()
sys.exitfunc = exit
vc.registerCloseCallback(myConnectionCloseCallback, None)
#Add 2 callbacks to prove this works with more than just one
vc.domainEventRegister(myDomainEventCallback1,None)
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_LIFECYCLE, myDomainEventCallback2, None)
@@ -577,7 +565,7 @@ def main():
# of demo we'll just go to sleep. The other option is to
# run the event loop in your main thread if your app is
# totally event based.
while run:
while vc.isAlive() == 1:
time.sleep(1)

View File

@@ -1,6 +1,5 @@
/* This file contains trivial example code to connect to the running
* hypervisor and gather a few bits of information about domains.
* Similar API's exist for storage pools, networks, and interfaces. */
* hypervisor and gather a few bits of information. */
#include <config.h>
@@ -16,7 +15,7 @@ showError(virConnectPtr conn)
virErrorPtr err;
err = malloc(sizeof(*err));
if (!err) {
if (NULL == err) {
printf("Could not allocate memory for error data\n");
goto out;
}
@@ -57,7 +56,7 @@ showHypervisorInfo(virConnectPtr conn)
* to fail if, for example, there is no connection to a
* hypervisor, so check what it returns. */
hvType = virConnectGetType(conn);
if (!hvType) {
if (NULL == hvType) {
ret = 1;
printf("Failed to get hypervisor type\n");
showError(conn);
@@ -91,16 +90,10 @@ static int
showDomains(virConnectPtr conn)
{
int ret = 0, i, numNames, numInactiveDomains, numActiveDomains;
int flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE |
VIR_CONNECT_LIST_DOMAINS_INACTIVE;
virDomainPtr *nameList = NULL;
char **nameList = NULL;
/* NB: The return from the virConnectNum*() APIs is only useful for
* the current call. A domain could be started or stopped and any
* assumptions made purely on these return values could result in
* unexpected results */
numActiveDomains = virConnectNumOfDomains(conn);
if (numActiveDomains == -1) {
if (-1 == numActiveDomains) {
ret = 1;
printf("Failed to get number of active domains\n");
showError(conn);
@@ -108,7 +101,7 @@ showDomains(virConnectPtr conn)
}
numInactiveDomains = virConnectNumOfDefinedDomains(conn);
if (numInactiveDomains == -1) {
if (-1 == numInactiveDomains) {
ret = 1;
printf("Failed to get number of inactive domains\n");
showError(conn);
@@ -118,24 +111,39 @@ showDomains(virConnectPtr conn)
printf("There are %d active and %d inactive domains\n",
numActiveDomains, numInactiveDomains);
/* Return a list of all active and inactive domains. Using this API
* instead of virConnectListDomains() and virConnectListDefinedDomains()
* is preferred since it "solves" an inherit race between separated API
* calls if domains are started or stopped between calls */
numNames = virConnectListAllDomains(conn,
&nameList,
flags);
for (i = 0; i < numNames; i++) {
int active = virDomainIsActive(nameList[i]);
printf(" %8s (%s)\n",
virDomainGetName(nameList[i]),
(active == 1 ? "active" : "non-active"));
/* must free the returned named per the API documentation */
virDomainFree(nameList[i]);
nameList = malloc(sizeof(*nameList) * numInactiveDomains);
if (NULL == nameList) {
ret = 1;
printf("Could not allocate memory for list of inactive domains\n");
goto out;
}
numNames = virConnectListDefinedDomains(conn,
nameList,
numInactiveDomains);
if (-1 == numNames) {
ret = 1;
printf("Could not get list of defined domains from hypervisor\n");
showError(conn);
goto out;
}
if (numNames > 0) {
printf("Inactive domains:\n");
}
for (i = 0 ; i < numNames ; i++) {
printf(" %s\n", *(nameList + i));
/* The API documentation doesn't say so, but the names
* returned by virConnectListDefinedDomains are strdup'd and
* must be freed here. */
free(*(nameList + i));
}
free(nameList);
out:
free(nameList);
return ret;
}
@@ -155,7 +163,7 @@ main(int argc, char *argv[])
* except, possibly, the URI of the hypervisor. */
conn = virConnectOpenAuth(uri, virConnectAuthPtrDefault, 0);
if (!conn) {
if (NULL == conn) {
ret = 1;
printf("No connection to hypervisor\n");
showError(conn);
@@ -163,7 +171,7 @@ main(int argc, char *argv[])
}
uri = virConnectGetURI(conn);
if (!uri) {
if (NULL == uri) {
ret = 1;
printf("Failed to get URI for hypervisor connection\n");
showError(conn);

View File

@@ -117,9 +117,11 @@ probe libvirt.rpc.socket_new {
remoteAddrs[pid(), sock] = remoteAddr;
}
probe libvirt.rpc.socket_dispose {
delete localAddrs[pid(), sock];
delete remoteAddrs[pid(), sock];
probe libvirt.rpc.socket_free {
if (refs == 1) {
delete localAddrs[pid(), sock];
delete remoteAddrs[pid(), sock];
}
}
@@ -129,11 +131,13 @@ probe libvirt.rpc.client_new {
print_ts(sprintf("C + %-16p local=%s remote=%s", client, localAddrs[pid(), sock], remoteAddrs[pid(), sock]));
}
probe libvirt.rpc.client_dispose {
print_ts(sprintf("C - %-16p local=%s remote=%s", client,
localAddrs[pid(), clientSocks[pid(), client]],
remoteAddrs[pid(), clientSocks[pid(), client]]));
delete clientSocks[pid(), client];
probe libvirt.rpc.client_free {
if (refs == 1) {
print_ts(sprintf("C - %-16p local=%s remote=%s", client,
localAddrs[pid(), clientSocks[pid(), client]],
remoteAddrs[pid(), clientSocks[pid(), client]]));
delete clientSocks[pid(), client];
}
}
@@ -143,11 +147,13 @@ probe libvirt.rpc.server_client_new {
print_ts(sprintf("+ S %-16p local=%s remote=%s", client, localAddrs[pid(), sock], remoteAddrs[pid(), sock]));
}
probe libvirt.rpc.server_client_dispose {
print_ts(sprintf("- S %-16p local=%s remote=%s", client,
localAddrs[pid(), serverSocks[pid(), client]],
remoteAddrs[pid(), serverSocks[pid(), client]]));
delete serverSocks[pid(), client];
probe libvirt.rpc.server_client_free {
if (refs == 1) {
print_ts(sprintf("- S %-16p local=%s remote=%s", client,
localAddrs[pid(), serverSocks[pid(), client]],
remoteAddrs[pid(), serverSocks[pid(), client]]));
delete serverSocks[pid(), client];
}
}

View File

@@ -5,7 +5,7 @@ index 209d64c..5ea72a1 100644
@@ -1,4 +1,4 @@
-# ssize_t.m4 serial 5 (gettext-0.18.2)
+# ssize_t.m4 serial 6 (gettext-0.18.2)
dnl Copyright (C) 2001-2003, 2006, 2010-2013 Free Software Foundation, Inc.
dnl Copyright (C) 2001-2003, 2006, 2010-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,21 @@ AC_DEFUN([gt_TYPE_SSIZE_T],

View File

@@ -6,7 +6,6 @@
virincdir = $(includedir)/libvirt
virinc_HEADERS = libvirt.h \
libvirt-lxc.h \
libvirt-qemu.h \
virterror.h

View File

@@ -1,54 +0,0 @@
/* -*- c -*-
* libvirt-lxc.h: Interfaces specific for LXC driver
* Summary: lxc specific interfaces
* Description: Provides the interfaces of the libvirt library to handle
* LXC specific methods
*
* Copyright (C) 2012-2013 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, see
* <http://www.gnu.org/licenses/>.
*
* Author: Daniel P. Berrange <berrange@redhat.com>
*/
#ifndef __VIR_LXC_H__
# define __VIR_LXC_H__
# include <libvirt/libvirt.h>
# ifdef __cplusplus
extern "C" {
# endif
int virDomainLxcOpenNamespace(virDomainPtr domain,
int **fdlist,
unsigned int flags);
int virDomainLxcEnterNamespace(virDomainPtr domain,
unsigned int nfdlist,
int *fdlist,
unsigned int *noldfdlist,
int **oldfdlist,
unsigned int flags);
int virDomainLxcEnterSecurityLabel(virSecurityModelPtr model,
virSecurityLabelPtr label,
virSecurityLabelPtr oldlabel,
unsigned int flags);
# ifdef __cplusplus
}
# endif
#endif /* __VIR_LXC_H__ */

View File

@@ -26,7 +26,7 @@
#ifndef __VIR_QEMU_H__
# define __VIR_QEMU_H__
# include <libvirt/libvirt.h>
# include "libvirt/libvirt.h"
# ifdef __cplusplus
extern "C" {

View File

@@ -4,7 +4,7 @@
* Description: Provides the interfaces of the libvirt library to handle
* virtualized domains
*
* Copyright (C) 2005-2006, 2010-2013 Red Hat, Inc.
* Copyright (C) 2005-2006, 2010-2012 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
@@ -116,23 +116,23 @@ typedef virDomain *virDomainPtr;
* A domain may be in different states at a given point in time
*/
typedef enum {
VIR_DOMAIN_NOSTATE = 0, /* no state */
VIR_DOMAIN_RUNNING = 1, /* the domain is running */
VIR_DOMAIN_BLOCKED = 2, /* the domain is blocked on resource */
VIR_DOMAIN_PAUSED = 3, /* the domain is paused by user */
VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */
VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */
VIR_DOMAIN_CRASHED = 6, /* the domain is crashed */
VIR_DOMAIN_PMSUSPENDED = 7, /* the domain is suspended by guest
power management */
VIR_DOMAIN_NOSTATE = 0, /* no state */
VIR_DOMAIN_RUNNING = 1, /* the domain is running */
VIR_DOMAIN_BLOCKED = 2, /* the domain is blocked on resource */
VIR_DOMAIN_PAUSED = 3, /* the domain is paused by user */
VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */
VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */
VIR_DOMAIN_CRASHED = 6, /* the domain is crashed */
VIR_DOMAIN_PMSUSPENDED = 7, /* the domain is suspended by guest
power management */
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_LAST
/*
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last state supported
* by this version of the libvirt API.
*/
VIR_DOMAIN_LAST
#endif
} virDomainState;
@@ -179,7 +179,6 @@ typedef enum {
VIR_DOMAIN_PAUSED_WATCHDOG = 6, /* paused due to a watchdog event */
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT = 7, /* paused after restoring from snapshot */
VIR_DOMAIN_PAUSED_SHUTTING_DOWN = 8, /* paused during shutdown process */
VIR_DOMAIN_PAUSED_SNAPSHOT = 9, /* paused while creating a snapshot */
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_PAUSED_LAST
@@ -351,7 +350,8 @@ typedef enum {
VIR_NODE_SUSPEND_TARGET_HYBRID = 2,
#ifdef VIR_ENUM_SENTINELS
VIR_NODE_SUSPEND_TARGET_LAST /* This constant is subject to change */
/* This constant is subject to change */
VIR_NODE_SUSPEND_TARGET_LAST
#endif
} virNodeSuspendTarget;
@@ -518,101 +518,6 @@ struct _virTypedParameter {
typedef virTypedParameter *virTypedParameterPtr;
virTypedParameterPtr
virTypedParamsGet (virTypedParameterPtr params,
int nparams,
const char *name);
int
virTypedParamsGetInt (virTypedParameterPtr params,
int nparams,
const char *name,
int *value);
int
virTypedParamsGetUInt (virTypedParameterPtr params,
int nparams,
const char *name,
unsigned int *value);
int
virTypedParamsGetLLong (virTypedParameterPtr params,
int nparams,
const char *name,
long long *value);
int
virTypedParamsGetULLong (virTypedParameterPtr params,
int nparams,
const char *name,
unsigned long long *value);
int
virTypedParamsGetDouble (virTypedParameterPtr params,
int nparams,
const char *name,
double *value);
int
virTypedParamsGetBoolean(virTypedParameterPtr params,
int nparams,
const char *name,
int *value);
int
virTypedParamsGetString (virTypedParameterPtr params,
int nparams,
const char *name,
const char **value);
int
virTypedParamsAddInt (virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
int value);
int
virTypedParamsAddUInt (virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
unsigned int value);
int
virTypedParamsAddLLong (virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
long long value);
int
virTypedParamsAddULLong (virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
unsigned long long value);
int
virTypedParamsAddDouble (virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
double value);
int
virTypedParamsAddBoolean(virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
int value);
int
virTypedParamsAddString (virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
const char *value);
int
virTypedParamsAddFromString(virTypedParameterPtr *params,
int *nparams,
int *maxparams,
const char *name,
int type,
const char *value);
void
virTypedParamsClear (virTypedParameterPtr params,
int nparams);
void
virTypedParamsFree (virTypedParameterPtr params,
int nparams);
/* data types related to virNodePtr */
/**
@@ -625,19 +530,17 @@ virTypedParamsFree (virTypedParameterPtr params,
typedef struct _virNodeInfo virNodeInfo;
struct _virNodeInfo {
char model[32]; /* string indicating the CPU model */
unsigned long memory; /* memory size in kilobytes */
unsigned int cpus; /* the number of active CPUs */
unsigned int mhz; /* expected CPU frequency */
unsigned int nodes; /* the number of NUMA cell, 1 for unusual NUMA
topologies or uniform memory access; check
capabilities XML for the actual NUMA topology */
unsigned int sockets; /* number of CPU sockets per node if nodes > 1,
1 in case of unusual NUMA topology */
unsigned int cores; /* number of cores per socket, total number of
processors in case of unusual NUMA topology*/
unsigned int threads; /* number of threads per core, 1 in case of
unusual numa topology */
char model[32]; /* string indicating the CPU model */
unsigned long memory;/* memory size in kilobytes */
unsigned int cpus; /* the number of active CPUs */
unsigned int mhz; /* expected CPU frequency */
unsigned int nodes; /* the number of NUMA cell, 1 for unusual NUMA
topologies or uniform memory access; check
capabilities XML for the actual NUMA topology */
unsigned int sockets;/* number of CPU sockets per node if nodes > 1,
total number of CPU sockets otherwise */
unsigned int cores; /* number of cores per socket */
unsigned int threads;/* number of threads per core */
};
/**
@@ -1186,8 +1089,6 @@ typedef enum {
* whole migration process; this will be used automatically
* when supported */
VIR_MIGRATE_UNSAFE = (1 << 9), /* force migration even if it is considered unsafe */
VIR_MIGRATE_OFFLINE = (1 << 10), /* offline migrate */
VIR_MIGRATE_COMPRESSED = (1 << 11), /* compress data during migration */
} virDomainMigrateFlags;
/* Domain migration. */
@@ -1215,13 +1116,6 @@ int virDomainMigrateSetMaxDowntime (virDomainPtr domain,
unsigned long long downtime,
unsigned int flags);
int virDomainMigrateGetCompressionCache(virDomainPtr domain,
unsigned long long *cacheSize,
unsigned int flags);
int virDomainMigrateSetCompressionCache(virDomainPtr domain,
unsigned long long cacheSize,
unsigned int flags);
int virDomainMigrateSetMaxSpeed(virDomainPtr domain,
unsigned long bandwidth,
unsigned int flags);
@@ -1288,7 +1182,8 @@ typedef enum {
VIR_CRED_EXTERNAL = 9, /* Externally managed credential */
#ifdef VIR_ENUM_SENTINELS
VIR_CRED_LAST /* More may be added - expect the unexpected */
/* More may be added - expect the unexpected */
VIR_CRED_LAST
#endif
} virConnectCredentialType;
@@ -1406,15 +1301,6 @@ typedef enum {
# endif
} virConnectCloseReason;
/**
* virConnectCloseFunc:
* @conn: virConnect connection
* @reason: reason why the connection was closed (one of virConnectCloseReason)
* @opaque: opaque user data
*
* A callback function to be registered, and called when the connection
* is closed.
*/
typedef void (*virConnectCloseFunc)(virConnectPtr conn,
int reason,
void *opaque);
@@ -1490,14 +1376,12 @@ virDomainPtr virDomainLookupByID (virConnectPtr conn,
virDomainPtr virDomainLookupByUUID (virConnectPtr conn,
const unsigned char *uuid);
virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn,
const char *uuid);
const char *uuid);
typedef enum {
VIR_DOMAIN_SHUTDOWN_DEFAULT = 0, /* hypervisor choice */
VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = (1 << 0), /* Send ACPI event */
VIR_DOMAIN_SHUTDOWN_GUEST_AGENT = (1 << 1), /* Use guest agent */
VIR_DOMAIN_SHUTDOWN_INITCTL = (1 << 2), /* Use initctl */
VIR_DOMAIN_SHUTDOWN_SIGNAL = (1 << 3), /* Send a signal */
} virDomainShutdownFlagValues;
int virDomainShutdown (virDomainPtr domain);
@@ -1508,8 +1392,6 @@ typedef enum {
VIR_DOMAIN_REBOOT_DEFAULT = 0, /* hypervisor choice */
VIR_DOMAIN_REBOOT_ACPI_POWER_BTN = (1 << 0), /* Send ACPI event */
VIR_DOMAIN_REBOOT_GUEST_AGENT = (1 << 1), /* Use guest agent */
VIR_DOMAIN_REBOOT_INITCTL = (1 << 2), /* Use initctl */
VIR_DOMAIN_REBOOT_SIGNAL = (1 << 3), /* Send a signal */
} virDomainRebootFlagValues;
int virDomainReboot (virDomainPtr domain,
@@ -1589,9 +1471,9 @@ int virDomainSaveImageDefineXML (virConnectPtr conn,
int virDomainManagedSave (virDomainPtr dom,
unsigned int flags);
int virDomainHasManagedSaveImage(virDomainPtr dom,
unsigned int flags);
unsigned int flags);
int virDomainManagedSaveRemove(virDomainPtr dom,
unsigned int flags);
unsigned int flags);
/*
* Domain core dump
@@ -1660,7 +1542,7 @@ int virDomainGetControlInfo (virDomainPtr domain,
* Return scheduler type in effect 'sedf', 'credit', 'linux'
*/
char * virDomainGetSchedulerType(virDomainPtr domain,
int *nparams);
int *nparams);
/* Manage blkio parameters. */
@@ -1772,7 +1654,8 @@ typedef enum {
VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE = 2,
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_NUMATUNE_MEM_LAST /* This constant is subject to change */
/* This constant is subject to change */
VIR_DOMAIN_NUMATUNE_MEM_LAST
#endif
} virDomainNumatuneMemMode;
@@ -1807,7 +1690,7 @@ unsigned int virDomainGetID (virDomainPtr domain);
int virDomainGetUUID (virDomainPtr domain,
unsigned char *uuid);
int virDomainGetUUIDString (virDomainPtr domain,
char *buf);
char *buf);
char * virDomainGetOSType (virDomainPtr domain);
unsigned long virDomainGetMaxMemory (virDomainPtr domain);
int virDomainSetMaxMemory (virDomainPtr domain,
@@ -1937,13 +1820,13 @@ int virDomainInterfaceStats (virDomainPtr dom,
#define VIR_DOMAIN_BANDWIDTH_OUT_BURST "outbound.burst"
int virDomainSetInterfaceParameters (virDomainPtr dom,
const char *device,
virTypedParameterPtr params,
int nparams, unsigned int flags);
const char *device,
virTypedParameterPtr params,
int nparams, unsigned int flags);
int virDomainGetInterfaceParameters (virDomainPtr dom,
const char *device,
virTypedParameterPtr params,
int *nparams, unsigned int flags);
const char *device,
virTypedParameterPtr params,
int *nparams, unsigned int flags);
/* Management of domain block devices */
@@ -2081,7 +1964,7 @@ int virConnectListAllDomains (virConnectPtr conn,
unsigned int flags);
int virDomainCreate (virDomainPtr domain);
int virDomainCreateWithFlags (virDomainPtr domain,
unsigned int flags);
unsigned int flags);
int virDomainGetAutostart (virDomainPtr domain,
int *autostart);
@@ -2624,7 +2507,7 @@ typedef enum {
config if it's not active */
VIR_NETWORK_UPDATE_AFFECT_LIVE = 1 << 0, /* affect live state of network only */
VIR_NETWORK_UPDATE_AFFECT_CONFIG = 1 << 1, /* affect persistent config only */
} virNetworkUpdateFlags;
} virNetworkUpdateFlags;
/*
* Update an existing network definition
@@ -2834,16 +2717,16 @@ typedef enum {
typedef enum {
VIR_STORAGE_VOL_WIPE_ALG_ZERO = 0, /* 1-pass, all zeroes */
VIR_STORAGE_VOL_WIPE_ALG_NNSA = 1, /* 4-pass NNSA Policy Letter
NAP-14.1-C (XVI-8) */
NAP-14.1-C (XVI-8) */
VIR_STORAGE_VOL_WIPE_ALG_DOD = 2, /* 4-pass DoD 5220.22-M section
8-306 procedure */
8-306 procedure */
VIR_STORAGE_VOL_WIPE_ALG_BSI = 3, /* 9-pass method recommended by the
German Center of Security in
Information Technologies */
German Center of Security in
Information Technologies */
VIR_STORAGE_VOL_WIPE_ALG_GUTMANN = 4, /* The canonical 35-pass sequence */
VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER = 5, /* 7-pass method described by
Bruce Schneier in "Applied
Cryptography" (1996) */
Bruce Schneier in "Applied
Cryptography" (1996) */
VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7 = 6, /* 7-pass random */
VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33 = 7, /* 33-pass random */
@@ -2851,12 +2734,12 @@ typedef enum {
VIR_STORAGE_VOL_WIPE_ALG_RANDOM = 8, /* 1-pass random */
#ifdef VIR_ENUM_SENTINELS
VIR_STORAGE_VOL_WIPE_ALG_LAST
/*
* NB: this enum value will increase over time as new algorithms are
* added to the libvirt API. It reflects the last algorithm supported
* by this version of the libvirt API.
*/
VIR_STORAGE_VOL_WIPE_ALG_LAST
#endif
} virStorageVolWipeAlgorithm;
@@ -3016,10 +2899,6 @@ virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn,
const char* virStorageVolGetName (virStorageVolPtr vol);
const char* virStorageVolGetKey (virStorageVolPtr vol);
typedef enum {
VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA = 1 << 0,
} virStorageVolCreateFlags;
virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool,
const char *xmldesc,
unsigned int flags);
@@ -3083,12 +2962,12 @@ typedef enum {
VIR_KEYCODE_SET_RFB = 9,
#ifdef VIR_ENUM_SENTINELS
VIR_KEYCODE_SET_LAST
/*
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last keycode set supported
* by this version of the libvirt API.
*/
VIR_KEYCODE_SET_LAST
#endif
} virKeycodeSet;
@@ -3106,99 +2985,6 @@ int virDomainSendKey(virDomainPtr domain,
int nkeycodes,
unsigned int flags);
/*
* These just happen to match Linux signal numbers. The numbers
* will be mapped to whatever the SIGNUM is in the guest OS in
* question by the agent delivering the signal. The names are
* based on the POSIX / XSI signal standard though.
*
* Do not rely on all values matching Linux though. It is possible
* this enum might be extended with new signals which have no
* mapping in Linux.
*/
typedef enum {
VIR_DOMAIN_PROCESS_SIGNAL_NOP = 0, /* No constant in POSIX/Linux */
VIR_DOMAIN_PROCESS_SIGNAL_HUP = 1, /* SIGHUP */
VIR_DOMAIN_PROCESS_SIGNAL_INT = 2, /* SIGINT */
VIR_DOMAIN_PROCESS_SIGNAL_QUIT = 3, /* SIGQUIT */
VIR_DOMAIN_PROCESS_SIGNAL_ILL = 4, /* SIGILL */
VIR_DOMAIN_PROCESS_SIGNAL_TRAP = 5, /* SIGTRAP */
VIR_DOMAIN_PROCESS_SIGNAL_ABRT = 6, /* SIGABRT */
VIR_DOMAIN_PROCESS_SIGNAL_BUS = 7, /* SIGBUS */
VIR_DOMAIN_PROCESS_SIGNAL_FPE = 8, /* SIGFPE */
VIR_DOMAIN_PROCESS_SIGNAL_KILL = 9, /* SIGKILL */
VIR_DOMAIN_PROCESS_SIGNAL_USR1 = 10, /* SIGUSR1 */
VIR_DOMAIN_PROCESS_SIGNAL_SEGV = 11, /* SIGSEGV */
VIR_DOMAIN_PROCESS_SIGNAL_USR2 = 12, /* SIGUSR2 */
VIR_DOMAIN_PROCESS_SIGNAL_PIPE = 13, /* SIGPIPE */
VIR_DOMAIN_PROCESS_SIGNAL_ALRM = 14, /* SIGALRM */
VIR_DOMAIN_PROCESS_SIGNAL_TERM = 15, /* SIGTERM */
VIR_DOMAIN_PROCESS_SIGNAL_STKFLT = 16, /* Not in POSIX (SIGSTKFLT on Linux )*/
VIR_DOMAIN_PROCESS_SIGNAL_CHLD = 17, /* SIGCHLD */
VIR_DOMAIN_PROCESS_SIGNAL_CONT = 18, /* SIGCONT */
VIR_DOMAIN_PROCESS_SIGNAL_STOP = 19, /* SIGSTOP */
VIR_DOMAIN_PROCESS_SIGNAL_TSTP = 20, /* SIGTSTP */
VIR_DOMAIN_PROCESS_SIGNAL_TTIN = 21, /* SIGTTIN */
VIR_DOMAIN_PROCESS_SIGNAL_TTOU = 22, /* SIGTTOU */
VIR_DOMAIN_PROCESS_SIGNAL_URG = 23, /* SIGURG */
VIR_DOMAIN_PROCESS_SIGNAL_XCPU = 24, /* SIGXCPU */
VIR_DOMAIN_PROCESS_SIGNAL_XFSZ = 25, /* SIGXFSZ */
VIR_DOMAIN_PROCESS_SIGNAL_VTALRM = 26, /* SIGVTALRM */
VIR_DOMAIN_PROCESS_SIGNAL_PROF = 27, /* SIGPROF */
VIR_DOMAIN_PROCESS_SIGNAL_WINCH = 28, /* Not in POSIX (SIGWINCH on Linux) */
VIR_DOMAIN_PROCESS_SIGNAL_POLL = 29, /* SIGPOLL (also known as SIGIO on Linux) */
VIR_DOMAIN_PROCESS_SIGNAL_PWR = 30, /* Not in POSIX (SIGPWR on Linux) */
VIR_DOMAIN_PROCESS_SIGNAL_SYS = 31, /* SIGSYS (also known as SIGUNUSED on Linux) */
VIR_DOMAIN_PROCESS_SIGNAL_RT0 = 32, /* SIGRTMIN */
VIR_DOMAIN_PROCESS_SIGNAL_RT1 = 33, /* SIGRTMIN + 1 */
VIR_DOMAIN_PROCESS_SIGNAL_RT2 = 34, /* SIGRTMIN + 2 */
VIR_DOMAIN_PROCESS_SIGNAL_RT3 = 35, /* SIGRTMIN + 3 */
VIR_DOMAIN_PROCESS_SIGNAL_RT4 = 36, /* SIGRTMIN + 4 */
VIR_DOMAIN_PROCESS_SIGNAL_RT5 = 37, /* SIGRTMIN + 5 */
VIR_DOMAIN_PROCESS_SIGNAL_RT6 = 38, /* SIGRTMIN + 6 */
VIR_DOMAIN_PROCESS_SIGNAL_RT7 = 39, /* SIGRTMIN + 7 */
VIR_DOMAIN_PROCESS_SIGNAL_RT8 = 40, /* SIGRTMIN + 8 */
VIR_DOMAIN_PROCESS_SIGNAL_RT9 = 41, /* SIGRTMIN + 9 */
VIR_DOMAIN_PROCESS_SIGNAL_RT10 = 42, /* SIGRTMIN + 10 */
VIR_DOMAIN_PROCESS_SIGNAL_RT11 = 43, /* SIGRTMIN + 11 */
VIR_DOMAIN_PROCESS_SIGNAL_RT12 = 44, /* SIGRTMIN + 12 */
VIR_DOMAIN_PROCESS_SIGNAL_RT13 = 45, /* SIGRTMIN + 13 */
VIR_DOMAIN_PROCESS_SIGNAL_RT14 = 46, /* SIGRTMIN + 14 */
VIR_DOMAIN_PROCESS_SIGNAL_RT15 = 47, /* SIGRTMIN + 15 */
VIR_DOMAIN_PROCESS_SIGNAL_RT16 = 48, /* SIGRTMIN + 16 */
VIR_DOMAIN_PROCESS_SIGNAL_RT17 = 49, /* SIGRTMIN + 17 */
VIR_DOMAIN_PROCESS_SIGNAL_RT18 = 50, /* SIGRTMIN + 18 */
VIR_DOMAIN_PROCESS_SIGNAL_RT19 = 51, /* SIGRTMIN + 19 */
VIR_DOMAIN_PROCESS_SIGNAL_RT20 = 52, /* SIGRTMIN + 20 */
VIR_DOMAIN_PROCESS_SIGNAL_RT21 = 53, /* SIGRTMIN + 21 */
VIR_DOMAIN_PROCESS_SIGNAL_RT22 = 54, /* SIGRTMIN + 22 */
VIR_DOMAIN_PROCESS_SIGNAL_RT23 = 55, /* SIGRTMIN + 23 */
VIR_DOMAIN_PROCESS_SIGNAL_RT24 = 56, /* SIGRTMIN + 24 */
VIR_DOMAIN_PROCESS_SIGNAL_RT25 = 57, /* SIGRTMIN + 25 */
VIR_DOMAIN_PROCESS_SIGNAL_RT26 = 58, /* SIGRTMIN + 26 */
VIR_DOMAIN_PROCESS_SIGNAL_RT27 = 59, /* SIGRTMIN + 27 */
VIR_DOMAIN_PROCESS_SIGNAL_RT28 = 60, /* SIGRTMIN + 28 */
VIR_DOMAIN_PROCESS_SIGNAL_RT29 = 61, /* SIGRTMIN + 29 */
VIR_DOMAIN_PROCESS_SIGNAL_RT30 = 62, /* SIGRTMIN + 30 */
VIR_DOMAIN_PROCESS_SIGNAL_RT31 = 63, /* SIGRTMIN + 31 */
VIR_DOMAIN_PROCESS_SIGNAL_RT32 = 64, /* SIGRTMIN + 32 / SIGRTMAX */
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_PROCESS_SIGNAL_LAST
#endif
} virDomainProcessSignal;
int virDomainSendProcessSignal(virDomainPtr domain,
long long pid_value,
unsigned int signum,
unsigned int flags);
/*
* Deprecated calls
*/
@@ -3222,9 +3008,10 @@ typedef struct _virNodeDevice virNodeDevice;
* virNodeDevicePtr:
*
* A virNodeDevicePtr is a pointer to a virNodeDevice structure. Get
* one via virNodeDeviceLookupByName, or virNodeDeviceCreate. Be sure
* to call virNodeDeviceFree when done using a virNodeDevicePtr obtained
* from any of the above functions to avoid leaking memory.
* one via virNodeDeviceLookupByKey, virNodeDeviceLookupByName, or
* virNodeDeviceCreate. Be sure to Call virNodeDeviceFree when done
* using a virNodeDevicePtr obtained from any of the above functions to
* avoid leaking memory.
*/
typedef virNodeDevice *virNodeDevicePtr;
@@ -3247,17 +3034,15 @@ int virNodeListDevices (virConnectPtr conn,
* type.
*/
typedef enum {
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = 1 << 0, /* System capability */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = 1 << 1, /* PCI device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = 1 << 2, /* USB device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = 1 << 3, /* USB interface */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET = 1 << 4, /* Network device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = 1 << 5, /* SCSI Host Bus Adapter */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = 1 << 6, /* SCSI Target */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI = 1 << 7, /* SCSI device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = 1 << 8, /* Storage device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST = 1 << 9, /* FC Host Bus Adapter */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = 1 << 10, /* Capable of vport */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = 1 << 0, /* System capability */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = 1 << 1, /* PCI device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = 1 << 2, /* USB device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = 1 << 3, /* USB interface */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET = 1 << 4, /* Network device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = 1 << 5, /* SCSI Host Bus Adapter */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = 1 << 6, /* SCSI Target */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI = 1 << 7, /* SCSI device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = 1 << 8, /* Storage device */
} virConnectListAllNodeDeviceFlags;
int virConnectListAllNodeDevices (virConnectPtr conn,
@@ -3267,11 +3052,6 @@ int virConnectListAllNodeDevices (virConnectPtr conn,
virNodeDevicePtr virNodeDeviceLookupByName (virConnectPtr conn,
const char *name);
virNodeDevicePtr virNodeDeviceLookupSCSIHostByWWN (virConnectPtr conn,
const char *wwnn,
const char *wwpn,
unsigned int flags);
const char * virNodeDeviceGetName (virNodeDevicePtr dev);
const char * virNodeDeviceGetParent (virNodeDevicePtr dev);
@@ -3289,9 +3069,6 @@ int virNodeDeviceRef (virNodeDevicePtr dev);
int virNodeDeviceFree (virNodeDevicePtr dev);
int virNodeDeviceDettach (virNodeDevicePtr dev);
int virNodeDeviceDetachFlags(virNodeDevicePtr dev,
const char *driverName,
unsigned int flags);
int virNodeDeviceReAttach (virNodeDevicePtr dev);
int virNodeDeviceReset (virNodeDevicePtr dev);
@@ -3381,7 +3158,6 @@ typedef enum {
VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG = 3, /* Suspended due to a watchdog firing */
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED = 4, /* Restored from paused state file */
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT = 5, /* Restored from paused snapshot */
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR = 6, /* suspended after failure during libvirt API call */
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_SUSPENDED_LAST
@@ -3459,8 +3235,6 @@ typedef enum {
* @opaque: opaque user data
*
* A callback function to be registered, and called when a domain event occurs
*
* Returns 0 (the return value is currently ignored)
*/
typedef int (*virConnectDomainEventCallback)(virConnectPtr conn,
virDomainPtr dom,
@@ -3553,8 +3327,6 @@ typedef void (*virEventUpdateHandleFunc)(int watch, int event);
* If a virEventHandleFreeFunc was supplied when the handle was
* registered, it will be invoked some time during, or after this
* function call, when it is safe to release the user data.
*
* Returns -1 if the file handle was not registered, 0 upon success
*/
typedef int (*virEventRemoveHandleFunc)(int watch);
@@ -3654,15 +3426,14 @@ typedef enum {
VIR_SECRET_USAGE_TYPE_NONE = 0,
VIR_SECRET_USAGE_TYPE_VOLUME = 1,
VIR_SECRET_USAGE_TYPE_CEPH = 2,
VIR_SECRET_USAGE_TYPE_ISCSI = 3,
#ifdef VIR_ENUM_SENTINELS
VIR_SECRET_USAGE_TYPE_LAST
/*
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last secret owner ID
* supported by this version of the libvirt API.
*/
VIR_SECRET_USAGE_TYPE_LAST
#endif
} virSecretUsageType;
@@ -3680,12 +3451,12 @@ int virConnectListSecrets (virConnectPtr conn,
*/
typedef enum {
VIR_CONNECT_LIST_SECRETS_EPHEMERAL = 1 << 0, /* kept in memory, never
stored persistently */
stored persistently */
VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL = 1 << 1,
VIR_CONNECT_LIST_SECRETS_PRIVATE = 1 << 2, /* not revealed to any caller
of libvirt, nor to any other
node */
of libvirt, nor to any other
node */
VIR_CONNECT_LIST_SECRETS_NO_PRIVATE = 1 << 3,
} virConnectListAllSecretsFlags;
@@ -3958,213 +3729,8 @@ struct _virDomainJobInfo {
int virDomainGetJobInfo(virDomainPtr dom,
virDomainJobInfoPtr info);
int virDomainGetJobStats(virDomainPtr domain,
int *type,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags);
int virDomainAbortJob(virDomainPtr dom);
/**
* VIR_DOMAIN_JOB_TIME_ELAPSED:
*
* virDomainGetJobStats field: time (ms) since the beginning of the
* job, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to timeElapsed field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_TIME_ELAPSED "time_elapsed"
/**
* VIR_DOMAIN_JOB_TIME_REMAINING:
*
* virDomainGetJobStats field: remaining time (ms) for VIR_DOMAIN_JOB_BOUNDED
* jobs, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to timeRemaining field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_TIME_REMAINING "time_remaining"
/**
* VIR_DOMAIN_JOB_DOWNTIME:
*
* virDomainGetJobStats field: downtime (ms) that is expected to happen
* during migration, as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_DOWNTIME "downtime"
/**
* VIR_DOMAIN_JOB_DATA_TOTAL:
*
* virDomainGetJobStats field: total number of bytes supposed to be
* transferred, as VIR_TYPED_PARAM_ULLONG. For VIR_DOMAIN_JOB_UNBOUNDED
* jobs, this may be less than the sum of VIR_DOMAIN_JOB_DATA_PROCESSED and
* VIR_DOMAIN_JOB_DATA_REMAINING in the event that the hypervisor has to
* repeat some data, e.g., due to dirtied pages during migration. For
* VIR_DOMAIN_JOB_BOUNDED jobs, VIR_DOMAIN_JOB_DATA_TOTAL shall always equal
* VIR_DOMAIN_JOB_DATA_PROCESSED + VIR_DOMAIN_JOB_DATA_REMAINING.
*
* This field corresponds to dataTotal field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_DATA_TOTAL "data_total"
/**
* VIR_DOMAIN_JOB_DATA_PROCESSED:
*
* virDomainGetJobStats field: number of bytes transferred from the
* beginning of the job, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to dataProcessed field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_DATA_PROCESSED "data_processed"
/**
* VIR_DOMAIN_JOB_DATA_REMAINING:
*
* virDomainGetJobStats field: number of bytes that still need to be
* transferred, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to dataRemaining field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_DATA_REMAINING "data_remaining"
/**
* VIR_DOMAIN_JOB_MEMORY_TOTAL:
*
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only
* tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to memTotal field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_MEMORY_TOTAL "memory_total"
/**
* VIR_DOMAIN_JOB_MEMORY_PROCESSED:
*
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_PROCESSED but only
* tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to memProcessed field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_MEMORY_PROCESSED "memory_processed"
/**
* VIR_DOMAIN_JOB_MEMORY_REMAINING:
*
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_REMAINING but only
* tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to memRemaining field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_MEMORY_REMAINING "memory_remaining"
/**
* VIR_DOMAIN_JOB_MEMORY_CONSTANT:
*
* virDomainGetJobStats field: number of pages filled with a constant
* byte (all bytes in a single page are identical) transferred since the
* beginning of the migration job, as VIR_TYPED_PARAM_ULLONG.
*
* The most common example of such pages are zero pages, i.e., pages filled
* with zero bytes.
*/
#define VIR_DOMAIN_JOB_MEMORY_CONSTANT "memory_constant"
/**
* VIR_DOMAIN_JOB_MEMORY_NORMAL:
*
* virDomainGetJobStats field: number of pages that were transferred without
* any kind of compression (i.e., pages which were not filled with a constant
* byte and which could not be compressed) transferred since the beginning
* of the migration job, as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_MEMORY_NORMAL "memory_normal"
/**
* VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES:
*
* virDomainGetJobStats field: number of bytes transferred as normal pages,
* as VIR_TYPED_PARAM_ULLONG.
*
* See VIR_DOMAIN_JOB_MEMORY_NORMAL for more details.
*/
#define VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES "memory_normal_bytes"
/**
* VIR_DOMAIN_JOB_DISK_TOTAL:
*
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only
* tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to fileTotal field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_DISK_TOTAL "disk_total"
/**
* VIR_DOMAIN_JOB_DISK_PROCESSED:
*
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_PROCESSED but only
* tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to fileProcessed field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_DISK_PROCESSED "disk_processed"
/**
* VIR_DOMAIN_JOB_DISK_REMAINING:
*
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_REMAINING but only
* tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG.
*
* This field corresponds to fileRemaining field in virDomainJobInfo.
*/
#define VIR_DOMAIN_JOB_DISK_REMAINING "disk_remaining"
/**
* VIR_DOMAIN_JOB_COMPRESSION_CACHE:
*
* virDomainGetJobStats field: size of the cache (in bytes) used for
* compressing repeatedly transferred memory pages during live migration,
* as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_COMPRESSION_CACHE "compression_cache"
/**
* VIR_DOMAIN_JOB_COMPRESSION_BYTES:
*
* virDomainGetJobStats field: number of compressed bytes transferred
* since the beginning of migration, as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_COMPRESSION_BYTES "compression_bytes"
/**
* VIR_DOMAIN_JOB_COMPRESSION_PAGES:
*
* virDomainGetJobStats field: number of compressed pages transferred
* since the beginning of migration, as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_COMPRESSION_PAGES "compression_pages"
/**
* VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES:
*
* virDomainGetJobStats field: number of repeatedly changing pages that
* were not found in compression cache and thus could not be compressed,
* as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES "compression_cache_misses"
/**
* VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW:
*
* virDomainGetJobStats field: number of repeatedly changing pages that
* were found in compression cache but were sent uncompressed because
* the result of compression was larger than the original page as a whole,
* as VIR_TYPED_PARAM_ULLONG.
*/
#define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "compression_overflow"
/**
* virDomainSnapshot:
*
@@ -4204,9 +3770,6 @@ typedef enum {
the domain */
VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC = (1 << 7), /* atomically avoid
partial changes */
VIR_DOMAIN_SNAPSHOT_CREATE_LIVE = (1 << 8), /* create the snapshot
while the guest is
running */
} virDomainSnapshotCreateFlags;
/* Take a snapshot of the current VM state */
@@ -4248,25 +3811,6 @@ typedef enum {
which have metadata */
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA = (1 << 4), /* Filter by snapshots
with no metadata */
VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE = (1 << 5), /* Filter by snapshots
taken while guest was
shut off */
VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE = (1 << 6), /* Filter by snapshots
taken while guest was
active, and with
memory state */
VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY = (1 << 7), /* Filter by snapshots
taken while guest was
active, but without
memory state */
VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL = (1 << 8), /* Filter by snapshots
stored internal to
disk images */
VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL = (1 << 9), /* Filter by snapshots
that use files external
to disk images */
} virDomainSnapshotListFlags;
/* Return the number of snapshots for this domain */
@@ -4587,10 +4131,9 @@ typedef enum {
* virConnectDomainEventBlockJobCallback:
* @conn: connection object
* @dom: domain on which the event occurred
* @disk: fully-qualified filename of the affected disk
* @path: fully-qualified filename of the affected disk
* @type: type of block job (virDomainBlockJobType)
* @status: final status of the operation (virConnectDomainEventBlockJobStatus)
* @opaque: application specified data
*
* The callback signature to use when registering for an event of type
* VIR_DOMAIN_EVENT_ID_BLOCK_JOB with virConnectDomainEventRegisterAny()
@@ -4635,12 +4178,12 @@ typedef enum {
* VIR_DOMAIN_EVENT_ID_DISK_CHANGE with virConnectDomainEventRegisterAny()
*/
typedef void (*virConnectDomainEventDiskChangeCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *oldSrcPath,
const char *newSrcPath,
const char *devAlias,
int reason,
void *opaque);
virDomainPtr dom,
const char *oldSrcPath,
const char *newSrcPath,
const char *devAlias,
int reason,
void *opaque);
/**
* virConnectDomainEventTrayChangeReason:
@@ -4704,7 +4247,7 @@ typedef void (*virConnectDomainEventPMWakeupCallback)(virConnectPtr conn,
* This callback occurs when the guest is waken up.
*
* The callback signature to use when registering for an event of type
* VIR_DOMAIN_EVENT_ID_PMSUSPEND with virConnectDomainEventRegisterAny()
* VIR_DOMAIN_EVENT_ID_PMSuspend with virConnectDomainEventRegisterAny()
*/
typedef void (*virConnectDomainEventPMSuspendCallback)(virConnectPtr conn,
virDomainPtr dom,
@@ -4773,12 +4316,12 @@ typedef enum {
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK = 14, /* virConnectDomainEventPMSuspendDiskCallback */
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_ID_LAST
/*
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last event ID supported
* by this version of the libvirt API.
*/
VIR_DOMAIN_EVENT_ID_LAST
#endif
} virDomainEventID;
@@ -4877,22 +4420,6 @@ int virDomainOpenConsole(virDomainPtr dom,
virStreamPtr st,
unsigned int flags);
/**
* virDomainChannelFlags
*
* Since 1.0.2
*/
typedef enum {
VIR_DOMAIN_CHANNEL_FORCE = (1 << 0), /* abort a (possibly) active channel
connection to force a new
connection */
} virDomainChannelFlags;
int virDomainOpenChannel(virDomainPtr dom,
const char *name,
virStreamPtr st,
unsigned int flags);
typedef enum {
VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH = (1 << 0),
} virDomainOpenGraphicsFlags;
@@ -4904,10 +4431,6 @@ int virDomainOpenGraphics(virDomainPtr dom,
int virDomainInjectNMI(virDomainPtr domain, unsigned int flags);
int virDomainFSTrim(virDomainPtr dom,
const char *mountPoint,
unsigned long long minimum,
unsigned int flags);
/**
* virSchedParameterType:

View File

@@ -114,9 +114,6 @@ typedef enum {
VIR_FROM_SSH = 50, /* Error from libssh2 connection transport */
VIR_FROM_LOCKSPACE = 51, /* Error from lockspace */
VIR_FROM_INITCTL = 52, /* Error from initctl device communication */
VIR_FROM_IDENTITY = 53, /* Error from identity code */
VIR_FROM_CGROUP = 54, /* Error from cgroups */
# ifdef VIR_ENUM_SENTINELS
VIR_ERR_DOMAIN_LAST
@@ -313,8 +310,6 @@ void virResetLastError (void);
void virResetError (virErrorPtr err);
void virFreeError (virErrorPtr err);
const char * virGetLastErrorMessage (void);
virErrorPtr virConnGetLastError (virConnectPtr conn);
void virConnResetLastError (virConnectPtr conn);
int virCopyLastError (virErrorPtr to);

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +0,0 @@
dnl The libapparmor.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[
LIBVIRT_CHECK_LIB([APPARMOR], [apparmor],
[aa_change_profile], [sys/apparmor.h])
AC_ARG_WITH([apparmor_mount],
AC_HELP_STRING([--with-apparmor-mount],
[set AppArmor mount point @<:@default=check@:>@]),
[],
[with_apparmor_mount=check])
if test "$with_apparmor" = "yes"; then
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
])
AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[
LIBVIRT_RESULT_LIB([APPARMOR])
])

View File

@@ -1,9 +0,0 @@
dnl The libattr.so library
AC_DEFUN([LIBVIRT_CHECK_ATTR],[
LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [attr/xattr.h])
])
AC_DEFUN([LIBVIRT_RESULT_ATTR],[
LIBVIRT_RESULT_LIB([ATTR])
])

View File

@@ -1,27 +0,0 @@
dnl The libaudit.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_AUDIT],[
LIBVIRT_CHECK_LIB([AUDIT], [audit],
[audit_encode_nv_string], [libaudit.h])
])
AC_DEFUN([LIBVIRT_RESULT_AUDIT],[
LIBVIRT_RESULT_LIB([AUDIT])
])

View File

@@ -1,26 +0,0 @@
dnl The libavahi.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_AVAHI],[
LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0])
])
AC_DEFUN([LIBVIRT_RESULT_AVAHI],[
LIBVIRT_RESULT_LIB([AVAHI])
])

View File

@@ -1,26 +0,0 @@
dnl The libblkid.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_BLKID],[
LIBVIRT_CHECK_PKG([BLKID], [blkid], [2.17])
])
AC_DEFUN([LIBVIRT_RESULT_BLKID],[
LIBVIRT_RESULT_LIB([BLKID])
])

View File

@@ -1,26 +0,0 @@
dnl The libcapng.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_CAPNG],[
LIBVIRT_CHECK_LIB([CAPNG], [cap-ng], [capng_updatev], [cap-ng.h])
])
AC_DEFUN([LIBVIRT_RESULT_CAPNG],[
LIBVIRT_RESULT_LIB([CAPNG])
])

View File

@@ -1,35 +0,0 @@
dnl
dnl Check for support for position independent executables
dnl
dnl Copyright (C) 2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_COMPILE_PIE],[
PIE_CFLAGS=
PIE_LDFLAGS=
case "$host" in
*-*-mingw* | *-*-msvc* | *-*-cygwin* )
;; dnl All code is position independent on Win32 target
*)
gl_COMPILER_OPTION_IF([-fPIE -DPIE], [
PIE_CFLAGS="-fPIE -DPIE"
PIE_LDFLAGS="-pie"
])
esac
AC_SUBST([PIE_CFLAGS])
AC_SUBST([PIE_LDFLAGS])
])

View File

@@ -93,25 +93,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
if test $lv_cv_gcc_pragma_push_works = no; then
dontwarn="$dontwarn -Wmissing-prototypes"
dontwarn="$dontwarn -Wmissing-declarations"
dontwarn="$dontwarn -Wcast-align"
fi
dnl Check whether strchr(s, char variable) causes a bogus compile
dnl warning, which is the case with GCC < 4.6 on some glibc
AC_CACHE_CHECK([whether GCC -Wlogical-op gives bogus warnings],
[lv_cv_gcc_wlogical_op_broken], [
save_CFLAGS="$CFLAGS"
CFLAGS="-O2 -Wlogical-op -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]], [[
const char *haystack;
char needle;
return strchr(haystack, needle) == haystack;]])],
[lv_cv_gcc_wlogical_op_broken=no],
[lv_cv_gcc_wlogical_op_broken=yes])
CFLAGS="$save_CFLAGS"])
# We might fundamentally need some of these disabled forever, but
# ideally we'd turn many of them on
dontwarn="$dontwarn -Wfloat-equal"
@@ -213,10 +196,4 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
WARN_PYTHON_CFLAGS=$WARN_CFLAGS
AC_SUBST(WARN_PYTHON_CFLAGS)
WARN_CFLAGS=$save_WARN_CFLAGS
if test "$gl_cv_warn_c__Wlogical_op" = yes &&
test "$lv_cv_gcc_wlogical_op_broken" = yes; then
AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP], 1,
[Define to 1 if gcc -Wlogical-op reports false positives on strchr])
fi
])

View File

@@ -1,34 +0,0 @@
dnl The libcurl.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_CURL],[
LIBVIRT_CHECK_PKG([CURL], [libcurl], [7.18.0])
# XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version
# of <curl/curl.h> that #defines several wrapper macros around underlying
# functions to add type safety for gcc only. However, these macros
# spuriously trip gcc's -Wlogical-op warning. Avoid the warning by
# disabling the wrappers; even if it removes some type-check safety.
CURL_CFLAGS="-DCURL_DISABLE_TYPECHECK $CURL_CFLAGS"
AC_SUBST(CURL_CFLAGS)
])
AC_DEFUN([LIBVIRT_RESULT_CURL],[
LIBVIRT_RESULT_LIB([CURL])
])

View File

@@ -1,36 +0,0 @@
dnl The libdbus.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_DBUS],[
LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0])
if test "$with_dbus" = "yes" ; then
old_CFLAGS="$CFLAGS"
old_LIBS="$LIBS"
CFLAGS="$CFLAGS $DBUS_CFLAGS"
LIBS="$LIBS $DBUS_LIBS"
AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
CFLAGS="$old_CFLAGS"
LIBS="$old_LIBS"
fi
])
AC_DEFUN([LIBVIRT_RESULT_DBUS],[
LIBVIRT_RESULT_LIB([DBUS])
])

View File

@@ -1,26 +0,0 @@
dnl The libfuse.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_FUSE],[
LIBVIRT_CHECK_PKG([FUSE], [fuse], [2.8.6])
])
AC_DEFUN([LIBVIRT_RESULT_FUSE],[
LIBVIRT_RESULT_LIB([FUSE])
])

View File

@@ -1,26 +0,0 @@
dnl The libhal.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_HAL],[
LIBVIRT_CHECK_PKG([HAL], [hal], [0.5.0])
])
AC_DEFUN([LIBVIRT_RESULT_HAL],[
LIBVIRT_RESULT_LIB([HAL])
])

View File

@@ -1,391 +0,0 @@
dnl
dnl virt-lib.m4: Helper macros for checking for libraries
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
dnl Probe for existence of libXXXX and set WITH_XXX
dnl config header var, WITH_XXXX make conditional and
dnl with_XXX configure shell var.
dnl
dnl LIBVIRT_CHECK_LIB([CHECK_NAME], [LIBRARY_NAME],
dnl [FUNCTION_NAME], [HEADER_NAME])
dnl
dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
dnl Used to set
dnl config.h: WITH_XXX macro
dnl Makefile: WITH_XXX conditional
dnl Makefile: XXX_CFLAGS, XXX_LIBS variables
dnl configure: --with-xxx argument
dnl configure: with_xxx variable
dnl
dnl LIBRARY_NAME: base name of library to check for eg libXXX.so
dnl FUNCTION_NAME: function to check for in libXXX.so
dnl HEADER_NAME: header file to check for
dnl
dnl e.g.
dnl
dnl LIBVIRT_CHECK_LIB([SELINUX], [selinux],
dnl [getfilecon], [selinux/selinux.h])
dnl LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client],
dnl [sanlock_init], [sanlock.h])
dnl LIBVIRT_CHECK_LIB([LIBATTR], [attr],
dnl [getxattr], [attr/attr.h])
dnl
AC_DEFUN([LIBVIRT_CHECK_LIB],[
m4_pushdef([check_name], [$1])
m4_pushdef([library_name], [$2])
m4_pushdef([function_name], [$3])
m4_pushdef([header_name], [$4])
m4_pushdef([check_name_lc], m4_tolower(check_name))
m4_pushdef([config_var], [WITH_]check_name)
m4_pushdef([make_var], [WITH_]check_name)
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
m4_pushdef([arg_var], [with-]check_name_lc)
m4_pushdef([with_var], [with_]check_name_lc)
AC_ARG_WITH(check_name_lc,
[AS_HELP_STRING([--arg_var],
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])],
[],[with_var][=check])
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
cflags_var=
libs_var=
fail=0
if test "x$with_var" != "xno" ; then
if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then
cflags_var="-I$with_var/include"
libs_var="-L$with_var/lib"
fi
CFLAGS="$CFLAGS $cflags_var"
LIBS="$LIBS $libs_var"
AC_CHECK_LIB(library_name, function_name, [],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
with_var=no
])
if test "$fail" = "0" && test "x$with_var" != "xno" ; then
AC_CHECK_HEADER([header_name], [
with_var=yes
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
with_var=no
])
fi
fi
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
if test $fail = 1; then
AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])
else
if test "x$with_var" = "xyes" ; then
if test "x$libs_var" = 'x' ; then
libs_var="-l[]library_name"
else
libs_var="$libs_var -l[]library_name"
fi
AC_DEFINE_UNQUOTED(config_var, 1, [whether lib]library_name[ is available])
fi
AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"])
AC_SUBST(cflags_var)
AC_SUBST(libs_var)
fi
m4_popdef([with_var])
m4_popdef([arg_var])
m4_popdef([libs_var])
m4_popdef([cflags_var])
m4_popdef([make_var])
m4_popdef([config_var])
m4_popdef([check_name_lc])
m4_popdef([header_name])
m4_popdef([function_name])
m4_popdef([library_name])
m4_popdef([check_name])
])
dnl Probe for existence of libXXXX and set WITH_XXX
dnl config header var, WITH_XXXX make conditional and
dnl with_XXX configure shell var.
dnl
dnl LIBVIRT_CHECK_LIB_ALT([CHECK_NAME], [LIBRARY_NAME],
dnl [FUNCTION_NAME], [HEADER_NAME],
dnl [CHECK_NAME_ALT, [LIBRARY_NAME_ALT],
dnl [FUNCTION_NAME_ALT], [HEADER_NAME_ALT])
dnl
dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
dnl Used to set
dnl config.h: WITH_XXX macro
dnl Makefile: WITH_XXX conditional
dnl Makefile: XXX_CFLAGS, XXX_LIBS variables
dnl configure: --with-xxx argument
dnl configure: with_xxx variable
dnl
dnl LIBRARY_NAME: base name of library to check for eg libXXX.so
dnl FUNCTION_NAME: function to check for in libXXX.so
dnl HEADER_NAME: header file to check for
dnl
dnl CHECK_NAME_ALT: Suffix/prefix used to set additional
dnl variables if alternative check succeeds
dnl config.h: WITH_XXX macro
dnl Makefile: WITH_XXX conditional
dnl NB all vars for CHECK_NAME are also set
dnl LIBRARY_NAME_ALT: alternative library name to check for
dnl FUNCTION_NAME_ALT: alternative function name to check for
dnl HEADER_NAME_ALT: alternative header file to check for
dnl
dnl e.g.
dnl
dnl LIBVIRT_CHECK_LIB([YAJL], [yajl],
dnl [yajl_parse_complete], [yajl/yajl_common.h],
dnl [YAJL2], [yajl],
dnl [yajl_tree_parse], [yajl/yajl_common.h])
dnl
AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[
m4_pushdef([check_name], [$1])
m4_pushdef([library_name], [$2])
m4_pushdef([function_name], [$3])
m4_pushdef([header_name], [$4])
m4_pushdef([check_name_alt], [$5])
m4_pushdef([library_name_alt], [$6])
m4_pushdef([function_name_alt], [$7])
m4_pushdef([header_name_alt], [$8])
m4_pushdef([check_name_lc], m4_tolower(check_name))
m4_pushdef([config_var], [WITH_]check_name)
m4_pushdef([make_var], [WITH_]check_name)
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
m4_pushdef([arg_var], [with-]check_name_lc)
m4_pushdef([with_var], [with_]check_name_lc)
m4_pushdef([config_var_alt], [WITH_]check_name_alt)
m4_pushdef([make_var_alt], [WITH_]check_name_alt)
AC_ARG_WITH(check_name_lc,
[AS_HELP_STRING([--arg_var],
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])],
[],[with_var][=check])
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
cflags_var=
libs_var=
fail=0
alt=0
if test "x$with_var" != "xno" ; then
if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then
cflags_var="-I$with_var/include"
libs_var="-L$with_var/lib"
fi
CFLAGS="$CFLAGS $cflags_var"
LIBS="$LIBS $libs_var"
AC_CHECK_LIB(library_name, function_name, [],[
AC_CHECK_LIB(library_name_alt, function_name_alt, [
alt=1
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
with_var=no
])
])
if test "$fail" = "0" && test "x$with_var" != "xno" ; then
AC_CHECK_HEADER([header_name], [
with_var=yes
],[
AC_CHECK_HEADER([header_name_alt], [
with_var=yes
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
with_var=no
])
])
fi
fi
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
if test $fail = 1; then
AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])
else
if test "x$with_var" = "xyes" ; then
if test "x$libs_var" = 'x' ; then
libs_var="-l[]library_name"
else
libs_var="$libs_var -l[]library_name"
fi
AC_DEFINE_UNQUOTED(config_var, 1, [whether lib]library_name[ is available])
if test "$alt" = "1" ; then
AC_DEFINE_UNQUOTED(config_var_alt, 1, [whether lib]library_name[ is available])
fi
fi
AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"])
AM_CONDITIONAL(make_var_alt, [test "x$with_var" = "xyes" && test "$alt" = "1"])
AC_SUBST(cflags_var)
AC_SUBST(libs_var)
fi
m4_popdef([make_var_alt])
m4_popdef([config_var_alt])
m4_popdef([with_var])
m4_popdef([arg_var])
m4_popdef([libs_var])
m4_popdef([cflags_var])
m4_popdef([make_var])
m4_popdef([config_var])
m4_popdef([check_name_lc])
m4_popdef([header_name_alt])
m4_popdef([function_name_alt])
m4_popdef([library_name_alt])
m4_popdef([header_name])
m4_popdef([function_name])
m4_popdef([library_name])
m4_popdef([check_name])
])
dnl
dnl Probe for existence of libXXXX and set WITH_XXX
dnl config header var, WITH_XXXX make conditional and
dnl with_XXX configure shell var.
dnl
dnl LIBVIRT_CHECK_PKG([CHECK_NAME], [PC_NAME], [PC_VERSION])
dnl
dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
dnl Used to set
dnl config.h: WITH_XXX macro
dnl Makefile: WITH_XXX conditional
dnl Makefile: XXX_CFLAGS, XXX_LIBS variables
dnl configure: --with-xxx argument
dnl configure: with_xxx variable
dnl PC_NAME: Name of the pkg-config module
dnl PC_VERSION: Version of the pkg-config module
dnl
dnl eg
dnl
dnl LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4])
dnl
AC_DEFUN([LIBVIRT_CHECK_PKG],[
m4_pushdef([check_name], [$1])
m4_pushdef([pc_name], [$2])
m4_pushdef([pc_version], [$3])
m4_pushdef([check_name_lc], m4_tolower(check_name))
m4_pushdef([config_var], [WITH_]check_name)
m4_pushdef([make_var], [WITH_]check_name)
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
m4_pushdef([arg_var], [with-]check_name_lc)
m4_pushdef([with_var], [with_]check_name_lc)
AC_ARG_WITH(check_name_lc,
[AS_HELP_STRING([--arg_var],
[with ]]m4_dquote(pc_name)[[ (>= ]]m4_dquote(pc_version)[[) support @<:@default=check@:>@])],
[],[with_var][=check])
fail=0
if test "x$with_var" != "xno" ; then
PKG_CHECK_MODULES(check_name, pc_name[ >= ]pc_version, [
with_var=yes
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
with_var=no
])
fi
if test $fail = 1; then
AC_MSG_ERROR([You must install the ]pc_name[ >= ]pc_version[pkg-config module to compile libvirt])
fi
if test "x$with_var" = "xyes" ; then
AC_DEFINE_UNQUOTED(config_var, 1, [whether ]pc_name[ >= ]pc_version[ is available])
fi
AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"])
m4_popdef([with_var])
m4_popdef([arg_var])
m4_popdef([libs_var])
m4_popdef([cflags_var])
m4_popdef([make_var])
m4_popdef([config_var])
m4_popdef([check_name_lc])
m4_popdef([pc_version])
m4_popdef([pc_name])
m4_popdef([check_name])
])
dnl
dnl To be used after a call to LIBVIRT_CHECK_LIB,
dnl LIBVIRT_CHECK_LIB_ALT or LIBVIRT_CHECK_PKG
dnl to print the result status
dnl
dnl LIBVIRT_RESULT_LIB([CHECK_NAME])
dnl
dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
dnl
dnl LIBVIRT_RESULT_LIB([SELINUX])
dnl
AC_DEFUN([LIBVIRT_RESULT_LIB],[
m4_pushdef([check_name], [$1])
m4_pushdef([check_name_lc], m4_tolower(check_name))
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
m4_pushdef([with_var], [with_]check_name_lc)
LIBVIRT_RESULT(check_name_lc, [$with_var], [CFLAGS='$cflags_var' LIBS='$libs_var'])
m4_popdef([with_var])
m4_popdef([libs_var])
m4_popdef([cflags_var])
m4_popdef([check_name_lc])
m4_popdef([check_name])
])

View File

@@ -1,32 +0,0 @@
dnl
dnl Check for -z now and -z relro linker flags
dnl
dnl Copyright (C) 2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_LINKER_RELRO],[
AC_MSG_CHECKING([for how to force completely read-only GOT table])
RELRO_LDFLAGS=
`$LD --help 2>&1 | grep -- "-z relro" >/dev/null` && \
RELRO_LDFLAGS="-Wl,-z -Wl,relro"
`$LD --help 2>&1 | grep -- "-z now" >/dev/null` && \
RELRO_LDFLAGS="$RELRO_LDFLAGS -Wl,-z -Wl,now"
AC_SUBST([RELRO_LDFLAGS])
AC_MSG_RESULT([$RELRO_LDFLAGS])
])

View File

@@ -1,40 +0,0 @@
dnl The libnetcf.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_NETCF],[
LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4])
if test "$with_netcf" = "yes" ; then
old_CFLAGS="$CFLAGS"
old_LIBS="$CFLAGS"
CFLAGS="$CFLAGS $NETCF_CFLAGS"
LIBS="$LIBS $NETCF_LIBS"
AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0])
if test "$netcf_transactions" = "1" ; then
AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], [1],
[we have sufficiently new version of netcf for transaction network API])
fi
CFLAGS="$old_CFLAGS"
LIBS="$old_LIBS"
fi
])
AC_DEFUN([LIBVIRT_RESULT_NETCF],[
LIBVIRT_RESULT_LIB([NETCF])
])

View File

@@ -1,26 +0,0 @@
dnl The libnuma.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_NUMACTL],[
LIBVIRT_CHECK_LIB([NUMACTL], [numa], [numa_available], [numa.h])
])
AC_DEFUN([LIBVIRT_RESULT_NUMACTL],[
LIBVIRT_RESULT_LIB([NUMACTL])
])

View File

@@ -1,26 +0,0 @@
dnl The libopenwsman.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[
LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3])
])
AC_DEFUN([LIBVIRT_RESULT_OPENWSMAN],[
LIBVIRT_RESULT_LIB([OPENWSMAN])
])

View File

@@ -1,26 +0,0 @@
dnl The libpciaccess.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_PCIACCESS],[
LIBVIRT_CHECK_PKG([PCIACCESS], [pciaccess], [0.10.0])
])
AC_DEFUN([LIBVIRT_RESULT_PCIACCESS],[
LIBVIRT_RESULT_LIB([PCIACCESS])
])

View File

@@ -1,42 +0,0 @@
dnl
dnl virt-result.m4: Helper macros for checking for libraries
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
dnl
dnl To be used to print the results of a conditional test
dnl
dnl LIBVIRT_RESULT(CHECK_NAME, STATUS, DETAILS)
dnl
dnl CHECK_NAME: Name of the item being checked
dnl STATUS: 'yes' or 'no' result of check
dnl DETAILS: Details of result eg compiler flags
dnl
dnl eg
dnl
dnl LIBVIRT_RESULT([yajl], [yes], [-I/opt/yajl/include -lyajl])
dnl
AC_DEFUN([LIBVIRT_RESULT], [
if test "$2" = "no" || test -z "$3" ; then
STR=`printf "%10s: %-3s" "$1" "$2"`
else
STR=`printf "%10s: %-3s (%s)" "$1" "$2" "$3"`
fi
AC_MSG_NOTICE([$STR])
])

View File

@@ -1,56 +0,0 @@
dnl The libsanlock_client.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[
LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client], [sanlock_init], [sanlock.h])
if test "x$with_sanlock" = "xyes" ; then
AC_CHECK_DECLS([SANLK_INQ_WAIT], [sanlock_inq_wait=1], [sanlock_inq_wait=0], [[
#include <stdint.h>
#include <sanlock_admin.h>
]])
old_cppflags="$CPPFLAGS"
old_libs="$LIBS"
CPPFLAGS="$CPPFLAGS $SANLOCK_CFLAGS"
LIBS="$LIBS $SANLOCK_LIBS"
AC_CHECK_LIB([sanlock_client], [sanlock_killpath],
[sanlock_killpath=yes], [sanlock_killpath=no])
if test "x$sanlock_killpath" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_SANLOCK_KILLPATH], 1,
[whether Sanlock supports sanlock_killpath])
fi
AC_CHECK_LIB([sanlock_client], [sanlock_inq_lockspace],
[sanlock_inq_lockspace=yes], [sanlock_inq_lockspace=no])
if test "x$sanlock_inq_lockspace" = "xyes" && \
test $sanlock_inq_wait = 1; then
AC_DEFINE_UNQUOTED([HAVE_SANLOCK_INQ_LOCKSPACE], 1,
[whether sanlock supports sanlock_inq_lockspace])
fi
CPPFLAGS="$old_cppflags"
LIBS="$old_libs"
fi
])
AC_DEFUN([LIBVIRT_RESULT_SANLOCK],[
LIBVIRT_RESULT_LIB([SANLOCK])
])

View File

@@ -1,29 +0,0 @@
dnl The libsasl2.so or libsasl.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_SASL],[
LIBVIRT_CHECK_LIB_ALT([SASL], [sasl2],
[sasl_client_init], [sasl/sasl.h],
[SASL1], [sasl],
[sasl_client_init], [sasl/sasl.h])
])
AC_DEFUN([LIBVIRT_RESULT_SASL],[
LIBVIRT_RESULT_LIB([SASL])
])

View File

@@ -1,51 +0,0 @@
dnl The libselinux.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_SELINUX],[
LIBVIRT_CHECK_LIB([SELINUX], [selinux],
[fgetfilecon_raw], [selinux/selinux.h])
AC_ARG_WITH([selinux_mount],
AC_HELP_STRING([--with-selinux-mount], [set SELinux mount point @<:@default=check@:>@]),
[],
[with_selinux_mount=check])
if test "$with_selinux" = "yes"; then
AC_MSG_CHECKING([SELinux mount point])
if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then
if test -d /sys/fs/selinux ; then
SELINUX_MOUNT=/sys/fs/selinux
else
SELINUX_MOUNT=/selinux
fi
else
SELINUX_MOUNT=$with_selinux_mount
fi
AC_MSG_RESULT([$SELINUX_MOUNT])
AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point])
dnl We prefer to use <selinux/label.h> and selabel_open, but can fall
dnl back to matchpathcon for the sake of RHEL 5's version of libselinux.
AC_CHECK_HEADERS([selinux/label.h])
fi
])
AC_DEFUN([LIBVIRT_RESULT_SELINUX],[
LIBVIRT_RESULT_LIB([SELINUX])
])

View File

@@ -1,26 +0,0 @@
dnl The libssh2.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_SSH2],[
LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3])
])
AC_DEFUN([LIBVIRT_RESULT_SSH2],[
LIBVIRT_RESULT_LIB([SSH2])
])

View File

@@ -1,32 +0,0 @@
dnl The libudev.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_UDEV],[
AC_REQUIRE([LIBVIRT_CHECK_PCIACCESS])
LIBVIRT_CHECK_PKG([UDEV], [libudev], [145])
if test "$with_udev" = "yes" && test "$with_pciaccess" != "yes" ; then
AC_MSG_ERROR([You must install the pciaccess module to build with udev])
fi
])
AC_DEFUN([LIBVIRT_RESULT_UDEV],[
AC_REQUIRE([LIBVIRT_RESULT_PCIACCESS])
LIBVIRT_RESULT_LIB([UDEV])
])

View File

@@ -1,51 +0,0 @@
dnl The libyajl.so library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_YAJL],[
dnl YAJL JSON library http://lloyd.github.com/yajl/
if test "$with_qemu:$with_yajl" = yes:check; then
dnl Some versions of qemu require the use of yajl; try to detect them
dnl here, although we do not require qemu to exist in order to compile.
dnl This check mirrors src/qemu/qemu_capabilities.c
AC_PATH_PROGS([QEMU], [qemu-kvm qemu kvm qemu-system-x86_64],
[], [$PATH:/usr/bin:/usr/libexec])
if test -x "$QEMU"; then
if `$QEMU -help | grep libvirt` >/dev/null; then
with_yajl=yes
else
[qemu_version_sed='s/.*ersion \([0-9.,]*\).*/\1/']
qemu_version=`$QEMU -version | sed "$qemu_version_sed"`
case $qemu_version in
[[1-9]].* | 0.15.* ) with_yajl=yes ;;
0.* | '' ) ;;
*) AC_MSG_ERROR([Unexpected qemu version string]) ;;
esac
fi
fi
fi
LIBVIRT_CHECK_LIB_ALT([YAJL], [yajl],
[yajl_parse_complete], [yajl/yajl_common.h],
[YAJL2], [yajl],
[yajl_tree_parse], [yajl/yajl_common.h])
])
AC_DEFUN([LIBVIRT_RESULT_YAJL],[
LIBVIRT_RESULT_LIB([YAJL])
])

Some files were not shown because too many files have changed in this diff Show More