Browse Source

New upstream version 1.2.6

tags/upstream/1.2.6^0
Guido Günther 6 years ago
parent
commit
ab710a4bc8
100 changed files with 92583 additions and 69735 deletions
  1. +4
    -0
      AUTHORS
  2. +3066
    -0
      ChangeLog
  3. +5
    -2
      Makefile.am
  4. +12
    -3
      Makefile.in
  5. +1
    -1
      autogen.sh
  6. +25
    -4
      cfg.mk
  7. +18
    -1
      config.h.in
  8. +235
    -51
      configure
  9. +9
    -2
      configure.ac
  10. +1
    -1
      daemon/libvirtd.8.in
  11. +4
    -0
      daemon/libvirtd.conf
  12. +222
    -0
      daemon/remote.c
  13. +71
    -0
      daemon/remote_dispatch.h
  14. +1
    -1
      docs/apibuild.py
  15. +189
    -38
      docs/devhelp/libvirt-libvirt.html
  16. +1
    -0
      docs/devhelp/libvirt-virterror.html
  17. +15
    -0
      docs/devhelp/libvirt.devhelp
  18. +62
    -34
      docs/formatcaps.html
  19. +101
    -38
      docs/formatcaps.html.in
  20. +18
    -8
      docs/formatdomain.html
  21. +18
    -8
      docs/formatdomain.html.in
  22. +28
    -1
      docs/formatnode.html
  23. +33
    -0
      docs/formatnode.html.in
  24. +0
    -1
      docs/generic.css
  25. +1
    -1
      docs/hacking.html
  26. +1
    -1
      docs/hacking.html.in
  27. +63
    -13
      docs/html/libvirt-libvirt.html
  28. +1
    -1
      docs/html/libvirt-virterror.html
  29. +2
    -2
      docs/hvsupport.html
  30. +47
    -17
      docs/hvsupport.html.in
  31. +206
    -40
      docs/libvirt-api.xml
  32. +554
    -153
      docs/libvirt-refs.xml
  33. +0
    -2
      docs/libvirt.css
  34. +284
    -0
      docs/news.html
  35. +297
    -0
      docs/news.html.in
  36. +25
    -0
      docs/schemas/basictypes.rng
  37. +36
    -0
      docs/schemas/capability.rng
  38. +29
    -8
      docs/schemas/domaincommon.rng
  39. +158
    -133
      docs/schemas/interface.rng
  40. +40
    -0
      docs/schemas/nodedev.rng
  41. +18
    -0
      examples/lxcconvert/Makefile.am
  42. +1902
    -0
      examples/lxcconvert/Makefile.in
  43. +127
    -0
      examples/lxcconvert/virt-lxc-convert
  44. +0
    -5
      gnulib/lib/chown.c
  45. +16
    -0
      gnulib/lib/fcntl.in.h
  46. +6
    -1
      gnulib/lib/mbrtowc.c
  47. +9
    -0
      gnulib/tests/test-isnanl.h
  48. +1
    -4
      gnulib/tests/test-mbrtowc.c
  49. +10
    -0
      gnulib/tests/test-signbit.c
  50. +1
    -1
      gnulib/tests/xalloc.h
  51. +82
    -40
      include/libvirt/libvirt.h
  52. +81
    -39
      include/libvirt/libvirt.h.in
  53. +2
    -0
      include/libvirt/virterror.h
  54. +14
    -0
      libvirt-lxc.pc.in
  55. +14
    -0
      libvirt-qemu.pc.in
  56. +4
    -1
      libvirt.pc.in
  57. +26
    -4
      libvirt.spec
  58. +25
    -3
      libvirt.spec.in
  59. +10
    -2
      m4/dup2.m4
  60. +11
    -1
      m4/fcntl.m4
  61. +11
    -1
      m4/gnulib-common.m4
  62. +45
    -1
      m4/mbrtowc.m4
  63. +9
    -9
      m4/printf.m4
  64. +45
    -40
      m4/pthread_sigmask.m4
  65. +21
    -15
      m4/virt-compile-warnings.m4
  66. +1
    -1
      m4/virt-driver-bhyve.m4
  67. +4
    -0
      m4/virt-numactl.m4
  68. +2
    -7
      maint.mk
  69. +2
    -0
      mingw-libvirt.spec.in
  70. +4
    -0
      po/POTFILES.in
  71. BIN
      po/af.gmo
  72. +5599
    -4594
      po/af.po
  73. BIN
      po/am.gmo
  74. +5599
    -4594
      po/am.po
  75. BIN
      po/ar.gmo
  76. +5599
    -4594
      po/ar.po
  77. BIN
      po/as.gmo
  78. +5695
    -4604
      po/as.po
  79. BIN
      po/be.gmo
  80. +5599
    -4594
      po/be.po
  81. BIN
      po/bg.gmo
  82. +5607
    -4596
      po/bg.po
  83. BIN
      po/bn.gmo
  84. +5599
    -4594
      po/bn.po
  85. BIN
      po/bn_IN.gmo
  86. +5651
    -4608
      po/bn_IN.po
  87. BIN
      po/bo.gmo
  88. +5571
    -4636
      po/bo.po
  89. BIN
      po/bs.gmo
  90. +5599
    -4594
      po/bs.po
  91. BIN
      po/ca.gmo
  92. +5585
    -4611
      po/ca.po
  93. BIN
      po/cs.gmo
  94. +5611
    -4596
      po/cs.po
  95. BIN
      po/cy.gmo
  96. +5599
    -4594
      po/cy.po
  97. BIN
      po/da.gmo
  98. +5602
    -4596
      po/da.po
  99. BIN
      po/de.gmo
  100. +5682
    -4590
      po/de.po

+ 4
- 0
AUTHORS View File

@@ -89,6 +89,7 @@ Adam Walters <adam@pandorasboxen.com>
Alan Pevec <apevec@redhat.com>
Alex Jia <ajia@redhat.com>
Alex Williamson <alex.williamson@redhat.com>
Alexander Burluka <aburluka@parallels.com>
Alexander Larsson <alexl@redhat.com>
Alexander Todorov <atodorov@otb.bg>
Aline Manera <alinefm@br.ibm.com>
@@ -211,6 +212,7 @@ Henrik Persson E <henrik.e.persson@ericsson.com>
Hero Phương <herophuong93@gmail.com>
Hongwei Bi <hwbi2008@gmail.com>
Hu Tao <hutao@cn.fujitsu.com>
Ian Campbell <Ian.Campbell@citrix.com>
Ian Campbell <ian.campbell@citrix.com>
Ian Main <imain@redhat.com>
Ilja Livenson <ilja.livenson@gmail.com>
@@ -289,6 +291,7 @@ Michael Ellerman <michael@ellerman.id.au>
Michael Santos <michael.santos@gmail.com>
Michael Wood <esiotrot@gmail.com>
Michal Novotny <minovotn@redhat.com>
Michal Privoznik <miso.privoznik@gmail.com>
Michal Privoznik <mprivozn@redhat.com>
Michal Prívozník <mprivozn@redhat.com>
Michał Łomnicki <michal.lomnicki@gmail.com>
@@ -419,6 +422,7 @@ Xu He Jie <xuhj@linux.vnet.ibm.com>
Xuesong Zhang <xuzhang@redhat.com>
Yanbing Du <ydu@redhat.com>
Yogesh Tillu <tillu.yogesh@gmail.com>
Yohan BELLEGUIC <yohan.belleguic@diateam.net>
Yudai Yamagish <yummy@sfc.wide.ad.jp>
Yufang Zhang <yufang521247@gmail.com>
Yufang Zhang <yuzhang@redhat.com>


+ 3066
- 0
ChangeLog
File diff suppressed because it is too large
View File


+ 5
- 2
Makefile.am View File

@@ -23,7 +23,8 @@ SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \
tests po examples/object-events examples/hellolibvirt \
examples/dominfo examples/domsuspend examples/apparmor \
examples/xml/nwfilter examples/openauth examples/systemtap \
tools/wireshark examples/dommigrate
tools/wireshark examples/dommigrate \
examples/lxcconvert

ACLOCAL_AMFLAGS = -I m4

@@ -37,6 +38,8 @@ EXTRA_DIST = \
libvirt.spec libvirt.spec.in \
mingw-libvirt.spec.in \
libvirt.pc.in \
libvirt-qemu.pc.in \
libvirt-lxc.pc.in \
autobuild.sh \
Makefile.nonreentrant \
autogen.sh \
@@ -46,7 +49,7 @@ EXTRA_DIST = \
$(XML_EXAMPLES)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libvirt.pc
pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc

NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \


+ 12
- 3
Makefile.in View File

@@ -83,6 +83,7 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in $(top_srcdir)/build-aux/mkinstalldirs \
$(srcdir)/run.in $(srcdir)/libvirt.pc.in \
$(srcdir)/libvirt-qemu.pc.in $(srcdir)/libvirt-lxc.pc.in \
$(srcdir)/libvirt.spec.in $(srcdir)/mingw-libvirt.spec.in \
ABOUT-NLS COPYING COPYING.LESSER TODO build-aux/compile \
build-aux/config.guess build-aux/config.rpath \
@@ -260,7 +261,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = run libvirt.pc libvirt.spec mingw-libvirt.spec
CONFIG_CLEAN_FILES = run libvirt.pc libvirt-qemu.pc libvirt-lxc.pc \
libvirt.spec mingw-libvirt.spec
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -1834,7 +1836,8 @@ SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \
tests po examples/object-events examples/hellolibvirt \
examples/dominfo examples/domsuspend examples/apparmor \
examples/xml/nwfilter examples/openauth examples/systemtap \
tools/wireshark examples/dommigrate
tools/wireshark examples/dommigrate \
examples/lxcconvert

ACLOCAL_AMFLAGS = -I m4
XML_EXAMPLES = \
@@ -1847,6 +1850,8 @@ EXTRA_DIST = \
libvirt.spec libvirt.spec.in \
mingw-libvirt.spec.in \
libvirt.pc.in \
libvirt-qemu.pc.in \
libvirt-lxc.pc.in \
autobuild.sh \
Makefile.nonreentrant \
autogen.sh \
@@ -1856,7 +1861,7 @@ EXTRA_DIST = \
$(XML_EXAMPLES)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libvirt.pc
pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc
MAINTAINERCLEANFILES = .git-module-status

# Generate the ChangeLog file (with all entries since the switch to git)
@@ -1919,6 +1924,10 @@ run: $(top_builddir)/config.status $(srcdir)/run.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libvirt.pc: $(top_builddir)/config.status $(srcdir)/libvirt.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libvirt-qemu.pc: $(top_builddir)/config.status $(srcdir)/libvirt-qemu.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libvirt-lxc.pc: $(top_builddir)/config.status $(srcdir)/libvirt-lxc.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libvirt.spec: $(top_builddir)/config.status $(srcdir)/libvirt.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mingw-libvirt.spec: $(top_builddir)/config.status $(srcdir)/mingw-libvirt.spec.in


+ 1
- 1
autogen.sh View File

@@ -35,7 +35,7 @@ if test -z "$NOCONFIGURE" ; then
echo "Running ./configure with $EXTRA_ARGS $@"
else
if test -z "$*" && test ! -f "$THEDIR/config.status"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "I am going to run ./configure with no arguments - if you wish"
echo "to pass any to it, please specify them on the $0 command line."
fi
fi


+ 25
- 4
cfg.mk View File

@@ -90,7 +90,7 @@ endif

# Files that should never cause syntax check failures.
VC_LIST_ALWAYS_EXCLUDE_REGEX = \
(^(HACKING|docs/(news\.html\.in|.*\.patch))|\.po)$$
(^(HACKING|docs/(news\.html\.in|.*\.patch))|\.(po|fig|gif|ico|png))$$

# Functions like free() that are no-ops on NULL arguments.
useless_free_options = \
@@ -774,7 +774,7 @@ sc_prohibit_cross_inclusion:
access/ | conf/) safe="($$dir|conf|util)";; \
locking/) safe="($$dir|util|conf|rpc)";; \
cpu/| network/| node_device/| rpc/| security/| storage/) \
safe="($$dir|util|conf)";; \
safe="($$dir|util|conf|storage)";; \
xenapi/ | xenxs/ ) safe="($$dir|util|conf|xen)";; \
*) safe="($$dir|$(mid_dirs)|util)";; \
esac; \
@@ -929,9 +929,24 @@ sc_prohibit_mixed_case_abbreviations:
halt='Use PCI, USB, SCSI, not Pci, Usb, Scsi' \
$(_sc_search_regexp)

# Require #include <locale.h> in all files that call setlocale()
sc_require_locale_h:
@require='include.*locale\.h' \
containing='setlocale *(' \
halt='setlocale() requires <locale.h>' \
$(_sc_search_regexp)

sc_prohibit_empty_first_line:
@awk 'BEGIN { fail=0; } \
FNR == 1 { if ($$0 == "") { print FILENAME ":1:"; fail=1; } } \
END { if (fail == 1) { \
print "$(ME): Prohibited empty first line" > "/dev/stderr"; \
} exit fail; }' $$($(VC_LIST_EXCEPT));

# We don't use this feature of maint.mk.
prev_version_file = /dev/null

ifneq ($(_gl-Makefile),)
ifeq (0,$(MAKELEVEL))
_curr_status = .git-module-status
# The sed filter accommodates those who check out on a commit from which
@@ -964,6 +979,7 @@ ifeq (0,$(MAKELEVEL))
maint.mk Makefile: _autogen
endif
endif
endif

# It is necessary to call autogen any time gnulib changes. Autogen
# reruns configure, then we regenerate all Makefiles at once.
@@ -973,7 +989,9 @@ _autogen:
./config.status

# regenerate HACKING as part of the syntax-check
ifneq ($(_gl-Makefile),)
syntax-check: $(top_srcdir)/HACKING bracket-spacing-check
endif

bracket-spacing-check:
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.c$$'`; \
@@ -1029,7 +1047,7 @@ exclude_file_name_regexp--sc_prohibit_close = \
(\.p[yl]$$|^docs/|^(src/util/virfile\.c|src/libvirt\.c|tests/vir(cgroup|pci)mock\.c)$$)

exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
(^tests/(qemuhelp|nodeinfo|virpcitest)data/|\.(gif|ico|png|diff)$$)
(^tests/(qemuhelp|nodeinfo|virpcitest)data/|\.diff$$)

_src2=src/(util/vircommand|libvirt|lxc/lxc_controller|locking/lock_daemon)
exclude_file_name_regexp--sc_prohibit_fork_wrappers = \
@@ -1075,7 +1093,7 @@ exclude_file_name_regexp--sc_require_config_h_first = \
^(examples/|tools/virsh-edit\.c$$)

exclude_file_name_regexp--sc_trailing_blank = \
(/qemuhelpdata/|/sysinfodata/.*\.data|\.(fig|gif|ico|png)$$)
/qemuhelpdata/|/sysinfodata/.*\.data|/nodeinfodata/.*\.cpuinfo$$

exclude_file_name_regexp--sc_unmarked_diagnostics = \
^(docs/apibuild.py|tests/virt-aa-helper-test)$$
@@ -1104,3 +1122,6 @@ exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \

exclude_file_name_regexp--sc_prohibit_mixed_case_abbreviations = \
^src/(vbox/vbox_CAPI.*.h|esx/esx_vi.(c|h)|esx/esx_storage_backend_iscsi.c)$$

exclude_file_name_regexp--sc_prohibit_empty_first_line = \
^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt|tests/nodeinfodata/linux-raspberrypi/cpu/offline)$$

+ 18
- 1
config.h.in View File

@@ -1293,6 +1293,9 @@
/* whether numad is available */
#undef HAVE_NUMAD

/* whether numa_bitmask_isbitset is available */
#undef HAVE_NUMA_BITMASK_ISBITSET

/* Define to 1 if the system has the 'openpty' function. */
#undef HAVE_OPENPTY

@@ -2009,6 +2012,10 @@
/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
#undef MAP_ANONYMOUS

/* Define if the mbrtowc function does not return (size_t) -2 for empty input.
*/
#undef MBRTOWC_EMPTY_INPUT_BUG

/* Define if the mbrtowc function has the NULL pwc argument bug. */
#undef MBRTOWC_NULL_ARG1_BUG

@@ -2099,7 +2106,7 @@
*/
#undef PTHREAD_SIGMASK_FAILS_WITH_ERRNO

/* Define to 1 if pthread_sigmask() may returns 0 and have no effect. */
/* Define to 1 if pthread_sigmask may return 0 and have no effect. */
#undef PTHREAD_SIGMASK_INEFFECTIVE

/* Define to 1 if pthread_sigmask() unblocks signals incorrectly. */
@@ -2853,6 +2860,16 @@
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED

/* gcc supports the "unused" attribute on possibly unused labels, and
g++ has since version 4.5. Note to support C++ as well as C,
_GL_UNUSED_LABEL should be used with a trailing ; */
#if !defined __cplusplus || __GNUC__ > 4 \
|| (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
# define _GL_UNUSED_LABEL _GL_UNUSED
#else
# define _GL_UNUSED_LABEL
#endif

/* The __pure__ attribute was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))


+ 235
- 51
configure View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libvirt 1.2.5.
# Generated by GNU Autoconf 2.69 for libvirt 1.2.6.
#
# Report bugs to <libvir-list@redhat.com>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libvirt'
PACKAGE_TARNAME='libvirt'
PACKAGE_VERSION='1.2.5'
PACKAGE_STRING='libvirt 1.2.5'
PACKAGE_VERSION='1.2.6'
PACKAGE_STRING='libvirt 1.2.6'
PACKAGE_BUGREPORT='libvir-list@redhat.com'
PACKAGE_URL='http://libvirt.org'

@@ -3050,7 +3050,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libvirt 1.2.5 to adapt to many kinds of systems.
\`configure' configures libvirt 1.2.6 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

@@ -3120,7 +3120,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libvirt 1.2.5:";;
short | recursive ) echo "Configuration of libvirt 1.2.6:";;
esac
cat <<\_ACEOF

@@ -3439,7 +3439,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libvirt configure 1.2.5
libvirt configure 1.2.6
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
@@ -4148,7 +4148,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by libvirt $as_me 1.2.5, which was
It was created by libvirt $as_me 1.2.6, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
@@ -4441,6 +4441,7 @@ gl_func_list="$gl_func_list readlinkat"
gl_func_list="$gl_func_list chown"
gl_func_list="$gl_func_list fchown"
gl_func_list="$gl_func_list _set_invalid_parameter_handler"
gl_func_list="$gl_func_list getdtablesize"
gl_header_list="$gl_header_list unistd.h"
gl_header_list="$gl_header_list execinfo.h"
gl_func_list="$gl_func_list fcntl"
@@ -4463,7 +4464,6 @@ gl_func_list="$gl_func_list fsync"
gl_header_list="$gl_header_list netdb.h"
gl_header_list="$gl_header_list netinet/in.h"
gl_func_list="$gl_func_list getdelim"
gl_func_list="$gl_func_list getdtablesize"
gl_header_list="$gl_header_list stdio_ext.h"
gl_header_list="$gl_header_list termios.h"
gl_func_list="$gl_func_list __fsetlocking"
@@ -5140,7 +5140,7 @@ fi

# Define the identity of the package.
PACKAGE='libvirt'
VERSION='1.2.5'
VERSION='1.2.6'


cat >>confdefs.h <<_ACEOF
@@ -10815,6 +10815,11 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h








:


@@ -13221,11 +13226,6 @@ _ACEOF








{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5
$as_echo_n "checking type of array argument to getgroups... " >&6; }
if ${ac_cv_type_getgroups+:} false; then :
@@ -17481,7 +17481,7 @@ else
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
@@ -21999,6 +21999,13 @@ $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h



:







$as_echo "#define HAVE_DUP2 1" >>confdefs.h

@@ -22018,7 +22025,9 @@ else
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
gl_cv_func_dup2_works="guessing no" ;;
freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
aix* | freebsd*)
# on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
# not EBADF.
gl_cv_func_dup2_works="guessing no" ;;
haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
gl_cv_func_dup2_works="guessing no" ;;
@@ -22035,6 +22044,11 @@ int
main ()
{
int result = 0;
#ifdef HAVE_GETDTABLESIZE
int bad_fd = getdtablesize ();
#else
int bad_fd = 1000000;
#endif
#ifdef FD_CLOEXEC
if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
result |= 1;
@@ -22049,7 +22063,7 @@ int result = 0;
if (dup2 (0, 0) != -1)
result |= 8;
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (2, 1000000) == -1 && errno != EBADF)
if (dup2 (2, bad_fd) == -1 && errno != EBADF)
result |= 16;
/* Flush out some cygwin core dumps. */
if (dup2 (2, -1) != -1 || errno != EBADF)
@@ -22386,6 +22400,9 @@ $as_echo "#define GNULIB_TEST_FCLOSE 1" >>confdefs.h






if test $ac_cv_func_fcntl = no; then


@@ -22418,6 +22435,9 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#ifdef HAVE_GETDTABLESIZE
# include <unistd.h>
#endif
#include <fcntl.h>
#include <errno.h>

@@ -22425,8 +22445,15 @@ int
main ()
{
int result = 0;
#ifdef HAVE_GETDTABLESIZE
int bad_fd = getdtablesize ();
#else
int bad_fd = 1000000;
#endif
if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
if (errno != EINVAL) result |= 2;
if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
if (errno != EINVAL) result |= 8;
return result;

;
@@ -27811,6 +27838,49 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
$as_echo_n "(cached) " >&6
else

case "$host_os" in
# Guess no on AIX and glibc systems.
aix* | *-gnu*)
gl_cv_func_mbrtowc_empty_input="guessing no" ;;
*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
esac
if test "$cross_compiling" = yes; then :
:
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <wchar.h>
static wchar_t wc;
static mbstate_t mbs;
int
main (void)
{
return mbrtowc (&wc, "", 0, &mbs) == (size_t) -2;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
gl_cv_func_mbrtowc_empty_input=no
else
gl_cv_func_mbrtowc_empty_input=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }

case "$gl_cv_func_mbrtowc_null_arg1" in
*yes) ;;
*)
@@ -27840,6 +27910,14 @@ $as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
*)
$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h

REPLACE_MBRTOWC=1
;;
esac
case "$gl_cv_func_mbrtowc_empty_input" in
*yes) ;;
*)
$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h

REPLACE_MBRTOWC=1
;;
esac
@@ -30777,34 +30855,37 @@ $as_echo "$gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&6; }


if test -z "$LIB_PTHREAD_SIGMASK"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask works without -lpthread" >&5
case " $LIBS " in
*' -lpthread '*) ;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask works without -lpthread" >&5
$as_echo_n "checking whether pthread_sigmask works without -lpthread... " >&6; }
if ${gl_cv_func_pthread_sigmask_in_libc_works+:} false; then :
$as_echo_n "(cached) " >&6
else

if test "$cross_compiling" = yes; then :
if test "$cross_compiling" = yes; then :

case "$host_os" in
freebsd* | hpux* | solaris | solaris2.[2-9]*)
gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
*)
gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
esac
case "$host_os" in
freebsd* | hpux* | solaris | solaris2.[2-9]*)
gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
*)
gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
esac

else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <pthread.h>
#include <signal.h>
#include <stddef.h>
int main ()
{
sigset_t set;
sigemptyset (&set);
return pthread_sigmask (1729, &set, NULL) != 0;
}
#include <pthread.h>
#include <signal.h>
#include <stddef.h>
int main ()
{
sigset_t set;
sigemptyset (&set);
return pthread_sigmask (1729, &set, NULL) != 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
gl_cv_func_pthread_sigmask_in_libc_works=no
@@ -30819,13 +30900,14 @@ fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_libc_works" >&5
$as_echo "$gl_cv_func_pthread_sigmask_in_libc_works" >&6; }
case "$gl_cv_func_pthread_sigmask_in_libc_works" in
*no)
REPLACE_PTHREAD_SIGMASK=1
case "$gl_cv_func_pthread_sigmask_in_libc_works" in
*no)
REPLACE_PTHREAD_SIGMASK=1

$as_echo "#define PTHREAD_SIGMASK_INEFFECTIVE 1" >>confdefs.h

;;
;;
esac;;
esac
fi

@@ -30896,8 +30978,8 @@ else
*)
gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
esac
gl_save_LIBS="$LIBS"
LIBS="$LIBS $LIBMULTITHREAD"
gl_save_LIBS=$LIBS
LIBS="$LIBS $LIBMULTITHREAD"
if test "$cross_compiling" = yes; then :
:
else
@@ -30947,7 +31029,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

LIBS="$gl_save_LIBS"
LIBS=$gl_save_LIBS

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_unblock_works" >&5
@@ -54970,9 +55052,6 @@ $as_echo "$lv_cv_gcc_wlogical_op_broken" >&6; }
# ideally we'd turn many of them on
dontwarn="$dontwarn -Wfloat-equal"
dontwarn="$dontwarn -Wdeclaration-after-statement"
dontwarn="$dontwarn -Wcast-qual"
dontwarn="$dontwarn -Wconversion"
dontwarn="$dontwarn -Wsign-conversion"
dontwarn="$dontwarn -Wpacked"
dontwarn="$dontwarn -Wunused-macros"
dontwarn="$dontwarn -Woverlength-strings"
@@ -55263,9 +55342,7 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
aarch64-*-*)
;;
*-*-linux*)
wantwarn="$wantwarn -fstack-protector-all"
wantwarn="$wantwarn --param=ssp-buffer-size=4"
wantwarn="$wantwarn -Wno-unused-command-line-argument"
wantwarn="$wantwarn -fstack-protector-strong"
;;
*-*-freebsd*)
wantwarn="$wantwarn -fstack-protector"
@@ -55336,6 +55413,60 @@ fi

done

case $host in
*-*-linux*)
case $WARN_CFLAGS in
*-fstack-protector-strong*)
;;
*)

as_gl_Warn=`$as_echo "gl_cv_warn_c_"-fstack-protector-all"" | $as_tr_sh`
gl_positive=""-fstack-protector-all""
case $gl_positive in
-Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles \"-fstack-protector-all\"" >&5
$as_echo_n "checking whether C compiler handles \"-fstack-protector-all\"... " >&6; }
if eval \${$as_gl_Warn+:} false; then :
$as_echo_n "(cached) " >&6
else

gl_save_compiler_FLAGS="$CFLAGS"
as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$as_gl_Warn=yes"
else
eval "$as_gl_Warn=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS="$gl_save_compiler_FLAGS"

fi
eval ac_res=\$$as_gl_Warn
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then :
as_fn_append WARN_CFLAGS " "-fstack-protector-all""
fi


;;
esac
;;
esac

# Silence certain warnings in gnulib, and use improved glibc headers

$as_echo "#define lint 1" >>confdefs.h
@@ -57584,6 +57715,53 @@ fi



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for numa_bitmask_isbitset in -lnuma" >&5
$as_echo_n "checking for numa_bitmask_isbitset in -lnuma... " >&6; }
if ${ac_cv_lib_numa_numa_bitmask_isbitset+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnuma $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char numa_bitmask_isbitset ();
int
main ()
{
return numa_bitmask_isbitset ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_numa_numa_bitmask_isbitset=yes
else
ac_cv_lib_numa_numa_bitmask_isbitset=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_bitmask_isbitset" >&5
$as_echo "$ac_cv_lib_numa_numa_bitmask_isbitset" >&6; }
if test "x$ac_cv_lib_numa_numa_bitmask_isbitset" = xyes; then :
have_numa_bitmask_isbitset=yes
fi

if test "$have_numa_bitmask_isbitset" = "yes"; then

cat >>confdefs.h <<_ACEOF
#define HAVE_NUMA_BITMASK_ISBITSET 1
_ACEOF

fi



@@ -62467,7 +62645,7 @@ fi



if test -z "$BHYVE" || test -z "$BHYVECTL" \
if test -z "$BHYVE" || test -z "$BHYVECTL" || \
test -z "$BHYVELOAD" || test "$with_freebsd" = "no"; then
if test "$with_bhyve" = "check"; then
with_bhyve="no"
@@ -69318,7 +69496,7 @@ _ACEOF

ac_config_files="$ac_config_files run"

ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile docs/Makefile docs/schemas/Makefile gnulib/lib/Makefile gnulib/tests/Makefile libvirt.pc libvirt.spec mingw-libvirt.spec po/Makefile.in include/libvirt/Makefile include/libvirt/libvirt.h daemon/Makefile tools/Makefile tests/Makefile examples/apparmor/Makefile examples/object-events/Makefile examples/domsuspend/Makefile examples/dominfo/Makefile examples/dommigrate/Makefile examples/openauth/Makefile examples/hellolibvirt/Makefile examples/systemtap/Makefile examples/xml/nwfilter/Makefile tools/wireshark/Makefile tools/wireshark/src/Makefile"
ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile docs/Makefile docs/schemas/Makefile gnulib/lib/Makefile gnulib/tests/Makefile libvirt.pc libvirt-qemu.pc libvirt-lxc.pc src/libvirt.pc src/libvirt-qemu.pc src/libvirt-lxc.pc libvirt.spec mingw-libvirt.spec po/Makefile.in include/libvirt/Makefile include/libvirt/libvirt.h daemon/Makefile tools/Makefile tests/Makefile examples/apparmor/Makefile examples/object-events/Makefile examples/domsuspend/Makefile examples/dominfo/Makefile examples/dommigrate/Makefile examples/openauth/Makefile examples/hellolibvirt/Makefile examples/systemtap/Makefile examples/xml/nwfilter/Makefile examples/lxcconvert/Makefile tools/wireshark/Makefile tools/wireshark/src/Makefile"

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -70341,7 +70519,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libvirt $as_me 1.2.5, which was
This file was extended by libvirt $as_me 1.2.6, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
@@ -70412,7 +70590,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libvirt config.status 1.2.5
libvirt config.status 1.2.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

@@ -70842,6 +71020,11 @@ do
"gnulib/lib/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/lib/Makefile" ;;
"gnulib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/tests/Makefile" ;;
"libvirt.pc") CONFIG_FILES="$CONFIG_FILES libvirt.pc" ;;
"libvirt-qemu.pc") CONFIG_FILES="$CONFIG_FILES libvirt-qemu.pc" ;;
"libvirt-lxc.pc") CONFIG_FILES="$CONFIG_FILES libvirt-lxc.pc" ;;
"src/libvirt.pc") CONFIG_FILES="$CONFIG_FILES src/libvirt.pc" ;;
"src/libvirt-qemu.pc") CONFIG_FILES="$CONFIG_FILES src/libvirt-qemu.pc" ;;
"src/libvirt-lxc.pc") CONFIG_FILES="$CONFIG_FILES src/libvirt-lxc.pc" ;;
"libvirt.spec") CONFIG_FILES="$CONFIG_FILES libvirt.spec" ;;
"mingw-libvirt.spec") CONFIG_FILES="$CONFIG_FILES mingw-libvirt.spec" ;;
"po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
@@ -70859,6 +71042,7 @@ do
"examples/hellolibvirt/Makefile") CONFIG_FILES="$CONFIG_FILES examples/hellolibvirt/Makefile" ;;
"examples/systemtap/Makefile") CONFIG_FILES="$CONFIG_FILES examples/systemtap/Makefile" ;;
"examples/xml/nwfilter/Makefile") CONFIG_FILES="$CONFIG_FILES examples/xml/nwfilter/Makefile" ;;
"examples/lxcconvert/Makefile") CONFIG_FILES="$CONFIG_FILES examples/lxcconvert/Makefile" ;;
"tools/wireshark/Makefile") CONFIG_FILES="$CONFIG_FILES tools/wireshark/Makefile" ;;
"tools/wireshark/src/Makefile") CONFIG_FILES="$CONFIG_FILES tools/wireshark/src/Makefile" ;;



+ 9
- 2
configure.ac View File

@@ -16,7 +16,7 @@ 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/>.

AC_INIT([libvirt], [1.2.5], [libvir-list@redhat.com], [], [http://libvirt.org])
AC_INIT([libvirt], [1.2.6], [libvir-list@redhat.com], [], [http://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
@@ -2727,7 +2727,13 @@ AC_CONFIG_FILES([\
docs/schemas/Makefile \
gnulib/lib/Makefile \
gnulib/tests/Makefile \
libvirt.pc libvirt.spec mingw-libvirt.spec \
libvirt.pc \
libvirt-qemu.pc \
libvirt-lxc.pc \
src/libvirt.pc \
src/libvirt-qemu.pc \
src/libvirt-lxc.pc \
libvirt.spec mingw-libvirt.spec \
po/Makefile.in \
include/libvirt/Makefile include/libvirt/libvirt.h \
daemon/Makefile \
@@ -2742,6 +2748,7 @@ AC_CONFIG_FILES([\
examples/hellolibvirt/Makefile \
examples/systemtap/Makefile \
examples/xml/nwfilter/Makefile \
examples/lxcconvert/Makefile \
tools/wireshark/Makefile \
tools/wireshark/src/Makefile])
AC_OUTPUT


+ 1
- 1
daemon/libvirtd.8.in View File

@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LIBVIRTD 8"
.TH LIBVIRTD 8 "2013-08-28" "libvirt-1.2.5" "Virtualization Support"
.TH LIBVIRTD 8 "2013-08-28" "libvirt-1.2.6" "Virtualization Support"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l


+ 4
- 0
daemon/libvirtd.conf View File

@@ -48,6 +48,10 @@
# Override the default configuration which binds to all network
# interfaces. This can be a numeric IPv4/6 address, or hostname
#
# If the libvirtd service is started in parallel with network
# startup (e.g. with systemd), binding to addresses other than
# the wildcards (0.0.0.0/::) might not be available yet.
#
#listen_addr = "192.168.0.1"




+ 222
- 0
daemon/remote.c View File

@@ -931,6 +931,44 @@ remoteRelayDomainEventDeviceRemoved(virConnectPtr conn,
}


static int
remoteRelayDomainEventBlockJob2(virConnectPtr conn,
virDomainPtr dom,
const char *dst,
int type,
int status,
void *opaque)
{
daemonClientEventCallbackPtr callback = opaque;
remote_domain_event_block_job_2_msg data;

if (callback->callbackID < 0 ||
!remoteRelayDomainEventCheckACL(callback->client, conn, dom))
return -1;

VIR_DEBUG("Relaying domain block job 2 event %s %d %s %i, %i, callback %d",
dom->name, dom->id, dst, type, status, callback->callbackID);

/* build return data */
memset(&data, 0, sizeof(data));
data.callbackID = callback->callbackID;
if (VIR_STRDUP(data.dst, dst) < 0)
goto error;
data.type = type;
data.status = status;
make_nonnull_domain(&data.dom, dom);

remoteDispatchObjectEventSend(callback->client, remoteProgram,
REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2,
(xdrproc_t)xdr_remote_domain_event_block_job_2_msg, &data);

return 0;
error:
VIR_FREE(data.dst);
return -1;
}


static virConnectDomainEventGenericCallback domainEventCallbacks[] = {
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventLifecycle),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventReboot),
@@ -948,6 +986,7 @@ static virConnectDomainEventGenericCallback domainEventCallbacks[] = {
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventBalloonChange),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventPMSuspendDisk),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventDeviceRemoved),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventBlockJob2),
};

verify(ARRAY_CARDINALITY(domainEventCallbacks) == VIR_DOMAIN_EVENT_ID_LAST);
@@ -6115,6 +6154,189 @@ remoteDispatchDomainGetTime(virNetServerPtr server ATTRIBUTE_UNUSED,
return rv;
}


static int
remoteDispatchNodeGetFreePages(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
remote_node_get_free_pages_args *args,
remote_node_get_free_pages_ret *ret)
{
int rv = -1;
int len;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);

if (!priv->conn) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}

if (args->pages.pages_len * args->cellCount > REMOTE_NODE_MAX_CELLS) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("the result won't fit into REMOTE_NODE_MAX_CELLS"));
goto cleanup;
}

/* Allocate return buffer. */
if (VIR_ALLOC_N(ret->counts.counts_val,
args->pages.pages_len * args->cellCount) < 0)
goto cleanup;

if ((len = virNodeGetFreePages(priv->conn,
args->pages.pages_len,
args->pages.pages_val,
args->startCell,
args->cellCount,
(unsigned long long *) ret->counts.counts_val,
args->flags)) <= 0)
goto cleanup;

ret->counts.counts_len = len;
rv = 0;

cleanup:
if (rv < 0) {
virNetMessageSaveError(rerr);
VIR_FREE(ret->counts.counts_val);
}
return rv;
}

/* Copy contents of virNetworkDHCPLeasePtr to remote_network_dhcp_lease */
static int
remoteSerializeDHCPLease(remote_network_dhcp_lease *lease_dst, virNetworkDHCPLeasePtr lease_src)
{
char **mac_tmp = NULL;
char **iaid_tmp = NULL;
char **hostname_tmp = NULL;
char **clientid_tmp = NULL;

lease_dst->expirytime = lease_src->expirytime;
lease_dst->type = lease_src->type;
lease_dst->prefix = lease_src->prefix;

if (VIR_STRDUP(lease_dst->iface, lease_src->iface) < 0 ||
VIR_STRDUP(lease_dst->ipaddr, lease_src->ipaddr) < 0)
goto error;

if (lease_src->mac) {
if (VIR_ALLOC(mac_tmp) < 0 ||
VIR_STRDUP(*mac_tmp, lease_src->mac) < 0)
goto error;
}
if (lease_src->iaid) {
if (VIR_ALLOC(iaid_tmp) < 0 ||
VIR_STRDUP(*iaid_tmp, lease_src->iaid) < 0)
goto error;
}
if (lease_src->hostname) {
if (VIR_ALLOC(hostname_tmp) < 0 ||
VIR_STRDUP(*hostname_tmp, lease_src->hostname) < 0)
goto error;
}
if (lease_src->clientid) {
if (VIR_ALLOC(clientid_tmp) < 0 ||
VIR_STRDUP(*clientid_tmp, lease_src->clientid) < 0)
goto error;
}

lease_dst->mac = mac_tmp;
lease_dst->iaid = iaid_tmp;
lease_dst->hostname = hostname_tmp;
lease_dst->clientid = clientid_tmp;

return 0;

error:
if (mac_tmp)
VIR_FREE(*mac_tmp);
if (iaid_tmp)
VIR_FREE(*iaid_tmp);
if (hostname_tmp)
VIR_FREE(*hostname_tmp);
if (clientid_tmp)
VIR_FREE(*clientid_tmp);
VIR_FREE(mac_tmp);
VIR_FREE(iaid_tmp);
VIR_FREE(hostname_tmp);
VIR_FREE(clientid_tmp);
VIR_FREE(lease_dst->ipaddr);
VIR_FREE(lease_dst->iface);
return -1;
}


static int
remoteDispatchNetworkGetDHCPLeases(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
virNetMessageErrorPtr rerr,
remote_network_get_dhcp_leases_args *args,
remote_network_get_dhcp_leases_ret *ret)
{
int rv = -1;
size_t i;
struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client);
virNetworkDHCPLeasePtr *leases = NULL;
virNetworkPtr net = NULL;
int nleases = 0;

if (!priv->conn) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}

if (!(net = get_nonnull_network(priv->conn, args->net)))
goto cleanup;

if ((nleases = virNetworkGetDHCPLeases(net,
args->mac ? *args->mac : NULL,
args->need_results ? &leases : NULL,
args->flags)) < 0)
goto cleanup;

if (nleases > REMOTE_NETWORK_DHCP_LEASES_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of leases is %d, which exceeds max limit: %d"),
nleases, REMOTE_NETWORK_DHCP_LEASES_MAX);
goto cleanup;
}

if (leases && nleases) {
if (VIR_ALLOC_N(ret->leases.leases_val, nleases) < 0)
goto cleanup;

ret->leases.leases_len = nleases;

for (i = 0; i < nleases; i++) {
if (remoteSerializeDHCPLease(ret->leases.leases_val + i, leases[i]) < 0)
goto cleanup;
}

} else {
ret->leases.leases_len = 0;
ret->leases.leases_val = NULL;
}

ret->ret = nleases;

rv = 0;

cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
if (leases) {
for (i = 0; i < nleases; i++)
virNetworkDHCPLeaseFree(leases[i]);
VIR_FREE(leases);
}
virNetworkFree(net);
return rv;
}


/*----- Helpers. -----*/

/* get_nonnull_domain and get_nonnull_network turn an on-wire


+ 71
- 0
daemon/remote_dispatch.h View File

@@ -10314,6 +10314,28 @@ cleanup:



static int remoteDispatchNetworkGetDHCPLeases(
virNetServerPtr server,
virNetServerClientPtr client,
virNetMessagePtr msg,
virNetMessageErrorPtr rerr,
remote_network_get_dhcp_leases_args *args,
remote_network_get_dhcp_leases_ret *ret);
static int remoteDispatchNetworkGetDHCPLeasesHelper(
virNetServerPtr server,
virNetServerClientPtr client,
virNetMessagePtr msg,
virNetMessageErrorPtr rerr,
void *args,
void *ret)
{
VIR_DEBUG("server=%p client=%p msg=%p rerr=%p args=%p ret=%p", server, client, msg, rerr, args, ret);
return remoteDispatchNetworkGetDHCPLeases(server, client, msg, rerr, args, ret);
}
/* remoteDispatchNetworkGetDHCPLeases body has to be implemented manually */



static int remoteDispatchNetworkGetXMLDesc(
virNetServerPtr server,
virNetServerClientPtr client,
@@ -11517,6 +11539,28 @@ cleanup:



static int remoteDispatchNodeGetFreePages(
virNetServerPtr server,
virNetServerClientPtr client,
virNetMessagePtr msg,
virNetMessageErrorPtr rerr,
remote_node_get_free_pages_args *args,
remote_node_get_free_pages_ret *ret);
static int remoteDispatchNodeGetFreePagesHelper(
virNetServerPtr server,
virNetServerClientPtr client,
virNetMessagePtr msg,
virNetMessageErrorPtr rerr,
void *args,
void *ret)
{
VIR_DEBUG("server=%p client=%p msg=%p rerr=%p args=%p ret=%p", server, client, msg, rerr, args, ret);
return remoteDispatchNodeGetFreePages(server, client, msg, rerr, args, ret);
}
/* remoteDispatchNodeGetFreePages body has to be implemented manually */



static int remoteDispatchNodeGetInfo(
virNetServerPtr server,
virNetServerClientPtr client,
@@ -17371,5 +17415,32 @@ virNetServerProgramProc remoteProcs[] = {
true,
0
},
{ /* Async event DomainEventBlockJob2 => 339 */
NULL,
0,
(xdrproc_t)xdr_void,
0,
(xdrproc_t)xdr_void,
true,
0
},
{ /* Method NodeGetFreePages => 340 */
remoteDispatchNodeGetFreePagesHelper,
sizeof(remote_node_get_free_pages_args),
(xdrproc_t)xdr_remote_node_get_free_pages_args,
sizeof(remote_node_get_free_pages_ret),
(xdrproc_t)xdr_remote_node_get_free_pages_ret,
true,
1
},
{ /* Method NetworkGetDHCPLeases => 341 */
remoteDispatchNetworkGetDHCPLeasesHelper,
sizeof(remote_network_get_dhcp_leases_args),
(xdrproc_t)xdr_remote_network_get_dhcp_leases_args,
sizeof(remote_network_get_dhcp_leases_ret),
(xdrproc_t)xdr_remote_network_get_dhcp_leases_ret,
true,
0
},
};
size_t remoteNProcs = ARRAY_CARDINALITY(remoteProcs);

+ 1
- 1
docs/apibuild.py View File

@@ -1312,7 +1312,7 @@ class CParser:
name = None
self.comment = None
comment = ""
value = "0"
value = "-1"
while token is not None:
if token[0] == "sep" and token[1] == "{":
token = self.token()


+ 189
- 38
docs/devhelp/libvirt-libvirt.html View File

@@ -159,6 +159,7 @@ typedef struct _virConnectAuth <a href="#virConnectAuth">virConnectAuth</a>;
typedef <a href="libvirt-libvirt.html#virConnectAuth">virConnectAuth</a> * <a href="#virConnectAuthPtr">virConnectAuthPtr</a>;
typedef enum <a href="#virConnectBaselineCPUFlags">virConnectBaselineCPUFlags</a>;
typedef enum <a href="#virConnectCloseReason">virConnectCloseReason</a>;
typedef enum <a href="#virConnectCompareCPUFlags">virConnectCompareCPUFlags</a>;
typedef struct _virConnectCredential <a href="#virConnectCredential">virConnectCredential</a>;
typedef <a href="libvirt-libvirt.html#virConnectCredential">virConnectCredential</a> * <a href="#virConnectCredentialPtr">virConnectCredentialPtr</a>;
typedef enum <a href="#virConnectCredentialType">virConnectCredentialType</a>;
@@ -263,6 +264,7 @@ typedef enum <a href="#virDomainUndefineFlagsValues">virDomainUndefineFlagsValue
typedef enum <a href="#virDomainVcpuFlags">virDomainVcpuFlags</a>;
typedef enum <a href="#virDomainXMLFlags">virDomainXMLFlags</a>;
typedef enum <a href="#virEventHandleType">virEventHandleType</a>;
typedef enum <a href="#virIPAddrType">virIPAddrType</a>;
typedef struct _virInterface <a href="#virInterface">virInterface</a>;
typedef <a href="libvirt-libvirt.html#virInterface">virInterface</a> * <a href="#virInterfacePtr">virInterfacePtr</a>;
typedef enum <a href="#virInterfaceXMLFlags">virInterfaceXMLFlags</a>;
@@ -273,6 +275,8 @@ typedef enum <a href="#virMemoryParameterType">virMemoryParameterType</a>;
typedef struct _virNWFilter <a href="#virNWFilter">virNWFilter</a>;
typedef <a href="libvirt-libvirt.html#virNWFilter">virNWFilter</a> * <a href="#virNWFilterPtr">virNWFilterPtr</a>;
typedef struct _virNetwork <a href="#virNetwork">virNetwork</a>;
typedef struct _virNetworkDHCPLease <a href="#virNetworkDHCPLease">virNetworkDHCPLease</a>;
typedef <a href="libvirt-libvirt.html#virNetworkDHCPLease">virNetworkDHCPLease</a> * <a href="#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a>;
typedef enum <a href="#virNetworkEventID">virNetworkEventID</a>;
typedef enum <a href="#virNetworkEventLifecycleType">virNetworkEventLifecycleType</a>;
typedef <a href="libvirt-libvirt.html#virNetwork">virNetwork</a> * <a href="#virNetworkPtr">virNetworkPtr</a>;
@@ -609,12 +613,14 @@ int <a href="#virNWFilterRef">virNWFilterRef</a> (<a href="libvirt-libvirt.htm
int <a href="#virNWFilterUndefine">virNWFilterUndefine</a> (<a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> nwfilter);
int <a href="#virNetworkCreate">virNetworkCreate</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkCreateXML">virNetworkCreateXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc);
void <a href="#virNetworkDHCPLeaseFree">virNetworkDHCPLeaseFree</a> (<a href="libvirt-libvirt.html#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a> lease);
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkDefineXML">virNetworkDefineXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xml);
int <a href="#virNetworkDestroy">virNetworkDestroy</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virNetworkFree">virNetworkFree</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virNetworkGetAutostart">virNetworkGetAutostart</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> int * autostart);
char * <a href="#virNetworkGetBridgeName">virNetworkGetBridgeName</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virNetworkGetConnect">virNetworkGetConnect</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net);
int <a href="#virNetworkGetDHCPLeases">virNetworkGetDHCPLeases</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> const char * mac, <br/> <a href="libvirt-libvirt.html#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a> ** leases, <br/> unsigned int flags);
const char * <a href="#virNetworkGetName">virNetworkGetName</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virNetworkGetUUID">virNetworkGetUUID</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> unsigned char * uuid);
int <a href="#virNetworkGetUUIDString">virNetworkGetUUIDString</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> char * buf);
@@ -647,6 +653,7 @@ int <a href="#virNodeGetCPUMap">virNodeGetCPUMap</a> (<a href="libvirt-libvirt.
int <a href="#virNodeGetCPUStats">virNodeGetCPUStats</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> int cpuNum, <br/> <a href="libvirt-libvirt.html#virNodeCPUStatsPtr">virNodeCPUStatsPtr</a> params, <br/> int * nparams, <br/> unsigned int flags);
int <a href="#virNodeGetCellsFreeMemory">virNodeGetCellsFreeMemory</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned long long * freeMems, <br/> int startCell, <br/> int maxCells);
unsigned long long <a href="#virNodeGetFreeMemory">virNodeGetFreeMemory</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
int <a href="#virNodeGetFreePages">virNodeGetFreePages</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned int npages, <br/> unsigned int * pages, <br/> int startCell, <br/> unsigned int cellCount, <br/> unsigned long long * counts, <br/> unsigned int flags);
int <a href="#virNodeGetInfo">virNodeGetInfo</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info);
int <a href="#virNodeGetMemoryParameters">virNodeGetMemoryParameters</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br/> int * nparams, <br/> unsigned int flags);
int <a href="#virNodeGetMemoryStats">virNodeGetMemoryStats</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> int cellNum, <br/> <a href="libvirt-libvirt.html#virNodeMemoryStatsPtr">virNodeMemoryStatsPtr</a> params, <br/> int * nparams, <br/> unsigned int flags);
@@ -1271,6 +1278,12 @@ The content of this structure is not made public by the API.
<a name="VIR_CONNECT_CLOSE_REASON_LAST">VIR_CONNECT_CLOSE_REASON_LAST</a> = 4
};
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectCompareCPUFlags">Enum </a>virConnectCompareCPUFlags</h3><pre class="programlisting">enum <a href="#virConnectCompareCPUFlags">virConnectCompareCPUFlags</a> {
<a name="VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE">VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE</a> = 1 /* treat incompatible CPUs as failure */
};
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectCredential">Structure </a>virConnectCredential</h3><pre class="programlisting">struct _virConnectCredential {
@@ -1426,6 +1439,7 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en"><h3><a name="virDomainBlockCommitFlags">Enum </a>virDomainBlockCommitFlags</h3><pre class="programlisting">enum <a href="#virDomainBlockCommitFlags">virDomainBlockCommitFlags</a> {
<a name="VIR_DOMAIN_BLOCK_COMMIT_SHALLOW">VIR_DOMAIN_BLOCK_COMMIT_SHALLOW</a> = 1 /* NULL base means next backing file, not whole chain */
<a name="VIR_DOMAIN_BLOCK_COMMIT_DELETE">VIR_DOMAIN_BLOCK_COMMIT_DELETE</a> = 2 /* Delete any files that are now invalid after their contents have been committed */
<a name="VIR_DOMAIN_BLOCK_COMMIT_ACTIVE">VIR_DOMAIN_BLOCK_COMMIT_ACTIVE</a> = 4 /* Allow a two-phase commit when top is the active layer */
};
</pre><p/>
</div>
@@ -1454,7 +1468,7 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virDomainBlockJobInfo">Structure </a>virDomainBlockJobInfo</h3><pre class="programlisting">struct _virDomainBlockJobInfo {
<a href="libvirt-libvirt.html#virDomainBlockJobType">virDomainBlockJobType</a> type
int type : <a href="libvirt-libvirt.html#virDomainBlockJobType">virDomainBlockJobType</a>
unsigned long bandwidth : The following fields provide an indication of block job progress. @cu
<a href="libvirt-libvirt.html#virDomainBlockJobCursor">virDomainBlockJobCursor</a> cur
<a href="libvirt-libvirt.html#virDomainBlockJobCursor">virDomainBlockJobCursor</a> end
@@ -1467,11 +1481,12 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virDomainBlockJobType">Enum </a>virDomainBlockJobType</h3><pre class="programlisting">enum <a href="#virDomainBlockJobType">virDomainBlockJobType</a> {
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN">VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN</a> = 0
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_PULL">VIR_DOMAIN_BLOCK_JOB_TYPE_PULL</a> = 1
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_COPY">VIR_DOMAIN_BLOCK_JOB_TYPE_COPY</a> = 2
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT">VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT</a> = 3
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_LAST">VIR_DOMAIN_BLOCK_JOB_TYPE_LAST</a> = 4
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN">VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN</a> = 0 /* Placeholder */
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_PULL">VIR_DOMAIN_BLOCK_JOB_TYPE_PULL</a> = 1 /* Block Pull (virDomainBlockPull, or virDomainBlockRebase without flags), job ends on completion */
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_COPY">VIR_DOMAIN_BLOCK_JOB_TYPE_COPY</a> = 2 /* Block Copy (virDomainBlockRebase with flags), job exists as long as mirroring is active */
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT">VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT</a> = 3 /* Block Commit (virDomainBlockCommit without flags), job ends on completion */
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT">VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT</a> = 4 /* Active Block Commit (virDomainBlockCommit with flags), job exists as long as sync is active */
<a name="VIR_DOMAIN_BLOCK_JOB_TYPE_LAST">VIR_DOMAIN_BLOCK_JOB_TYPE_LAST</a> = 5
};
</pre><p/>
</div>
@@ -1558,11 +1573,11 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virDomainCoreDumpFormat">Enum </a>virDomainCoreDumpFormat</h3><pre class="programlisting">enum <a href="#virDomainCoreDumpFormat">virDomainCoreDumpFormat</a> {
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_RAW">VIR_DOMAIN_CORE_DUMP_FORMAT_RAW</a> = 1 /* dump guest memory in raw format */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB">VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB</a> = 2 /* kdump-compressed format, with zlib compression */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO">VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO</a> = 3 /* kdump-compressed format, with lzo compression */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY">VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY</a> = 4 /* kdump-compressed format, with snappy compression */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_LAST">VIR_DOMAIN_CORE_DUMP_FORMAT_LAST</a> = 5 /* 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. */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_RAW">VIR_DOMAIN_CORE_DUMP_FORMAT_RAW</a> = 0 /* dump guest memory in raw format */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB">VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB</a> = 1 /* kdump-compressed format, with zlib compression */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO">VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO</a> = 2 /* kdump-compressed format, with lzo compression */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY">VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY</a> = 3 /* kdump-compressed format, with snappy compression */
<a name="VIR_DOMAIN_CORE_DUMP_FORMAT_LAST">VIR_DOMAIN_CORE_DUMP_FORMAT_LAST</a> = 4 /* 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. */
};
</pre><p/>
</div>
@@ -1649,10 +1664,10 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virDomainEventGraphicsAddressType">Enum </a>virDomainEventGraphicsAddressType</h3><pre class="programlisting">enum <a href="#virDomainEventGraphicsAddressType">virDomainEventGraphicsAddressType</a> {
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4</a> = 1 /* IPv4 address */
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6</a> = 2 /* IPv6 address */
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX</a> = 3 /* UNIX socket path */
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST</a> = 4
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4</a> = 0 /* IPv4 address */
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6</a> = 1 /* IPv6 address */
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX</a> = 2 /* UNIX socket path */
<a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST</a> = 3
};
</pre><p/>
</div>
@@ -1705,7 +1720,8 @@ The content of this structure is not made public by the API.
<a name="VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE">VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE</a> = 13 /* virConnectDomainEventBalloonChangeCallback */
<a name="VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK">VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK</a> = 14 /* virConnectDomainEventPMSuspendDiskCallback */
<a name="VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED">VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED</a> = 15 /* virConnectDomainEventDeviceRemovedCallback */
<a name="VIR_DOMAIN_EVENT_ID_LAST">VIR_DOMAIN_EVENT_ID_LAST</a> = 16 /* 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. */
<a name="VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2">VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2</a> = 16 /* virConnectDomainEventBlockJobCallback */
<a name="VIR_DOMAIN_EVENT_ID_LAST">VIR_DOMAIN_EVENT_ID_LAST</a> = 17 /* 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. */
};
</pre><p/>
</div>
@@ -2269,6 +2285,14 @@ The content of this structure is not made public by the API.
<a name="VIR_EVENT_HANDLE_HANGUP">VIR_EVENT_HANDLE_HANGUP</a> = 8
};
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virIPAddrType">Enum </a>virIPAddrType</h3><pre class="programlisting">enum <a href="#virIPAddrType">virIPAddrType</a> {
<a name="VIR_IP_ADDR_TYPE_IPV4">VIR_IP_ADDR_TYPE_IPV4</a> = 0
<a name="VIR_IP_ADDR_TYPE_IPV6">VIR_IP_ADDR_TYPE_IPV6</a> = 1
<a name="VIR_IP_ADDR_TYPE_LAST">VIR_IP_ADDR_TYPE_LAST</a> = 2
};
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterface">Structure </a>virInterface</h3><pre class="programlisting">struct _virInterface {
@@ -2340,6 +2364,24 @@ The content of this structure is not made public by the API.
The content of this structure is not made public by the API.
} virNetwork;
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkDHCPLease">Structure </a>virNetworkDHCPLease</h3><pre class="programlisting">struct _virNetworkDHCPLease {
char * iface : Network interface name
long long expirytime : Seconds since epoch
int type : <a href="libvirt-libvirt.html#virIPAddrType">virIPAddrType</a>
char * mac : MAC address
char * iaid : IAID
char * ipaddr : IP address
unsigned int prefix : IP address prefix
char * hostname : Hostname
char * clientid : Client ID or DUID
} virNetworkDHCPLease;
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkDHCPLeasePtr">Typedef </a>virNetworkDHCPLeasePtr</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkDHCPLease">virNetworkDHCPLease</a> * virNetworkDHCPLeasePtr;
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkEventID">Enum </a>virNetworkEventID</h3><pre class="programlisting">enum <a href="#virNetworkEventID">virNetworkEventID</a> {
@@ -2762,9 +2804,20 @@ VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE with virConnectDomainEventRegisterAny()</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>actual</tt></i>:</span></td><td>the new balloon level measured in kibibytes(blocks of 1024 bytes)</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventBlockJobCallback"/>Function type virConnectDomainEventBlockJobCallback</h3><pre class="programlisting">void virConnectDomainEventBlockJobCallback (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> const char * disk, <br/> int type, <br/> int status, <br/> void * opaque)<br/>
</pre><p>The callback signature to use when registering for an event of type
VIR_DOMAIN_EVENT_ID_BLOCK_JOB with virConnectDomainEventRegisterAny()</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>fully-qualified filename of the affected disk</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of block job (virDomainBlockJobType)</td></tr><tr><td><span class="term"><i><tt>status</tt></i>:</span></td><td>final status of the operation (virConnectDomainEventBlockJobStatus)</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div></div>
</pre><p>The string returned for @disk can be used in any of the libvirt API
that operate on a particular disk of the domain, and depends on what
event type was registered with virConnectDomainEventRegisterAny().
If the callback was registered using the older type of
VIR_DOMAIN_EVENT_ID_BLOCK_JOB, then @disk contains the absolute file
name of the host resource for the active layer of the disk; however,
this name is unstable (pivoting via block copy or active block commit
will change which file is active, giving a different name for the two
events associated with the same job) and cannot be relied on if the
active layer is associated with a network resource. If the callback
was registered using the newer type of VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2,
then @disk will contain the device target shorthand (the &lt;target
dev='...'/&gt; sub-element, such as "vda").</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>name associated with the affected disk (filename or target device, depending on how the callback was registered)</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of block job (virDomainBlockJobType)</td></tr><tr><td><span class="term"><i><tt>status</tt></i>:</span></td><td>status of the operation (virConnectDomainEventBlockJobStatus)</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventCallback"/>Function type virConnectDomainEventCallback</h3><pre class="programlisting">int virConnectDomainEventCallback (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> int event, <br/> int detail, <br/> void * opaque)<br/>
</pre><p>A callback function to be registered, and called when a domain event occurs</p>
@@ -2999,7 +3052,7 @@ after the corresponding operation completes.</p>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectCompareCPU"/>virConnectCompareCPU ()</h3><pre class="programlisting">int virConnectCompareCPU (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc, <br/> unsigned int flags)<br/>
</pre><p>Compares the given CPU description with the host CPU</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML describing the CPU to compare with host CPU</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>comparison result according to enum <a href="libvirt-libvirt.html#virCPUCompareResult">virCPUCompareResult</a></td></tr></tbody></table></div></div>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML describing the CPU to compare with host CPU</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virConnectCompareCPUFlags">virConnectCompareCPUFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>comparison result according to enum virCPUCompareResult. If <a href="libvirt-libvirt.html#VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE">VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE</a> is used and @xmlDesc CPU is incompatible with host CPU, this function will return <a href="libvirt-libvirt.html#VIR_CPU_COMPARE_ERROR">VIR_CPU_COMPARE_ERROR</a> (instead of VIR_CPU_COMPARE_INCOMPATIBLE) and the error will use the <a href="libvirt-virterror.html#VIR_ERR_CPU_INCOMPATIBLE">VIR_ERR_CPU_INCOMPATIBLE</a> code with a message providing more details about the incompatibility.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventDeregister"/>virConnectDomainEventDeregister ()</h3><pre class="programlisting">int virConnectDomainEventDeregister (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb)<br/>
</pre><p>Removes a callback previously registered with the
@@ -3636,17 +3689,32 @@ raised to indicate the final status, and the job no longer exists. If
the job is aborted, it is up to the hypervisor whether starting a new
job will resume from the same point, or start over.

As a special case, if @top is the active image (or NULL), and @flags
includes VIR_DOMAIN_BLOCK_COMMIT_ACTIVE, the block job will have a type
of VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT, and operates in two phases.
In the first phase, the contents are being committed into @base, and the
job can only be canceled. The job transitions to the second phase when
the job info states cur == end, and remains alive to keep all further
changes to @top synchronized into @base; an event with status
VIR_DOMAIN_BLOCK_JOB_READY is also issued to mark the job transition.
Once in the second phase, the user must choose whether to cancel the job
(keeping @top as the active image, but now containing only the changes
since the time the job ended) or to pivot the job (adjusting to @base as
the active image, and invalidating @top).

Be aware that this command may invalidate files even if it is aborted;
the user is cautioned against relying on the contents of invalidated
intermediate files such as @top without manually rebasing those files
to use a backing file of a read-only copy of @base prior to the point
where the commit operation was started (although such a rebase cannot
be safely done until the commit has successfully completed). However,
the domain itself will not have any issues; the active layer remains
valid throughout the entire commit operation. As a convenience,
if @flags contains VIR_DOMAIN_BLOCK_COMMIT_DELETE, this command will
unlink all files that were invalidated, after the commit successfully
completes.
intermediate files such as @top (when @top is not the active image)
without manually rebasing those files to use a backing file of a
read-only copy of @base prior to the point where the commit operation
was started (and such a rebase cannot be safely done until the commit
has successfully completed). However, the domain itself will not have
any issues; the active layer remains valid throughout the entire commit
operation.

Some hypervisors may support a shortcut where if @flags contains
VIR_DOMAIN_BLOCK_COMMIT_DELETE, then this command will unlink all files
that were invalidated, after the commit successfully completes.

By default, if @base is NULL, the commit target will be the bottom of
the backing chain; if @flags contains VIR_DOMAIN_BLOCK_COMMIT_SHALLOW,
@@ -3654,8 +3722,9 @@ then the immediate backing file of @top will be used instead. If @top
is NULL, the active image at the top of the chain will be used. Some
hypervisors place restrictions on how much can be committed, and might
fail if @base is not the immediate backing file of @top, or if @top is
the active layer in use by a running domain, or if @top is not the
top-most file; restrictions may differ for online vs. offline domains.
the active layer in use by a running domain but @flags did not include
VIR_DOMAIN_BLOCK_COMMIT_ACTIVE, or if @top is not the top-most file;
restrictions may differ for online vs. offline domains.

The @disk parameter is either an unambiguous source name of the
block device (the &lt;source file='...'/&gt; sub-element, such as
@@ -3705,13 +3774,16 @@ to pick up from where it left off.

If the current block job for @disk is VIR_DOMAIN_BLOCK_JOB_TYPE_COPY, then
the default is to abort the mirroring and revert to the source disk;
adding @flags of <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT">VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT</a> causes this call to
fail with <a href="libvirt-virterror.html#VIR_ERR_BLOCK_COPY_ACTIVE">VIR_ERR_BLOCK_COPY_ACTIVE</a> if the copy is not fully populated,
otherwise it will swap the disk over to the copy to end the mirroring. An
event will be issued when the job is ended, and it is possible to use
VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC to control whether this command waits
for the completion of the job. Restarting this job requires starting
over from the beginning of the first phase.</p>
likewise, if the current job is VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT,
the default is to abort without changing the active layer of @disk.
Adding @flags of <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT">VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT</a> causes this call to
fail with <a href="libvirt-virterror.html#VIR_ERR_BLOCK_COPY_ACTIVE">VIR_ERR_BLOCK_COPY_ACTIVE</a> if the copy or commit is not yet
ready; otherwise it will swap the disk over to the new active image
to end the mirroring or active commit. An event will be issued when the
job is ended, and it is possible to use VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC
to control whether this command waits for the completion of the job.
Restarting a copy or active commit job requires starting over from the
beginning of the first phase.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainBlockJobAbortFlags">virDomainBlockJobAbortFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when successful.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virDomainBlockJobSetSpeed"/>virDomainBlockJobSetSpeed ()</h3><pre class="programlisting">int virDomainBlockJobSetSpeed (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> const char * disk, <br/> unsigned long bandwidth, <br/> unsigned int flags)<br/>
@@ -6618,6 +6690,10 @@ moves from the defined to the running networks pools.</p>
</pre><p>Create and start a new virtual network, based on an XML description
similar to the one returned by virNetworkGetXMLDesc()</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>an XML description of the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkDHCPLeaseFree"/>virNetworkDHCPLeaseFree ()</h3><pre class="programlisting">void virNetworkDHCPLeaseFree (<a href="libvirt-libvirt.html#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a> lease)<br/>
</pre><p>Frees all the memory occupied by @lease.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>lease</tt></i>:</span></td><td>pointer to a leases object</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkDefineXML"/>virNetworkDefineXML ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkDefineXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xml)<br/>
</pre><p>Define a network, but does not create it</p>
@@ -6655,6 +6731,34 @@ WARNING: When writing libvirt bindings in other languages, do
not use this function. Instead, store the connection and
the network object together.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>net</tt></i>:</span></td><td>pointer to a network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkGetDHCPLeases"/>virNetworkGetDHCPLeases ()</h3><pre class="programlisting">int virNetworkGetDHCPLeases (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> const char * mac, <br/> <a href="libvirt-libvirt.html#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a> ** leases, <br/> unsigned int flags)<br/>
</pre><p>For DHCPv4, the information returned:
- Network Interface Name
- Expiry Time
- MAC address
- IAID (NULL)
- IPv4 address (with type and prefix)
- Hostname (can be NULL)
- Client ID (can be NULL)

For DHCPv6, the information returned:
- Network Interface Name
- Expiry Time
- MAC address
- IAID (can be NULL, only in rare cases)
- IPv6 address (with type and prefix)
- Hostname (can be NULL)
- Client DUID

Note: @mac, @iaid, @ipaddr, @clientid are in ASCII form, not raw bytes.
Note: @expirytime can 0, in case the lease is for infinite time.

The API fetches leases info of guests in the specified network. If the
optional parameter @mac is specified, the returned list will contain only
lease info about a specific guest interface with @mac. There can be
multiple leases for a single @mac because this API supports DHCPv6 too.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>Pointer to network object</td></tr><tr><td><span class="term"><i><tt>mac</tt></i>:</span></td><td>Optional ASCII formatted MAC address of an interface</td></tr><tr><td><span class="term"><i><tt>leases</tt></i>:</span></td><td>Pointer to a variable to store the array containing details on obtained leases, or NULL if the list is not required (just returns number of leases).</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>Extra flags, not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of leases found or -1 and sets @leases to NULL in case of error. On success, the array stored into @leases is guaranteed to have an extra allocated element set to NULL but not included in the return count, to make iteration easier. The caller is responsible for calling virNetworkDHCPLeaseFree() on each array element, then calling free() on @leases. See also virNetworkGetDHCPLeasesForMAC() as a convenience for filtering the list to a single MAC address. Example of usage: <a href="libvirt-libvirt.html#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a> *leases = NULL; <a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network = ... obtain a network pointer here ...; size_t i; int nleases; unsigned int flags = 0; nleases = virNetworkGetDHCPLeases(network, NULL, &amp;leases, flags); if (nleases &lt; 0) error(); ... do something with returned values, for example: for (i = 0; i &lt; nleases; i++) { <a href="libvirt-libvirt.html#virNetworkDHCPLeasePtr">virNetworkDHCPLeasePtr</a> lease = leases[i]; printf("Time(epoch): %lu, MAC address: %s, " "IP address: %s, Hostname: %s, ClientID: %s\n", lease-&gt;expirytime, lease-&gt;mac, lease-&gt;ipaddr, lease-&gt;hostname, lease-&gt;clientid); virNetworkDHCPLeaseFree(leases[i]); } free(leases);</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkGetName"/>virNetworkGetName ()</h3><pre class="programlisting">const char * virNetworkGetName (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)<br/>
</pre><p>Get the public name for that network</p>
@@ -6910,6 +7014,53 @@ whichever is smaller.</p>
Note: most libvirt APIs provide memory sizes in kibibytes, but in this
function the returned value is in bytes. Divide by 1024 as necessary.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the available free memory in bytes or 0 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNodeGetFreePages"/>virNodeGetFreePages ()</h3><pre class="programlisting">int virNodeGetFreePages (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned int npages, <br/> unsigned int * pages, <br/> int startCell, <br/> unsigned int cellCount, <br/> unsigned long long * counts, <br/> unsigned int flags)<br/>
</pre><p>This calls queries the host system on free pages of
specified size. Ont the input, @pages is expected to be
filled with pages that caller is interested in (the size
unit is kibibytes, so e.g. pass 2048 for 2MB), then @startcell
refers to the first NUMA node that info should be collected
from, and @cellcount tells how many consecutive nodes should
be queried. On the function output, @counts is filled with
desired information, where items are grouped by NUMA node.
So from @counts[0] till @counts[@npages - 1] you'll find count
for the first node (@startcell), then from @counts[@npages]
till @count[2 * @npages - 1] you'll find info for the
(@startcell + 1) node, and so on. It's callers responsibility
to allocate the @counts array.

Example how to use this API:

unsigned int pages[] = { 4, 2048, 1048576}
unsigned int npages = ARRAY_CARDINALITY(pages);
int startcell = 0;
unsigned int cellcount = 2;

unsigned long long counts = malloc(sizeof(long long) * npages * cellcount);

virNodeGetFreePages(conn, pages, npages,
startcell, cellcount, counts, 0);

for (i = 0 ; i &lt; cellcount ; i++) {
fprintf(stdout, "Cell %d\n", startcell + i);
for (j = 0 ; j &lt; npages ; j++) {
fprintf(stdout, " Page size=%d count=%d bytes=%llu\n",
pages[j], counts[(i * npages) + j],
pages[j] * counts[(i * npages) + j]);
}
}

This little code snippet will produce something like this:
Cell 0
Page size=4096 count=300 bytes=1228800
Page size=2097152 count=0 bytes=0
Page size=1073741824 count=1 bytes=1073741824
Cell 1
Page size=4096 count=0 bytes=0
Page size=2097152 count=20 bytes=41943040
Page size=1073741824 count=0 bytes=0</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>npages</tt></i>:</span></td><td>number of items in the @pages array</td></tr><tr><td><span class="term"><i><tt>pages</tt></i>:</span></td><td>page sizes to query</td></tr><tr><td><span class="term"><i><tt>startCell</tt></i>:</span></td><td>index of first cell to return free pages info on.</td></tr><tr><td><span class="term"><i><tt>cellCount</tt></i>:</span></td><td>maximum number of cells for which free pages information can be returned.</td></tr><tr><td><span class="term"><i><tt>counts</tt></i>:</span></td><td>returned counts of free pages</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of entries filled in @counts or -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNodeGetInfo"/>virNodeGetInfo ()</h3><pre class="programlisting">int virNodeGetInfo (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info)<br/>
</pre><p>Extract hardware information about the node.</p>


+ 1
- 0
docs/devhelp/libvirt-virterror.html View File

@@ -248,6 +248,7 @@ void <a href="#virSetErrorFunc">virSetErrorFunc</a> (void * userData, <br/>
<a name="VIR_ERR_ACCESS_DENIED">VIR_ERR_ACCESS_DENIED</a> = 88 /* operation on the object/resource was denied */
<a name="VIR_ERR_DBUS_SERVICE">VIR_ERR_DBUS_SERVICE</a> = 89 /* error from a dbus service */
<a name="VIR_ERR_STORAGE_VOL_EXIST">VIR_ERR_STORAGE_VOL_EXIST</a> = 90 /* the storage vol already exists */
<a name="VIR_ERR_CPU_INCOMPATIBLE">VIR_ERR_CPU_INCOMPATIBLE</a> = 91 /* given CPU is incompatible with host CP */
};
</pre><p/>
</div>


+ 15
- 0
docs/devhelp/libvirt.devhelp View File

@@ -125,6 +125,7 @@
<function name="VIR_CONNECT_CLOSE_REASON_ERROR" link="libvirt-libvirt.html#VIR_CONNECT_CLOSE_REASON_ERROR"/>
<function name="VIR_CONNECT_CLOSE_REASON_KEEPALIVE" link="libvirt-libvirt.html#VIR_CONNECT_CLOSE_REASON_KEEPALIVE"/>
<function name="VIR_CONNECT_CLOSE_REASON_LAST" link="libvirt-libvirt.html#VIR_CONNECT_CLOSE_REASON_LAST"/>
<function name="VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE" link="libvirt-libvirt.html#VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE"/>
<function name="VIR_CONNECT_LIST_DOMAINS_ACTIVE" link="libvirt-libvirt.html#VIR_CONNECT_LIST_DOMAINS_ACTIVE"/>
<function name="VIR_CONNECT_LIST_DOMAINS_AUTOSTART" link="libvirt-libvirt.html#VIR_CONNECT_LIST_DOMAINS_AUTOSTART"/>
<function name="VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT" link="libvirt-libvirt.html#VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT"/>
@@ -209,6 +210,7 @@
<function name="VIR_DOMAIN_BLOCKED" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCKED"/>
<function name="VIR_DOMAIN_BLOCKED_LAST" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCKED_LAST"/>
<function name="VIR_DOMAIN_BLOCKED_UNKNOWN" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCKED_UNKNOWN"/>
<function name="VIR_DOMAIN_BLOCK_COMMIT_ACTIVE" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_COMMIT_ACTIVE"/>
<function name="VIR_DOMAIN_BLOCK_COMMIT_DELETE" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_COMMIT_DELETE"/>
<function name="VIR_DOMAIN_BLOCK_COMMIT_SHALLOW" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_COMMIT_SHALLOW"/>
<function name="VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC"/>
@@ -218,6 +220,7 @@
<function name="VIR_DOMAIN_BLOCK_JOB_FAILED" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_FAILED"/>
<function name="VIR_DOMAIN_BLOCK_JOB_LAST" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_LAST"/>
<function name="VIR_DOMAIN_BLOCK_JOB_READY" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_READY"/>
<function name="VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT"/>
<function name="VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT"/>
<function name="VIR_DOMAIN_BLOCK_JOB_TYPE_COPY" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_COPY"/>
<function name="VIR_DOMAIN_BLOCK_JOB_TYPE_LAST" link="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_LAST"/>
@@ -275,6 +278,7 @@
<function name="VIR_DOMAIN_EVENT_GRAPHICS_LAST" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_GRAPHICS_LAST"/>
<function name="VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE"/>
<function name="VIR_DOMAIN_EVENT_ID_BLOCK_JOB" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_BLOCK_JOB"/>
<function name="VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2"/>
<function name="VIR_DOMAIN_EVENT_ID_CONTROL_ERROR" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_CONTROL_ERROR"/>
<function name="VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED"/>
<function name="VIR_DOMAIN_EVENT_ID_DISK_CHANGE" link="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_DISK_CHANGE"/>
@@ -574,6 +578,7 @@
<function name="VIR_ERR_CALL_FAILED" link="libvirt-virterror.html#VIR_ERR_CALL_FAILED"/>
<function name="VIR_ERR_CONFIG_UNSUPPORTED" link="libvirt-virterror.html#VIR_ERR_CONFIG_UNSUPPORTED"/>
<function name="VIR_ERR_CONF_SYNTAX" link="libvirt-virterror.html#VIR_ERR_CONF_SYNTAX"/>
<function name="VIR_ERR_CPU_INCOMPATIBLE" link="libvirt-virterror.html#VIR_ERR_CPU_INCOMPATIBLE"/>
<function name="VIR_ERR_DBUS_SERVICE" link="libvirt-virterror.html#VIR_ERR_DBUS_SERVICE"/>
<function name="VIR_ERR_DOMAIN_LAST" link="libvirt-virterror.html#VIR_ERR_DOMAIN_LAST"/>
<function name="VIR_ERR_DOM_EXIST" link="libvirt-virterror.html#VIR_ERR_DOM_EXIST"/>
@@ -718,6 +723,9 @@
<function name="VIR_FROM_XEN_INOTIFY" link="libvirt-virterror.html#VIR_FROM_XEN_INOTIFY"/>
<function name="VIR_FROM_XML" link="libvirt-virterror.html#VIR_FROM_XML"/>
<function name="VIR_INTERFACE_XML_INACTIVE" link="libvirt-libvirt.html#VIR_INTERFACE_XML_INACTIVE"/>
<function name="VIR_IP_ADDR_TYPE_IPV4" link="libvirt-libvirt.html#VIR_IP_ADDR_TYPE_IPV4"/>
<function name="VIR_IP_ADDR_TYPE_IPV6" link="libvirt-libvirt.html#VIR_IP_ADDR_TYPE_IPV6"/>
<function name="VIR_IP_ADDR_TYPE_LAST" link="libvirt-libvirt.html#VIR_IP_ADDR_TYPE_LAST"/>
<function name="VIR_KEYCODE_SET_ATSET1" link="libvirt-libvirt.html#VIR_KEYCODE_SET_ATSET1"/>
<function name="VIR_KEYCODE_SET_ATSET2" link="libvirt-libvirt.html#VIR_KEYCODE_SET_ATSET2"/>
<function name="VIR_KEYCODE_SET_ATSET3" link="libvirt-libvirt.html#VIR_KEYCODE_SET_ATSET3"/>
@@ -853,6 +861,7 @@
<function name="virConnectAuthPtr" link="libvirt-libvirt.html#virConnectAuthPtr"/>
<function name="virConnectBaselineCPUFlags" link="libvirt-libvirt.html#virConnectBaselineCPUFlags"/>
<function name="virConnectCloseReason" link="libvirt-libvirt.html#virConnectCloseReason"/>
<function name="virConnectCompareCPUFlags" link="libvirt-libvirt.html#virConnectCompareCPUFlags"/>
<function name="virConnectCredentialPtr" link="libvirt-libvirt.html#virConnectCredentialPtr"/>
<function name="virConnectCredentialType" link="libvirt-libvirt.html#virConnectCredentialType"/>
<function name="virConnectDomainEventBlockJobStatus" link="libvirt-libvirt.html#virConnectDomainEventBlockJobStatus"/>
@@ -946,12 +955,14 @@
<function name="virErrorNumber" link="libvirt-virterror.html#virErrorNumber"/>
<function name="virErrorPtr" link="libvirt-virterror.html#virErrorPtr"/>
<function name="virEventHandleType" link="libvirt-libvirt.html#virEventHandleType"/>
<function name="virIPAddrType" link="libvirt-libvirt.html#virIPAddrType"/>
<function name="virInterfacePtr" link="libvirt-libvirt.html#virInterfacePtr"/>
<function name="virInterfaceXMLFlags" link="libvirt-libvirt.html#virInterfaceXMLFlags"/>
<function name="virKeycodeSet" link="libvirt-libvirt.html#virKeycodeSet"/>
<function name="virMemoryParameterPtr" link="libvirt-libvirt.html#virMemoryParameterPtr"/>
<function name="virMemoryParameterType" link="libvirt-libvirt.html#virMemoryParameterType"/>
<function name="virNWFilterPtr" link="libvirt-libvirt.html#virNWFilterPtr"/>
<function name="virNetworkDHCPLeasePtr" link="libvirt-libvirt.html#virNetworkDHCPLeasePtr"/>
<function name="virNetworkEventID" link="libvirt-libvirt.html#virNetworkEventID"/>
<function name="virNetworkEventLifecycleType" link="libvirt-libvirt.html#virNetworkEventLifecycleType"/>
<function name="virNetworkPtr" link="libvirt-libvirt.html#virNetworkPtr"/>
@@ -1016,6 +1027,7 @@
<function name="virMemoryParameter" link="libvirt-libvirt.html#virMemoryParameter"/>
<function name="virNWFilter" link="libvirt-libvirt.html#virNWFilter"/>
<function name="virNetwork" link="libvirt-libvirt.html#virNetwork"/>
<function name="virNetworkDHCPLease" link="libvirt-libvirt.html#virNetworkDHCPLease"/>
<function name="virNodeCPUStats" link="libvirt-libvirt.html#virNodeCPUStats"/>
<function name="virNodeDevice" link="libvirt-libvirt.html#virNodeDevice"/>
<function name="virNodeInfo" link="libvirt-libvirt.html#virNodeInfo"/>
@@ -1325,12 +1337,14 @@
<function name="virNWFilterUndefine ()" link="libvirt-libvirt.html#virNWFilterUndefine"/>
<function name="virNetworkCreate ()" link="libvirt-libvirt.html#virNetworkCreate"/>
<function name="virNetworkCreateXML ()" link="libvirt-libvirt.html#virNetworkCreateXML"/>
<function name="virNetworkDHCPLeaseFree ()" link="libvirt-libvirt.html#virNetworkDHCPLeaseFree"/>
<function name="virNetworkDefineXML ()" link="libvirt-libvirt.html#virNetworkDefineXML"/>
<function name="virNetworkDestroy ()" link="libvirt-libvirt.html#virNetworkDestroy"/>
<function name="virNetworkFree ()" link="libvirt-libvirt.html#virNetworkFree"/>
<function name="virNetworkGetAutostart ()" link="libvirt-libvirt.html#virNetworkGetAutostart"/>
<function name="virNetworkGetBridgeName ()" link="libvirt-libvirt.html#virNetworkGetBridgeName"/>
<function name="virNetworkGetConnect ()" link="libvirt-libvirt.html#virNetworkGetConnect"/>
<function name="virNetworkGetDHCPLeases ()" link="libvirt-libvirt.html#virNetworkGetDHCPLeases"/>
<function name="virNetworkGetName ()" link="libvirt-libvirt.html#virNetworkGetName"/>
<function name="virNetworkGetUUID ()" link="libvirt-libvirt.html#virNetworkGetUUID"/>
<function name="virNetworkGetUUIDString ()" link="libvirt-libvirt.html#virNetworkGetUUIDString"/>
@@ -1363,6 +1377,7 @@
<function name="virNodeGetCPUStats ()" link="libvirt-libvirt.html#virNodeGetCPUStats"/>
<function name="virNodeGetCellsFreeMemory ()" link="libvirt-libvirt.html#virNodeGetCellsFreeMemory"/>
<function name="virNodeGetFreeMemory ()" link="libvirt-libvirt.html#virNodeGetFreeMemory"/>
<function name="virNodeGetFreePages ()" link="libvirt-libvirt.html#virNodeGetFreePages"/>
<function name="virNodeGetInfo ()" link="libvirt-libvirt.html#virNodeGetInfo"/>
<function name="virNodeGetMemoryParameters ()" link="libvirt-libvirt.html#virNodeGetMemoryParameters"/>
<function name="virNodeGetMemoryStats ()" link="libvirt-libvirt.html#virNodeGetMemoryStats"/>


+ 62
- 34
docs/formatcaps.html View File

@@ -158,18 +158,70 @@
</div>
<div id="content">
<h1>Driver capabilities XML format</h1>
<p>As new virtualization engine support gets added to libvirt, and to handle
cases like QEmu supporting a variety of emulations, a query interface has
been added in 0.2.1 allowing to list the set of supported virtualization
capabilities on the host:</p>
<ul><li>
<a href="#elements">Element and attribute overview</a>
<ul><li>
<a href="#elementHost">Host capabilities</a>
</li><li>
<a href="#elementGuest">Guest capabilities</a>
</li><li>
<a href="#elementExamples">Examples</a>
</li></ul>
</li></ul>