1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-09-19 01:44:56 +03:00

Compare commits

..

11 Commits

Author SHA1 Message Date
Ján Tomko
f5ace9c05d api: disallow virConnect*HypervisorCPU on read-only connections
These APIs can be used to execute arbitrary emulators.
Forbid them on read-only connections.

Fixes: CVE-2019-10168
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit bf6c2830b6)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-06-24 09:55:54 +02:00
Ján Tomko
5441f05a42 api: disallow virConnectGetDomainCapabilities on read-only connections
This API can be used to execute arbitrary emulators.
Forbid it on read-only connections.

Fixes: CVE-2019-10167
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 8afa68bac0)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-06-24 09:55:54 +02:00
Ján Tomko
6da721ea37 api: disallow virDomainManagedSaveDefineXML on read-only connections
The virDomainManagedSaveDefineXML can be used to alter the domain's
config used for managedsave or even execute arbitrary emulator binaries.
Forbid it on read-only connections.

Fixes: CVE-2019-10166
Reported-by: Matthias Gerstner <mgerstner@suse.de>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit db0b78457f)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-06-24 09:55:54 +02:00
Ján Tomko
3352c8af26 api: disallow virDomainSaveImageGetXMLDesc on read-only connections
The virDomainSaveImageGetXMLDesc API is taking a path parameter,
which can point to any path on the system. This file will then be
read and parsed by libvirtd running with root privileges.

Forbid it on read-only connections.

Fixes: CVE-2019-10161
Reported-by: Matthias Gerstner <mgerstner@suse.de>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit aed6a032ce)
Signed-off-by: Ján Tomko <jtomko@redhat.com>

Conflicts:
  src/libvirt-domain.c
  src/remote/remote_protocol.x

Upstream commit 12a51f372 which introduced the VIR_DOMAIN_SAVE_IMAGE_XML_SECURE
alias for VIR_DOMAIN_XML_SECURE is not backported.
Just skip the commit since we now disallow the whole API on read-only
connections, regardless of the flag.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-06-24 09:55:53 +02:00
Daniel P. Berrangé
030fdf5725 logging: restrict sockets to mode 0600
The virtlogd daemon's only intended client is the libvirtd daemon. As
such it should never allow clients from other user accounts to connect.
The code already enforces this and drops clients from other UIDs, but
we can get earlier (and thus stronger) protection against DoS by setting
the socket permissions to 0600

Fixes CVE-2019-10132

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit e37bd65f99)
2019-05-21 13:26:36 +01:00
Daniel P. Berrangé
54005b84b0 locking: restrict sockets to mode 0600
The virtlockd daemon's only intended client is the libvirtd daemon. As
such it should never allow clients from other user accounts to connect.
The code already enforces this and drops clients from other UIDs, but
we can get earlier (and thus stronger) protection against DoS by setting
the socket permissions to 0600

Fixes CVE-2019-10132

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit f111e09468)
2019-05-21 13:26:36 +01:00
Daniel P. Berrangé
dfd22fc50f admin: reject clients unless their UID matches the current UID
The admin protocol RPC messages are only intended for use by the user
running the daemon. As such they should not be allowed for any client
UID that does not match the server UID.

Fixes CVE-2019-10132

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 96f41cd765)
2019-05-21 13:26:36 +01:00
Jiri Denemark
c811c618c1 cpu_map: Define md-clear CPUID bit
CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091

The bit is set when microcode provides the mechanism to invoke a flush
of various exploitable CPU buffers by invoking the VERW instruction.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 538d873571)

Conflicts:
        src/cpu_map/x86_features.xml
            - missing pconfig feature

        tests/cputestdata/x86_64-cpuid-Xeon-Platinum-8268-guest.xml
        tests/cputestdata/x86_64-cpuid-Xeon-Platinum-8268-host.xml
            - test data missing downstream

        tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
        tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
            - intel-pt feature is missing
	    - stibp feature is missing

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-05-14 19:42:27 +01:00
Jiri Denemark
b15a3c9f9b cputest: Add data for Intel(R) Xeon(R) CPU E3-1225 v5
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 5cd9db3ac1)

CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091

Conflicts:
	tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
	tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
            - intel-pt feature is missing
	    - stibp feature is missing

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-05-14 19:32:01 +01:00
Jiri Denemark
d606ac1130 qemu: Don't cache microcode version
My earlier commit be46f61326 was incomplete. It removed caching of
microcode version in the CPU driver, which means the capabilities XML
will see the correct microcode version. But it is also cached in the
QEMU capabilities cache where it is used to detect whether we need to
reprobe QEMU. By missing the second place, the original commit
be46f61326 made the situation even worse since libvirt would report
correct microcode version while still using the old host CPU model
(visible in domain capabilities XML).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 673c62a3b7)

Conflicts:
        src/qemu/qemu_capabilities.c
            - virQEMUCapsCacheLookupByArch refactoring (commits
              7948ad4129 and 1a3de67001) are missing

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-05-14 11:28:31 +01:00
Jiri Denemark
33998cdd47 cpu_x86: Do not cache microcode version
The microcode version checks are used to invalidate cached CPU data we
get from QEMU. To minimize /proc/cpuinfo parsing the microcode version
was only read when libvirtd started and cached for the daemon's
lifetime. However, the CPU microcode can change anytime (updating the
microcode package can automatically upload it to the CPU) and we need to
stop caching it to avoid using stale CPU model data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit be46f61326)
2019-05-14 11:05:51 +01:00
3528 changed files with 176435 additions and 380695 deletions

1
.ctags
View File

@@ -3,4 +3,3 @@
--exclude=*.html
--exclude=*.html.in
--langmap=c:+.h.in
--c-kinds=+p

View File

@@ -1 +0,0 @@
../.ctags

99
.gitignore vendored
View File

@@ -11,6 +11,7 @@
*.gcov
*.html
*.i
*.init
*.la
*.lo
*.loT
@@ -37,6 +38,7 @@
.sc-start-sc_*
.ycm_extra_conf.py
/AUTHORS
/ChangeLog
/GNUmakefile
/INSTALL
/NEWS
@@ -44,7 +46,6 @@
/autom4te.cache
/build-aux/*
/build/
/ci/scratch/
/confdefs.h
/config.cache
/config.guess
@@ -67,22 +68,23 @@
/docs/libvirt-qemu-*.xml
/docs/libvirt-refs.xml
/docs/news.html.in
/docs/search.php
/docs/todo.html.in
/examples/c/admin/client_close
/examples/c/admin/client_info
/examples/c/admin/client_limits
/examples/c/admin/list_clients
/examples/c/admin/list_servers
/examples/c/admin/logging
/examples/c/admin/threadpool_params
/examples/c/domain/dommigrate
/examples/c/domain/domtop
/examples/c/domain/info1
/examples/c/domain/rename
/examples/c/domain/suspend
/examples/c/misc/event-test
/examples/c/misc/hellolibvirt
/examples/c/misc/openauth
/examples/admin/client_close
/examples/admin/client_info
/examples/admin/client_limits
/examples/admin/list_clients
/examples/admin/list_servers
/examples/admin/logging
/examples/admin/threadpool_params
/examples/object-events/event-test
/examples/dominfo/info1
/examples/domsuspend/suspend
/examples/dommigrate/dommigrate
/examples/domtop/domtop
/examples/hellolibvirt/hellolibvirt
/examples/openauth/openauth
/examples/rename/rename
/gnulib/lib/*
/gnulib/m4/*
/gnulib/tests/*
@@ -118,14 +120,8 @@
/src/admin/admin_client.h
/src/admin/admin_protocol.[ch]
/src/admin/admin_server_dispatch_stubs.h
/src/bhyve/test_virtbhyved.aug
/src/bhyve/virtbhyved.aug
/src/bhyve/virtbhyved.conf
/src/esx/*.generated.*
/src/hyperv/*.generated.*
/src/interface/test_virtinterfaced.aug
/src/interface/virtinterfaced.aug
/src/interface/virtinterfaced.conf
/src/libvirt*.def
/src/libvirt.syms
/src/libvirt_access.syms
@@ -141,10 +137,6 @@
/src/libvirt_lxc
/src/libvirtd
/src/libvirtd*.logrotate
/src/libxl/test_libvirtd_libxl.aug
/src/libxl/test_virtxend.aug
/src/libxl/virtxend.aug
/src/libxl/virtxend.conf
/src/locking/libxl-lockd.conf
/src/locking/libxl-sanlock.conf
/src/locking/lock_daemon_dispatch_stubs.h
@@ -152,76 +144,29 @@
/src/locking/qemu-lockd.conf
/src/locking/qemu-sanlock.conf
/src/locking/test_libvirt_sanlock.aug
/src/locking/test_libvirt_lockd.aug
/src/locking/test_virtlockd.aug
/src/logging/log_daemon_dispatch_stubs.h
/src/logging/log_protocol.[ch]
/src/logging/test_virtlogd.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/test_libvirtd_lxc.aug
/src/lxc/test_virtlxcd.aug
/src/lxc/virtlxcd.aug
/src/lxc/virtlxcd.conf
/src/network/test_virtnetworkd.aug
/src/network/virtnetworkd.aug
/src/network/virtnetworkd.conf
/src/node_device/test_virtnodedevd.aug
/src/node_device/virtnodedevd.aug
/src/node_device/virtnodedevd.conf
/src/nwfilter/test_virtnwfilterd.aug
/src/nwfilter/virtnwfilterd.aug
/src/nwfilter/virtnwfilterd.conf
/src/qemu/test_libvirtd_qemu.aug
/src/qemu/test_virtqemud.aug
/src/qemu/virtqemud.aug
/src/qemu/virtqemud.conf
/src/remote/*_client_bodies.h
/src/remote/*_protocol.[ch]
/src/remote/*_stubs.h
/src/remote/libvirtd.aug
/src/remote/libvirtd.conf
/src/remote/test_libvirtd.aug
/src/remote/test_virtproxyd.aug
/src/remote/virtproxyd.aug
/src/remote/virtproxyd.conf
/src/rpc/virkeepaliveprotocol.[ch]
/src/rpc/virnetprotocol.[ch]
/src/secret/test_virtsecretd.aug
/src/secret/virtsecretd.aug
/src/secret/virtsecretd.conf
/src/storage/test_virtstoraged.aug
/src/storage/virtstoraged.aug
/src/storage/virtstoraged.conf
/src/test*.aug
/src/test_libvirt*.aug
/src/test_virtlockd.aug
/src/test_virtlogd.aug
/src/util/virkeycodetable*.h
/src/util/virkeynametable*.h
/src/vbox/test_virtvboxd.aug
/src/vbox/virtvboxd.aug
/src/vbox/virtvboxd.conf
/src/virt-aa-helper
/src/virtbhyved
/src/virtinterfaced
/src/virtxend
/src/virtlockd
/src/virtlogd
/src/virtlxcd
/src/virtnetworkd
/src/virtnodedevd
/src/virtnwfilterd
/src/virtproxyd
/src/virtqemud
/src/virtsecretd
/src/virtstoraged
/src/virtvboxd
/src/virtvzd
/src/virt-guest-shutdown.target
/src/vz/test_virtvzd.aug
/src/vz/virtvzd.aug
/src/vz/virtvzd.conf
/tests/*.log
/tests/*.pid
/tests/*.trs
@@ -240,12 +185,12 @@
/tests/test_conf
/tools/libvirt-guests.sh
/tools/virt-login-shell
/tools/virt-login-shell-helper
/tools/virsh
/tools/virsh-*-edit.c
/tools/virt-admin
/tools/virt-*-validate
/tools/virt-sanlock-cleanup
/tools/wireshark/src/plugin.c
/tools/wireshark/src/libvirt
/update.log
GPATH

View File

@@ -1,46 +0,0 @@
.job_template: &job_definition
script:
- mkdir build
- cd build
- ../autogen.sh $CONFIGURE_OPTS || (cat config.log && exit 1)
- make -j $(getconf _NPROCESSORS_ONLN)
# We could run every arch on every versions, but it is a little
# overkill. Instead we split jobs evenly across 9, 10 and sid
# to achieve reasonable cross-coverage.
debian-9-cross-armv6l:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-9-cross-armv6l:latest
debian-9-cross-mips64el:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-9-cross-mips64el:latest
debian-9-cross-mipsel:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-9-cross-mipsel:latest
debian-10-cross-aarch64:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-10-cross-aarch64:latest
debian-10-cross-ppc64le:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-10-cross-ppc64le:latest
debian-10-cross-s390x:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-10-cross-s390x:latest
debian-sid-cross-armv7l:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-sid-cross-armv7l:latest
debian-sid-cross-i686:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-sid-cross-i686:latest
debian-sid-cross-mips:
<<: *job_definition
image: quay.io/libvirt/buildenv-libvirt-debian-sid-cross-mips:latest

Submodule .gnulib updated: 1f6fb368c0...68df637b5f

View File

@@ -43,10 +43,6 @@
<nshirokovskiy@virtuozzo.com> <nshirokovskiy@parallels.com>
<jyang@redhat.com> <osier@yunify.com>
<kkoukiou@redhat.com> <k.koukiou@googlemail.com>
<intrigeri@boum.org> <intrigeri+libvirt@boum.org>
<fidencio@redhat.com> <fabiano@fidencio.org>
<shi_lei@massclouds.com> <shilei.massclouds@gmx.com>
<adrian.brzezinski@eo.pl> <redhat@adrb.pl>
# Name consolidation:
# Preferred author spelling <preferred email>

View File

@@ -5,58 +5,95 @@ branches:
except:
- /^.*-maint$/
addons:
homebrew:
update: true
packages:
- ccache
- rpcgen
- xz
- yajl
matrix:
include:
- services:
- docker
env:
- IMAGE="ubuntu-18"
- MAKE_ARGS="syntax-check distcheck"
script:
- make -C ci/ ci-build@$IMAGE CI_MAKE_ARGS="$MAKE_ARGS"
- DISTCHECK_CONFIGURE_FLAGS="--with-init-script=systemd"
- DOCKER_CMD="$LINUX_CMD"
- services:
- docker
env:
- IMAGE="centos-7"
- MAKE_ARGS="syntax-check distcheck"
script:
- make -C ci/ ci-build@$IMAGE CI_MAKE_ARGS="$MAKE_ARGS"
- DISTCHECK_CONFIGURE_FLAGS="--with-init-script=upstart"
- DOCKER_CMD="$LINUX_CMD"
- services:
- docker
env:
- IMAGE="fedora-30"
- IMAGE="fedora-rawhide"
- MINGW="mingw32"
script:
- make -C ci/ ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
- DOCKER_CMD="$MINGW_CMD"
- services:
- docker
env:
- IMAGE="fedora-30"
- IMAGE="fedora-rawhide"
- MINGW="mingw64"
script:
- make -C ci/ ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
- DOCKER_CMD="$MINGW_CMD"
- compiler: clang
language: c
os: osx
env:
- PATH="/usr/local/opt/gettext/bin:/usr/local/opt/ccache/libexec:/usr/local/opt/rpcgen/bin:$PATH"
script:
# We can't run 'distcheck' or 'syntax-check' because they fail on
# macOS, but doing 'install' and 'dist' gives us some useful coverage
- ./autogen.sh --prefix=$(pwd)/install-root && make -j3 && make -j3 install && make -j3 dist
/bin/sh -xc "$MACOS_CMD"
script:
- docker run
-v $(pwd):/build
-w /build
-e VIR_TEST_DEBUG="$VIR_TEST_DEBUG"
-e MINGW="$MINGW"
-e DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS"
"libvirt/buildenv-$IMAGE"
/bin/sh -xc "$DOCKER_CMD"
git:
submodules: true
env:
global:
- VIR_TEST_DEBUG=1
- LINUX_CMD="
./autogen.sh &&
make -j3 syntax-check &&
make -j3 distcheck DISTCHECK_CONFIGURE_FLAGS=\"\$DISTCHECK_CONFIGURE_FLAGS\" ||
(
echo '=== LOG FILE(S) START ===';
find -name test-suite.log | xargs cat;
echo '=== LOG FILE(S) END ===';
exit 1
)
"
- MINGW_CMD="
NOCONFIGURE=1 ./autogen.sh &&
\$MINGW-configure &&
make -j3 ||
(
echo '=== LOG FILE(S) START ===';
find -name test-suite.log | xargs cat;
echo '=== LOG FILE(S) END ===';
exit 1
)
"
# We can't run 'distcheck' or 'syntax-check' because they fail on
# macOS, but doing 'install' and 'dist' gives us some useful coverage
- MACOS_CMD="
brew update &&
brew install ccache rpcgen xz yajl &&
./autogen.sh --prefix=\$(pwd)/install-root &&
make -j3 &&
make -j3 install &&
make -j3 dist ||
(
echo '=== LOG FILE(S) START ===';
find -name test-suite.log | xargs cat;
echo '=== LOG FILE(S) END ===';
exit 1
)
"
notifications:
irc:
# The channel name "irc.oftc.net#virt" is encrypted against libvirt/libvirt

View File

@@ -1,15 +0,0 @@
libvirt ChangeLog
=================
The libvirt project doesn't include a detailed ChangeLog in its release
archives.
If you're interested in the full list of changes made to libvirt since
the project was started, you can clone the git repository from
https://libvirt.org/git/libvirt.git
and browse them locally using your favorite git history viewer or,
alternatively, browse them online at
https://libvirt.org/git/?p=libvirt.git;a=log

16699
ChangeLog-old Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,7 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
config-post.h \
ChangeLog-old \
libvirt.spec libvirt.spec.in \
mingw-libvirt.spec.in \
libvirt.pc.in \
@@ -40,20 +41,7 @@ EXTRA_DIST = \
cfg.mk \
run.in \
README.md \
AUTHORS.in \
build-aux/augeas-gentest.pl \
build-aux/check-spacing.pl \
build-aux/gitlog-to-changelog \
build-aux/header-ifdef.pl \
build-aux/minimize-po.pl \
build-aux/mock-noinline.pl \
build-aux/prohibit-duplicate-header.pl \
build-aux/useless-if-before-free \
build-aux/vc-list-files \
ci/Makefile \
ci/build.sh \
ci/prepare.sh \
$(NULL)
AUTHORS.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc libvirt-admin.pc
@@ -86,7 +74,7 @@ srpm: clean
check-local: all tests
check-access: all
check-access:
@($(MAKE) $(AM_MAKEFLAGS) -C tests check-access)
cov: clean-cov
@@ -105,7 +93,19 @@ clean-cov:
MAINTAINERCLEANFILES = .git-module-status
dist-hook: gen-AUTHORS
dist-hook: gen-ChangeLog gen-AUTHORS
# Generate the ChangeLog file (with all entries since the switch to git)
# and insert it into the directory we're about to use to create a tarball.
gen_start_date = 2009-07-04
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d .git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--since=$(gen_start_date) > $(distdir)/cl-t; \
rm -f $(distdir)/ChangeLog; \
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
.PHONY: gen-AUTHORS
gen-AUTHORS:
@@ -123,6 +123,3 @@ gen-AUTHORS:
mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS && \
rm -f all.list maint.list contrib.list; \
fi
ci-%:
$(MAKE) -C ci/ $@

View File

@@ -30,7 +30,7 @@ License
The libvirt C API is distributed under the terms of GNU Lesser General
Public License, version 2.1 (or later). Some parts of the code that are
not part of the C library may have the more restrictive GNU General
Public License, version 2.0 (or later). See the files `COPYING.LESSER`
Public License, version 2.1 (or later). See the files `COPYING.LESSER`
and `COPYING` for full license terms & conditions.

View File

@@ -1,10 +1,10 @@
#! /bin/sh
# Print a version string.
scriptversion=2019-01-04.17; # UTC
scriptversion=2018-07-01.02; # UTC
# Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
# Copyright (C) 2003-2018 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
@@ -142,9 +142,6 @@ die() { warn_ "$@"; exit 1; }
# Configuration.
# Name of the Makefile.am
gnulib_mk=gnulib.mk
# List of gnulib modules needed.
gnulib_modules=
@@ -162,11 +159,18 @@ bootstrap_post_import_hook() { :; }
# Override it via your own definition in bootstrap.conf.
bootstrap_epilogue() { :; }
# The command to download all .po files for a specified domain into a
# specified directory. Fill in the first %s with the destination
# directory and the second with the domain name.
# The command to download all .po files for a specified domain into
# a specified directory. Fill in the first %s is the domain name, and
# the second with the destination directory. Use rsync's -L and -r
# options because the latest/%s directory and the .po files within are
# all symlinks.
po_download_command_format=\
"wget --mirror --level=1 -nd -q -A.po -P '%s' \
"rsync --delete --exclude '*.s1' -Lrtvz \
'translationproject.org::tp/latest/%s/' '%s'"
# Fallback for downloading .po files (if rsync fails).
po_download_command_format2=\
"wget --mirror -nd -q -np -A.po -P '%s' \
https://translationproject.org/latest/%s/"
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
@@ -734,7 +738,10 @@ download_po_files() {
subdir=$1
domain=$2
echo "$me: getting translations into $subdir for $domain..."
cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
eval "$cmd" && return
# Fallback to HTTPS.
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
eval "$cmd"
}
@@ -963,16 +970,6 @@ fi
bootstrap_post_import_hook \
|| die "bootstrap_post_import_hook failed"
# Don't proceed if there are uninitialized submodules. In particular,
# the next step will remove dangling links, which might be links into
# uninitialized submodules.
#
# Uninitialized submodules are listed with an initial dash.
if $use_git && git submodule | grep '^-' >/dev/null; then
die "some git submodules are not initialized. " \
"Run 'git submodule init' and bootstrap again."
fi
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
# The following requires GNU find 4.2.3 or newer. Considering the usual

View File

@@ -10,7 +10,7 @@
# This program 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.
# GNU 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
@@ -176,8 +176,8 @@ xmllint -
xsltproc -
"
# Automake requires that AUTHORS exist.
touch AUTHORS || exit 1
# Automake requires that ChangeLog and AUTHORS exist.
touch AUTHORS ChangeLog || exit 1
# Override bootstrap's list - we don't use mdate-sh or texinfo.tex.
gnulib_extra_files="

View File

@@ -16,28 +16,38 @@
# 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;
die "syntax: $0 CONFIG TEMPLATE\n" unless @ARGV == 2;
die "syntax: $0 CONFIG TEMPLATE AUGTEST\n" unless @ARGV == 3;
my $config = shift @ARGV;
my $template = shift @ARGV;
my $augtest = shift @ARGV;
open AUGTEST, ">", $augtest or die "cannot create $augtest: $!";
$SIG{__DIE__} = sub {
unlink $augtest;
};
open CONFIG, "<", $config or die "cannot read $config: $!";
open TEMPLATE, "<", $template or die "cannot read $template: $!";
my $group = 0;
while (<TEMPLATE>) {
if (/\@CONFIG\@/) {
if (/::CONFIG::/) {
my $group = 0;
print " let conf = \"";
print AUGTEST " let conf = \"";
while (<CONFIG>) {
if (/^#\w/) {
s/^#//;
s/\"/\\\"/g;
print $_;
print AUGTEST $_;
$group = /\[\s$/;
} elsif ($group) {
s/\"/\\\"/g;
@@ -46,15 +56,16 @@ while (<TEMPLATE>) {
}
if (/^#/) {
s/^#//;
print $_;
print AUGTEST $_;
}
}
}
print "\"\n";
print AUGTEST "\"\n";
} else {
print $_;
print AUGTEST $_;
}
}
close TEMPLATE;
close CONFIG;
close AUGTEST or die "cannot save $augtest: $!";

View File

@@ -16,6 +16,9 @@
# 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;
@@ -42,6 +45,9 @@ foreach my $file (@ARGV) {
# Kill any quoted strings
$data =~ s,"(?:[^\\\"]|\\.)*","XXX",g;
# Kill any C++ style comments
$data =~ s,//.*$,//,;
next if $data =~ /^#/;
# Kill contents of multi-line comments

View File

@@ -1,182 +0,0 @@
#!/usr/bin/perl
#
# Validate that header files follow a standard layout:
#
# /*
# ...copyright header...
# */
# <one blank line>
# #pragma once
# ....content....
#
#---
#
# For any file ending priv.h, before the #pragma once
# We will have a further section
#
# #ifndef SYMBOL_ALLOW
# # error ....
# #endif /* SYMBOL_ALLOW */
# <one blank line>
#
#---
#
# For public headers (files in include/), use the standard header guard instead of #pragma once:
# #ifndef SYMBOL
# # define SYMBOL
# ....content....
# #endif /* SYMBOL */
use strict;
use warnings;
my $STATE_COPYRIGHT_COMMENT = 0;
my $STATE_COPYRIGHT_BLANK = 1;
my $STATE_PRIV_START = 2;
my $STATE_PRIV_ERROR = 3;
my $STATE_PRIV_END = 4;
my $STATE_PRIV_BLANK = 5;
my $STATE_GUARD_START = 6;
my $STATE_GUARD_DEFINE = 7;
my $STATE_GUARD_END = 8;
my $STATE_EOF = 9;
my $STATE_PRAGMA = 10;
my $file = " ";
my $ret = 0;
my $ifdef = "";
my $ifdefpriv = "";
my $publicheader = 0;
my $state = $STATE_EOF;
my $mistake = 0;
sub mistake {
my $msg = shift;
warn $msg;
$mistake = 1;
$ret = 1;
}
while (<>) {
if (not $file eq $ARGV) {
if ($state == $STATE_COPYRIGHT_COMMENT) {
&mistake("$file: missing copyright comment");
} elsif ($state == $STATE_COPYRIGHT_BLANK) {
&mistake("$file: missing blank line after copyright header");
} elsif ($state == $STATE_PRIV_START) {
&mistake("$file: missing '#ifndef $ifdefpriv'");
} elsif ($state == $STATE_PRIV_ERROR) {
&mistake("$file: missing '# error ...priv allow...'");
} elsif ($state == $STATE_PRIV_END) {
&mistake("$file: missing '#endif /* $ifdefpriv */'");
} elsif ($state == $STATE_PRIV_BLANK) {
&mistake("$file: missing blank line after priv header check");
} elsif ($state == $STATE_GUARD_START) {
if ($publicheader) {
&mistake("$file: missing '#ifndef $ifdef'");
} else {
&mistake("$file: missing '#pragma once' header guard");
}
} elsif ($state == $STATE_GUARD_DEFINE) {
&mistake("$file: missing '# define $ifdef'");
} elsif ($state == $STATE_GUARD_END) {
&mistake("$file: missing '#endif /* $ifdef */'");
}
$ifdef = uc $ARGV;
$ifdef =~ s,.*/,,;
$ifdef =~ s,[^A-Z0-9],_,g;
$ifdef =~ s,__+,_,g;
unless ($ifdef =~ /^LIBVIRT_/ && $ARGV !~ /libvirt_internal.h/) {
$ifdef = "LIBVIRT_" . $ifdef;
}
$ifdefpriv = $ifdef . "_ALLOW";
$file = $ARGV;
$state = $STATE_COPYRIGHT_COMMENT;
$mistake = 0;
$publicheader = ($ARGV =~ /include\//);
}
if ($mistake ||
$ARGV =~ /config-post\.h$/ ||
$ARGV =~ /vbox_(CAPI|XPCOM)/) {
$state = $STATE_EOF;
next;
}
if ($state == $STATE_COPYRIGHT_COMMENT) {
if (m,\*/,) {
$state = $STATE_COPYRIGHT_BLANK;
}
} elsif ($state == $STATE_COPYRIGHT_BLANK) {
if (! /^$/) {
&mistake("$file: missing blank line after copyright header");
}
if ($ARGV =~ /priv\.h$/) {
$state = $STATE_PRIV_START;
} else {
$state = $STATE_GUARD_START;
}
} elsif ($state == $STATE_PRIV_START) {
if (/^$/) {
&mistake("$file: too many blank lines after copyright header");
} elsif (/#ifndef $ifdefpriv$/) {
$state = $STATE_PRIV_ERROR;
} else {
&mistake("$file: missing '#ifndef $ifdefpriv'");
}
} elsif ($state == $STATE_PRIV_ERROR) {
if (/# error ".*"$/) {
$state = $STATE_PRIV_END;
} else {
&mistake("$file: missing '# error ...priv allow...'");
}
} elsif ($state == $STATE_PRIV_END) {
if (m,#endif /\* $ifdefpriv \*/,) {
$state = $STATE_PRIV_BLANK;
} else {
&mistake("$file: missing '#endif /* $ifdefpriv */'");
}
} elsif ($state == $STATE_PRIV_BLANK) {
if (! /^$/) {
&mistake("$file: missing blank line after priv guard");
}
$state = $STATE_GUARD_START;
} elsif ($state == $STATE_GUARD_START) {
if (/^$/) {
&mistake("$file: too many blank lines after copyright header");
}
if ($publicheader) {
if (/#ifndef $ifdef$/) {
$state = $STATE_GUARD_DEFINE;
} else {
&mistake("$file: missing '#ifndef $ifdef'");
}
} else {
if (/#pragma once/) {
$state = $STATE_PRAGMA;
} else {
&mistake("$file: missing '#pragma once' header guard");
}
}
} elsif ($state == $STATE_GUARD_DEFINE) {
if (/# define $ifdef$/) {
$state = $STATE_GUARD_END;
} else {
&mistake("$file: missing '# define $ifdef'");
}
} elsif ($state == $STATE_GUARD_END) {
if (m,#endif /\* $ifdef \*/$,) {
$state = $STATE_EOF;
}
} elsif ($state == $STATE_PRAGMA) {
next;
} elsif ($state == $STATE_EOF) {
die "$file: unexpected content after '#endif /* $ifdef */'";
} else {
die "$file: unexpected state $state";
}
}
exit $ret;

View File

@@ -6,9 +6,6 @@ my %mocked;
# Functions in public header don't get the noinline annotation
# so whitelist them here
$noninlined{"virEventAddTimeout"} = 1;
# This one confuses the script as its defined in the mock file
# but is actually just a local helper
$noninlined{"virMockStatRedirect"} = 1;
foreach my $arg (@ARGV) {
if ($arg =~ /\.h$/) {

199
cfg.mk
View File

@@ -1,5 +1,5 @@
# Customize Makefile.maint. -*- makefile -*-
# Copyright (C) 2008-2019 Red Hat, Inc.
# Copyright (C) 2008-2015 Red Hat, Inc.
# Copyright (C) 2003-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -59,7 +59,6 @@ local-checks-to-skip = \
sc_obsolete_symbols \
sc_prohibit_S_IS_definition \
sc_prohibit_atoi_atof \
sc_prohibit_gnu_make_extensions \
sc_prohibit_hash_without_use \
sc_prohibit_jm_in_m4 \
sc_prohibit_quote_without_use \
@@ -121,6 +120,7 @@ useless_free_options = \
--name=virConfFreeValue \
--name=virDomainActualNetDefFree \
--name=virDomainChrDefFree \
--name=virDomainChrSourceDefFree \
--name=virDomainControllerDefFree \
--name=virDomainDefFree \
--name=virDomainDeviceDefFree \
@@ -134,6 +134,7 @@ useless_free_options = \
--name=virDomainNetDefFree \
--name=virDomainObjFree \
--name=virDomainSmartcardDefFree \
--name=virDomainSnapshotDefFree \
--name=virDomainSnapshotObjFree \
--name=virDomainSoundDefFree \
--name=virDomainVideoDefFree \
@@ -147,6 +148,9 @@ useless_free_options = \
--name=virJSONValueFree \
--name=virLastErrFreeData \
--name=virNetMessageFree \
--name=virNetServerMDNSFree \
--name=virNetServerMDNSEntryFree \
--name=virNetServerMDNSGroupFree \
--name=virNWFilterDefFree \
--name=virNWFilterEntryFree \
--name=virNWFilterHashTableFree \
@@ -208,6 +212,7 @@ useless_free_options = \
# y virDomainInputDefFree
# y virDomainNetDefFree
# y virDomainObjFree
# y virDomainSnapshotDefFree
# n virDomainSnapshotFree (returns int)
# n virDomainSnapshotFreeName (returns int)
# y virDomainSnapshotObjFree
@@ -300,11 +305,10 @@ sc_flags_usage:
$(srcdir)/include/libvirt/libvirt-qemu.h \
$(srcdir)/include/libvirt/libvirt-lxc.h \
$(srcdir)/include/libvirt/libvirt-admin.h \
| $(GREP) -c '\(long\|unsigned\) flags')" != 4 && \
| grep -c '\(long\|unsigned\) flags')" != 4 && \
{ echo '$(ME): new API should use "unsigned int flags"' 1>&2; \
exit 1; } || :
@prohibit=' flags ATTRIBUTE_UNUSED' \
exclude='virSecurityDomainImageLabelFlags' \
halt='flags should be checked with virCheckFlags' \
$(_sc_search_regexp)
@prohibit='^[^@]*([^d] (int|long long)|[^dg] long) flags[;,)]' \
@@ -468,7 +472,6 @@ sc_prohibit_canonicalize_file_name:
# Insist on correct types for [pug]id.
sc_correct_id_types:
@prohibit='\<(int|long) *[pug]id\>' \
exclude='exempt from syntax-check' \
halt='use pid_t for pid, uid_t for uid, gid_t for gid' \
$(_sc_search_regexp)
@@ -612,7 +615,6 @@ msg_gen_function += virReportError
msg_gen_function += virReportErrorHelper
msg_gen_function += virReportSystemError
msg_gen_function += xenapiSessionErrorHandler
msg_gen_function += virLastErrorPrefixMessage
# Uncomment the following and run "make syntax-check" to see diagnostics
# that are not yet marked for translation, but that need to be rewritten
@@ -636,12 +638,10 @@ sc_libvirt_unmarked_diagnostics:
exclude='_\(' \
halt='found unmarked diagnostic(s)' \
$(_sc_search_regexp)
@{ $(VC_LIST_EXCEPT) | xargs \
$(GREP) -nE '\<$(func_re) *\(.*;$$' /dev/null; \
$(VC_LIST_EXCEPT) | xargs \
$(GREP) -A1 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \
| $(SED) -E 's/_\("([^\"]|\\.)+"//;s/"%s"//' \
| $(GREP) '"' && \
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
| $(SED) 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \
| grep '[ ]"' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
@@ -653,9 +653,9 @@ sc_libvirt_unmarked_diagnostics:
# there are functions to which this one applies but that do not get marked
# diagnostics.
sc_prohibit_newline_at_end_of_diagnostic:
@$(VC_LIST_EXCEPT) | xargs $(GREP) -A2 -nE \
'\<$(func_re) *\(' /dev/null \
| $(GREP) '\\n"' \
@grep -A2 -nE \
'\<$(func_re) *\(' $$($(VC_LIST_EXCEPT)) \
| grep '\\n"' \
&& { echo '$(ME): newline at end of message(s)' 1>&2; \
exit 1; } || :
@@ -663,14 +663,12 @@ sc_prohibit_newline_at_end_of_diagnostic:
# allow VIR_ERROR to do this, and ignore functions that take a single
# string rather than a format argument.
sc_prohibit_diagnostic_without_format:
@{ $(VC_LIST_EXCEPT) | xargs \
$(GREP) -nE '\<$(func_re) *\(.*;$$' /dev/null; \
$(VC_LIST_EXCEPT) | xargs \
$(GREP) -A2 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
grep -A2 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
| $(SED) -rn -e ':l; /[,"]$$/ {N;b l;}' \
-e '/(xenapiSessionErrorHandler|vah_(error|warning))/d' \
-e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \
| $(GREP) -vE 'VIR_ERROR' && \
| grep -vE 'VIR_ERROR' && \
{ echo '$(ME): found diagnostic without %' 1>&2; \
exit 1; } || :
@@ -688,16 +686,16 @@ sc_prohibit_useless_translation:
# When splitting a diagnostic across lines, ensure that there is a space
# or \n on one side of the split.
sc_require_whitespace_in_translation:
@$(VC_LIST_EXCEPT) | xargs $(GREP) -n -A1 '"$$' /dev/null \
@grep -n -A1 '"$$' $$($(VC_LIST_EXCEPT)) \
| $(SED) -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \
-e '/_(.*[^\ ]""[^\ ]/p' | $(GREP) . && \
-e '/_(.*[^\ ]""[^\ ]/p' | grep . && \
{ echo '$(ME): missing whitespace at line split' 1>&2; \
exit 1; } || :
# Enforce recommended preprocessor indentation style.
sc_preprocessor_indentation:
@if cppi --version >/dev/null 2>&1; then \
$(VC_LIST_EXCEPT) | $(GREP) -E '\.[ch](\.in)?$$' | xargs cppi -a -c \
$(VC_LIST_EXCEPT) | grep -E '\.[ch](\.in)?$$' | xargs cppi -a -c \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
exit 1; }; \
else \
@@ -708,13 +706,13 @@ sc_preprocessor_indentation:
# (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 \
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; } \
done | { if grep . >&2; then false; else :; fi; } \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
exit 1; }; \
else \
@@ -791,7 +789,7 @@ sc_prohibit_cross_inclusion:
access/ | conf/) safe="($$dir|conf|util)";; \
cpu/| network/| node_device/| rpc/| security/| storage/) \
safe="($$dir|util|conf|storage)";; \
xenapi/) safe="($$dir|util|conf|xen|cpu)";; \
xenapi/ | xenconfig/ ) safe="($$dir|util|conf|xen|cpu)";; \
*) safe="($$dir|$(mid_dirs)|util)";; \
esac; \
in_vc_files="^src/$$dir" \
@@ -804,13 +802,12 @@ sc_prohibit_cross_inclusion:
# When converting an enum to a string, make sure that we track any new
# elements added to the enum by using a _LAST marker.
sc_require_enum_last_marker:
@$(VC_LIST_EXCEPT) | xargs \
$(GREP) -A1 -nE '^[^#]*VIR_ENUM_IMPL *\(' /dev/null \
| $(SED) -ne '/VIR_ENUM_IMPL.*,$$/N' \
-e '/VIR_ENUM_IMPL[^,]*,[^,]*,[^,]*[^_,][^L,][^A,][^S,][^T,],/p' \
@grep -A1 -nE '^[^#]*VIR_ENUM_IMPL *\(' $$($(VC_LIST_EXCEPT)) \
| $(SED) -ne '/VIR_ENUM_IMPL[^,]*,$$/N' \
-e '/VIR_ENUM_IMPL[^,]*,[^,]*[^_,][^L,][^A,][^S,][^T,],/p' \
-e '/VIR_ENUM_IMPL[^,]*,[^,]\{0,4\},/p' \
| $(GREP) . && \
{ echo '$(ME): enum impl needs _LAST marker on second line' 1>&2; \
| grep . && \
{ 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
@@ -856,13 +853,20 @@ sc_prohibit_unbounded_arrays_in_rpc:
halt='Arrays in XDR must have a upper limit set for <NNN>' \
$(_sc_search_regexp)
sc_prohibit_getenv:
@prohibit='\b(secure_)?getenv *\(' \
exclude='exempt from syntax-check' \
halt='Use virGetEnv{Allow,Block}SUID instead of getenv' \
$(_sc_search_regexp)
sc_prohibit_atoi:
@prohibit='\bato(i|f|l|ll|q) *\(' \
halt='Use virStrToLong* instead of atoi, atol, atof, atoq, atoll' \
$(_sc_search_regexp)
sc_prohibit_wrong_filename_in_comment:
@$(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs awk 'BEGIN { \
@fail=0; \
awk 'BEGIN { \
fail=0; \
} FNR < 3 { \
n=match($$0, /[[:space:]][^[:space:]]*[.][ch][[:space:]:]/); \
@@ -878,8 +882,11 @@ sc_prohibit_wrong_filename_in_comment:
if (fail == 1) { \
exit 1; \
} \
}' || { echo '$(ME): The file name in comments must match the' \
'actual file name' 1>&2; exit 1; }
}' $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$') || fail=1; \
if test $$fail -eq 1; then \
{ echo '$(ME): The file name in comments must match the' \
'actual file name' 1>&2; exit 1; } \
fi;
sc_prohibit_virConnectOpen_in_virsh:
@prohibit='\bvirConnectOpen[a-zA-Z]* *\(' \
@@ -910,21 +917,22 @@ sc_require_if_else_matching_braces:
$(_sc_search_regexp)
sc_curly_braces_style:
@if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs $(GREP) -nHP \
@files=$$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); \
if $(GREP) -nHP \
'^\s*(?!([a-zA-Z_]*for_?each[a-zA-Z_]*) ?\()([_a-zA-Z0-9]+( [_a-zA-Z0-9]+)* ?\()?(\*?[_a-zA-Z0-9]+(,? \*?[_a-zA-Z0-9\[\]]+)+|void)\) ?\{' \
/dev/null; then \
$$files; then \
echo '$(ME): Non-K&R style used for curly braces around' \
'function body' 1>&2; exit 1; \
fi; \
if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs \
$(GREP) -A1 -En ' ((if|for|while|switch) \(|(else|do)\b)[^{]*$$' \
/dev/null | $(GREP) '^[^ ]*- *{'; then \
if $(GREP) -A1 -En ' ((if|for|while|switch) \(|(else|do)\b)[^{]*$$'\
$$files | $(GREP) '^[^ ]*- *{'; then \
echo '$(ME): Use hanging braces for compound statements' 1>&2; exit 1; \
fi
sc_prohibit_windows_special_chars_in_filename:
@$(VC_LIST_EXCEPT) | $(GREP) '[:*?"<>|]' && \
{ echo '$(ME): Windows special chars in filename not allowed' 1>&2; echo exit 1; } || :
@files=$$($(VC_LIST_EXCEPT) | grep '[:*?"<>|]'); \
test -n "$$files" && { echo '$(ME): Windows special chars' \
'in filename not allowed:' 1>&2; echo $$files 1>&2; exit 1; } || :
sc_prohibit_mixed_case_abbreviations:
@prohibit='Pci|Usb|Scsi' \
@@ -940,11 +948,11 @@ sc_require_locale_h:
$(_sc_search_regexp)
sc_prohibit_empty_first_line:
@$(VC_LIST_EXCEPT) | xargs awk 'BEGIN { fail=0; } \
@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; }'
} exit fail; }' $$($(VC_LIST_EXCEPT));
sc_prohibit_paren_brace:
@prohibit='\)\{$$' \
@@ -987,9 +995,8 @@ sc_prohibit_sysconf_pagesize:
$(_sc_search_regexp)
sc_prohibit_virSecurity:
@$(VC_LIST_EXCEPT) | $(GREP) 'src/qemu/' | \
$(GREP) -v 'src/qemu/qemu_security' | \
xargs $(GREP) -Pn 'virSecurityManager(?!Ptr)' /dev/null && \
@grep -Pn 'virSecurityManager(?!Ptr)' $$($(VC_LIST_EXCEPT) | grep 'src/qemu/' | \
grep -v 'src/qemu/qemu_security') && \
{ echo '$(ME): prefer qemuSecurity wrappers' 1>&2; exit 1; } || :
sc_prohibit_pthread_create:
@@ -1042,11 +1049,6 @@ sc_prohibit_http_urls:
halt='Links must use https:// protocol' \
$(_sc_search_regexp)
sc_prohibit_author:
@prohibit="(\*|#)\s*(A|a)uthors?:" \
halt="Author: statements are prohibited in source comments" \
$(_sc_search_regexp)
# Alignment is usually achieved through spaces (at least two of them)
# or tabs (at least one of them) right before the trailing backslash
sc_prohibit_backslash_alignment:
@@ -1058,36 +1060,14 @@ sc_prohibit_backslash_alignment:
# Some syntax rules pertaining to the usage of cleanup macros
# implementing GNU C's cleanup attribute
# Rule to ensure that variables declared using a cleanup macro are
# Rule to ensure that varibales declared using a cleanup macro are
# always initialized.
sc_require_attribute_cleanup_initialization:
@prohibit='VIR_AUTO((FREE|PTR|UNREF|CLEAN)\(.+\)|CLOSE|STRINGLIST) *[^=]+;' \
@prohibit='VIR_AUTO(FREE|PTR)\(.+\) *[^=]+;' \
in_vc_files='\.[chx]$$' \
halt='variable declared with a cleanup macro must be initialized' \
$(_sc_search_regexp)
# "class" in headers is not good because by default Vim treats it as a keyword
# Let's prohibit it in source files as well.
sc_prohibit_class:
@prohibit=' +_?class *;' \
in_vc_files='\.[chx]$$' \
halt='use klass instead of class or _class' \
$(_sc_search_regexp)
# The dirent "d_type" field is non-portable and even when it
# exists some filesystems will only ever return DT_UNKNOWN.
# This field should only be used by code which is exclusively
# run platforms supporting "d_type" and must expect DT_UNKNOWN.
# We blacklist it to discourage accidental usage which has
# happened many times. Add an exclude rule if it is genuinely
# needed and the above restrictions are acceptable.
sc_prohibit_dirent_d_type:
@prohibit='(->|\.)d_type' \
in_vc_files='\.[chx]$$' \
halt='do not use the d_type field in "struct dirent"' \
$(_sc_search_regexp)
# We don't use this feature of maint.mk.
prev_version_file = /dev/null
@@ -1117,7 +1097,7 @@ maint.mk Makefile: _autogen_error
# though, as it would be quite pointless
ifeq (2,$(_dry_run_result)$(_clean_requested))
$(info INFO: running autogen.sh is required, running it now...)
$(shell touch $(srcdir)/AUTHORS)
$(shell touch $(srcdir)/AUTHORS $(srcdir)/ChangeLog)
maint.mk Makefile: _autogen
endif
endif
@@ -1136,39 +1116,29 @@ _autogen_error:
ifneq ($(_gl-Makefile),)
syntax-check: spacing-check test-wrap-argv \
prohibit-duplicate-header mock-noinline group-qemu-caps \
header-ifdef
@if ! cppi --version >/dev/null 2>&1; then \
echo "*****************************************************" >&2; \
echo "* cppi not installed, some checks have been skipped *" >&2; \
echo "*****************************************************" >&2; \
fi
prohibit-duplicate-header mock-noinline group-qemu-caps
endif
# Don't include duplicate header in the source (either *.c or *.h)
prohibit-duplicate-header:
$(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[chx]$$' | xargs \
$(PERL) -W $(top_srcdir)/build-aux/prohibit-duplicate-header.pl
$(AM_V_GEN)files=$$($(VC_LIST_EXCEPT) | grep '\.[chx]$$'); \
$(PERL) -W $(top_srcdir)/build-aux/prohibit-duplicate-header.pl $$files
spacing-check:
$(AM_V_GEN)$(VC_LIST) | $(GREP) '\.c$$' | xargs \
$(PERL) $(top_srcdir)/build-aux/check-spacing.pl || \
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.c$$'`; \
$(PERL) $(top_srcdir)/build-aux/check-spacing.pl $$files || \
{ echo '$(ME): incorrect formatting' 1>&2; exit 1; }
mock-noinline:
$(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[ch]$$' | xargs \
$(PERL) $(top_srcdir)/build-aux/mock-noinline.pl
header-ifdef:
$(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[h]$$' | xargs \
$(PERL) $(top_srcdir)/build-aux/header-ifdef.pl
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.[ch]$$'`; \
$(PERL) $(top_srcdir)/build-aux/mock-noinline.pl $$files
test-wrap-argv:
$(AM_V_GEN)$(VC_LIST) | $(GREP) -E '\.(ldargs|args)' | xargs \
$(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check
$(AM_V_GEN)files=`$(VC_LIST) | grep -E '\.(ldargs|args)'`; \
$(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check $$files
group-qemu-caps:
$(AM_V_GEN)$(PERL) $(top_srcdir)/tests/group-qemu-caps.pl --check $(top_srcdir)/
$(PERL) $(top_srcdir)/tests/group-qemu-caps.pl --check $(top_srcdir)/
# sc_po_check can fail if generated files are not built first
sc_po_check: \
@@ -1198,7 +1168,7 @@ exclude_file_name_regexp--sc_avoid_write = \
exclude_file_name_regexp--sc_bindtextdomain = .*
exclude_file_name_regexp--sc_gettext_init = ^((tests|examples)/|tools/virt-login-shell.c)
exclude_file_name_regexp--sc_gettext_init = ^(tests|examples)/
exclude_file_name_regexp--sc_copyright_format = \
^cfg\.mk$$
@@ -1207,7 +1177,7 @@ exclude_file_name_regexp--sc_copyright_usage = \
^COPYING(|\.LESSER)$$
exclude_file_name_regexp--sc_flags_usage = \
^(cfg\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vir(cgroup|pci|test|usb)|nss|qemuxml2argv|qemusecurity)mock|virfilewrapper)\.c$$)
^(cfg\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vir(cgroup|pci|test|usb)|nss|qemuxml2argv)mock|virfilewrapper)\.c$$)
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
^(src/rpc/gendispatch\.pl$$|tests/)
@@ -1224,13 +1194,13 @@ exclude_file_name_regexp--sc_prohibit_access_xok = \
^(cfg\.mk|src/util/virutil\.c)$$
exclude_file_name_regexp--sc_prohibit_asprintf = \
^(cfg\.mk|bootstrap.conf$$|examples/|src/util/virstring\.[ch]$$|tests/vircgroupmock\.c|tools/virt-login-shell\.c|tools/nss/libvirt_nss\.c$$)
^(cfg\.mk|bootstrap.conf$$|examples/|src/util/virstring\.[ch]$$|tests/vircgroupmock\.c$$)
exclude_file_name_regexp--sc_prohibit_strdup = \
^(docs/|examples/|src/util/virstring\.c|tests/vir(netserverclient|cgroup)mock.c|tests/commandhelper\.c|tools/nss/libvirt_nss_(leases|macs)\.c$$)
^(docs/|examples/|src/util/virstring\.c|tests/vir(netserverclient|cgroup)mock.c|tests/commandhelper\.c$$)
exclude_file_name_regexp--sc_prohibit_close = \
(\.p[yl]$$|\.spec\.in$$|^docs/|^(src/util/virfile\.c|src/libvirt-stream\.c|tests/(vir.+mock\.c|commandhelper\.c|qemusecuritymock\.c)|tools/nss/libvirt_nss_(leases|macs)\.c)$$)
(\.p[yl]$$|\.spec\.in$$|^docs/|^(src/util/virfile\.c|src/libvirt-stream\.c|tests/vir.+mock\.c|tests/commandhelper\.c)$$)
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
(^tests/(virhostcpu|virpcitest)data/|docs/js/.*\.js|docs/fonts/.*\.woff|\.diff|tests/virconfdata/no-newline\.conf$$)
@@ -1251,21 +1221,21 @@ exclude_file_name_regexp--sc_prohibit_newline_at_end_of_diagnostic = \
^src/rpc/gendispatch\.pl$$
exclude_file_name_regexp--sc_prohibit_nonreentrant = \
^((po|tests|examples)/|docs/.*(py|js|html\.in)|run.in$$|tools/wireshark/util/genxdrstub\.pl|tools/virt-login-shell\.c$$)
^((po|tests)/|docs/.*(py|js|html\.in)|run.in$$|tools/wireshark/util/genxdrstub\.pl$$)
exclude_file_name_regexp--sc_prohibit_select = \
^cfg\.mk$$
exclude_file_name_regexp--sc_prohibit_canonicalize_file_name = \
^(cfg\.mk|tests/virfilemock\.c)$$
^cfg\.mk$$
exclude_file_name_regexp--sc_prohibit_raw_allocation = \
^(docs/hacking\.html\.in|src/util/viralloc\.[ch]|examples/.*|tests/(securityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/src/packet-libvirt\.c|tools/nss/libvirt_nss(_leases|_macs)?\.c)$$
^(docs/hacking\.html\.in|src/util/viralloc\.[ch]|examples/.*|tests/(securityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/src/packet-libvirt\.c)$$
exclude_file_name_regexp--sc_prohibit_readlink = \
^src/(util/virutil|lxc/lxc_container)\.c$$
exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c|tools/virt-login-shell\.c$$
exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c$$
exclude_file_name_regexp--sc_prohibit_sprintf = \
^(cfg\.mk|docs/hacking\.html\.in|.*\.stp|.*\.pl)$$
@@ -1281,10 +1251,10 @@ exclude_file_name_regexp--sc_prohibit_xmlURI = ^src/util/viruri\.c$$
exclude_file_name_regexp--sc_prohibit_return_as_function = \.py$$
exclude_file_name_regexp--sc_require_config_h = \
^(examples/|tools/virsh-edit\.c$$|tests/virmockstathelpers.c)
^(examples/|tools/virsh-edit\.c$$)
exclude_file_name_regexp--sc_require_config_h_first = \
^(examples/|tools/virsh-edit\.c$$|tests/virmockstathelpers.c)
^(examples/|tools/virsh-edit\.c$$)
exclude_file_name_regexp--sc_trailing_blank = \
/sysinfodata/.*\.data|/virhostcpudata/.*\.cpuinfo|^gnulib/local/.*/.*diff$$
@@ -1300,7 +1270,7 @@ exclude_file_name_regexp--sc_correct_id_types = \
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$$|tools/wireshark/src/packet-libvirt.c$$)
^(src/internal\.h$$|tools/wireshark/src/packet-libvirt.h$$)
exclude_file_name_regexp--sc_prohibit_include_public_headers_brackets = \
^(tools/|examples/|include/libvirt/(virterror|libvirt(-(admin|qemu|lxc))?)\.h$$)
@@ -1311,6 +1281,9 @@ exclude_file_name_regexp--sc_prohibit_int_ijk = \
exclude_file_name_regexp--sc_prohibit_unsigned_pid = \
^(include/libvirt/.*\.h|src/(qemu/qemu_driver\.c|driver-hypervisor\.h|libvirt(-[a-z]*)?\.c|.*\.x|util/vir(polkit|systemd)\.c)|tests/virpolkittest\.c|tools/virsh-domain\.c)$$
exclude_file_name_regexp--sc_prohibit_getenv = \
^tests/.*\.[ch]$$
exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \
^(src/util/virlog\.h|src/network/bridge_driver\.h)$$
@@ -1339,13 +1312,7 @@ exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
^tests/virtestmock.c$$
exclude_file_name_regexp--sc_prohibit_readdir = \
^(tests/(.*mock|virfilewrapper)\.c|tools/nss/libvirt_nss\.c)$$
^tests/(.*mock|virfilewrapper)\.c$$
exclude_file_name_regexp--sc_prohibit_cross_inclusion = \
^(src/util/virclosecallbacks\.h|src/util/virhostdev\.h)$$
exclude_file_name_regexp--sc_prohibit_dirent_d_type = \
^(src/util/vircgroup.c)$
exclude_file_name_regexp--sc_prohibit_strcmp = \
^(tools/nss/libvirt_nss.*\.c)

View File

@@ -1,279 +0,0 @@
# -*- makefile -*-
# vim: filetype=make
# The root directory of the libvirt.git checkout
CI_GIT_ROOT = $(shell git rev-parse --show-toplevel)
# The root directory for all CI-related contents
CI_ROOTDIR = $(CI_GIT_ROOT)/ci
# The directory holding content on the host that we will
# expose to the container.
CI_SCRATCHDIR = $(CI_ROOTDIR)/scratch
# The directory holding the clone of the git repo that
# we will expose to the container
CI_HOST_SRCDIR = $(CI_SCRATCHDIR)/src
# The directory holding the source inside the
# container, i.e. where we want to expose
# the $(CI_HOST_SRCDIR) directory from the host
CI_CONT_SRCDIR = $(CI_USER_HOME)/libvirt
# Relative directory to perform the build in. This
# defaults to using a separate build dir, but can be
# set to empty string for an in-source tree build.
CI_VPATH = build
# The directory holding the build output inside the
# container.
CI_CONT_BUILDDIR = $(CI_CONT_SRCDIR)/$(CI_VPATH)
# Can be overridden with mingw{32,64}-configure if desired
CI_CONFIGURE = $(CI_CONT_SRCDIR)/configure
# Default to using all possible CPUs
CI_SMP = $(shell getconf _NPROCESSORS_ONLN)
# Any extra arguments to pass to make
CI_MAKE_ARGS =
# Any extra arguments to pass to configure
CI_CONFIGURE_ARGS =
# Script containing environment preparation steps
CI_PREPARE_SCRIPT = $(CI_ROOTDIR)/prepare.sh
# Script containing build instructions
CI_BUILD_SCRIPT = $(CI_ROOTDIR)/build.sh
# Location of the container images we're going to pull
# Can be useful to overridde to use a locally built
# image instead
CI_IMAGE_PREFIX = quay.io/libvirt/buildenv-libvirt-
# The default tag is ':latest' but if the container
# repo above uses different conventions this can override it
CI_IMAGE_TAG = :latest
# We delete the virtual root after completion, set
# to 0 if you need to keep it around for debugging
CI_CLEAN = 1
# We'll always freshly clone the virtual root each
# time in case it was not cleaned up before. Set
# to 1 if you want to try restarting a previously
# preserved env
CI_REUSE = 0
# We need the container process to run with current host IDs
# so that it can access the passed in build directory
CI_UID = $(shell id -u)
CI_GID = $(shell id -g)
# We also need the user's login and home directory to prepare the
# environment the way some programs expect it
CI_USER_LOGIN = $(shell echo "$$USER")
CI_USER_HOME = $(shell echo "$$HOME")
CI_ENGINE = auto
# Container engine we are going to use, can be overridden per make
# invocation, if it is not we try podman and then default to docker.
ifeq ($(CI_ENGINE),auto)
override CI_ENGINE = $(shell podman version >/dev/null 2>&1 && echo podman || echo docker)
endif
# IDs you run as do not need to exist in
# the container's /etc/passwd & /etc/group files, but
# if they do not, then libvirt's 'make check' will fail
# many tests.
# We do not directly mount /etc/{passwd,group} as Docker
# is liable to mess with SELinux labelling which will
# then prevent the host accessing them. And podman cannot
# relabel the files due to it running rootless. So
# copying them first is safer and less error-prone.
CI_PWDB_MOUNTS = \
--volume $(CI_SCRATCHDIR)/group:/etc/group:ro,z \
--volume $(CI_SCRATCHDIR)/passwd:/etc/passwd:ro,z \
$(NULL)
CI_HOME_MOUNTS = \
--volume $(CI_SCRATCHDIR)/home:$(CI_USER_HOME):z \
$(NULL)
CI_SCRIPT_MOUNTS = \
--volume $(CI_SCRATCHDIR)/prepare:$(CI_USER_HOME)/prepare:z \
--volume $(CI_SCRATCHDIR)/build:$(CI_USER_HOME)/build:z \
$(NULL)
# Docker containers can have very large ulimits
# for nofiles - as much as 1048576. This makes
# libvirt very slow at exec'ing programs.
CI_ULIMIT_FILES = 1024
ifeq ($(CI_ENGINE),podman)
# Podman cannot reuse host namespace when running non-root
# containers. Until support for --keep-uid is added we can
# just create another mapping that will do that for us.
# Beware, that in {uid,git}map=container_id:host_id:range, the
# host_id does actually refer to the uid in the first mapping
# where 0 (root) is mapped to the current user and rest is
# offset.
#
# In order to set up this mapping, we need to keep all the
# user IDs to prevent possible errors as some images might
# expect UIDs up to 90000 (looking at you fedora), so we don't
# want the overflowuid to be used for them. For mapping all
# the other users properly, some math needs to be done.
# Don't worry, it's just addition and subtraction.
#
# 65536 ought to be enough (tm), but for really rare cases the
# maximums might need to be higher, but that only happens when
# your /etc/sub{u,g}id allow users to have more IDs. Unless
# --keep-uid is supported, let's do this in a way that should
# work for everyone.
CI_MAX_UID = $(shell sed -n "s/^$(CI_USER_LOGIN):[^:]\+://p" /etc/subuid)
CI_MAX_GID = $(shell sed -n "s/^$(CI_USER_LOGIN):[^:]\+://p" /etc/subgid)
ifeq ($(CI_MAX_UID),)
CI_MAX_UID = 65536
endif
ifeq ($(CI_MAX_GID),)
CI_MAX_GID = 65536
endif
CI_UID_OTHER = $(shell echo $$(($(CI_UID)+1)))
CI_GID_OTHER = $(shell echo $$(($(CI_GID)+1)))
CI_UID_OTHER_RANGE = $(shell echo $$(($(CI_MAX_UID)-$(CI_UID))))
CI_GID_OTHER_RANGE = $(shell echo $$(($(CI_MAX_GID)-$(CI_GID))))
CI_PODMAN_ARGS = \
--uidmap 0:1:$(CI_UID) \
--uidmap $(CI_UID):0:1 \
--uidmap $(CI_UID_OTHER):$(CI_UID_OTHER):$(CI_UID_OTHER_RANGE) \
--gidmap 0:1:$(CI_GID) \
--gidmap $(CI_GID):0:1 \
--gidmap $(CI_GID_OTHER):$(CI_GID_OTHER):$(CI_GID_OTHER_RANGE) \
$(NULL)
endif
# Args to use when cloning a git repo.
# -c stop it complaining about checking out a random hash
# -q stop it displaying progress info for local clone
# --local ensure we don't actually copy files
CI_GIT_ARGS = \
-c advice.detachedHead=false \
-q \
--local \
$(NULL)
# Args to use when running the container
# --rm stop inactive containers getting left behind
# --user we execute as the same user & group account
# as dev so that file ownership matches host
# instead of root:root
# --volume to pass in the cloned git repo & config
# --ulimit lower files limit for performance reasons
# --interactive
# --tty Ensure we have ability to Ctrl-C the build
CI_ENGINE_ARGS = \
--rm \
--interactive \
--tty \
$(CI_PODMAN_ARGS) \
$(CI_PWDB_MOUNTS) \
$(CI_HOME_MOUNTS) \
$(CI_SCRIPT_MOUNTS) \
--volume $(CI_HOST_SRCDIR):$(CI_CONT_SRCDIR):z \
--ulimit nofile=$(CI_ULIMIT_FILES):$(CI_ULIMIT_FILES) \
--cap-add=SYS_PTRACE \
$(NULL)
ci-check-engine:
@echo -n "Checking if $(CI_ENGINE) is available..." && \
$(CI_ENGINE) version 1>/dev/null && echo "yes"
ci-prepare-tree: ci-check-engine
@test "$(CI_REUSE)" != "1" && rm -rf $(CI_SCRATCHDIR) || :
@if ! test -d $(CI_SCRATCHDIR) ; then \
mkdir -p $(CI_SCRATCHDIR); \
cp /etc/passwd $(CI_SCRATCHDIR); \
cp /etc/group $(CI_SCRATCHDIR); \
mkdir -p $(CI_SCRATCHDIR)/home; \
cp "$(CI_PREPARE_SCRIPT)" $(CI_SCRATCHDIR)/prepare; \
cp "$(CI_BUILD_SCRIPT)" $(CI_SCRATCHDIR)/build; \
chmod +x "$(CI_SCRATCHDIR)/prepare" "$(CI_SCRATCHDIR)/build"; \
echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \
git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \
for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') ; \
do \
test -f $(CI_GIT_ROOT)/$$mod/.git || continue ; \
echo "Cloning $(CI_GIT_ROOT)/$$mod to $(CI_HOST_SRCDIR)/$$mod"; \
git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT)/$$mod $(CI_HOST_SRCDIR)/$$mod || exit 1; \
done ; \
fi
ci-run-command@%: ci-prepare-tree
$(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \
/bin/bash -c ' \
$(CI_USER_HOME)/prepare || exit 1; \
sudo \
--login \
--user="#$(CI_UID)" \
--group="#$(CI_GID)" \
CI_CONT_SRCDIR="$(CI_CONT_SRCDIR)" \
CI_CONT_BUILDDIR="$(CI_CONT_BUILDDIR)" \
CI_SMP="$(CI_SMP)" \
CI_CONFIGURE="$(CI_CONFIGURE)" \
CI_CONFIGURE_ARGS="$(CI_CONFIGURE_ARGS)" \
CI_MAKE_ARGS="$(CI_MAKE_ARGS)" \
$(CI_COMMAND) || exit 1'
@test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || :
ci-shell@%:
$(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND="/bin/bash"
ci-build@%:
$(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND="$(CI_USER_HOME)/build"
ci-check@%:
$(MAKE) -C $(CI_ROOTDIR) ci-build@$* CI_MAKE_ARGS="check"
ci-help:
@echo "Build libvirt inside containers used for CI"
@echo
@echo "Available targets:"
@echo
@echo " ci-build@\$$IMAGE - run a default 'make'"
@echo " ci-check@\$$IMAGE - run a 'make check'"
@echo " ci-shell@\$$IMAGE - run an interactive shell"
@echo
@echo "Available x86 container images:"
@echo
@echo " centos-7"
@echo " debian-9"
@echo " debian-10"
@echo " debian-sid"
@echo " fedora-29"
@echo " fedora-30"
@echo " fedora-rawhide"
@echo " ubuntu-16"
@echo " ubuntu-18"
@echo
@echo "Available cross-compiler container images:"
@echo
@echo " debian-{9,10,sid}-cross-aarch64"
@echo " debian-{9,10,sid}-cross-armv6l"
@echo " debian-{9,10,sid}-cross-armv7l"
@echo " debian-{10,sid}-cross-i686"
@echo " debian-{9,10,sid}-cross-mips64el"
@echo " debian-{9,10,sid}-cross-mips"
@echo " debian-{9,10,sid}-cross-mipsel"
@echo " debian-{9,10,sid}-cross-ppc64le"
@echo " debian-{9,10,sid}-cross-s390x"
@echo
@echo "Available make variables:"
@echo
@echo " CI_CLEAN=0 - do not delete '$(CI_SCRATCHDIR)' after completion"
@echo " CI_REUSE=1 - re-use existing '$(CI_SCRATCHDIR)' content"
@echo " CI_ENGINE=auto - container engine to use (podman, docker)"
@echo

View File

@@ -1,40 +0,0 @@
# This script is used to build libvirt inside the container.
#
# You can customize it to your liking, or alternatively use a
# completely different script by passing
#
# CI_BUILD_SCRIPT=/path/to/your/build/script
#
# to make.
mkdir -p "$CI_CONT_BUILDDIR" || exit 1
cd "$CI_CONT_BUILDDIR"
export VIR_TEST_DEBUG=1
NOCONFIGURE=1 "$CI_CONT_SRCDIR/autogen.sh" || exit 1
# $CONFIGURE_OPTS is a env that can optionally be set in the container,
# populated at build time from the Dockerfile. A typical use case would
# be to pass --host/--target args to trigger cross-compilation
#
# This can be augmented by make local args in $CI_CONFIGURE_ARGS
"$CI_CONFIGURE" $CONFIGURE_OPTS $CI_CONFIGURE_ARGS
if test $? != 0; then
test -f config.log && cat config.log
exit 1
fi
find -name test-suite.log -delete
# gl_public_submodule_commit= to disable gnulib's submodule check
# which breaks due to way we clone the submodules
make -j"$CI_SMP" gl_public_submodule_commit= $CI_MAKE_ARGS
if test $? != 0; then \
LOGS=$(find -name test-suite.log)
if test "$LOGS"; then
echo "=== LOG FILE(S) START ==="
cat $LOGS
echo "=== LOG FILE(S) END ==="
fi
exit 1
fi

View File

@@ -1,13 +0,0 @@
# This script is used to prepare the environment that will be used
# to build libvirt inside the container.
#
# You can customize it to your liking, or alternatively use a
# completely different script by passing
#
# CI_PREPARE_SCRIPT=/path/to/your/prepare/script
#
# to make.
#
# Note that this script will have root privileges inside the
# container, so it can be used for things like installing additional
# packages.

View File

@@ -16,8 +16,64 @@
* <http://www.gnu.org/licenses/>.
*/
/*
* Since virt-login-shell will be setuid, we must do everything
* we can to avoid linking to other libraries. Many of them do
* unsafe things in functions marked __atttribute__((constructor)).
* The only way to avoid such deps is to re-compile the
* functions with the code in question disabled, and for that we
* must override the main config.h rules. Hence this file :-(
*/
#ifdef LIBVIRT_SETUID_RPC_CLIENT
# undef HAVE_LIBNL
# undef HAVE_LIBNL3
# undef HAVE_LIBSASL2
# undef HAVE_SYS_ACL_H
# undef WITH_CAPNG
# undef WITH_CURL
# undef WITH_DBUS
# undef WITH_DEVMAPPER
# undef WITH_DTRACE_PROBES
# undef WITH_GNUTLS
# undef WITH_LIBSSH
# undef WITH_MACVTAP
# undef WITH_NUMACTL
# undef WITH_SASL
# undef WITH_SSH2
# undef WITH_SYSTEMD_DAEMON
# undef WITH_VIRTUALPORT
# undef WITH_YAJL
# undef WITH_YAJL2
#endif
/*
* With the NSS module it's the same story as virt-login-shell. See the
* explanation above.
*/
#ifdef LIBVIRT_NSS
# undef HAVE_LIBNL
# undef HAVE_LIBNL3
# undef HAVE_LIBSASL2
# undef HAVE_SYS_ACL_H
# undef WITH_CAPNG
# undef WITH_CURL
# undef WITH_DEVMAPPER
# undef WITH_DTRACE_PROBES
# undef WITH_GNUTLS
# undef WITH_LIBSSH
# undef WITH_MACVTAP
# undef WITH_NUMACTL
# undef WITH_SASL
# undef WITH_SSH2
# undef WITH_VIRTUALPORT
# undef WITH_SECDRIVER_SELINUX
# undef WITH_SECDRIVER_APPARMOR
# undef WITH_CAPNG
#endif /* LIBVIRT_NSS */
#ifndef __GNUC__
# error "Libvirt requires GCC >= 4.8, or CLang"
# error "Libvirt requires GCC >= 4.4, or CLang"
#endif
/*
@@ -32,6 +88,6 @@
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#endif
#if !(__GNUC_PREREQ(4, 8) || defined(__clang__))
# error "Libvirt requires GCC >= 4.8, or CLang"
#if !(__GNUC_PREREQ(4, 4) || defined(__clang__))
# error "Libvirt requires GCC >= 4.4, or CLang"
#endif

View File

@@ -16,21 +16,15 @@ 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], [5.7.0], [libvir-list@redhat.com], [], [https://libvirt.org])
AC_INIT([libvirt], [4.7.0], [libvir-list@redhat.com], [], [https://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AH_BOTTOM([#include <config-post.h>])
AC_CONFIG_MACRO_DIR([m4])
dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([
foreign
-Wno-portability
tar-pax
no-dist-gzip
dist-xz
subdir-objects
])
dnl Make automake keep quiet about wildcards & other GNUmake-isms; also keep
dnl quiet about the fact that we intentionally cater to automake 1.9
AM_INIT_AUTOMAKE([-Wno-portability -Wno-obsolete tar-pax no-dist-gzip dist-xz subdir-objects])
dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
dnl we don't really need the 'u' even in older toolchains. Then there is
dnl older libtool, which spelled it AR_FLAGS
@@ -129,29 +123,6 @@ if test -d $srcdir/.git && git --version >/dev/null 2>&1 ; then
AB_VERSION=`cd $srcdir && git describe --match 'v[[0-9]]*' 2>/dev/null`
fi
dnl autoconf 2.70 adds a --runstatedir option so that downstreams
dnl can point to /run instead of the historic /var/run, but
dnl autoconf hasn't had a release since 2012.
dnl
dnl gnulib sets configmake.h to include runstatedir, but sets
dnl it to $localstatedir/run if $runstatedir env var is not set
dnl which is useless for apps that need to use /run without
dnl waiting for autoconf 2.70
dnl
dnl we introduce --with-runstatedir and then overwrite the
dnl value of $runstatedir so gnulib's configmake.h becomes useful
AC_ARG_WITH(
[runstatedir],
[AS_HELP_STRING(
[--with-runstatedir],
[State directory for temporary sockets, pid files, etc])])
if test -n "$with_runstatedir"
then
runstatedir=$with_runstatedir
fi
gl_EARLY
gl_INIT
@@ -203,13 +174,13 @@ want_ifconfig=no
dnl Make some notes about which OS we're compiling for, as the lxc and qemu
dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter
dnl are also linux specific. The "network" and storage_fs drivers are known
dnl to not work on macOS presently, so we also make a note if compiling
dnl to not work on MacOS X presently, so we also make a note if compiling
dnl for that
with_linux=no with_macos=no with_freebsd=no with_win=no with_cygwin=no
with_linux=no with_osx=no with_freebsd=no with_win=no with_cygwin=no
case $host in
*-*-linux*) with_linux=yes ;;
*-*-darwin*) with_macos=yes ;;
*-*-darwin*) with_osx=yes ;;
*-*-freebsd*) with_freebsd=yes ;;
*-*-mingw* | *-*-msvc* ) with_win=yes ;;
*-*-cygwin*) with_cygwin=yes ;;
@@ -235,7 +206,6 @@ fi
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"])
# We don't support the daemon yet
if test "$with_win" = "yes" ; then
@@ -255,6 +225,7 @@ if test "$with_libvirtd" = "no" ; then
with_qemu=no
with_lxc=no
with_libxl=no
with_uml=no
with_vbox=no
fi
@@ -269,13 +240,13 @@ LIBVIRT_LINKER_NO_UNDEFINED
LIBVIRT_ARG_APPARMOR
LIBVIRT_ARG_ATTR
LIBVIRT_ARG_AUDIT
LIBVIRT_ARG_AVAHI
LIBVIRT_ARG_BASH_COMPLETION
LIBVIRT_ARG_BLKID
LIBVIRT_ARG_CAPNG
LIBVIRT_ARG_CURL
LIBVIRT_ARG_DBUS
LIBVIRT_ARG_FIREWALLD
LIBVIRT_ARG_FIREWALLD_ZONE
LIBVIRT_ARG_FUSE
LIBVIRT_ARG_GLUSTER
LIBVIRT_ARG_HAL
@@ -307,6 +278,7 @@ LIBVIRT_CHECK_APPARMOR
LIBVIRT_CHECK_ATOMIC
LIBVIRT_CHECK_ATTR
LIBVIRT_CHECK_AUDIT
LIBVIRT_CHECK_AVAHI
LIBVIRT_CHECK_BASH_COMPLETION
LIBVIRT_CHECK_BLKID
LIBVIRT_CHECK_CAPNG
@@ -315,7 +287,6 @@ LIBVIRT_CHECK_DBUS
LIBVIRT_CHECK_DEVMAPPER
LIBVIRT_CHECK_DLOPEN
LIBVIRT_CHECK_FIREWALLD
LIBVIRT_CHECK_FIREWALLD_ZONE
LIBVIRT_CHECK_FUSE
LIBVIRT_CHECK_GLUSTER
LIBVIRT_CHECK_GNUTLS
@@ -351,50 +322,17 @@ AC_CHECK_SIZEOF([long])
dnl Availability of various common functions (non-fatal if missing),
dnl and various less common threadsafe functions
AC_CHECK_FUNCS_ONCE([\
cfmakeraw \
fallocate \
geteuid \
getgid \
getifaddrs \
getmntent_r \
getpwuid_r \
getrlimit \
getuid \
getutxid \
if_indextoname \
mmap \
newlocale \
posix_fallocate \
posix_memalign \
prlimit \
sched_getaffinity \
sched_setscheduler \
setgroups \
setns \
setrlimit \
symlink \
sysctlbyname \
unshare \
])
AC_CHECK_FUNCS_ONCE([cfmakeraw fallocate geteuid getgid getgrnam_r \
getmntent_r getpwuid_r getrlimit getuid if_indextoname kill mmap \
newlocale posix_fallocate posix_memalign prlimit regexec \
sched_getaffinity setgroups setns setrlimit symlink sysctlbyname \
getifaddrs sched_setscheduler unshare])
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([\
ifaddrs.h \
libtasn1.h \
linux/magic.h \
mntent.h \
net/ethernet.h \
netinet/tcp.h \
pwd.h \
stdarg.h \
syslog.h \
sys/mount.h \
sys/syscall.h \
sys/sysctl.h \
sys/ucred.h \
sys/un.h \
])
AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
sys/un.h sys/syscall.h sys/sysctl.h netinet/tcp.h ifaddrs.h \
libtasn1.h sys/ucred.h sys/mount.h stdarg.h])
dnl Check whether endian provides handy macros.
AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64])
@@ -437,6 +375,19 @@ dnl
LIBVIRT_CHECK_EXTERNAL_PROGRAMS
dnl Specific dir for HTML output ?
LIBVIRT_ARG_WITH([HTML_DIR], [path to base html directory],
['$(datadir)/doc'])
LIBVIRT_ARG_WITH([HTML_SUBDIR], [directory used under html-dir],
['$(PACKAGE)-$(VERSION)/html'])
if test "x$with_html_subdir" != "x" ; then
HTML_DIR="$with_html_dir/$with_html_subdir"
else
HTML_DIR="$with_html_dir"
fi
AC_SUBST([HTML_DIR])
dnl if --prefix is /usr, don't use /usr/var for localstatedir
dnl or /usr/etc for sysconfdir
dnl as this makes a lot of things break in testing situations
@@ -462,6 +413,7 @@ LIBVIRT_DRIVER_ARG_VBOX
LIBVIRT_DRIVER_ARG_LXC
LIBVIRT_DRIVER_ARG_VZ
LIBVIRT_DRIVER_ARG_BHYVE
LIBVIRT_DRIVER_ARG_UML
LIBVIRT_DRIVER_ARG_ESX
LIBVIRT_DRIVER_ARG_HYPERV
LIBVIRT_DRIVER_ARG_TEST
@@ -480,6 +432,7 @@ LIBVIRT_DRIVER_CHECK_VBOX
LIBVIRT_DRIVER_CHECK_LXC
LIBVIRT_DRIVER_CHECK_VZ
LIBVIRT_DRIVER_CHECK_BHYVE
LIBVIRT_DRIVER_CHECK_UML
LIBVIRT_DRIVER_CHECK_ESX
LIBVIRT_DRIVER_CHECK_HYPERV
LIBVIRT_DRIVER_CHECK_TEST
@@ -488,6 +441,8 @@ LIBVIRT_DRIVER_CHECK_LIBVIRTD
LIBVIRT_DRIVER_CHECK_NETWORK
LIBVIRT_DRIVER_CHECK_INTERFACE
AM_CONDITIONAL([WITH_XENCONFIG], [test "$with_libxl" = "yes"])
dnl
dnl in case someone want to build static binaries
@@ -535,6 +490,9 @@ dnl
AC_CHECK_HEADERS([linux/kvm.h])
AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"])
dnl
dnl check for kernel headers required by src/bridge.c
dnl
@@ -632,9 +590,9 @@ if test "$with_libvirtd" = "no"; then
with_storage_vstorage=no
fi
dnl storage-fs does not work on macOS
dnl storage-fs does not work on MacOS X
if test "$with_macos" = "yes"; then
if test "$with_osx" = "yes"; then
with_storage_fs=no
fi
@@ -957,6 +915,7 @@ AC_MSG_NOTICE([])
AC_MSG_NOTICE([Drivers])
AC_MSG_NOTICE([])
LIBVIRT_DRIVER_RESULT_QEMU
LIBVIRT_DRIVER_RESULT_UML
LIBVIRT_DRIVER_RESULT_OPENVZ
LIBVIRT_DRIVER_RESULT_VMWARE
LIBVIRT_DRIVER_RESULT_VBOX
@@ -1005,6 +964,7 @@ LIBVIRT_RESULT_ACL
LIBVIRT_RESULT_APPARMOR
LIBVIRT_RESULT_ATTR
LIBVIRT_RESULT_AUDIT
LIBVIRT_RESULT_AVAHI
LIBVIRT_RESULT_BASH_COMPLETION
LIBVIRT_RESULT_BLKID
LIBVIRT_RESULT_CAPNG
@@ -1012,7 +972,6 @@ LIBVIRT_RESULT_CURL
LIBVIRT_RESULT_DBUS
LIBVIRT_RESULT_DLOPEN
LIBVIRT_RESULT_FIREWALLD
LIBVIRT_RESULT_FIREWALLD_ZONE
LIBVIRT_RESULT_FUSE
LIBVIRT_RESULT_GLUSTER
LIBVIRT_RESULT_GNUTLS

View File

@@ -16,33 +16,26 @@
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
HTML_DIR = $(docdir)/html
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
modules = \
libvirt-common \
libvirt-domain \
libvirt-domain-checkpoint \
libvirt-domain-snapshot \
libvirt-event \
libvirt-host \
libvirt-interface \
libvirt-network \
libvirt-nodedev \
libvirt-nwfilter \
libvirt-secret \
libvirt-storage \
libvirt-stream \
virterror \
$(NULL)
apihtml = \
html/index.html \
$(apihtml_generated)
apihtml_generated = \
$(addprefix html/libvirt-,$(addsuffix .html,$(modules))) \
$(NULL)
html/libvirt-libvirt-common.html \
html/libvirt-libvirt-domain.html \
html/libvirt-libvirt-domain-snapshot.html \
html/libvirt-libvirt-event.html \
html/libvirt-libvirt-host.html \
html/libvirt-libvirt-interface.html \
html/libvirt-libvirt-network.html \
html/libvirt-libvirt-nodedev.html \
html/libvirt-libvirt-nwfilter.html \
html/libvirt-libvirt-secret.html \
html/libvirt-libvirt-storage.html \
html/libvirt-libvirt-stream.html \
html/libvirt-virterror.html
apipng = \
html/left.png \
@@ -54,11 +47,7 @@ devhelphtml = \
devhelp/libvirt.devhelp \
devhelp/index.html \
devhelp/general.html \
$(devhelphtml_generated)
devhelphtml_generated = \
$(addprefix devhelp/libvirt-,$(addsuffix .html,$(modules))) \
$(NULL)
devhelp/libvirt-virterror.html
css = \
generic.css \
@@ -66,10 +55,6 @@ css = \
mobile.css \
main.css
javascript = \
js/main.js \
$(NULL)
fonts = \
fonts/LICENSE.md \
fonts/stylesheet.css \
@@ -133,10 +118,6 @@ internals_html_in = \
$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
internals_html = $(internals_html_in:%.html.in=%.html)
kbase_html_in = \
$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.html.in))
kbase_html = $(kbase_html_in:%.html.in=%.html)
# Since we ship pre-built html in the tarball, we must also
# ship the sources, even when those sources are themselves
# generated.
@@ -147,6 +128,10 @@ dot_html_in = \
$(notdir $(wildcard $(srcdir)/*.html.in))
dot_html = $(dot_html_in:%.html.in=%.html)
dot_php_in = $(notdir $(wildcard $(srcdir)/*.php.in))
dot_php_code_in = $(dot_php_in:%.php.in=%.php.code.in)
dot_php = $(dot_php_in:%.php.in=%.php)
xml = \
libvirt-api.xml \
libvirt-refs.xml
@@ -190,9 +175,8 @@ EXTRA_DIST= \
$(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
$(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
$(xml) $(qemu_xml) $(lxc_xml) $(admin_xml) $(fig) $(png) $(css) \
$(javascript) $(logofiles) \
$(logofiles) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
$(internals_html_in) $(internals_html) $(fonts) \
$(kbase_html_in) $(kbase_html) \
aclperms.htmlinc \
hvsupport.pl \
$(schema_DATA)
@@ -208,7 +192,7 @@ MAINTAINERCLEANFILES = \
$(addprefix $(srcdir)/,$(apihtml)) \
$(addprefix $(srcdir)/,$(devhelphtml)) \
$(addprefix $(srcdir)/,$(internals_html)) \
$(addprefix $(srcdir)/,$(kbase_html)) \
$(addprefix $(srcdir)/,$(dot_php)) \
$(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc
timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \
@@ -225,8 +209,8 @@ qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
lxc_api: $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
admin_api: $(srcdir)/libvirt-admin-api.xml $(srcdir)/libvirt-admin-refs.xml
web: $(dot_html) $(internals_html) $(kbase_html) \
html/index.html devhelp/index.html
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html \
$(dot_php)
hvsupport.html: $(srcdir)/hvsupport.html.in
@@ -237,14 +221,20 @@ $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
$(AM_V_GEN)$(PERL) $(srcdir)/hvsupport.pl $(top_srcdir)/src > $@ \
|| { rm $@ && exit 1; }
# xsltproc seems to add the xmlns="" attribute to random output elements:
# use sed to strip it out, as leaving it there triggers XML errors during
# further transformation steps
news.html.in: \
$(srcdir)/news.xml \
$(srcdir)/news-html.xsl
$(AM_V_GEN)$(XSLTPROC) --nonet \
$(srcdir)/news-html.xsl \
$(srcdir)/news.xml \
>$@ \
|| { rm -f $@; exit 1; };
>$@-tmp \
|| { rm -f $@-tmp; exit 1; }; \
sed 's/ xmlns=""//g' $@-tmp >$@ \
|| { rm -f $@-tmp; exit 1; }; \
rm -f $@-tmp
EXTRA_DIST += \
$(srcdir)/news.xml \
$(srcdir)/news.rng \
@@ -275,6 +265,18 @@ MAINTAINERCLEANFILES += \
$(AM_V_GEN)$(XMLLINT) --nonet --format $< > $(srcdir)/$@ \
|| { rm $(srcdir)/$@ && exit 1; }
%.php.tmp: %.php.in site.xsl page.xsl
$(AM_V_GEN)$(XSLTPROC) --stringparam pagename $(@:.tmp=) \
--stringparam timestamp $(timestamp) --nonet \
$(top_srcdir)/docs/site.xsl $< > $@ \
|| { rm $@ && exit 1; }
%.php: %.php.tmp %.php.code.in
$(AM_V_GEN)sed \
-e '/<span id="php_placeholder"><\/span>/r '"$(srcdir)/$@.code.in" \
-e /php_placeholder/d < $@.tmp > $(srcdir)/$@ \
|| { rm $(srcdir)/$@ && exit 1; }
$(apihtml_generated): html/index.html
html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
@@ -314,7 +316,6 @@ $(python_generated_files): $(APIBUILD_STAMP)
$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
$(top_srcdir)/include/libvirt/libvirt.h \
$(top_srcdir)/include/libvirt/libvirt-common.h.in \
$(top_srcdir)/include/libvirt/libvirt-domain-checkpoint.h \
$(top_srcdir)/include/libvirt/libvirt-domain-snapshot.h \
$(top_srcdir)/include/libvirt/libvirt-domain.h \
$(top_srcdir)/include/libvirt/libvirt-event.h \
@@ -331,7 +332,6 @@ $(APIBUILD_STAMP): $(srcdir)/apibuild.py \
$(top_srcdir)/include/libvirt/libvirt-admin.h \
$(top_srcdir)/include/libvirt/virterror.h \
$(top_srcdir)/src/libvirt.c \
$(top_srcdir)/src/libvirt-domain-checkpoint.c \
$(top_srcdir)/src/libvirt-domain-snapshot.c \
$(top_srcdir)/src/libvirt-domain.c \
$(top_srcdir)/src/libvirt-host.c \
@@ -371,9 +371,6 @@ install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
for f in $(css) $(dot_html) $(gif) $(png); do \
$(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/js
for f in $(javascript); do \
$(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/js/; done
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/logos
for f in $(logofiles); do \
$(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/logos; done
@@ -385,9 +382,6 @@ install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/internals
for f in $(internals_html); do \
$(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/internals; done
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/kbase
for f in $(kbase_html); do \
$(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/kbase; done
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
$(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
@@ -404,17 +398,11 @@ uninstall-local:
for f in $(logofiles); do \
rm -f $(DESTDIR)$(HTML_DIR)/$$f; \
done
for f in $(javascript); do \
rm -f $(DESTDIR)$(HTML_DIR)/$$f; \
done
for h in $(apihtml); do rm -f $(DESTDIR)$(HTML_DIR)/$$h; done
for p in $(apipng); do rm -f $(DESTDIR)$(HTML_DIR)/$$p; done
for f in $(internals_html); do \
rm -f $(DESTDIR)$(HTML_DIR)/$$f; \
done
for f in $(kbase_html); do \
rm -f $(DESTDIR)$(HTML_DIR)/$$f; \
done
for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
rm -f $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
done

View File

@@ -287,119 +287,6 @@
</tbody>
</table>
<h2><a id="connect_driver">Hypervisor Driver connect_driver</a></h2>
<p>
The <code>connect_driver</code> parameter describes the
client's <a href="remote.html">remote Connection Driver</a>
name based on the <a href="uri.html">URI</a> used for the
connection.
</p>
<p>
<span class="since">Since 4.1.0</span>, when calling an API
outside the scope of the primary connection driver, the
primary driver will attempt to open a secondary connection
to the specific API driver in order to process the API. For
example, when hypervisor domain processing needs to make an
API call within the storage driver or the network filter driver
an attempt to open a connection to the "storage" or "nwfilter"
driver will be made. Similarly, a "storage" primary connection
may need to create a connection to the "secret" driver in order
to process secrets for the API. If successful, then calls to
those API's will occur in the <code>connect_driver</code> context
of the secondary connection driver rather than in the context of
the primary driver. This affects the <code>connect_driver</code>
returned from rule generation from the <code>action.loookup</code>
function. The following table provides a list of the various
connection drivers and the <code>connect_driver</code> name
used by each regardless of primary or secondary connection.
The access denied error message from libvirt will list the
connection driver by name that denied the access.
</p>
<h3><a id="object_connect_driver">Connection Driver Name</a></h3>
<table class="acl">
<thead>
<tr>
<th>Connection Driver</th>
<th><code>connect_driver</code> name</th>
</tr>
</thead>
<tbody>
<tr>
<td>bhyve</td>
<td>bhyve</td>
</tr>
<tr>
<td>esx</td>
<td>ESX</td>
</tr>
<tr>
<td>hyperv</td>
<td>Hyper-V</td>
</tr>
<tr>
<td>interface</td>
<td>interface</td>
</tr>
<tr>
<td>libxl</td>
<td>xenlight</td>
</tr>
<tr>
<td>lxc</td>
<td>LXC</td>
</tr>
<tr>
<td>network</td>
<td>network</td>
</tr>
<tr>
<td>nodedev</td>
<td>nodedev</td>
</tr>
<tr>
<td>nwfilter</td>
<td>NWFilter</td>
</tr>
<tr>
<td>openvz</td>
<td>OPENVZ</td>
</tr>
<tr>
<td>phyp</td>
<td>PHYP</td>
</tr>
<tr>
<td>qemu</td>
<td>QEMU</td>
</tr>
<tr>
<td>secret</td>
<td>secret</td>
</tr>
<tr>
<td>storage</td>
<td>storage</td>
</tr>
<tr>
<td>vbox</td>
<td>VBOX</td>
</tr>
<tr>
<td>vmware</td>
<td>VMWARE</td>
</tr>
<tr>
<td>vz</td>
<td>vz</td>
</tr>
<tr>
<td>xenapi</td>
<td>XenAPI</td>
</tr>
</tbody>
</table>
<h2><a id="user">User identity attributes</a></h2>

View File

@@ -89,7 +89,7 @@
separately.
</p>
<h2><a id='publicapi'>Defining the public API</a></h2>
<h2><a name='publicapi'>Defining the public API</a></h2>
<p>The first task is to define the public API. If the new API
involves an XML extension, you have to enhance the RelaxNG
@@ -119,7 +119,7 @@
rework it as you go through the process of implementing it.
</p>
<h2><a id='internalapi'>Defining the internal API</a></h2>
<h2><a name='internalapi'>Defining the internal API</a></h2>
<p>
Each public API call is associated with a driver, such as a host
@@ -146,7 +146,7 @@
provide a <code>NULL</code> stub for the new function.
</p>
<h2><a id='implpublic'>Implementing the public API</a></h2>
<h2><a name='implpublic'>Implementing the public API</a></h2>
<p>
Implementing the public API is largely a formality in which we wire up
@@ -179,7 +179,7 @@
<p><code>src/libvirt-$MODULE.c</code></p>
<h2><a id='remoteproto'>Implementing the remote protocol</a></h2>
<h2><a name='remoteproto'>Implementing the remote protocol</a></h2>
<p>
Implementing the remote protocol is essentially a
@@ -187,7 +187,7 @@
understood by referring to the existing code.
</p>
<h3><a id='wireproto'>Defining the wire protocol format</a></h3>
<h3><a name='wireproto'>Defining the wire protocol format</a></h3>
<p>
Defining the wire protocol involves making additions to:
@@ -226,11 +226,11 @@
src/remote/remote_protocol.h
</code></p>
<h3><a id='rpcclient'>Implement the RPC client</a></h3>
<h3><a name='rpcclient'>Implement the RPC client</a></h3>
<p>
Implementing the RPC client uses the rpcgen generated .h files.
The remote method calls go in:
Implementing the uses the rpcgen generated .h files. The remote
method calls go in:
</p>
<p><code>src/remote/remote_driver.c</code></p>
@@ -256,7 +256,7 @@
The server side dispatchers are implemented in:
</p>
<p><code>src/remote/remote_daemon_dispatch.c</code></p>
<p><code>src/remote/daemon_dispatch.c</code></p>
<p>Again, this step uses the .h files generated by make rpcgen.</p>

View File

@@ -26,7 +26,6 @@ debugsym = None
included_files = {
"libvirt-common.h": "header with general libvirt API definitions",
"libvirt-domain.h": "header with general libvirt API definitions",
"libvirt-domain-checkpoint.h": "header with general libvirt API definitions",
"libvirt-domain-snapshot.h": "header with general libvirt API definitions",
"libvirt-event.h": "header with general libvirt API definitions",
"libvirt-host.h": "header with general libvirt API definitions",
@@ -40,7 +39,6 @@ included_files = {
"virterror.h": "header with error specific API definitions",
"libvirt.c": "Main interfaces for the libvirt library",
"libvirt-domain.c": "Domain interfaces for the libvirt library",
"libvirt-domain-checkpoint.c": "Domain checkpoint interfaces for the libvirt library",
"libvirt-domain-snapshot.c": "Domain snapshot interfaces for the libvirt library",
"libvirt-host.c": "Host interfaces for the libvirt library",
"libvirt-interface.c": "Interface interfaces for the libvirt library",
@@ -1005,8 +1003,6 @@ class CParser:
# skip hidden macros
if name in hidden_macros:
return token
if name[-2:] == "_H" or name[-8:] == "_H_ALLOW":
return token
strValue = None
if len(lst) == 1 and lst[0][0] == '"' and lst[0][-1] == '"':
@@ -2119,22 +2115,12 @@ class docBuilder:
self.modulename_file(id.header)))
if id.info is not None:
info = id.info
valhex = ""
if info[0] is not None and info[0] != '':
try:
val = eval(info[0])
valhex = hex(val)
except:
val = info[0]
output.write(" value='%s'" % (val))
if valhex != "":
output.write(" value_hex='%s'" % (valhex))
m = re.match("\(?1<<(\d+)\)?", info[0])
if m:
output.write(" value_bitshift='%s'" % (m.group(1)))
if info[2] is not None and info[2] != '':
output.write(" type='%s'" % info[2])
if info[1] is not None and info[1] != '':
@@ -2284,7 +2270,7 @@ class docBuilder:
output.write(" <file name='%s'>\n" % (module))
dict = self.headers[file]
if dict.info is not None:
for data in ('Summary', 'Description'):
for data in ('Summary', 'Description', 'Author'):
try:
output.write(" <%s>%s</%s>\n" % (
data.lower(),

View File

@@ -30,6 +30,26 @@
<img src="logos/logo-square-powered-256.png" alt="libvirt powered"/>
</p>
<h2><a id="clientserver">Client/Server applications</a></h2>
<dl>
<dt><a href="http://archipelproject.org">Archipel</a></dt>
<dd>
Archipel is a libvirt-based solution to manage and supervise virtual
machines. It uses XMPP for all communication. There is no web
service or custom protocol. You just need at least one XMPP server,
like eJabberd, to start playing with it. This allows Archipel to
work completely real time. You never have to refresh the user
interface, you'll be notified as soon as something happens. You can
even use your favorite chat clients to command your infrastructure.
</dd>
<dd>
Isn't it great to be able to open a chat conversation with your
virtual machine and say things like "How are you today?" or "Hey,
please reboot"?
</dd>
</dl>
<h2><a id="command">Command line tools</a></h2>
<dl>
@@ -99,12 +119,6 @@
machines. It is a command line tool for developers that makes it very
fast and easy to deploy and re-deploy an environment of vm's.
</dd>
<dt><a href="https://github.com/virt-lightning/virt-lightning">virt-lightning</a></dt>
<dd>
Virt-Lightning uses libvirt, cloud-init and libguestfs to allow anyone
to quickly start a new VM. Very much like a container CLI, but with a
virtual machine.
</dd>
</dl>
<h2><a id="configmgmt">Configuration Management</a></h2>
@@ -128,7 +142,7 @@
<h2><a id="continuousintegration">Continuous Integration</a></h2>
<dl>
<dt><a href="http://docs.buildbot.net/latest/manual/configuration/workers-libvirt.html">BuildBot</a></dt>
<dt><a href="https://buildbot.net/buildbot/docs/current/Libvirt.html">BuildBot</a></dt>
<dd>
BuildBot is a system to automate the compile/test cycle required
by most software projects. CVS commits trigger new builds, run on
@@ -359,6 +373,12 @@
metrics. It supports pCPU, vCPU, memory, block device, network interface,
and performance event metrics for each virtual guest.
</dd>
<dt><a href="https://community.zenoss.org/docs/DOC-4687">Zenoss</a></dt>
<dd>
The Zenoss libvirt Zenpack adds support for monitoring virtualization
servers. It has been tested with KVM, QEMU, VMware ESX, and VMware
GSX.
</dd>
</dl>
<h2><a id="provisioning">Provisioning</a></h2>
@@ -463,6 +483,17 @@
</dd>
</dl>
<h2><a id="mobile">Mobile applications</a></h2>
<dl>
<dt><a href="https://market.android.com/details?id=vm.manager">VM Manager</a></dt>
<dd>
VM Manager is VM (libvirt) manager (over SSH) application. VM Manager
is an application for libvirt VM / Domain management over SSH.
Please keep in mind that this software is under heavy development.
</dd>
</dl>
<h2><a id="other">Other</a></h2>
<dl>

View File

@@ -184,29 +184,15 @@ Default policy will still allow any application to connect to the RO socket.
</p>
<p>
The default policy can be overridden by creating a new policy file in the
<code>/etc/polkit-1/rules.d</code> directory. Information on the options
available can be found by reading the <code>polkit(8)</code> man page. The
two libvirt actions are named <code>org.libvirt.unix.manage</code> for full
management access, and <code>org.libvirt.unix.monitor</code> for read-only
access.
</p>
<p>
As an example, creating <code>/etc/polkit-1/rules.d/80-libvirt-manage.rules</code>
with the following gives the user <code>fred</code> full management access
when accessing from an active local session:
</p>
<pre>polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" &amp;&amp;
subject.local &amp;&amp; subject.active &amp;&amp; subject.user == "fred") {
return polkit.Result.YES;
}
});</pre>
<p>
Older versions of PolicyKit used policy files ending with .pkla in the
local override directory <code>/etc/polkit-1/localauthority/50-local.d/</code>.
Compatibility with this older format is provided by <a
href="https://pagure.io/polkit-pkla-compat">polkit-pkla-compat</a>. As an
example, this gives the user <code>fred</code> full management access:
Policy files should have a unique name ending with .pkla. Using reverse DNS
naming works well. Information on the options available can be found by
reading the pklocalauthority man page. The two libvirt daemon actions
available are named <code>org.libvirt.unix.manage</code> for full management
access, and <code>org.libvirt.unix.monitor</code> for read-only access.
</p>
<p>
As an example, this gives the user <code>fred</code> full management access:
</p>
<pre>[Allow fred libvirt management permissions]
Identity=unix-user:fred
@@ -214,6 +200,10 @@ Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes</pre>
<p>
Further examples of PolicyKit setup can be found on the
<a href="http://wiki.libvirt.org/page/SSHPolicyKitSetup">wiki page</a>.
</p>
<h2><a id="ACL_server_sasl">SASL pluggable authentication</a></h2>
<p>

View File

@@ -6,14 +6,14 @@
<ul id="toc"></ul>
<h2><a id="description">Description</a></h2>
<h2><a name="description">Description</a></h2>
<p>
libvirt-dbus wraps libvirt API to provide a high-level object-oriented
API better suited for dbus-based applications.
</p>
<h2><a id="git">GIT source repository</a></h2>
<h2><a name="git">GIT source repository</a></h2>
<p>
The D-Bus bindings source code is maintained in a
<a href="https://git-scm.com/">git</a> repository available on
@@ -32,7 +32,7 @@ git clone https://libvirt.org/git/libvirt-dbus.git
<a href="https://libvirt.org/git/?p=libvirt-dbus.git">https://libvirt.org/git/?p=libvirt-dbus.git</a>
</pre>
<h2><a id="usage">Usage</a></h2>
<h2><a name="usage">Usage</a></h2>
<p>
libvirt-dbus exports libvirt API using D-Bus objects with methods and

View File

@@ -72,6 +72,7 @@
<xsl:if test="deprecated">
<p> WARNING: this module is deprecated !</p>
</xsl:if>
<p>Author(s): <xsl:value-of select="author"/></p>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

View File

@@ -173,7 +173,7 @@
<xsl:template mode="details" match="struct">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}">Structure </a><xsl:value-of select="$name"/></h3>
<h3><a name="{$name}">Structure </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:value-of select="@type"/><xsl:text> {
</xsl:text>
@@ -214,7 +214,7 @@
<xsl:template mode="details" match="typedef[@type != 'enum']">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}">Typedef </a><xsl:value-of select="$name"/></h3>
<h3><a name="{$name}">Typedef </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="string(@type)"/>
@@ -236,7 +236,7 @@
<xsl:template mode="details" match="variable">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}">Variable </a><xsl:value-of select="$name"/></h3>
<h3><a name="{$name}">Variable </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="string(@type)"/>
@@ -258,7 +258,7 @@
<xsl:template mode="details" match="typedef[@type = 'enum']">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}">Enum </a><xsl:value-of select="$name"/></h3>
<h3><a name="{$name}">Enum </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:text>enum </xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
@@ -267,7 +267,7 @@
<xsl:for-each select="/api/symbols/enum[@type=$name]">
<xsl:sort select="@value" data-type="number" order="ascending"/>
<xsl:text> </xsl:text>
<a id="{@name}"><xsl:value-of select="@name"/></a>
<a name="{@name}"><xsl:value-of select="@name"/></a>
<xsl:if test="@value">
<xsl:text> = </xsl:text>
<xsl:value-of select="@value"/>
@@ -295,7 +295,7 @@
<xsl:template mode="details" match="macro">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}">Macro </a><xsl:value-of select="$name"/></h3>
<h3><a name="{$name}">Macro </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:text>#define </xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
@@ -342,7 +342,7 @@
<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))"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}"></a><xsl:value-of select="$name"/> ()</h3>
<h3><a name="{$name}"></a><xsl:value-of select="$name"/> ()</h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
@@ -419,7 +419,7 @@
<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))"/>
<div class="refsect2" lang="en">
<h3><a id="{$name}"></a>Function type <xsl:value-of select="$name"/> </h3>
<h3><a name="{$name}"></a>Function type <xsl:value-of select="$name"/> </h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
@@ -565,6 +565,10 @@ by a Linux instance. The library aim at providing long term stable C API
initially for the <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen
paravirtualization</a> but should be able to integrate other virtualization
mechanisms if needed.</p>
<p> If you get lost searching for some specific API use, try
<a href="https://libvirt.org/search.php">the online search
engine</a> hosted on <a href="https://libvirt.org/">libvirt.org</a>
it indexes the project page, the APIs as well as the mailing-list archives. </p>
</body>
</html>
</xsl:document>

View File

@@ -72,21 +72,23 @@
<dd>Description of the XML schemas for
<a href="formatdomain.html">domains</a>,
<a href="formatnetwork.html">networks</a>,
<a href="formatnetworkport.html">network ports</a>,
<a href="formatnwfilter.html">network filtering</a>,
<a href="formatstorage.html">storage</a>,
<a href="formatstorageencryption.html">storage encryption</a>,
<a href="formatcaps.html">capabilities</a>,
<a href="formatdomaincaps.html">domain capabilities</a>,
<a href="formatstoragecaps.html">storage pool capabilities</a>,
<a href="formatnode.html">node devices</a>,
<a href="formatsecret.html">secrets</a>,
<a href="formatsnapshot.html">snapshots</a>,
<a href="formatcheckpoint.html">checkpoints</a></dd>
<a href="formatsnapshot.html">snapshots</a></dd>
<dt><a href="uri.html">URI format</a></dt>
<dd>The URI formats used for connecting to libvirt</dd>
<dt><a href="locking.html">Disk locking</a></dt>
<dd>Ensuring exclusive guest access to disks with
<a href="locking-lockd.html">virtlockd</a> or
<a href="locking-sanlock.html">Sanlock</a></dd>
<dt><a href="cgroups.html">CGroups</a></dt>
<dd>Control groups integration</dd>
@@ -94,7 +96,6 @@
<dd>Reference manual for the C public API, split in
<a href="html/libvirt-libvirt-common.html">common</a>,
<a href="html/libvirt-libvirt-domain.html">domain</a>,
<a href="html/libvirt-libvirt-domain-checkpoint.html">domain checkpoint</a>,
<a href="html/libvirt-libvirt-domain-snapshot.html">domain snapshot</a>,
<a href="html/libvirt-virterror.html">error</a>,
<a href="html/libvirt-libvirt-event.html">event</a>,
@@ -117,8 +118,8 @@
<dt><a href="hvsupport.html">Driver support</a></dt>
<dd>matrix of API support per hypervisor per release</dd>
<dt><a href="kbase.html">Knowledge Base</a></dt>
<dd>Task oriented guides to key features</dd>
<dt><a href="secureusage.html">Secure usage</a></dt>
<dd>Secure usage of the libvirt APIs</dd>
</dl>
</div>

View File

@@ -27,7 +27,8 @@
<tr>
<td>libvirt</td>
<td>
<a href="https://libvirt.org/sources/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/">ftp</a>
<a href="https://libvirt.org/sources/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt.git;a=summary">libvirt</a>
@@ -47,7 +48,8 @@
<tr>
<td>C#</td>
<td>
<a href="https://libvirt.org/sources/csharp/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/csharp/">ftp</a>
<a href="https://libvirt.org/sources/csharp/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-csharp.git;a=summary">libvirt</a>
@@ -61,7 +63,8 @@
<tr>
<td>Go</td>
<td>
<a href="https://libvirt.org/sources/go/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/go/">ftp</a>
<a href="https://libvirt.org/sources/go/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-go.git;a=summary">libvirt</a>
@@ -77,7 +80,8 @@
<tr>
<td>Java</td>
<td>
<a href="https://libvirt.org/sources/java/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/java/">ftp</a>
<a href="https://libvirt.org/sources/java/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-java.git;a=summary">libvirt</a>
@@ -91,7 +95,8 @@
<tr>
<td>OCaml</td>
<td>
<a href="https://libvirt.org/sources/ocaml/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/ocaml/">ftp</a>
<a href="https://libvirt.org/sources/ocaml/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-ocaml.git;a=summary">libvirt</a>
@@ -105,7 +110,7 @@
<tr>
<td>Perl (Sys::Virt)</td>
<td>
<a href="https://metacpan.org/release/Sys-Virt/">cpan</a>
<a href="http://search.cpan.org/dist/Sys-Virt/">cpan</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-perl.git;a=summary">libvirt</a>
@@ -115,14 +120,15 @@
<a href="https://github.com/libvirt/libvirt-perl">github</a>
</td>
<td>
<a href="https://metacpan.org/release/Sys-Virt/">api ref</a>
<a href="http://search.cpan.org/dist/Sys-Virt/">api ref</a>
<a href="https://libvirt.org/git/?p=libvirt-perl.git;a=blob;f=Changes;hb=HEAD">changes</a>
</td>
</tr>
<tr>
<td>PHP</td>
<td>
<a href="https://libvirt.org/sources/php/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/php/">ftp</a>
<a href="https://libvirt.org/sources/php/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-php.git;a=summary">libvirt</a>
@@ -136,7 +142,8 @@
<tr>
<td>Python</td>
<td>
<a href="https://libvirt.org/sources/python/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/python/">ftp</a>
<a href="https://libvirt.org/sources/python/">https</a>
<a href="https://pypi.python.org/pypi/libvirt-python">pypi</a>
</td>
<td>
@@ -151,7 +158,8 @@
<tr>
<td>Ruby</td>
<td>
<a href="https://libvirt.org/sources/ruby/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/ruby/">ftp</a>
<a href="https://libvirt.org/sources/ruby/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=ruby-libvirt.git;a=summary">libvirt</a>
@@ -165,7 +173,8 @@
<tr>
<td>Rust</td>
<td>
<a href="https://libvirt.org/sources/rust/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/rust/">ftp</a>
<a href="https://libvirt.org/sources/rust/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-rust.git;a=summary">libvirt</a>
@@ -182,7 +191,8 @@
<tr>
<td>GLib / GConfig / GObject</td>
<td>
<a href="https://libvirt.org/sources/glib/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/glib/">ftp</a>
<a href="https://libvirt.org/sources/glib/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-glib.git;a=summary">libvirt</a>
@@ -196,7 +206,8 @@
<tr>
<td>Go XML</td>
<td>
<a href="https://libvirt.org/sources/go/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/go/">ftp</a>
<a href="https://libvirt.org/sources/go/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-go-xml.git;a=summary">libvirt</a>
@@ -212,7 +223,8 @@
<tr>
<td>D-Bus</td>
<td>
<a href="https://libvirt.org/sources/dbus/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/dbus/">ftp</a>
<a href="https://libvirt.org/sources/dbus/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-dbus.git;a=summary">libvirt</a>
@@ -226,7 +238,8 @@
<tr>
<td>Console Proxy</td>
<td>
<a href="https://libvirt.org/sources/consoleproxy/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/consoleproxy/">ftp</a>
<a href="https://libvirt.org/sources/consoleproxy/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-console-proxy.git;a=summary">libvirt</a>
@@ -240,7 +253,8 @@
<tr>
<td>CIM provider</td>
<td>
<a href="https://libvirt.org/sources/CIM/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/CIM/">ftp</a>
<a href="https://libvirt.org/sources/CIM/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-cim.git;a=summary">libvirt</a>
@@ -254,7 +268,8 @@
<tr>
<td>CIM utils</td>
<td>
<a href="https://libvirt.org/sources/CIM/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/CIM/">ftp</a>
<a href="https://libvirt.org/sources/CIM/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libcmpiutil.git;a=summary">libvirt</a>
@@ -268,7 +283,8 @@
<tr>
<td>SNMP</td>
<td>
<a href="https://libvirt.org/sources/snmp/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/snmp/">ftp</a>
<a href="https://libvirt.org/sources/snmp/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-snmp.git;a=summary">libvirt</a>
@@ -282,7 +298,8 @@
<tr>
<td>Application Sandbox</td>
<td>
<a href="https://libvirt.org/sources/sandbox/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/sandbox/">ftp</a>
<a href="https://libvirt.org/sources/sandbox/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-sandbox.git;a=summary">libvirt</a>
@@ -299,7 +316,8 @@
<tr>
<td>TCK</td>
<td>
<a href="https://libvirt.org/sources/tck/">libvirt</a>
<a href="ftp://libvirt.org/libvirt/tck/">ftp</a>
<a href="https://libvirt.org/sources/tck/">https</a>
</td>
<td>
<a href="https://libvirt.org/git/?p=libvirt-tck.git;a=summary">libvirt</a>
@@ -404,11 +422,14 @@
<p>
Most modules have releases made available for download on the project
site via HTTPS. Some modules are instead made available at alternative
locations, for example, the Perl binding is made available only on CPAN.
site, via FTP, HTTP or HTTPS. Some modules are instead made available
at alternative locations, for example, the Perl binding is made
available only on CPAN.
</p>
<ul>
<li><a href="ftp://libvirt.org/libvirt/">libvirt.org FTP server</a></li>
<li><a href="https://libvirt.org/sources/">libvirt.org HTTP server</a></li>
<li><a href="https://libvirt.org/sources/">libvirt.org HTTPS server</a></li>
</ul>

View File

@@ -6,7 +6,7 @@
<ul>
<li><a href="#hypervisor">Hypervisor drivers</a></li>
<li><a href="storage.html">Storage drivers</a></li>
<li><a href="#storage">Storage drivers</a></li>
<li><a href="drvnodedev.html">Node device driver</a></li>
</ul>
@@ -29,6 +29,7 @@
<li><strong><a href="drvopenvz.html">OpenVZ</a></strong></li>
<li><strong><a href="drvqemu.html">QEMU</a></strong></li>
<li><strong><a href="drvtest.html">Test</a></strong> - Used for testing</li>
<li><strong><a href="drvuml.html">UML</a></strong> - User Mode Linux</li>
<li><strong><a href="drvvbox.html">VirtualBox</a></strong></li>
<li><strong><a href="drvesx.html">VMware ESX</a></strong></li>
<li><strong><a href="drvvmware.html">VMware Workstation/Player</a></strong></li>
@@ -39,5 +40,19 @@
<li><strong><a href="drvbhyve.html">Bhyve</a></strong> - The BSD Hypervisor</li>
</ul>
<h2><a id="storage">Storage drivers</a></h2>
<ul>
<li><strong><a href="storage.html#StorageBackendDir">Directory backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendFS">Local filesystem backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendNetFS">Network filesystem backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendLogical">Logical Volume Manager (LVM) backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendDisk">Disk backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendISCSI">iSCSI backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendSCSI">SCSI backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendMultipath">Multipath backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendRBD">RBD (RADOS Block Device) backend</a></strong></li>
<li><strong><a href="storage.html#StorageBackendSheepdog">Sheepdog backend</a></strong></li>
</ul>
</body>
</html>

View File

@@ -462,32 +462,5 @@ Example:</p>
&lt;/domain&gt;
</pre>
<h3><a id="bhyvecommand">Pass-through of arbitrary bhyve commands</a></h3>
<p><span class="since">Since 5.1.0</span>, it's possible to pass additional command-line
arguments to the bhyve process when starting the domain using the
<code>&lt;bhyve:commandline&gt;</code> element under <code>domain</code>.
To supply an argument, use the element <code>&lt;bhyve:arg&gt;</code> with
the attribute <code>value</code> set to additional argument to be added.
The arg element may be repeated multiple times. To use this XML addition, it is necessary
to issue an XML namespace request (the special <code>xmlns:<i>name</i></code> attribute)
that pulls in <code>http://libvirt.org/schemas/domain/bhyve/1.0</code>;
typically, the namespace is given the name of <code>bhyve</code>.
</p>
<p>Example:</p>
<pre>
&lt;domain type="bhyve" xmlns:bhyve="http://libvirt.org/schemas/domain/bhyve/1.0"&gt;
...
&lt;bhyve:commandline&gt;
&lt;bhyve:arg value='-somebhyvearg'/&gt;
&lt;/bhyve:commandline&gt;
&lt;/domain&gt;
</pre>
<p>Note that these extensions are for testing and development purposes only.
They are <b>unsupported</b>, using them may result in inconsistent state,
and upgrading either bhyve or libvirtd maybe break behavior of a domain that
was relying on a specific commands pass-through.</p>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<p>
The libvirt KVM/QEMU driver can manage any QEMU emulator from
version 1.5.0 or later.
version 0.12.0 or later.
</p>
<h2><a id="project">Project Links</a></h2>
@@ -38,7 +38,7 @@
<li>
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
node. If both are found, then KVM fully virtualized, hardware accelerated
node. If both are found, then KVM fullyvirtualized, hardware accelerated
guests will be available.
</li>
</ul>
@@ -376,7 +376,7 @@ chmod o+x /path/to/directory
<h3><a id="securityacl">Cgroups device ACLs</a></h3>
<p>
Linux kernels have a capability known as "cgroups" which is used
Recent Linux kernels have a capability known as "cgroups" which is used
for resource management. It is implemented via a number of "controllers",
each controller covering a specific task/functional area. One of the
available controllers is the "devices" controller, which is able to
@@ -395,8 +395,9 @@ chmod o+x /path/to/directory
<pre>
/dev/null, /dev/full, /dev/zero,
/dev/random, /dev/urandom,
/dev/ptmx, /dev/kvm,
/dev/rtc, /dev/hpet
/dev/ptmx, /dev/kvm, /dev/kqemu,
/dev/rtc, /dev/hpet, /dev/net/tun,
/dev/sev
</pre>
<p>
@@ -426,10 +427,6 @@ mount -t cgroup none /dev/cgroup -o devices
<h3><a id="xmlimport">Converting from QEMU args to domain XML</a></h3>
<p>
<b>Note:</b> this operation is <span class="removed"> deleted as of
5.5.0</span> and will return an error.
</p>
<p>
The <code>virsh domxml-from-native</code> provides a way to
convert an existing set of QEMU args into a guest description
@@ -443,17 +440,82 @@ mount -t cgroup none /dev/cgroup -o devices
examples) or by manually crafting XML to pass to virsh.
</p>
<pre>$ cat &gt; demo.args &lt;&lt;EOF
LC_ALL=C PATH=/bin HOME=/home/test USER=test \
LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
-nographic -monitor pty -no-acpi -boot c -hda \
/dev/HostVG/QEMUGuest1 -net none -serial none \
-parallel none -usb
EOF
$ virsh domxml-from-native qemu-argv demo.args
&lt;domain type='qemu'&gt;
&lt;uuid&gt;00000000-0000-0000-0000-000000000000&lt;/uuid&gt;
&lt;memory&gt;219136&lt;/memory&gt;
&lt;currentMemory&gt;219136&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='i686' machine='pc'&gt;hvm&lt;/type&gt;
&lt;boot dev='hd'/&gt;
&lt;/os&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/bin/qemu&lt;/emulator&gt;
&lt;disk type='block' device='disk'&gt;
&lt;source dev='/dev/HostVG/QEMUGuest1'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
<p>NB, don't include the literal \ in the args, put everything on one line</p>
<h3><a id="xmlexport">Converting from domain XML to QEMU args</a></h3>
<p>
The <code>virsh domxml-to-native</code> provides a way to convert a
guest description using libvirt Domain XML, into a set of QEMU args
that can be run manually. Note that currently the command line formatted
by libvirt is no longer suited for manually running qemu as the
configuration expects various resources and open file descriptors passed
to the process which are usually prepared by libvirtd.
that can be run manually.
</p>
<pre>$ cat &gt; demo.xml &lt;&lt;EOF
&lt;domain type='qemu'&gt;
&lt;name&gt;QEMUGuest1&lt;/name&gt;
&lt;uuid&gt;c7a5fdbd-edaf-9455-926a-d65c16db1809&lt;/uuid&gt;
&lt;memory&gt;219200&lt;/memory&gt;
&lt;currentMemory&gt;219200&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='i686' machine='pc'&gt;hvm&lt;/type&gt;
&lt;boot dev='hd'/&gt;
&lt;/os&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/bin/qemu&lt;/emulator&gt;
&lt;disk type='block' device='disk'&gt;
&lt;source dev='/dev/HostVG/QEMUGuest1'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt;
&lt;/devices&gt;
&lt;/domain&gt;
EOF
$ virsh domxml-to-native qemu-argv demo.xml
LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-no-kqemu -m 214 -smp 1 -name QEMUGuest1 -nographic \
-monitor pty -no-acpi -boot c -drive \
file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
-serial none -parallel none -usb
</pre>
<h2><a id="qemucommand">Pass-through of arbitrary qemu
commands</a></h2>
@@ -478,8 +540,7 @@ mount -t cgroup none /dev/cgroup -o devices
qemu guest (<span class="since">Since 0.8.3</span>),
and <code>virDomainQemuAttach</code>, for registering a qemu
domain that was manually started so that it can then be managed
by libvirtd (<span class="since">Since 0.9.4</span>,
<span class="removed">removed as of 5.5.0</span>).
by libvirtd (<span class="since">Since 0.9.4</span>).
</p>
<p>Additionally, the following XML additions allow fine-tuning of
the command line given to qemu when starting a domain
@@ -520,36 +581,6 @@ mount -t cgroup none /dev/cgroup -o devices
&lt;qemu:env name='QEMU_ENV' value='VAL'/&gt;
&lt;/qemu:commandline&gt;
&lt;/domain&gt;
</pre>
<h2><a id="xmlnsfeatures">QEMU feature configuration for testing</a></h2>
<p>
In some cases e.g. when developing a new feature or for testing it may
be required to control a given qemu feature (or qemu capability) to test
it before it's complete or disable it for debugging purposes.
<span class="since">Since 5.5.0</span> it's possible to use the same
special qemu namespace as above
(<code>http://libvirt.org/schemas/domain/qemu/1.0</code>) and use
<code>&lt;qemu:capabilities&gt;</code> element to add
(<code>&lt;qemu:add capability="capname"/&gt;</code>) or remove
(<code>&lt;qemu:del capability="capname"/&gt;</code>) capability bits.
The naming of the feature bits is the same libvirt uses in the status
XML. Note that this feature is meant for experiments only and should
_not_ be used in production.
</p>
<p>Example:</p><pre>
&lt;domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'&gt;
&lt;name&gt;testvm&lt;/name&gt;
[...]
&lt;qemu:capabilities&gt;
&lt;qemu:add capability='blockdev'/&gt;
&lt;qemu:del capability='drive'/&gt;
&lt;/qemu:capabilities&gt;
&lt;/domain&gt;
</pre>
<h2><a id="xmlconfig">Example domain XML config</a></h2>

93
docs/drvuml.html.in Normal file
View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>User Mode Linux driver</h1>
<p>
The UML driver for libvirt allows use and management of paravirtualized
guests built for User Mode Linux. UML requires no special support in
the host kernel, so can be used by any user of any linux system, provided
they have enough free RAM for their guest's needs, though there are
certain restrictions on network connectivity unless the administrator
has pre-created TAP devices.
</p>
<h2><a id="project">Project Links</a></h2>
<ul>
<li>
The <a href="http://user-mode-linux.sourceforge.net/">User
Mode Linux</a> paravirtualized kernel
</li>
</ul>
<h2>Connections to UML driver</h2>
<p>
The libvirt UML driver follows the QEMU driver in providing two
types of connection. There is one privileged instance per host,
which runs as root. This is called the "system" instance, and allows
full use of all host resources. Then, there is a per-user unprivileged
"session", instance. This has more restricted capabilities, and may
require the host administrator to setup certain resources ahead of
time to allow full integration with the network. Example connection
URIs are
</p>
<pre>
uml:///session (local access to per-user instance)
uml+unix:///session (local access to per-user instance)
uml:///system (local access to system instance)
uml+unix:///system (local access to system instance)
uml://example.com/system (remote access, TLS/x509)
uml+tcp://example.com/system (remote access, SASl/Kerberos)
uml+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
<h2>Example XML configuration</h2>
<p>
User mode Linux driver only supports directly kernel boot at
this time. A future driver enhancement may allow a paravirt
bootloader in a similar style to Xen's pygrub. For now though,
the UML kernel must be stored on the host and referenced
explicitly in the "os" element. Since UML is a paravirtualized
technology, the kernel "type" is set to "uml"
</p>
<p>
There is not yet support for networking in the driver, but
disks can be specified in the usual libvirt manner. The main
variation is the target device naming scheme "ubd0", and
bus type of "uml".
</p>
<p>
Once booted the primary console is connected to a PTY, and
thus accessible with "virsh console" or equivalent tools
</p>
<pre>
&lt;domain type='uml'&gt;
&lt;name&gt;demo&lt;/name&gt;
&lt;uuid&gt;b4433fc2-a22e-ffb3-0a3d-9c173b395800&lt;/uuid&gt;
&lt;memory&gt;500000&lt;/memory&gt;
&lt;currentMemory&gt;500000&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='x86_64'&gt;uml&lt;/type&gt;
&lt;kernel&gt;/home/berrange/linux-uml-2.6.26-x86_64&lt;/kernel&gt;
&lt;/os&gt;
&lt;devices&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/home/berrange/FedoraCore6-AMD64-root_fs'/&gt;
&lt;target dev='ubd0' bus='uml'/&gt;
&lt;/disk&gt;
&lt;console type='pty'/&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<p>
The libvirt libxl driver provides the ability to manage virtual
machines on any Xen release from 4.6.0 onwards.
machines on any Xen release from 4.4.0 onwards.
</p>
<h2><a id="project">Project Links</a></h2>
@@ -58,7 +58,8 @@ xen+ssh://root@example.com/system (remote access, SSH tunnelled)
original Xen virtual machine config format used by the legacy
xm/xend toolstack. The second, known as <code>xen-sxpr</code>,
is also one of the original formats that was used by xend's
legacy HTTP RPC service (<span class='removed'>removed in 5.6.0</span>)
legacy HTTP RPC service. For compatibility, import and export
of these legacy formats is supported by the libxl driver.
</p>
<p>

View File

@@ -129,44 +129,6 @@ MASQUERADE all -- * * 192.168.122.0/24 !192.168.122.0/24</pre>
</li>
</ul>
<h3><a id="fw-firewalld-and-virtual-network-driver">firewalld and the virtual network driver</a>
</h3>
<p>
If <a href="https://firewalld.org">firewalld</a> is active on
the host, libvirt will attempt to place the bridge interface of
a libvirt virtual network into the firewalld zone named
"libvirt" (thus making all guest->host traffic on that network
subject to the rules of the "libvirt" zone). This is done
because, if firewalld is using its nftables backend (available
since firewalld 0.6.0) the default firewalld zone (which would
be used if libvirt didn't explicitly set the zone) prevents
forwarding traffic from guests through the bridge, as well as
preventing DHCP, DNS, and most other traffic from guests to
host. The zone named "libvirt" is installed into the firewalld
configuration by libvirt (not by firewalld), and allows
forwarded traffic through the bridge as well as DHCP, DNS, TFTP,
and SSH traffic to the host - depending on firewalld's backend
this will be implemented via either iptables or nftables
rules. libvirt's own rules outlined above will *always* be
iptables rules regardless of which backend is in use by
firewalld.
</p>
<p>
NB: It is possible to manually set the firewalld zone for a
network's interface with the "zone" attribute of the network's
"bridge" element.
</p>
<p>
NB: Prior to libvirt 5.1.0, the firewalld "libvirt" zone did not
exist, and prior to firewalld 0.7.0 a feature crucial to making
the "libvirt" zone operate properly (rich rule priority
settings) was not implemented in firewalld. In cases where one
or the other of the two packages is missing the necessary
functionality, it's still possible to have functional guest
networking by setting the firewalld backend to "iptables" (in
firewalld prior to 0.6.0, this was the only backend available).
</p>
<h3><a id="fw-network-filter-driver">The network filter driver</a>
</h3>
<p>This driver provides a fully configurable network filtering capability

View File

@@ -17,16 +17,13 @@
<li><a href="formatdomain.html">Domains</a></li>
<li><a href="formatnetwork.html">Networks</a></li>
<li><a href="formatnwfilter.html">Network filtering</a></li>
<li><a href="formatnetworkport.html">Network ports</a></li>
<li><a href="formatstorage.html">Storage</a></li>
<li><a href="formatstorageencryption.html">Storage encryption</a></li>
<li><a href="formatcaps.html">Capabilities</a></li>
<li><a href="formatdomaincaps.html">Domain capabilities</a></li>
<li><a href="formatstoragecaps.html">Storage Pool capabilities</a></li>
<li><a href="formatnode.html">Node devices</a></li>
<li><a href="formatsecret.html">Secrets</a></li>
<li><a href="formatsnapshot.html">Snapshots</a></li>
<li><a href="formatcheckpoint.html">Checkpoints</a></li>
</ul>
<h2>Command line validation</h2>

View File

@@ -74,44 +74,24 @@
is able to run. Possible values are:
<dl>
<dt><code>xen</code></dt>
<dd>for XEN PV</dd>
<dd>for XEN</dd>
<dt><code>linux</code></dt>
<dd>legacy alias for <code>xen</code></dd>
<dt><code>xenpvh</code></dt>
<dd>for XEN PVH</dd>
<dt><code>hvm</code></dt>
<dd>Unmodified operating system</dd>
<dt><code>exe</code></dt>
<dd>Container based virtualization</dd>
<dt><code>uml</code></dt>
<dd>User Mode Linux</dd>
</dl>
</dd>
<dt><code>arch</code></dt>
<dd>This element brings some information on supported guest
architecture. Possible subelements are:
<dl>
<dt><code>wordsize</code></dt><dd>Size of CPU word in bits, for example 64.</dd>
<dt><code>emulator</code></dt><dd>Emulator (device model) path, for
use in <a href="formatdomain.html#elementEmulator">emulator</a>
element of domain XML.</dd>
<dt><code>loader</code></dt><dd>Loader path, for use in
<a href="formatdomain.html#elementLoader">loader</a> element of domain
XML.</dd>
<dt><code>machine</code></dt><dd>Machine type, for use in
<a href="formatdomain.html#attributeOSTypeMachine">machine</a>
attribute of os/type element in domain XML. For example Xen
supports <code>xenfv</code> for HVM, <code>xenpv</code> for
PV, or <code>xenpvh</code> for PVH.</dd>
<dt><code>domain</code></dt><dd>The <code>type</code> attribute of
this element specifies the type of hypervisor required to run the
domain. Use in <a href="formatdomain.html#attributeDomainType">type</a>
attribute of the domain root element.</dd>
</dl>
</dd>
<dd>This element brings some information on supported guest architecture.</dd>
<dt><code>features</code></dt>
<dd>This optional element encases possible features that can be used

View File

@@ -1,198 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Checkpoint XML format</h1>
<ul id="toc"></ul>
<h2><a id="CheckpointAttributes">Checkpoint XML</a></h2>
<p>
One method of capturing domain disk backups is via the use of
incremental backups. Right now, incremental backups are only
supported for the QEMU hypervisor when using qcow2 disks at the
active layer; if other disk formats are in use, capturing disk
backups requires different libvirt APIs
(see <a href="kbase/domainstatecapture.html">domain state
capture</a> for a comparison between APIs).
</p>
<p>
Libvirt is able to facilitate incremental backups by tracking
disk checkpoints, which are points in time against which it is
easy to compute which portion of the disk has changed. Given a
full backup (a backup created from the creation of the disk to a
given point in time), coupled with the creation of a disk
checkpoint at that time, and an incremental backup (a backup
created from just the dirty portion of the disk between the
first checkpoint and the second backup operation), it is
possible to do an offline reconstruction of the state of the
disk at the time of the second backup without having to copy as
much data as a second full backup would require. Future API
additions will make it possible to create checkpoints in
conjunction with a backup
via <code>virDomainBackupBegin()</code> or with an external
snapshot via <code>virDomainSnapshotCreateXML2</code>; but for
now, libvirt exposes enough support to create disk checkpoints
independently from a backup operation
via <code>virDomainCheckpointCreateXML()</code> <span class="since">since
5.6.0</span>. Likewise, the creation of checkpoints when
external snapshots exist is currently forbidden, although future
work will make it possible to integrate these two concepts.
</p>
<p>
Attributes of libvirt checkpoints are stored as child elements
of the <code>domaincheckpoint</code> element. At checkpoint
creation time, normally only
the <code>name</code>, <code>description</code>,
and <code>disks</code> elements are settable. The rest of the
fields are ignored on creation and will be filled in by libvirt
in for informational purposes
by <code>virDomainCheckpointGetXMLDesc()</code>. However, when
redefining a checkpoint, with
the <code>VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE</code> flag
of <code>virDomainCheckpointCreateXML()</code>, all of the XML
fields described here are relevant on input, even the fields
that are normally described as readonly for output.
</p>
<p>
The top-level <code>domaincheckpoint</code> element may contain
the following elements:
</p>
<dl>
<dt><code>name</code></dt>
<dd>The optional name for this checkpoint. If the name is
omitted, libvirt will create a name based on the time of the
creation.
</dd>
<dt><code>description</code></dt>
<dd>An optional human-readable description of the checkpoint.
If the description is omitted when initially creating the
checkpoint, then this field will be empty.
</dd>
<dt><code>disks</code></dt>
<dd>On input, this is an optional listing of specific
instructions for disk checkpoints; it is needed when making a
checkpoint on only a subset of the disks associated with a
domain. In particular, since QEMU checkpoints require qcow2
disks, this element may be needed on input for excluding guest
disks that are not in qcow2 format. If the entire element was
omitted on input, then all disks participate in the
checkpoint, otherwise, only the disks explicitly listed which
do not also use <code>checkpoint='no'</code> will
participate. On output, this is the checkpoint state of each
of the domain's disks.
<dl>
<dt><code>disk</code></dt>
<dd>This sub-element describes the checkpoint properties of
a specific disk with the following attributes:
<dl>
<dt><code>name</code></dt>
<dd>A mandatory attribute which must match either
the <code>&lt;target dev='name'/&gt;</code> or an
unambiguous <code>&lt;source file='name'/&gt;</code>
of one of
the <a href="formatdomain.html#elementsDisks">disk
devices</a> specified for the domain at the time of
the checkpoint.</dd>
<dt><code>checkpoint</code></dt>
<dd>An optional attribute; possible values
are <code>no</code> when the disk does not participate
in this checkpoint; or <code>bitmap</code> if the disk
will track all changes since the creation of this
checkpoint via a bitmap.</dd>
<dt><code>bitmap</code></dt>
<dd>The attribute <code>bitmap</code> is only valid
if <code>checkpoint='bitmap'</code>; it describes the
name of the tracking bitmap (defaulting to the
checkpoint name).</dd>
<dt><code>size</code></dt>
<dd>The attribute <code>size</code> is ignored on input;
on output, it is only present if
the <code>VIR_DOMAIN_CHECKPOINT_XML_SIZE</code> flag
was used to perform a dynamic query of the estimated
size in bytes of the changes made since the checkpoint
was created.</dd>
</dl>
</dd>
</dl>
</dd>
<dt><code>creationTime</code></dt>
<dd>A readonly representation of the time this checkpoint was
created. The time is specified in seconds since the Epoch,
UTC (i.e. Unix time).
</dd>
<dt><code>parent</code></dt>
<dd>Readonly, present if this checkpoint has a parent. The
parent name is given by the sub-element <code>name</code>. The
parent relationship allows tracking a list of related checkpoints.
</dd>
<dt><code>domain</code></dt>
<dd>A readonly representation of the
inactive <a href="formatdomain.html">domain configuration</a>
at the time the checkpoint was created. This element may be
omitted for output brevity by supplying
the <code>VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN</code> flag, but
the resulting XML is no longer viable for use with
the <code>VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE</code> flag
of <code>virDomainCheckpointCreateXML()</code>. The domain
will have security-sensitive information omitted unless the
flag <code>VIR_DOMAIN_CHECKPOINT_XML_SECURE</code> is provided
on a read-write connection.
</dd>
</dl>
<h2><a id="example">Examples</a></h2>
<p>Using this XML to create a checkpoint of just vda on a qemu
domain with two disks and a prior checkpoint:</p>
<pre>
&lt;domaincheckpoint&gt;
&lt;description&gt;Completion of updates after OS install&lt;/description&gt;
&lt;disks&gt;
&lt;disk name='vda' checkpoint='bitmap'/&gt;
&lt;disk name='vdb' checkpoint='no'/&gt;
&lt;/disks&gt;
&lt;/domaincheckpoint&gt;</pre>
<p>will result in XML similar to this from
<code>virDomainCheckpointGetXMLDesc()</code>:</p>
<pre>
&lt;domaincheckpoint&gt;
&lt;name&gt;1525889631&lt;/name&gt;
&lt;description&gt;Completion of updates after OS install&lt;/description&gt;
&lt;parent&gt;
&lt;name&gt;1525111885&lt;/name&gt;
&lt;/parent&gt;
&lt;creationTime&gt;1525889631&lt;/creationTime&gt;
&lt;disks&gt;
&lt;disk name='vda' checkpoint='bitmap' bitmap='1525889631'/&gt;
&lt;disk name='vdb' checkpoint='no'/&gt;
&lt;/disks&gt;
&lt;domain type='qemu'&gt;
&lt;name&gt;fedora&lt;/name&gt;
&lt;uuid&gt;93a5c045-6457-2c09-e56c-927cdf34e178&lt;/uuid&gt;
&lt;memory&gt;1048576&lt;/memory&gt;
...
&lt;devices&gt;
&lt;disk type='file' device='disk'&gt;
&lt;driver name='qemu' type='qcow2'/&gt;
&lt;source file='/path/to/file1'/&gt;
&lt;target dev='vda' bus='virtio'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='disk' snapshot='external'&gt;
&lt;driver name='qemu' type='raw'/&gt;
&lt;source file='/path/to/file2'/&gt;
&lt;target dev='vdb' bus='virtio'/&gt;
&lt;/disk&gt;
...
&lt;/devices&gt;
&lt;/domain&gt;
&lt;/domaincheckpoint&gt;</pre>
<p>With that checkpoint created, the qcow2 image is now tracking
all changes that occur in the image since the checkpoint via
the persistent bitmap named <code>1525889631</code>.
</p>
</body>
</html>

View File

@@ -19,10 +19,9 @@
<p>
The root element required for all virtual machines is
named <code>domain</code>. It has two attributes, the
<a id="attributeDomainType"><code>type</code></a>
specifies the hypervisor used for running
<code>type</code> specifies the hypervisor used for running
the domain. The allowed values are driver specific, but
include "xen", "kvm", "qemu" and "lxc". The
include "xen", "kvm", "qemu", "lxc" and "kqemu". The
second attribute is <code>id</code> which is a unique
integer identifier for the running guest machine. Inactive
machines have no id value.
@@ -128,7 +127,7 @@
<pre>
...
&lt;os firmware='efi'&gt;
&lt;os&gt;
&lt;type&gt;hvm&lt;/type&gt;
&lt;loader readonly='yes' secure='no' type='rom'&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;
&lt;nvram template='/usr/share/OVMF/OVMF_VARS.fd'&gt;/var/lib/libvirt/nvram/guest_VARS.fd&lt;/nvram&gt;
@@ -141,29 +140,6 @@
...</pre>
<dl>
<dt><code>firmware</code></dt>
<dd>The <code>firmware</code> attribute allows management
applications to automatically fill <code>&lt;loader/&gt;</code>
and <code>&lt;nvram/&gt;</code> elements and possibly enable
some features required by selected firmware. Accepted values are
<code>bios</code> and <code>efi</code>.<br/>
The selection process scans for files describing installed
firmware images in specified location and uses the most specific
one which fulfils domain requirements. The locations in order of
preference (from generic to most specific one) are:
<ul>
<li><code>/usr/share/qemu/firmware</code></li>
<li><code>/etc/qemu/firmware</code></li>
<li><code>$XDG_CONFIG_HOME/qemu/firmware</code></li>
</ul>
For more information refer to firmware metadata specification as
described in <code>docs/interop/firmware.json</code> in QEMU
repository. Regular users do not need to bother.
<span class="since">Since 5.2.0 (QEMU and KVM only)</span><br/>
For VMware guests, this is set to <code>efi</code> when the guest
uses UEFI, and it is not set when using BIOS.
<span class="since">Since 5.3.0 (VMware ESX and Workstation/Player)</span>
</dd>
<dt><code>type</code></dt>
<dd>The content of the <code>type</code> element specifies the
type of operating system to be booted in the virtual machine.
@@ -172,11 +148,11 @@
(badly named!) refers to an OS that supports the Xen 3 hypervisor
guest ABI. There are also two optional attributes, <code>arch</code>
specifying the CPU architecture to virtualization,
and <a id="attributeOSTypeMachine"><code>machine</code></a> referring
to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
and <code>machine</code> referring to the machine
type. The <a href="formatcaps.html">Capabilities XML</a>
provides details on allowed values for
these. <span class="since">Since 0.0.1</span></dd>
<dt><a id="elementLoader"><code>loader</code></a></dt>
<dt><code>loader</code></dt>
<dd>The optional <code>loader</code> tag refers to a firmware blob,
which is specified by absolute path,
used to assist the domain creation process. It is used by Xen
@@ -782,12 +758,6 @@
&lt;cachetune vcpus='0-3'&gt;
&lt;cache id='0' level='3' type='both' size='3' unit='MiB'/&gt;
&lt;cache id='1' level='3' type='both' size='3' unit='MiB'/&gt;
&lt;monitor level='3' vcpus='1'/&gt;
&lt;monitor level='3' vcpus='0-3'/&gt;
&lt;/cachetune&gt;
&lt;cachetune vcpus='4-5'&gt;
&lt;monitor level='3' vcpus='4'/&gt;
&lt;monitor level='3' vcpus='5'/&gt;
&lt;/cachetune&gt;
&lt;memorytune vcpus='0-3'&gt;
&lt;node id='0' bandwidth='60'/&gt;
@@ -938,22 +908,16 @@
<span class="since">Only QEMU driver support since 2.1.0</span>
</dd>
<dt><code>vcpusched</code>, <code>iothreadsched</code>
and <code>emulatorsched</code></dt>
<dt><code>vcpusched</code> and <code>iothreadsched</code></dt>
<dd>
The optional
<code>vcpusched</code>, <code>iothreadsched</code>
and <code>emulatorsched</code> elements specify the scheduler type
(values <code>batch</code>, <code>idle</code>, <code>fifo</code>,
<code>rr</code>) for particular vCPU, IOThread and emulator threads
respecively. For <code>vcpusched</code> and <code>iothreadsched</code>
the attributes <code>vcpus</code> and <code>iothreads</code> select
which vCPUs/IOThreads this setting applies to, leaving them out sets the
default. The element <code>emulatorsched</code> does not have that
attribute. Valid <code>vcpus</code> values start at 0 through one less
than the number of vCPU's defined for the
domain. Valid <code>iothreads</code> values are described in
the <code>iothreadids</code>
The optional <code>vcpusched</code> elements specifies the scheduler
type (values <code>batch</code>, <code>idle</code>, <code>fifo</code>,
<code>rr</code>) for particular vCPU/IOThread threads (based on
<code>vcpus</code> and <code>iothreads</code>, leaving out
<code>vcpus</code>/<code>iothreads</code> sets the default). Valid
<code>vcpus</code> values start at 0 through one less than the
number of vCPU's defined for the domain. Valid <code>iothreads</code>
values are described in the <code>iothreadids</code>
<a href="#elementsIOThreadsAllocation"><code>description</code></a>.
If no <code>iothreadids</code> are defined, then libvirt numbers
IOThreads from 1 to the number of <code>iothreads</code> available
@@ -962,7 +926,6 @@
well (and is ignored for non-real-time ones). The value range
for the priority depends on the host kernel (usually 1-99).
<span class="since">Since 1.2.13</span>
<code>emulatorsched</code> <span class="since">since 5.3.0</span>
</dd>
<dt><code>cachetune</code><span class="since">Since 4.1.0</span></dt>
@@ -979,8 +942,8 @@
<dl>
<dt><code>cache</code></dt>
<dd>
This optional element controls the allocation of CPU cache and has
the following attributes:
This element controls the allocation of CPU cache and has the
following attributes:
<dl>
<dt><code>level</code></dt>
<dd>
@@ -1014,26 +977,6 @@
</dd>
</dl>
</dd>
<dt><code>monitor</code><span class="since">Since 4.10.0</span></dt>
<dd>
The optional element <code>monitor</code> creates the cache
monitor(s) for current cache allocation and has the following
required attributes:
<dl>
<dt><code>level</code></dt>
<dd>
Host cache level the monitor belongs to.
</dd>
<dt><code>vcpus</code></dt>
<dd>
vCPU list the monitor applies to. A monitor's vCPU list
can only be the member(s) of the vCPU list of the associated
allocation. The default monitor has the same vCPU list as the
associated allocation. For non-default monitors, overlapping
vCPUs are not permitted.
</dd>
</dl>
</dd>
</dl>
</dd>
@@ -1156,7 +1099,7 @@
&lt;/hugepages&gt;
&lt;nosharepages/&gt;
&lt;locked/&gt;
&lt;source type="file|anonymous|memfd"/&gt;
&lt;source type="file|anonymous"/&gt;
&lt;access mode="shared|private"/&gt;
&lt;allocation mode="immediate|ondemand"/&gt;
&lt;discard/&gt;
@@ -1207,17 +1150,13 @@
suitable for the specific environment at the same time to mitigate
the risks described above. <span class="since">Since 1.0.6</span></dd>
<dt><code>source</code></dt>
<dd>Using the <code>type</code> attribute, it's possible to
provide "file" to utilize file memorybacking or keep the
default "anonymous". <span class="since">Since 4.10.0</span>,
you may choose "memfd" backing. (QEMU/KVM only)</dd>
<dd>In this attribute you can switch to file memorybacking or keep
default anonymous.</dd>
<dt><code>access</code></dt>
<dd>Using the <code>mode</code> attribute, specify if the memory is
to be "shared" or "private". This can be overridden per numa node by
<code>memAccess</code>.</dd>
<dd>Specify if memory is shared or private. This can be overridden per
numa node by <code>memAccess</code></dd>
<dt><code>allocation</code></dt>
<dd>Using the <code>mode</code> attribute, specify when to allocate
the memory by supplying either "immediate" or "ondemand".</dd>
<dd>Specify when allocate the memory</dd>
<dt><code>discard</code></dt>
<dd>When set and supported by hypervisor the memory
content is discarded just before guest shuts down (or
@@ -1273,9 +1212,9 @@
<a href="#elementsMemoryBacking">memory backing</a> because your
workload demands it, you'll have to take into account the specifics of
your deployment and figure out a value for <code>hard_limit</code> that
is large enough to support the memory requirements of your guest, but
small enough to protect your host against a malicious guest locking all
memory.</dd>
balances the risk of your guest being killed because the limit was set
too low and the risk of your host crashing because it cannot reclaim
the memory used by the guest due to <code>locked</code>. Good luck!</dd>
<dt><code>soft_limit</code></dt>
<dd> The optional <code>soft_limit</code> element is the memory limit to
enforce during memory contention. The units for this value are
@@ -1590,8 +1529,8 @@
hand, the ABI provided to the guest is reproducible. During
migration, complete CPU model definition is transferred to the
destination host so the migrated guest will see exactly the same CPU
model for the running instance of the guest, even if the destination
host contains more capable CPUs or newer kernel; but shutting down and restarting
model even if the destination host contains more capable CPUs for
the running instance of the guest; but shutting down and restarting
the guest may present different hardware to the guest according to
the capabilities of the new host. Prior to libvirt 3.2.0 and QEMU
2.9.0 detection of the host CPU model via QEMU is not supported.
@@ -1625,10 +1564,10 @@
environment cannot be reproduced on different hardware. Thus, if you
hit any bugs, you are on your own. Further details of that CPU can
be changed using <code>feature</code> elements. Migration of a guest
using host-passthrough is dangerous if the source and destination hosts
are not identical in both hardware, QEMU version, microcode version
and configuration. If such a migration is attempted then the guest may
hang or crash upon resuming execution on the destination host.</dd>
using host-passthrough is dangerous if the source and destination
hosts are not identical in both hardware and configuration. If such
a migration is attempted then the guest may hang or crash upon
resuming execution on the destination host.</dd>
</dl>
Both <code>host-model</code> and <code>host-passthrough</code> modes
@@ -1959,7 +1898,7 @@
<span class="since">Since 3.9.0</span>, the lifecycle events can
be configured via the
<a href="html/libvirt-libvirt-domain.html#virDomainSetLifecycleAction">
<code>virDomainSetLifecycleAction</code></a> API.
<code>virDomainSetLifecycleAction</code></a> API.
</p>
<p>
@@ -2033,20 +1972,14 @@
&lt;vpindex state='on'/&gt;
&lt;runtime state='on'/&gt;
&lt;synic state='on'/&gt;
&lt;stimer state='on'&gt;
&lt;direct state='on'/&gt;
&lt;/stimer&gt;
&lt;reset state='on'/&gt;
&lt;vendor_id state='on' value='KVM Hv'/&gt;
&lt;frequencies state='on'/&gt;
&lt;reenlightenment state='on'/&gt;
&lt;tlbflush state='on'/&gt;
&lt;ipi state='on'/&gt;
&lt;evmcs state='on'/&gt;
&lt;/hyperv&gt;
&lt;kvm&gt;
&lt;hidden state='on'/&gt;
&lt;hint-dedicated state='on'/&gt;
&lt;/kvm&gt;
&lt;pvspinlock state='on'/&gt;
&lt;gic version='2'/&gt;
@@ -2059,7 +1992,6 @@
&lt;tseg unit='MiB'&gt;48&lt;/tseg&gt;
&lt;/smm&gt;
&lt;htm state='on'/&gt;
&lt;msrs unknown='ignore'/&gt;
&lt;/features&gt;
...</pre>
@@ -2116,7 +2048,7 @@
<tr>
<td>relaxed</td>
<td>Relax constraints on timers</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">1.0.0 (QEMU 2.0)</span></td>
</tr>
<tr>
@@ -2134,31 +2066,31 @@
<tr>
<td>vpindex</td>
<td>Virtual processor index</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">1.3.3 (QEMU 2.5)</span></td>
</tr>
<tr>
<td>runtime</td>
<td>Processor time spent on running guest code and on behalf of guest code</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">1.3.3 (QEMU 2.5)</span></td>
</tr>
<tr>
<td>synic</td>
<td>Enable Synthetic Interrupt Controller (SynIC)</td>
<td>on, off</td>
<td>Enable Synthetic Interrupt Controller (SyNIC)</td>
<td> on, off</td>
<td><span class="since">1.3.3 (QEMU 2.6)</span></td>
</tr>
<tr>
<td>stimer</td>
<td>Enable SynIC timers, optionally with Direct Mode support</td>
<td>on, off; direct - on,off</td>
<td><span class="since">1.3.3 (QEMU 2.6), direct mode 5.7.0 (QEMU 4.1)</span></td>
<td>Enable SyNIC timers</td>
<td> on, off</td>
<td><span class="since">1.3.3 (QEMU 2.6)</span></td>
</tr>
<tr>
<td>reset</td>
<td>Enable hypervisor reset</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">1.3.3 (QEMU 2.5)</span></td>
</tr>
<tr>
@@ -2170,33 +2102,21 @@
<tr>
<td>frequencies</td>
<td>Expose frequency MSRs</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">4.7.0 (QEMU 2.12)</span></td>
</tr>
<tr>
<td>reenlightenment</td>
<td>Enable re-enlightenment notification on migration</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">4.7.0 (QEMU 3.0)</span></td>
</tr>
<tr>
<td>tlbflush</td>
<td>Enable PV TLB flush support</td>
<td>on, off</td>
<td> on, off</td>
<td><span class="since">4.7.0 (QEMU 3.0)</span></td>
</tr>
<tr>
<td>ipi</td>
<td>Enable PV IPI support</td>
<td>on, off</td>
<td><span class="since">4.10.0 (QEMU 3.1)</span></td>
</tr>
<tr>
<td>evmcs</td>
<td>Enable Enlightened VMCS</td>
<td>on, off</td>
<td><span class="since">4.10.0 (QEMU 3.1)</span></td>
</tr>
</table>
</dd>
<dt><code>pvspinlock</code></dt>
@@ -2220,12 +2140,6 @@
<td>on, off</td>
<td><span class="since">1.2.8 (QEMU 2.1.0)</span></td>
</tr>
<tr>
<td>hint-dedicated</td>
<td>Allows a guest to enable optimizations when running on dedicated vCPUs</td>
<td>on, off</td>
<td><span class="since">5.7.0 (QEMU 2.12.1)</span></td>
</tr>
</table>
</dd>
<dt><code>pmu</code></dt>
@@ -2336,27 +2250,6 @@
defined, the hypervisor default will be used.
<span class="since">Since 4.6.0</span> (QEMU/KVM only)
</dd>
<dt><code>nested-hv</code></dt>
<dd>Configure nested HV availability for pSeries guests. This needs to
be enabled from the host (L0) in order to be effective; having HV
support in the (L1) guest is very desiderable if it's planned to
run nested (L2) guests inside it, because it will result in those
nested guests having much better performance than they would when
using KVM PR or TCG.
Possible values for the <code>state</code> attribute are
<code>on</code> and <code>off</code>. If the attribute is not
defined, the hypervisor default will be used.
<span class="since">Since 4.10.0</span> (QEMU/KVM only)
</dd>
<dt><code>msrs</code></dt>
<dd>Some guests might require ignoring unknown
Model Specific Registers (MSRs) reads and writes. It's possible
to switch this by setting <code>unknown</code> attribute
of <code>msrs</code> to <code>ignore</code>. If the attribute is
not defined, or set to <code>fault</code>, unknown reads and writes
will not be ignored.
<span class="since">Since 5.1.0</span> (bhyve only)
</dd>
</dl>
<h3><a id="elementsTime">Time keeping</a></h3>
@@ -2449,9 +2342,7 @@
being modified, and can be one of
"platform" (currently unsupported),
"hpet" (libxl, xen, qemu), "kvmclock" (qemu),
"pit" (qemu), "rtc" (qemu), "tsc" (libxl, qemu -
<span class="since">since 3.2.0</span>)
or "hypervclock"
"pit" (qemu), "rtc" (qemu), "tsc" (libxl) or "hypervclock"
(qemu - <span class="since">since 1.2.2</span>).
The <code>hypervclock</code> timer adds support for the
@@ -2727,7 +2618,7 @@
...</pre>
<dl>
<dt><a id="elementEmulator"><code>emulator</code></a></dt>
<dt><code>emulator</code></dt>
<dd>
The contents of the <code>emulator</code> element specify
the fully qualified path to the device model emulator binary.
@@ -2900,6 +2791,7 @@
&lt;/source&gt;
&lt;target dev='sdb' bus='scsi'/&gt;
&lt;/disk&gt;
&lt;/disk&gt;
&lt;disk type='network' device='lun'&gt;
&lt;driver name='qemu' type='raw'/&gt;
&lt;source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'&gt;
@@ -2974,17 +2866,6 @@
<span class="since">Since 0.1.4</span>
</p>
</dd>
<dt><code>model</code></dt>
<dd>
Indicates the emulated device model of the disk. Typically
this is indicated solely by the <code>bus</code> property but
for <code>bus</code> "virtio" the model can be specified further
with "virtio-transitional", "virtio-non-transitional", or
"virtio". See
<a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
<span class="since">Since 5.2.0</span>
</dd>
<dt><code>rawio</code></dt>
<dd>
Indicates whether the disk needs rawio capability. Valid
@@ -3933,11 +3814,6 @@
</dd>
</dl>
<span class="since">Since 5.2.0</span>, the filesystem element
has an optional attribute <code>model</code> with supported values
"virtio-transitional", "virtio-non-transitional", or "virtio".
See <a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
</dd>
<dt><code>driver</code></dt>
@@ -4045,15 +3921,7 @@
(<span class="since">since 0.9.7, requires QEMU
0.13</span>). <code>multifunction</code> defaults to 'off',
but should be set to 'on' for function 0 of a slot that will
have multiple functions used.
(<span class="since">Since 4.10.0</span>), PCI address extensions
depending on the architecture are supported. For example, PCI
addresses for S390 guests will have a <code>zpci</code> child
element, with two attributes: <code>uid</code> (a hex value
between 0x0001 and 0xffff, inclusive), and <code>fid</code> (a
hex value between 0x00000000 and 0xffffffff, inclusive) used by
PCI devices on S390 for User-defined Identifiers and Function
Identifiers.<br/>
have multiple functions used.<br/>
<span class="since">Since 1.3.5</span>, some hypervisor
drivers may accept an <code>&lt;address type='pci'/&gt;</code>
element with no other attributes as an explicit request to
@@ -4088,9 +3956,9 @@
</dd>
<dt><code>spapr-vio</code></dt>
<dd>On PowerPC pseries guests, devices can be assigned to the
SPAPR-VIO bus. It has a flat 32-bit address space; by
SPAPR-VIO bus. It has a flat 64-bit address space; by
convention, devices are generally assigned at a non-zero
multiple of 0x00001000, but other addresses are valid and
multiple of 0x1000, but other addresses are valid and
permitted by libvirt. Each address has the following
additional attribute: <code>reg</code> (the hex value address
of the starting register). <span class="since">Since
@@ -4142,63 +4010,6 @@
<span class="since">Since 3.5.0</span>
</p>
<h4><a id="elementsVirtioTransitional">Virtio transitional devices</a></h4>
<p>
<span class="since">Since 5.2.0</span>, some of QEMU's virtio devices,
when used with PCI/PCIe machine types, accept the following
<code>model</code> values:
</p>
<dl>
<dt><code>virtio-transitional</code></dt>
<dd>This device can work both with virtio 0.9 and virtio 1.0 guest
drivers, so it's the best choice when compatibility with older
guest operating systems is desired. libvirt will plug the device
into a conventional PCI slot.
</dd>
<dt><code>virtio-non-transitional</code></dt>
<dd>This device can only work with virtio 1.0 guest drivers, and it's
the recommended option unless compatibility with older guest
operating systems is necessary. libvirt will plug the device into
either a PCI Express slot or a conventional PCI slot based on the
machine type, resulting in a more optimized PCI topology.
</dd>
<dt><code>virtio</code></dt>
<dd>This device will work like a <code>virtio-non-transitional</code>
device when plugged into a PCI Express slot, and like a
<code>virtio-transitional</code> device otherwise; libvirt will
pick one or the other based on the machine type. This is the best
choice when compatibility with libvirt versions older than 5.2.0
is necessary, but it's otherwise not recommended to use it.
</dd>
</dl>
<p>
While the information outlined above applies to most virtio devices,
there are a few exceptions:
</p>
<ul>
<li>
for SCSI controllers, <code>virtio-scsi</code> must be used instead
of <code>virtio</code> for backwards compatibility reasons;
</li>
<li>
some devices, such as GPUs and input devices (keyboard, tablet and
mouse), are only defined in the virtio 1.0 spec and as such don't
have a transitional variant: the only accepted model is
<code>virtio</code>, which will result in a non-transitional device.
</li>
</ul>
<p>
For more details see the
<a href="https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg00923.html">qemu patch posting</a> and the
<a href="http://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.html">virtio-1.0 spec</a>.
</p>
<h4><a id="elementsControllers">Controllers</a></h4>
<p>
@@ -4223,7 +4034,6 @@
&lt;driver iothread='4'/&gt;
&lt;address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/&gt;
&lt;/controller&gt;
&lt;controller type='xenbus' maxGrantFrames='64'/&gt;
...
&lt;/devices&gt;
...</pre>
@@ -4247,20 +4057,12 @@
<dd>The <code>virtio-serial</code> controller has two additional
optional attributes <code>ports</code> and <code>vectors</code>,
which control how many devices can be connected through the
controller. <span class="since">Since 5.2.0</span>, it
supports an optional attribute <code>model</code> which can
be 'virtio', 'virtio-transitional', or 'virtio-non-transitional'. See
<a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
</dd>
controller.</dd>
<dt><code>scsi</code></dt>
<dd>A <code>scsi</code> controller has an optional attribute
<code>model</code>, which is one of 'auto', 'buslogic', 'ibmvscsi',
'lsilogic', 'lsisas1068', 'lsisas1078', 'virtio-scsi',
'vmpvscsi', 'virtio-transitional', 'virtio-non-transitional'. See
<a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
</dd>
'lsilogic', 'lsisas1068', 'lsisas1078', 'virtio-scsi' or
'vmpvscsi'.</dd>
<dt><code>usb</code></dt>
<dd>A <code>usb</code> controller has an optional attribute
<code>model</code>, which is one of "piix3-uhci", "piix4-uhci",
@@ -4279,11 +4081,6 @@
<dd><span class="since">Since 3.10.0</span> for the vbox driver, the
<code>ide</code> controller has an optional attribute
<code>model</code>, which is one of "piix3", "piix4" or "ich6".</dd>
<dt><code>xenbus</code></dt>
<dd><span class="since">Since 5.2.0</span>, the <code>xenbus</code>
controller has an optional attribute <code>maxGrantFrames</code>,
which specifies the maximum number of grant frames the controller
makes available for connected devices.</dd>
</dl>
<p>
@@ -4426,7 +4223,7 @@
subelement <code>&lt;model&gt;</code> with an attribute
<code>name</code>. The name attribute holds the name of the
specific device that qemu is emulating (e.g. "i82801b11-bridge")
rather than simply the class of device ("pcie-to-pci-bridge",
rather than simply the class of device ("dmi-to-pci-bridge",
"pci-bridge"), which is set in the controller element's
model <b>attribute</b>. In almost all cases, you should not
manually add a <code>&lt;model&gt;</code> subelement to a
@@ -4615,11 +4412,11 @@
...
&lt;devices&gt;
&lt;controller type='pci' index='0' model='pcie-root'/&gt;
&lt;controller type='pci' index='1' model='pcie-root-port'&gt;
&lt;address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/&gt;
&lt;controller type='pci' index='1' model='dmi-to-pci-bridge'&gt;
&lt;address type='pci' domain='0' bus='0' slot='0xe' function='0'/&gt;
&lt;/controller&gt;
&lt;controller type='pci' index='2' model='pcie-to-pci-bridge'&gt;
&lt;address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/&gt;
&lt;controller type='pci' index='2' model='pci-bridge'&gt;
&lt;address type='pci' domain='0' bus='1' slot='1' function='0'/&gt;
&lt;/controller&gt;
&lt;/devices&gt;
...</pre>
@@ -4809,20 +4606,14 @@
<dd><span class="since">since 2.5.0</span>For SCSI devices, user
is responsible to make sure the device is not used by host. This
<code>type</code> passes all LUNs presented by a single HBA to
the guest. <span class="since">Since 5.2.0,</span> the
<code>model</code> attribute can be specified further
with "virtio-transitional", "virtio-non-transitional", or
"virtio". See
<a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
the guest.
</dd>
<dt><code>mdev</code></dt>
<dd>For mediated devices (<span class="since">Since 3.2.0</span>)
the <code>model</code> attribute specifies the device API which
determines how the host's vfio driver will expose the device to the
guest. Currently, <code>model='vfio-pci'</code>,
guest. Currently, <code>model='vfio-pci'</code> and
<code>model='vfio-ccw'</code> (<span class="since">Since 4.4.0</span>)
and <code>model='vfio-ap'</code> (<span class="since">Since 4.9.0</span>)
is supported. <a href="drvnodedev.html#MDEV">MDEV</a> section
provides more information about mediated devices as well as how to
create mediated devices on the host.
@@ -5321,14 +5112,6 @@
information for different classes of network
connections. <span class="since">Since 0.9.4</span>.
</p>
<p>
When a guest is running an interface of type <code>network</code>
may include a <code>portid</code> attribute. This provides the UUID
of an associated virNetworkPortPtr object that records the association
between the domain interface and the network. This attribute is
read-only since port objects are create and deleted automatically
during startup and shutdown. <span class="since">Since 5.1.0</span>
</p>
<p>
Also, similar to <code>direct</code> network connections
(described below), a connection of type <code>network</code> may
@@ -5380,6 +5163,7 @@
&lt;virtualport&gt;
&lt;parameters instanceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/&gt;
&lt;/virtualport&gt;
&lt;/interface&gt;
&lt;/devices&gt;
...</pre>
@@ -5856,11 +5640,7 @@ qemu-kvm -net nic,model=? /dev/null
<p>
Typical values for QEMU and KVM include:
ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio.
<span class="since">Since 5.2.0</span>, <code>virtio-transitional</code>
and <code>virtio-non-transitional</code> values are supported.
See <a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio
</p>
<h5><a id="elementsDriverBackendOptions">Setting NIC driver-specific options</a></h5>
@@ -5876,7 +5656,8 @@ qemu-kvm -net nic,model=? /dev/null
&lt;host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/&gt;
&lt;guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/&gt;
&lt;/driver&gt;
</b>&lt;/interface&gt;
</b>
&lt;/interface&gt;
&lt;/devices&gt;
...</pre>
@@ -6378,7 +6159,7 @@ qemu-kvm -net nic,model=? /dev/null
<b>&lt;route family='ipv4' address='192.168.122.0' prefix='24' gateway='192.168.122.1'/&gt;</b>
<b>&lt;route family='ipv4' address='192.168.122.8' gateway='192.168.122.1'/&gt;</b>
&lt;/hostdev&gt;
...
&lt;/devices&gt;
...
</pre>
@@ -6570,12 +6351,6 @@ qemu-kvm -net nic,model=? /dev/null
For type <code>passthrough</code>, the mandatory sub-element <code>source</code>
must have an <code>evdev</code> attribute containing the absolute path to the
event device passed through to guests. (KVM only)
<span class="since">Since 5.2.0</span>, the <code>input</code> element
accepts a <code>model</code> attribute which has the values 'virtio',
'virtio-transitional' and 'virtio-non-transitional'. See
<a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
</p>
<p>
@@ -6866,17 +6641,12 @@ qemu-kvm -net nic,model=? /dev/null
the other types, for practical reasons it should be paired with
either <code>vnc</code> or <code>spice</code> graphics types.
This display type is only supported by QEMU domains
(needs QEMU <span class="since">2.10</span> or newer).
<span class="Since">5.0.0</span> this element accepts a
<code>&lt;gl/&gt;</code> sub-element with an optional attribute
<code>rendernode</code> which can be used to specify an absolute
path to a host's DRI device to be used for OpenGL rendering.
(needs QEMU <span class="since">2.10</span> or newer) and doesn't
accept any attributes.
</p>
<pre>
&lt;graphics type='spice' autoport='yes'/&gt;
&lt;graphics type='egl-headless'&gt;
&lt;gl rendernode='/dev/dri/renderD128'/&gt;
&lt;/graphics&gt;
&lt;graphics type='egl-headless'/&gt;
</pre>
</dd>
</dl>
@@ -7002,9 +6772,8 @@ qemu-kvm -net nic,model=? /dev/null
attribute which takes the value "vga", "cirrus", "vmvga", "xen",
"vbox", "qxl" (<span class="since">since 0.8.6</span>),
"virtio" (<span class="since">since 1.3.0</span>),
"gop" (<span class="since">since 3.2.0</span>),
"none" (<span class="since">since 4.6.0</span>, or "bochs"
(<span class="since">since 5.6.0</span>)
"gop" (<span class="since">since 3.2.0</span>), or
"none" (<span class="since">since 4.6.0</span>)
depending on the hypervisor features available.
The purpose of the type <code>none</code> is to instruct libvirt not
to add a default video device in the guest (see the paragraph above).
@@ -7324,9 +7093,9 @@ qemu-kvm -net nic,model=? /dev/null
Valid values for the <code>type</code> attribute are:
<code>serial</code> (described below);
<code>virtio</code> (usable whenever VirtIO support is available);
<code>xen</code>, <code>lxc</code> and <code>openvz</code>
(available when the corresponding hypervisor is in use).
<code>sclp</code> and <code>sclplm</code> (usable for s390 and
<code>xen</code>, <code>lxc</code>, <code>uml</code> and
<code>openvz</code> (available when the corresponding hypervisor is in
use). <code>sclp</code> and <code>sclplm</code> (usable for s390 and
s390x QEMU guests) are supported for compatibility reasons but should
not be used for new guests: use the <code>sclpconsole</code> and
<code>sclplmconsole</code> target models, respectively, with the
@@ -8048,12 +7817,8 @@ qemu-kvm -net nic,model=? /dev/null
</p>
<ul>
<li>'virtio' - default with QEMU/KVM</li>
<li>'virtio-transitional' <span class="since">Since 5.2.0</span></li>
<li>'virtio-non-transitional' <span class="since">Since 5.2.0</span></li>
<li>'xen' - default with Xen</li>
</ul>
See <a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
</dd>
<dt><code>autodeflate</code></dt>
<dd>
@@ -8125,11 +7890,7 @@ qemu-kvm -net nic,model=? /dev/null
</p>
<ul>
<li>'virtio' - supported by qemu and virtio-rng kernel module</li>
<li>'virtio-transitional' <span class='since'>Since 5.2.0</span></li>
<li>'virtio-non-transitional' <span class='since'>Since 5.2.0</span></li>
</ul>
See <a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
</dd>
<dt><code>rate</code></dt>
<dd>
@@ -8225,9 +7986,6 @@ qemu-kvm -net nic,model=? /dev/null
TPM functionality for each VM. QEMU talks to it over a Unix socket. With
the emulator device type each guest gets its own private TPM.
<span class="since">'emulator' since 4.5.0</span>
The state of the TPM emulator can be encrypted by providing an
<code>encryption</code> element.
<span class="since">'encryption' since 5.6.0</span>
</p>
<p>
Example: usage of the TPM Emulator
@@ -8237,7 +7995,6 @@ qemu-kvm -net nic,model=? /dev/null
&lt;devices&gt;
&lt;tpm model='tpm-tis'&gt;
&lt;backend type='emulator' version='2.0'&gt;
&lt;encryption secret='6dd3e4a5-1d76-44ce-961f-f119f5aad935'/&gt;
&lt;/backend&gt;
&lt;/tpm&gt;
&lt;/devices&gt;
@@ -8300,14 +8057,6 @@ qemu-kvm -net nic,model=? /dev/null
<li>'2.0' : creates a TPM 2.0</li>
</ul>
</dd>
<dt><code>encryption</code></dt>
<dd>
<p>
The <code>encryption</code> element allows the state of a TPM emulator
to be encrypted. The <code>secret</code> must reference a secret object
that holds the passphrase from which the encryption key will be derived.
</p>
</dd>
</dl>
<h4><a id="elementsNVRAM">NVRAM device</a></h4>
@@ -8324,7 +8073,7 @@ qemu-kvm -net nic,model=? /dev/null
...
&lt;devices&gt;
&lt;nvram&gt;
&lt;address type='spapr-vio' reg='0x00003000'/&gt;
&lt;address type='spapr-vio' reg='0x3000'/&gt;
&lt;/nvram&gt;
&lt;/devices&gt;
...
@@ -8505,21 +8254,6 @@ qemu-kvm -net nic,model=? /dev/null
&lt;memory model='nvdimm'&gt;
&lt;source&gt;
&lt;path&gt;/tmp/nvdimm&lt;/path&gt;
&lt;alignsize unit='KiB'&gt;2048&lt;/alignsize&gt;
&lt;/source&gt;
&lt;target&gt;
&lt;size unit='KiB'&gt;524288&lt;/size&gt;
&lt;node&gt;1&lt;/node&gt;
&lt;label&gt;
&lt;size unit='KiB'&gt;128&lt;/size&gt;
&lt;/label&gt;
&lt;readonly/&gt;
&lt;/target&gt;
&lt;/memory&gt;
&lt;memory model='nvdimm'&gt;
&lt;source&gt;
&lt;path&gt;/dev/dax0.0&lt;/path&gt;
&lt;pmem/&gt;
&lt;/source&gt;
&lt;target&gt;
&lt;size unit='KiB'&gt;524288&lt;/size&gt;
@@ -8601,36 +8335,10 @@ qemu-kvm -net nic,model=? /dev/null
</dl>
<p>
For model <code>nvdimm</code> this element is mandatory. The
mandatory child element <code>path</code> represents a path in
the host that backs the nvdimm module in the guest. The following
optional elements may be used:
For model <code>nvdimm</code> this element is mandatory and has a
single child element <code>path</code> that represents a path
in the host that backs the nvdimm module in the guest.
</p>
<dl>
<dt><code>alignsize</code></dt>
<dd>
<p>
The <code>alignsize</code> element defines the page size
alignment used to mmap the address range for the backend
<code>path</code>. If not supplied the host page size is used.
For example, to mmap a real NVDIMM device a 2M-aligned page may
be required.
<span class="since">Since 5.0.0</span>
</p>
</dd>
<dt><code>pmem</code></dt>
<dd>
<p>
If persistent memory is supported and enabled by the hypervisor
in order to guarantee the persistence of writes to the vNVDIMM
backend, then use the <code>pmem</code> element in order to
utilize the feature.
<span class="since">Since 5.0.0</span>
</p>
</dd>
</dl>
</dd>
<dt><code>target</code></dt>
@@ -8649,39 +8357,19 @@ qemu-kvm -net nic,model=? /dev/null
NUMA nodes configured.
</p>
<p>
The following optional elements may be used:
For NVDIMM type devices one can optionally use
<code>label</code> and its subelement <code>size</code>
to configure the size of namespaces label storage
within the NVDIMM module. The <code>size</code> element
has usual meaning described
<a href="#elementsMemoryAllocation">here</a>.
For QEMU domains the following restrictions apply:
</p>
<dl>
<dt><code>label</code></dt>
<dd>
<p>
For NVDIMM type devices one can optionally use
<code>label</code> and its subelement <code>size</code>
to configure the size of namespaces label storage
within the NVDIMM module. The <code>size</code> element
has usual meaning described
<a href="#elementsMemoryAllocation">here</a>.
For QEMU domains the following restrictions apply:
</p>
<ol>
<li>the minimum label size is 128KiB,</li>
<li>the remaining size (total-size - label-size) will be aligned
to 4KiB as default.</li>
</ol>
</dd>
<dt><code>readonly</code></dt>
<dd>
<p>
The <code>readonly</code> element is used to mark the vNVDIMM
as read-only. Only the real NVDIMM device backend can guarantee
the guest write persistence, so other backend types should use
the <code>readonly</code> element.
<span class="since">Since 5.0.0</span>
</p>
</dd>
</dl>
<ol>
<li>the minimum label size is 128KiB,</li>
<li>the remaining size (total-size - label-size) has to be aligned to
4KiB</li>
</ol>
</dd>
</dl>
@@ -8708,17 +8396,14 @@ qemu-kvm -net nic,model=? /dev/null
<dt><code>model</code></dt>
<dd>
<p>
Supported values are <code>intel</code> (for Q35 guests) and,
<span class="since">since 5.5.0</span>, <code>smmuv3</code> (for
ARM virt guests).
Currently only the <code>intel</code> model is supported.
</p>
</dd>
<dt><code>driver</code></dt>
<dd>
<p>
The <code>driver</code> subelement can be used to configure
additional options, some of which might only be available for
certain IOMMU models:
additional options:
</p>
<dl>
<dt><code>intremap</code></dt>
@@ -8771,11 +8456,7 @@ qemu-kvm -net nic,model=? /dev/null
<h3><a id="vsock">Vsock</a></h3>
<p>A vsock host/guest interface. The <code>model</code> attribute
defaults to <code>virtio</code>. <span class="since">Since 5.2.0</span>
<code>model</code> can also be 'virtio-transitional' and
'virtio-non-transitional', see
<a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
defaults to <code>virtio</code>.
The optional attribute <code>address</code> of the <code>cid</code>
element specifies the CID assigned to the guest. If the attribute
<code>auto</code> is set to <code>yes</code>, libvirt
@@ -8960,7 +8641,7 @@ qemu-kvm -net nic,model=? /dev/null
<p>Note: DEA/TDEA is synonymous with DES/TDES.</p>
<h3><a id="launchSecurity">Launch Security</a></h3>
<h3><a id="sev">Launch Security</a></h3>
<p>
The contents of the <code>&lt;launchSecurity type='sev'&gt;</code> element
@@ -8975,8 +8656,8 @@ qemu-kvm -net nic,model=? /dev/null
different entity using a different key the encrypted guests data will
be incorrectly decrypted, leading to unintelligible data.
For more information see various input parameters and its format see the
<a href="https://support.amd.com/TechDocs/55766_SEV-KM_API_Specification.pdf">SEV API spec</a>
For more information see various input parameters and its format see the SEV API spec
<a href="https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf"> https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf </a>
<span class="since">Since 4.4.0</span>
</p>
<pre>

View File

@@ -37,17 +37,6 @@
management application to choose an appropriate mode for a pass-through
host device as well as which adapter to utilize.</p>
<p>Some XML elements may be entirely omitted from the domaincapabilities
XML, depending on what the libvirt driver has filled in. Applications
should only act on what is explicitly reported in the domaincapabilities
XML. For example, if &lt;disk supported='yes'/&gt; is present, you can safely
assume the driver supports &lt;disk&gt; devices. If &lt;disk supported='no'/&gt; is
present, you can safely assume the driver does NOT support &lt;disk&gt;
devices. If the &lt;disk&gt; block is omitted entirely, the driver is not
indicating one way or the other whether it supports &lt;disk&gt; devices, and
applications should not interpret the missing block to mean any thing in
particular.</p>
<h2><a id="elements">Element and attribute overview</a></h2>
<p> A new query interface was added to the virConnect API's to retrieve the
@@ -119,10 +108,6 @@
&lt;domainCapabilities&gt;
...
&lt;os supported='yes'&gt;
&lt;enum name='firmware'&gt;
&lt;value&gt;bios&lt;/value&gt;
&lt;value&gt;efi&lt;/value&gt;
&lt;/enum&gt;
&lt;loader supported='yes'&gt;
&lt;value&gt;/usr/share/OVMF/OVMF_CODE.fd&lt;/value&gt;
&lt;enum name='type'&gt;
@@ -133,26 +118,12 @@
&lt;value&gt;yes&lt;/value&gt;
&lt;value&gt;no&lt;/value&gt;
&lt;/enum&gt;
&lt;enum name='secure'&gt;
&lt;value&gt;yes&lt;/value&gt;
&lt;value&gt;no&lt;/value&gt;
&lt;/enum&gt;
&lt;/loader&gt;
&lt;/os&gt;
...
&lt;domainCapabilities&gt;
</pre>
<p>The <code>firmware</code> enum corresponds to
<code>firmware</code> attribute of the <code>os</code> element.
Plain presence of this enum means that libvirt is capable of so
called firmware auto selection. The listed values then represent
accepted values for the domain attribute. Only values for which
there exists a firmware descriptor that matches machine type and
architecture are listed, i.e. those which won't cause a failure
on domain startup.
</p>
<p>For the <code>loader</code> element, the following can occur:</p>
<dl>
@@ -170,11 +141,6 @@
<dt><code>readonly</code></dt>
<dd>Options for the <code>readonly</code> attribute of the
&lt;loader/&gt; element.</dd>
<dt><code>secure</code></dt>
<dd>Options for the <code>secure</code> attribute of the
&lt;loader/&gt; element. Note, that <code>yes</code> is listed
only if there is a firmware that supports it.</dd>
</dl>
<h3><a id="elementsCPU">CPU configuration</a></h3>
@@ -312,6 +278,7 @@
&lt;value&gt;virtio&lt;/value&gt;
&lt;value&gt;xen&lt;/value&gt;
&lt;value&gt;usb&lt;/value&gt;
&lt;value&gt;uml&lt;/value&gt;
&lt;value&gt;sata&lt;/value&gt;
&lt;value&gt;sd&lt;/value&gt;
&lt;/enum&gt;
@@ -450,41 +417,6 @@
element.</dd>
</dl>
<h4><a id="elementsRNG">RNG device</a></h4>
<p>RNG device capabilities are exposed under the
<code>rng</code> element. For instance:</p>
<pre>
&lt;domainCapabilities&gt;
...
&lt;devices&gt;
&lt;rng supported='yes'&gt;
&lt;enum name='model'&gt;
&lt;value&gt;virtio&lt;/value&gt;
&lt;value&gt;virtio-transitional&lt;/value&gt;
&lt;value&gt;virtio-non-transitional&lt;/value&gt;
&lt;/enum&gt;
&lt;enum name='backendModel'&gt;
&lt;value&gt;random&lt;/value&gt;
&lt;value&gt;egd&lt;/value&gt;
&lt;/enum&gt;
&lt;/rng&gt;
...
&lt;/devices&gt;
&lt;/domainCapabilities&gt;
</pre>
<dl>
<dt><code>model</code></dt>
<dd>Options for the <code>model</code> attribute of the
&lt;rng&gt; element.</dd>
<dt><code>backendModel</code></dt>
<dd>Options for the <code>model</code> attribute of the
&lt;rng&gt;&lt;backend&gt; element.</dd>
</dl>
<h3><a id="elementsFeatures">Features</a></h3>
<p>One more set of XML elements describe the supported features and
@@ -549,9 +481,10 @@
encrypted with a key unique to that VM.</p>
<p>
For more details on the SEV feature, please follow resources in the
AMD developer's document store. In order to use SEV with libvirt have
a look at <a href="formatdomain.html#launchSecurity">SEV in domain XML</a>
For more details on SEV feature see:
<a href="https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf">
SEV API spec</a> and <a href="http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/12/AMD_Memory_Encryption_Whitepaper_v7-Public.pdf">
SEV White Paper</a>
</p>
<dl>

View File

@@ -107,13 +107,13 @@
may also be connected to the LAN. When defining
a new network with a <code>&lt;forward&gt;</code> mode of
"nat", "route", or "open" (or an isolated network with
"nat" or "route" (or an isolated network with
no <code>&lt;forward&gt;</code> element), libvirt will
automatically generate a unique name for the bridge device if
none is given, and this name will be permanently stored in the
network configuration so that that the same name will be used
every time the network is started. For these types of networks
(nat, route, open, and isolated), a bridge name beginning with the
(nat, routed, and isolated), a bridge name beginning with the
prefix "virbr" is recommended (and that is what is
auto-generated), but not enforced.
Attribute <code>stp</code> specifies if Spanning Tree Protocol
@@ -152,23 +152,6 @@
<span class="since">Since 1.2.11, requires kernel 3.17 or
newer</span>
</p>
<p>
The optional <code>zone</code> attribute of
the <code>bridge</code> element is used to specify
the <a href="https://firewalld.org">firewalld</a>
zone for the bridge of a network with <code>forward</code>
mode of "nat", "route", "open", or one with
no <code>forward</code> specified. By default, the bridges
of all virtual networks with these forward modes are placed
in the firewalld zone named "libvirt", which permits
incoming DNS, DHCP, TFTP, and SSH to the host from guests on
the network. This behavior can be changed either by
modifying the libvirt zone (using firewalld management
tools), or by placing the network in a different zone (which
will also be managed using firewalld tools).
<span class="since">Since 5.1.0</span>
</p>
</dd>
<dt><code>mtu</code></dt>
@@ -1096,28 +1079,6 @@
</dd>
</dl>
<h3><a id="elementsNamespaces">Network namespaces</a></h3>
<p>
A special XML namespace is available for passing options directly to the
underlying dnsmasq configuration file. Usage of XML namespaces comes with no
support guarantees, so use at your own risk.
</p>
<p>
This example XML will pass the option strings <code>foo=bar</code> and
<code>cname=*.foo.example.com,master.example.com</code> directly to the
underlying dnsmasq instance.
<pre>
&lt;network xmlns:dnsmasq='http://libvirt.org/schemas/network/dnsmasq/1.0'&gt;
...
&lt;dnsmasq:options&gt;
&lt;dnsmasq:option value="foo=bar"/&gt;
&lt;dnsmasq:option value="cname=*.foo.example.com,master.example.com"/&gt;
&lt;/dnsmasq:options&gt;
&lt;/network&gt;</pre>
</p>
<h2><a id="examples">Example configuration</a></h2>
<h3><a id="examplesNAT">NAT based network</a></h3>

View File

@@ -1,212 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Network XML format</h1>
<ul id="toc">
</ul>
<p>
This page provides an introduction to the network port XML format.
This stores information about the connection between a virtual
interface of a virtual domain, and the virtual network it is
attached to.
</p>
<h2><a id="elements">Element and attribute overview</a></h2>
<p>
The root element required for all virtual network ports is
named <code>networkport</code> and has no configurable attributes
The network port XML format is available <span class="since">since
5.5.0</span>
</p>
<h3><a id="elementsMetadata">General metadata</a></h3>
<p>
The first elements provide basic metadata about the virtual
network port.
</p>
<pre>
&lt;networkport
&lt;uuid&gt;7ae63b5f-fe96-4af0-a7c3-da04ba1b3f54&lt;/uuid&gt;
&lt;owner&gt;
&lt;uuid&gt;06578fc1-c686-46fa-bc2c-220893b466a6&lt;/uuid&gt;
&lt;name&gt;myguest&lt;name&gt;
&lt;/owner&gt;
&lt;group&gt;webfront&lt;group&gt;
&lt;mac address='52:54:0:7b:35:93'/&gt;
...</pre>
<dl>
<dt><code>uuid</code></dt>
<dd>The content of the <code>uuid</code> element provides
a globally unique identifier for the virtual network port.
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new network port, a random
UUID is generated.</dd>
<dd>The <code>owner</code> node records the domain object that
is the owner of the network port. It contains two child nodes:
<dl>
<dt><code>uuid</code></dt>
<dd>The content of the <code>uuid</code> element provides
a globally unique identifier for the virtual domain.</dd>
<dt><code>name</code></dt>
<dd>The unique name of the virtual domain</dd>
</dl>
</dd>
<dt><code>group</code></dt>
<dd>The port group in the virtual network to which the
port belongs. Can be omitted if no port groups are
defined on the network.</dd>
<dt><code>mac</code></dt>
<dd>The <code>address</code> attribute provides the MAC
address of the virtual port that will be see by the
guest. The MAC address must not start with 0xFE as this
byte is reserved for use on the host side of the port.
</dd>
</dl>
<h3><a id="elementsCommon">Common elements</a></h3>
<p>
The following elements are common to one or more of the plug
types listed later
</p>
<pre>
...
&lt;bandwidth&gt;
&lt;inbound average='1000' peak='5000' floor='200' burst='1024'/&gt;
&lt;outbound average='128' peak='256' burst='256'/&gt;
&lt;/bandwidth&gt;
&lt;rxfilters trustGuest='yes'/&gt;
&lt;virtualport type='802.1Qbg'&gt;
&lt;parameters managerid='11' typeid='1193047' typeidversion='2'/&gt;
&lt;/virtualport&gt;
...</pre>
<dl>
<dt><code>bandwidth</code></dt>
<dd>This part of the network port XML provides setting quality of service.
Incoming and outgoing traffic can be shaped independently.
The <code>bandwidth</code> element and its child elements are described
in the <a href="formatnetwork.html#elementQoS">QoS</a> section of
the Network XML. In addition the <code>classID</code> attribute may
exist to provide the ID of the traffic shaping class that is active.
</dd>
<dt><code>rxfilters</code></dt>
<dd>The <code>rxfilters</code> element property
<code>trustGuest</code> provides the
capability for the host to detect and trust reports from the
guest regarding changes to the interface mac address and receive
filters by setting the attribute to <code>yes</code>. The default
setting for the attribute is <code>no</code> for security
reasons and support depends on the guest network device model as
well as the type of connection on the host - currently it is
only supported for the virtio device model and for macvtap
connections on the host.
</dd>
<dt><code>virtualport</code></dt>
<dd>The <code>virtualport</code> element describes metadata that
needs to be provided to the underlying network subsystem. It
is described in the domain XML
<a href="formatdomain.html#elementsNICS">interface documentation</a>.
</dd>
</dl>
<h3><a id="elementsPlug">Plugs</a></h3>
<p>
The <code>plug</code> element has varying content depending
on the value of the <code>type</code> attribute.
</p>
<h4><a id="elementsPlugNetwork">Network</a></h4>
<p>
The <code>network</code> plug type refers to a managed virtual
network plug that is based on a traditional software bridge
device privately managed by libvirt.
</p>
<pre>
...
&lt;plug type='network' bridge='virbr0'/&gt;
...</pre>
<p>
The <code>bridge</code> attribute provides the name of the
privately managed bridge device associated with the virtual
network.
</p>
<h4><a id="elementsPlugNetwork">Bridge</a></h4>
<p>
The <code>bridge</code> plug type refers to an externally
managed traditional software bridge.
</p>
<pre>
...
&lt;plug type='bridge' bridge='br2'/&gt;
...</pre>
<p>
The <code>bridge</code> attribute provides the name of the
externally managed bridge device associated with the virtual
network.
</p>
<h4><a id="elementsPlugNetwork">Direct</a></h4>
<p>
The <code>direct</code> plug type refers to a connection
directly to a physical network interface.
</p>
<pre>
...
&lt;plug type='direct' dev='ens3' mode='vepa'/&gt;
...</pre>
<p>
The <code>dev</code> attribute provides the name of the
physical network interface to which the port will be
connected. The <code>mode</code> attribute describes
how the connection will be setup and takes the same
values described in the
<a href="formatdomain.html#elementsNICSDirect">domain XML</a>.
</p>
<h4><a id="elementsPlugNetwork">Host PCI</a></h4>
<p>
The <code>hostdev-pci</code> plug type refers to the
passthrough of a physical PCI device rather than emulation.
</p>
<pre>
...
&lt;plug type='hostdev-pci' managed='yes'&gt;
&lt;driver name='vfio'/&gt;
&lt;address domain='0x0001' bus='0x02' slot='0x03' function='0x4'/&gt;
&lt;/plug&gt;
...</pre>
<p>
The <code>managed</code> attribute indicates who is responsible for
managing the PCI device in the host. When set to the value <code>yes</code>
libvirt is responsible for automatically detaching the device from host
drivers and resetting it if needed. If the value is <code>no</code>,
some other party must ensure the device is not attached to any
host drivers.
</p>
</body>
</html>

View File

@@ -70,10 +70,6 @@
<dd>Describes a device on the host's PCI bus. Sub-elements
include:
<dl>
<dt><code>class</code></dt>
<dd>Optional element for combined class, subclass and
programming interface codes as 6-digit hexadecimal number.
<span class="since">Since 5.2.0</span></dd>
<dt><code>domain</code></dt>
<dd>Which domain the device belongs to.</dd>
<dt><code>bus</code></dt>
@@ -385,7 +381,6 @@
&lt;name&gt;igb&lt;/name&gt;
&lt;/driver&gt;
&lt;capability type='pci'&gt;
&lt;class&gt;0x020000&lt;/class&gt;
&lt;domain&gt;0&lt;/domain&gt;
&lt;bus&gt;2&lt;/bus&gt;
&lt;slot&gt;0&lt;/slot&gt;

View File

@@ -2265,7 +2265,7 @@ echo 3 > /proc/sys/net/netfilter/nf_conntrack_icmp_timeout
to the incoming and outgoing direction. All this is related to the ftp
data traffic originating from TCP port 20 of the VM. This then leads to
the following solution
<span class="since">(since 0.8.5 (QEMU, KVM))</span>:
<span class="since">(since 0.8.5 (QEMU, KVM, UML))</span>:
</p>
<pre>
&lt;filter name='test-eth0'&gt;

View File

@@ -42,8 +42,8 @@
Specifies what this secret is used for. A mandatory
<code>type</code> attribute specifies the usage category, currently
only <code>volume</code>, <code>ceph</code>, <code>iscsi</code>,
<code>tls</code>, and <code>vtpm</code> are defined. Specific usage
categories are described below.
and <code>tls</code> are defined. Specific usage categories
are described below.
</dd>
</dl>
@@ -322,63 +322,6 @@ Secret 718c71bd-67b5-4a2b-87ec-a24e8ca200dc created
<pre>
# MYSECRET=`printf %s "letmein" | base64`
# virsh secret-set-value 718c71bd-67b5-4a2b-87ec-a24e8ca200dc $MYSECRET
Secret value set
</pre>
<h3><a id="vTPMUsageType">Usage type "vtpm"</a></h3>
<p>
This secret is associated with a virtualized TPM (vTPM) and serves
as a passphrase for deriving a key from for encrypting the state
of the vTPM.
The <code>&lt;usage type='vtpm'&gt;</code> element must contain
a single <code>name</code> element that specifies a usage name
for the secret. The vTPM secret can then be used by UUID or by
this usage name via the <code>&lt;encryption&gt;</code> element of
a <a href="formatdomain.html#elementsTpm">tpm</a> when using an
emulator.
<span class="since">Since 5.6.0</span>. The following is an example
of the steps to be taken. First create a vtpm-secret.xml file: </p>
<pre>
# cat vtpm-secret.xml
&lt;secret ephemeral='no' private='yes'&gt;
&lt;description&gt;sample vTPM secret&lt;/description&gt;
&lt;usage type='vtpm'&gt;
&lt;name&gt;VTPM_example&lt;/name&gt;
&lt;/usage&gt;
&lt;/secret&gt;
# virsh secret-define vtpm-secret.xml
Secret 6dd3e4a5-1d76-44ce-961f-f119f5aad935 created
# virsh secret-list
UUID Usage
----------------------------------------------------------------------------------------
6dd3e4a5-1d76-44ce-961f-f119f5aad935 vtpm VTPM_example
#
</pre>
<p>
A secret may also be defined via the
<a href="html/libvirt-libvirt-secret.html#virSecretDefineXML">
<code>virSecretDefineXML</code></a> API.
Once the secret is defined, a secret value will need to be set. The
secret would be the passphrase used to decrypt the vTPM state.
The following is a simple example of using
<code>virsh secret-set-value</code> to set the secret value. The
<a href="html/libvirt-libvirt-secret.html#virSecretSetValue">
<code>virSecretSetValue</code></a> API may also be used to set
a more secure secret without using printable/readable characters.
</p>
<pre>
# MYSECRET=`printf %s "open sesame" | base64`
# virsh secret-set-value 6dd3e4a5-1d76-44ce-961f-f119f5aad935 $MYSECRET
Secret value set
</pre>

View File

@@ -9,9 +9,7 @@
<h2><a id="SnapshotAttributes">Snapshot XML</a></h2>
<p>
Snapshots are one form
of <a href="kbase/domainstatecapture.html">domain state
capture</a>. There are several types of snapshots:
There are several types of snapshots:
</p>
<dl>
<dt>disk snapshot</dt>
@@ -35,7 +33,7 @@
resume in a consistent state; but if the disks are modified
externally in the meantime, this is likely to lead to data
corruption.</dd>
<dt>full system</dt>
<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
left off with symptoms similar to hibernation (that is, TCP
@@ -57,12 +55,11 @@
as <code>virDomainSaveImageGetXMLDesc()</code> to work with
those files.
</p>
<p>Full system snapshots are created
by <code>virDomainSnapshotCreateXML()</code> with no flags, while
<p>System checkpoints are created
by <code>virDomainSnapshotCreateXML()</code> with no flags, and
disk snapshots are created by the same function with
the <code>VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</code>
flag. Regardless of the flags provided, restoration of the
snapshot is handled by
the <code>VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</code> flag; in
both cases, they are restored by
the <code>virDomainRevertToSnapshot()</code> function. For
these types of snapshots, libvirt tracks each snapshot as a
separate <code>virDomainSnapshotPtr</code> object, and maintains
@@ -81,8 +78,7 @@
redefining a snapshot (<span class="since">since 0.9.5</span>),
with the <code>VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</code> flag
of <code>virDomainSnapshotCreateXML()</code>, all of the XML
described here is relevant on input, even the fields that are
normally described as readonly for output.
described here is relevant.
</p>
<p>
Snapshots are maintained in a hierarchy. A domain can have a
@@ -93,9 +89,7 @@
sets that snapshot as current, and the prior current snapshot is
the parent of the new snapshot. Branches in the hierarchy can
be formed by reverting to a snapshot with a child, then creating
another snapshot. For now, the creation of external snapshots
when checkpoints exist is forbidden, although future work will
make it possible to integrate these two concepts.
another snapshot.
</p>
<p>
The top-level <code>domainsnapshot</code> element may contain
@@ -103,14 +97,16 @@
</p>
<dl>
<dt><code>name</code></dt>
<dd>The optional name for this snapshot. If the name is
omitted, libvirt will create a name based on the time of the
creation.
<dd>The name for this snapshot. If the name is specified when
initially creating the snapshot, then the snapshot will have
that particular name. If the name is omitted when initially
creating the snapshot, then libvirt will make up a name for
the snapshot, based on the time when it was created.
</dd>
<dt><code>description</code></dt>
<dd>An optional human-readable description of the snapshot. If
the description is omitted when initially creating the
snapshot, then this field will be empty.
<dd>A human-readable description of the snapshot. If the
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
@@ -132,10 +128,13 @@
what file name is created in an external snapshot. On output,
this is fully populated to show the state of each disk in the
snapshot, including any properties that were generated by the
hypervisor defaults. For full system snapshots, this field is
ignored on input and omitted on output (a full system snapshot
implies that all disks participate in the snapshot process).
This element has a list of <code>disk</code>
hypervisor defaults. For system checkpoints, this field is
ignored on input and omitted on output (a system checkpoint
implies that all disks participate in the snapshot process,
and since the current implementation only does internal system
checkpoints, there are no extra details to add); a future
release may allow the use of <code>disks</code> with a system
checkpoint. This element has a list of <code>disk</code>
sub-elements, describing anywhere from zero to all of the
disks associated with the domain. <span class="since">Since
0.9.5</span>
@@ -144,8 +143,8 @@
<dd>This sub-element describes the snapshot properties of a
specific disk. The attribute <code>name</code> is
mandatory, and must match either the <code>&lt;target
dev='name'/&gt;</code> (recommended) or an unambiguous
<code>&lt;source file='name'/&gt;</code> of one of
dev='name'/&gt;</code> or an unambiguous <code>&lt;source
file='name'/&gt;</code> of one of
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
@@ -174,12 +173,6 @@
snapshots, the original file name becomes the read-only
snapshot, and the new file name contains the read-write
delta of all disk changes since the snapshot.
<p/>
The <code>source</code> element also may contain the
<code>seclabel</code> element (described in the
<a href="formatdomain.html#seclabel">domain XML documentation</a>)
which can be used to override the domain security labeling policy
for <code>source</code>.
</dd>
<dt><code>driver</code></dt>
<dd>An optional sub-element <code>driver</code>,
@@ -187,7 +180,6 @@
as qcow2), of the new file created by the external
snapshot of the new file.
</dd>
<dt><code>seclabel</code></dt>
</dl>
<span class="since">Since 1.2.2</span> the <code>disk</code> element
@@ -209,50 +201,45 @@
</dl>
</dd>
<dt><code>creationTime</code></dt>
<dd>A readonly representation of the time this snapshot was
created. The time is specified in seconds since the Epoch,
UTC (i.e. Unix time).
<dd>The time this snapshot was created. The time is specified
in seconds since the Epoch, UTC (i.e. Unix time). Readonly.
</dd>
<dt><code>state</code></dt>
<dd>A readonly representation of the state of the domain at the
time this snapshot was taken. If a full system snapshot was
created, then this is the state of the domain at that
time. When the domain is reverted to this snapshot, the
domain's state will default to this state, unless overridden
by <code>virDomainRevertToSnapshot()</code> flags to revert to
a running or paused state. 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 snapshot will default to an inactive
guest.
<dd>The state of the domain at the time this snapshot was taken.
If the snapshot was created as a system checkpoint, then this
is the state of the domain at that time; when the domain is
reverted to this snapshot, the domain's state will default to
whatever is in this field unless additional flags are passed
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
snapshot will default to an inactive guest. Readonly.
</dd>
<dt><code>parent</code></dt>
<dd>Readonly, present only if this snapshot has a parent. The
parent name is given by the sub-element <code>name</code>. The
parent relationship allows tracking a tree of related snapshots.
<dd>The parent of this snapshot. If present, this element
contains exactly one child element, name. This specifies the
name of the parent snapshot of this snapshot, and is used to
represent trees of snapshots. Readonly.
</dd>
<dt><code>domain</code></dt>
<dd>A readonly representation of the domain that this snapshot
was taken against. Older versions of libvirt stored only a
single child element, uuid; reverting to a snapshot like this
is risky if the current state of the domain differs from the
state that the domain was created in, and requires the use of
the <code>VIR_DOMAIN_SNAPSHOT_REVERT_FORCE</code> flag
<dd>The domain that this snapshot was taken against. Older
versions of libvirt stored only a single child element, uuid;
reverting to a snapshot like this is risky if the current
state of the domain differs from the state that the domain was
created in, and requires the use of the
<code>VIR_DOMAIN_SNAPSHOT_REVERT_FORCE</code> flag
in <code>virDomainRevertToSnapshot()</code>. Newer versions
of libvirt (<span class="since">since 0.9.5</span>) store the
entire inactive <a href="formatdomain.html">domain
configuration</a> at the time of the snapshot
(<span class="since">since 0.9.5</span>). The domain will have
security-sensitive information omitted
unless the flag <code>VIR_DOMAIN_SNAPSHOT_XML_SECURE</code> is
provided on a read-write connection.
of libvirt (<span class="since">since 0.9.5</span>) store the entire
inactive <a href="formatdomain.html">domain configuration</a>
at the time of the snapshot (<span class="since">since
0.9.5</span>). Readonly.
</dd>
<dt><code>cookie</code></dt>
<dd>An optional readonly representation of a save image cookie
containing additional data libvirt may need to properly
restore a domain from an active snapshot when such data cannot
be stored directly in the <code>domain</code> to maintain
compatibility with older libvirt or hypervisor.
<dd>Save image cookie containing additional data libvirt may need to
properly restore a domain from an active snapshot when such data
cannot be stored directly in the <code>domain</code> to maintain
compatibility with older libvirt or hypervisor. Readonly.
</dd>
</dl>
@@ -264,15 +251,10 @@
&lt;domainsnapshot&gt;
&lt;description&gt;Snapshot of OS install and updates&lt;/description&gt;
&lt;disks&gt;
&lt;disk name='vda'&gt;
&lt;disk name='/path/to/old'&gt;
&lt;source file='/path/to/new'/&gt;
&lt;/disk&gt;
&lt;disk name='vdb' snapshot='no'/&gt;
&lt;disk name='vdc'&gt;
&lt;source file='/path/to/newc'&gt;
&lt;seclabel model='dac' relabel='no'/&gt;
&lt;/source&gt;
&lt;/disk&gt;
&lt;/disks&gt;
&lt;/domainsnapshot&gt;</pre>

View File

@@ -19,15 +19,14 @@
a single attribute <code>type</code>, which is one of <code>dir</code>,
<code>fs</code>, <code>netfs</code>, <code>disk</code>,
<code>iscsi</code>, <code>logical</code>, <code>scsi</code>
(all <span class="since">since 0.4.1</span>),
<code>mpath</code> (<span class="since">since 0.7.1</span>),
<code>rbd</code> (<span class="since">since 0.9.13</span>),
<code>sheepdog</code> (<span class="since">since 0.10.0</span>),
<code>gluster</code> (<span class="since">since 1.2.0</span>),
<code>zfs</code> (<span class="since">since 1.2.8</span>),
<code>vstorage</code> (<span class="since">since 3.1.0</span>),
or <code>iscsi-direct</code> (<span class="since">since 4.7.0</span>).
This corresponds to the
(all <span class="since">since 0.4.1</span>), <code>mpath</code>
(<span class="since">since 0.7.1</span>), <code>rbd</code>
(<span class="since">since 0.9.13</span>), <code>sheepdog</code>
(<span class="since">since 0.10.0</span>),
<code>gluster</code> (<span class="since">since
1.2.0</span>), <code>zfs</code> (<span class="since">since
1.2.8</span>) or <code>vstorage</code> (<span class="since">since
3.1.0</span>). This corresponds to the
storage backend drivers listed further along in this document.
</p>
<h3><a id="StoragePoolFirst">General metadata</a></h3>
@@ -122,26 +121,15 @@
&lt;/source&gt;
...</pre>
<pre>
...
&lt;source&gt;
&lt;host name='localhost'/&gt;
&lt;dir path='/var/lib/libvirt/images'/&gt;
&lt;format type='nfs'/&gt;
&lt;protocol ver='3'/&gt;
&lt;/source&gt;
...</pre>
<dl>
<dt><code>device</code></dt>
<dd>Provides the source for pools backed by physical devices
(pool types <code>fs</code>, <code>logical</code>, <code>disk</code>,
<code>iscsi</code>, <code>iscsi-direct</code>, <code>zfs</code>,
<code>vstorage</code>).
<code>iscsi</code>, <code>zfs</code>, <code>vstorage</code>).
May be repeated multiple times depending on backend driver. Contains
a required attribute <code>path</code> which is either the fully
qualified path to the block device node or for <code>iscsi</code>
or <code>iscsi-direct</code> the iSCSI Qualified Name (IQN).
the iSCSI Qualified Name (IQN).
<span class="since">Since 0.4.1</span>
<p>An optional attribute <code>part_separator</code> for each
<code>path</code> may be supplied. Valid values for the attribute
@@ -346,7 +334,6 @@
<dt><code>host</code></dt>
<dd>Provides the source for pools backed by storage from a
remote server (pool types <code>netfs</code>, <code>iscsi</code>,
<code>iscsi-direct</code>,
<code>rbd</code>, <code>sheepdog</code>, <code>gluster</code>). Will be
used in combination with a <code>directory</code>
or <code>device</code> element. Contains an attribute <code>name</code>
@@ -361,19 +348,11 @@
server. See the <a href="storage.html">storage driver page</a> for
any restrictions for specific storage backends.
<span class="since">Since 0.4.1</span></dd>
<dt><code>initiator</code></dt>
<dd>Required by the <code>iscsi-direct</code> pool in order to provide
the iSCSI Qualified Name (IQN) to communicate with the pool's
<code>device</code> target IQN. There is one sub-element
<code>iqn</code> with the <code>name</code> attribute to describe
the IQN for the initiator.
<span class="since">Since 4.7.0</span></dd>
<dt><code>auth</code></dt>
<dd>If present, the <code>auth</code> element provides the
authentication credentials needed to access the source by the
setting of the <code>type</code> attribute (pool
types <code>iscsi</code>, <code>iscsi-direct</code>, <code>rbd</code>).
The <code>type</code>
types <code>iscsi</code>, <code>rbd</code>). The <code>type</code>
must be either "chap" or "ceph". Use "ceph" for
Ceph RBD (Rados Block Device) network sources and use "iscsi" for CHAP
(Challenge-Handshake Authentication Protocol) iSCSI
@@ -407,12 +386,6 @@
LVM metadata type. All drivers are required to have a default
value for this, so it is optional. <span class="since">Since 0.4.1</span></dd>
<dt><code>protocol</code></dt>
<dd>For a <code>netfs</code> Storage Pool provide a mechanism to
define which NFS protocol version number will be used to contact
the server's NFS service. The attribute <code>ver</code> accepts
an unsigned integer as the version number to use.
<span class="since">Since 5.1.0</span></dd>
<dt><code>vendor</code></dt>
<dd>Provides optional information about the vendor of the
storage device. This contains a single
@@ -478,8 +451,8 @@
The <code>owner</code> element contains the numeric user ID.
The <code>group</code> element contains the numeric group ID.
If <code>owner</code> or <code>group</code> aren't specified when
creating a directory, the UID and GID of the libvirtd process are used.
The <code>label</code> element contains the MAC (eg SELinux)
creating a directory, the values are inherited from the parent
directory. The <code>label</code> element contains the MAC (eg SELinux)
label string.
<span class="since">Since 0.4.1</span>
For running directory or filesystem based pools, these fields
@@ -508,145 +481,6 @@
device, measured in bytes. <span class="since">Since 0.4.1</span>
</p>
<h3><a id="StoragePoolRefresh">Refresh overrides</a></h3>
<p>
The optional <code>refresh</code> element can control how the pool and
associated volumes are refreshed (pool type <code>rbd</code>). The
<code>allocation</code> attribute of the <code>volume</code> child element
controls the method used for computing the allocation of a volume. The
valid attribute values are <code>default</code> to compute the actual
usage or <code>capacity</code> to use the logical capacity for cases where
computing the allocation is too expensive. The following XML snippet
shows the syntax:
<pre>
&lt;pool type="rbd"&gt;
&lt;name&gt;myrbdpool&lt;/name&gt;
...
&lt;source/&gt;
...
&lt;refresh&gt;
&lt;volume allocation='capacity'/&gt;
&lt;/refresh&gt;
...
&lt;/pool&gt;
</pre>
<span class="since">Since 5.2.0</span>
</p>
<h3><a id="StoragePoolNamespaces">Storage Pool Namespaces</a></h3>
<p>
Usage of Storage Pool Namespaces provides a mechanism to provide
pool type specific data in a free form or arbitrary manner via
XML syntax targeted solely for the needs of the specific pool type
which is not otherwise supported in standard XML. For the "fs" and
"netfs" pool types this provides a mechanism to provide additional
mount options on the command line. For the "rbd" pool this provides
a mechanism to override default settings for RBD configuration options.
</p>
<p>
Usage of namespaces comes with no support guarantees. It is intended
for developers testing out a concept prior to requesting an explicitly
supported XML option in libvirt, and thus should never be used in
production.
</p>
<dl>
<dt><code>fs:mount_opts</code></dt>
<dd>Provides an XML namespace mechanism to optionally utilize
specifically named options for the mount command via the "-o"
option for the <code>fs</code> or <code>netfs</code> type storage
pools. In order to designate that the Storage Pool will be using
the mechanism, the <code>pool</code> element must be modified to
provide the XML namespace attribute syntax as follows:
<p>
xmlns:fs='http://libvirt.org/schemas/storagepool/fs/1.0'
</p>
<p>
The <code>fs:mount_opts</code> defines the mount options by
specifying multiple <code>fs:option</code> subelements with
the attribute <code>name</code> specifying the mount option to
be added. The value of the named option is not checked since
it's possible options don't exist on all distributions. It is
expected that proper and valid options will be supplied for the
target host.
</p>
The following XML snippet shows the syntax required in order to
utilize for a netfs pool:
<pre>
&lt;pool type="netfs" xmlns:fs='http://libvirt.org/schemas/storagepool/fs/1.0'&gt;
&lt;name&gt;nfsimages&lt;/name&gt;
...
&lt;source&gt;
...
&lt;/source&gt;
...
&lt;target&gt;
...
&lt;/target&gt;
&lt;fs:mount_opts&gt;
&lt;fs:option name='sync'/&gt;
&lt;fs:option name='lazytime'/&gt;
&lt;/fs:mount_opts&gt;
&lt;/pool&gt;
...</pre>
<span class="since">Since 5.1.0.</span></dd>
<dt><code>rbd:config_opts</code></dt>
<dd>Provides an XML namespace mechanism to optionally utilize
specifically named options for the RBD configuration options
via the rados_conf_set API for the <code>rbd</code> type
storage pools. In order to designate that the Storage Pool
will be using the mechanism, the <code>pool</code> element
must be modified to provide the XML namespace attribute
syntax as follows:
<p>
xmlns:rbd='http://libvirt.org/schemas/storagepool/rbd/1.0'
</p>
<p>
The <code>rbd:config_opts</code> defines the configuration options
by specifying multiple <code>rbd:option</code> subelements with
the attribute <code>name</code> specifying the configuration option
to be added and <code>value</code> specifying the configuration
option value. The name and value for each option is only checked
to be not empty. The name and value provided are not checked since
it's possible options don't exist on all distributions. It is
expected that proper and valid options will be supplied for the
target host.
</p>
The following XML snippet shows the syntax required in order to
utilize
<pre>
&lt;pool type="rbd" xmlns:rbd='http://libvirt.org/schemas/storagepool/rbd/1.0'&gt;
&lt;name&gt;myrbdpool&lt;/name&gt;
...
&lt;source&gt;
...
&lt;/source&gt;
...
&lt;target&gt;
...
&lt;/target&gt;
...
&lt;rbd:config_opts&gt;
&lt;rbd:option name='client_mount_timeout' value='45'/&gt;
&lt;rbd:option name='rados_mon_op_timeout' value='20'/&gt;
&lt;rbd:option name='rados_osd_op_timeout' value='10'/&gt;
&lt;/rbd:config_opts&gt;
&lt;/pool&gt;
</pre>
<span class="since">Since 5.1.0.</span></dd>
</dl>
<h2><a id="StorageVol">Storage volume XML</a></h2>
<p>
A storage volume will generally be either a file or a device
@@ -802,8 +636,8 @@
The <code>owner</code> element contains the numeric user ID.
The <code>group</code> element contains the numeric group ID.
If <code>owner</code> or <code>group</code> aren't specified when
creating a supported volume, the UID and GID of the libvirtd process
are used. The <code>label</code> element contains the MAC (eg SELinux)
creating a supported volume, the values are inherited from the parent
directory. The <code>label</code> element contains the MAC (eg SELinux)
label string.
For existing directory or filesystem based volumes, these fields
will be filled with the values used by the existing file.

View File

@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Storage Pool Capabilities XML format</h1>
<ul id="toc"></ul>
<h2><a id="Overview">Overview</a></h2>
<p>The Storage Pool Capabilities XML will provide the information
to determine what types of Storage Pools exist, whether the pool is
supported, and if relevant the source format types, the required
source elements, and the target volume format types. </p>
<p>The Storage Pool Capabilities XML provides more information than the
<a href="/html/libvirt-libvirt-host.html#virConnectGetCapabilities">
<code>virConnectGetCapabilities</code>
</a>
which only provides an enumerated list of supported pool types.</p>
<h2><a id="elements">Element and attribute overview</a></h2>
<p>A query interface was added to the virConnect API's to retrieve the
XML listing of the set of Storage Pool Capabilities
(<span class="since">Since 5.2.0</span>):</p>
<pre>
<a href="/html/libvirt-libvirt-domain.html#virConnectGetStoragePoolCapabilities">virConnectGetStoragePoolCapabilities</a>
</pre>
<p>The root element that emulator capability XML document starts with is
named <code>storagepoolCapabilities</code>. There will be any number of
<code>pool</code> child elements with two attributes <code>type</code>
and <code>supported</code>. Each <code>pool</code> element may have
a <code>poolOptions</code> or <code>volOptions</code> subelements to
describe the available features. Sample XML output is:</p>
<pre>
&lt;storagepoolCapabilities&gt;
&lt;pool type='dir' supported='yes'&gt;
&lt;volOptions&gt;
&lt;defaultFormat type='raw'&lt;/&gt;
&lt;enum name='targetFormatType'&gt;
&lt;value&gt;none&lt;/value&gt;
&lt;value&gt;raw&lt;/value&gt;
...
&lt;/enum&gt;
&lt;/volOptions&gt;
&lt;/pool&gt;
&lt;pool type='fs' supported='yes'&gt;
&lt;poolOptions&gt;
&lt;defaultFormat type='auto'&lt;/&gt;
&lt;enum name='sourceFormatType'&gt;
&lt;value&gt;auto&lt;/value&gt;
&lt;value&gt;ext2&lt;/value&gt;
...
&lt;/enum&gt;
&lt;/poolOptions&gt;
&lt;volOptions&gt;
&lt;defaultFormat type='raw'&lt;/&gt;
&lt;enum name='targetFormatType'&gt;
&lt;value&gt;none&lt;/value&gt;
&lt;value&gt;raw&lt;/value&gt;
...
&lt;/enum&gt;
&lt;/volOptions&gt;
&lt;/pool&gt;
...
&lt;/storagepoolCapabilities&gt;
</pre>
<p>The following section decribes subelements of the
<code>poolOptions</code> and <code>volOptions</code> subelements </p>:
<dl>
<dt><code>defaultFormat</code></dt>
<dd>For the <code>poolOptions</code>, the <code>type</code> attribute
describes the default format name used for the pool source. For the
<code>volOptions</code>, the <code>type</code> attribute describes
the default volume name used for each volume.
</dd>
<dl>
<dt><code>enum</code></dt>
<dd>Each enum uses a name from the list below with any number of
<code>value</code> value subelements describing the valid values.
<dl>
<dt><code>sourceFormatType</code></dt>
<dd>Lists all the possible <code>poolOptions</code> source
pool format types.
</dd>
<dt><code>targetFormatType</code></dt>
<dd>Lists all the possible <code>volOptions</code> target volume
format types.
</dd>
</dl>
</dd>
</dl>
</dl>
</body>
</html>

View File

@@ -22,8 +22,7 @@ use warnings;
my @objects = (
"CONNECT", "DOMAIN", "INTERFACE",
"NETWORK_PORT", "NETWORK", "NODE_DEVICE",
"NWFILTER_BINDING", "NWFILTER",
"NETWORK","NODE_DEVICE", "NWFILTER",
"SECRET", "STORAGE_POOL", "STORAGE_VOL",
);
@@ -84,7 +83,7 @@ foreach my $object (sort { $a cmp $b } keys %perms) {
my $class = $class{$object};
my $olink = lc "object_" . $object;
print <<EOF;
<h3><a id="$olink">$class</a></h3>
<h3><a name="$olink">$class</a></h3>
<table class="acl">
<thead>
<tr>
@@ -106,7 +105,7 @@ EOF
print <<EOF;
<tr>
<td><a id="$plink">$perm</a></td>
<td><a name="$plink">$perm</a></td>
<td>$description</td>
</tr>
EOF

View File

@@ -1,25 +0,0 @@
# Silly mistakes, mostly found in S-o-b or R-b tags.
"jdenemar redhat com" jdenemar@redhat.com
"pkrempa@redhat st.com" pkrempa@redhat.com
jyang@redhat jyang@redhat.com
wangjie88.huawei.com wangjie88@huawei.com
# This is information that's already present in .mailmap, and having to
# duplicate it is annoying. Unfortunately gitdm doesn't parse .mailmap
# and the format is different, so we can't just point it to the file
# either.
cedric.bosdonnat@free.fr cbosdonnat@suse.com
dan@berrange.com berrange@redhat.com
fabiano@fidencio.org fidencio@redhat.com
intrigeri+libvirt@boum.org intrigeri@boum.org
jim@meyering.net meyering@redhat.com
laine@laine.org laine@redhat.com
redhat@adrb.pl adrian.brzezinski@eo.pl
shilei.massclouds@gmx.com shi_lei@massclouds.com
# This deviates from what's found in .mailmap, but it makes more sense as
# far as gitdm is concerned since Jim was employed by Novell at the time.
jfehlig@linux-ypgk.site jfehlig@novell.com

View File

@@ -1,11 +0,0 @@
canonical.com
# Having an @ubuntu.com email address doesn't necessarily imply you're
# a Canonical employee; these people, however, seem to have been employed
# by Canonical at the time they contributed to libvirt.
jamie@ubuntu.com
serge.hallyn@ubuntu.com
smoser@ubuntu.com
soren@ubuntu.com
wgrant@ubuntu.com

View File

@@ -1,2 +0,0 @@
datto.com
dattobackup.com

View File

@@ -1,4 +0,0 @@
dreamhost.com
dreamhost.net
newdream.com
newdream.net

View File

@@ -1,2 +0,0 @@
nec.co.jp
nec.com

View File

@@ -1,101 +0,0 @@
6wind.com 6WIND
active.by ActiveCloud
aero.org Aerospace
akamai.com Akamai
amd.com AMD
anchor.net.au Anchor
aristanetworks.com Arista Networks
arpnetworks.com ARP Networks
av-test.de AV-TEST
b1-systems.de B1 Systems
brightbox.co.uk Brightbox
cisco.com Cisco
citrix.com Citrix
cloudwatt.com Cloudwatt
codethink.co.uk Codethink
cumulusnetworks.com Cumulus Networks
dataductus.se Data Ductus
datagravity.com DataGravity
dell.com Dell
diateam.net DIATEAM
eldorado.org.br ELDORADO
endocode.com Endocode
eo.pl eo Networks
ericsson.com Ericsson
fb.com Facebook
firewall-services.com Firewall-Services
freescale.com Freescale
fujitsu.com Fujitsu
gluster.com Gluster
gridcentric.ca Gridcentric
h3c.com H3C
hde.co.jp HDE
hds.com Hitachi Data Systems
hitachi.com Hitachi
hoster-ok.com hoster-ok.com
hp.com HP
huawei.com Huawei
ibm.com IBM
inktank.com Inktank Storage
intel.com Intel
intellilink.co.jp NTT DATA INTELLILINK
invisiblethingslab.com Invisible Things Lab
jtan.com JTAN
juniper.net Juniper Networks
laposte.net La Poste
le.com Le.com
linaro.org Linaro
linutronix.de Linutronix
linux2go.dk Linux2Go
liquidweb.com Liquid Web
massclouds.com MassClouds
designassembly.de Coffee-Break-Games
mellanox.com Mellanox
midokura.com Midokura
mirantis.com Mirantis
munzinger.de Munzinger Archiv
netease.com NetEase
netzquadrat.de [netzquadrat]
nicira.com Nicira
nimboxx.com NIMBOXX
novell.com Novell
ntt.co.jp NTT Group
ohmu.fi OHMU
open-minds.org OpenThink
oracle.com Oracle
os-t.de OpenSource Training
otb.bg Open Technologies Bulgaria
outscale.com OUTSCALE
parallels.com Parallels
petalogix.com PetaLogix
quobyte.com Quobyte
ravellosystems.com Ravello Systems
samsung.com Samsung
sde.cz SDE
semihalf.com Semihalf
siemens.com Siemens
smartjog.com SmartJog
solarflare.com Solarflare
ssatr.ch Swiss Satellite Radio
sun.com Sun Microsystems
taobao.com Taobao
tdf.fr TDF
tencent.com Tencent
transip.nl TransIP
tresys.com Tresys
uniudc.com Tsinghua Uniudc
univention.de Univention
veritas.com Veritas
vhgroup.net VHGroup
virtualopensystems.com Virtual Open Systems
websense.com Websense
wiktel.com Wikstrom Telephone Company
windriver.com Wind River
winhong.com Winhong
xmission.com XMission
xs4all.nl XS4ALL
yadro.com YADRO
yandex.ru Yandex
yunify.com Yunify
zstack.io ZStack
zte.com.cn ZTE

View File

@@ -1,6 +0,0 @@
redhat.com
# These Red Hat employees used their personal email address when contributing
# to libvirt and we don't have the corresponding @redhat.com address on file.
lkundrak@v3.sk

View File

@@ -1,7 +0,0 @@
suse.com
suse.de
# These SUSE employees used their personal email address when contributing
# to libvirt and we don't have the corresponding @suse.com address on file.
olaf@aepfle.de

View File

@@ -1,2 +0,0 @@
openvz.org
virtuozzo.com

View File

@@ -1,17 +0,0 @@
byu.net
csiro.au
epita.fr
hibikino.ne.jp
infn.it
inria.fr
isi.edu
nict.go.jp
parisdescartes.fr
telecom-bretagne.eu
tu-berlin.de
tu-dresden.de
ucla.edu
upc.edu
utah.edu
uvt.ro
wide.ad.jp

View File

@@ -1,12 +0,0 @@
alpinelinux.org
debian.org
fedoraproject.org
fsf.org
gentoo.org
gnome.org
gnu.org
kernel.org
linux.com
openbsd.org
salasaga.org
samba.org

View File

@@ -1,83 +0,0 @@
# These are all domains you can get a personal email address from, so it's
# fair to assume people using such addresses are contributing in their spare
# time rather than on behalf of their respective employers.
126.com
gmail.com
gmx.com
googlemail.com
hotmail.com
mail.ru
pobox.com
riseup.net
web.de
yahoo.com
# Same as the above, but for domains that don't generally allow random
# people to sign up for an email address. In this case we list the email
# addresses directly rather than just the domain, because we can't really
# consider the domain itself one way or the other.
adam@pandorasboxen.com
agx@sigxcpu.org
alexander.nusov@nfvexpress.com
andres@lagarcavilla.org
asad.saeed@acidseed.com
atler@pld-linux.org
benoar@dolka.fr
beorn@binaries.fr
bigon@bigon.be
bugzilla.redhat.simon@arlott.org
cardoe@cardoe.com
charles@dyfis.net
d.herrendoerfer@herrendoerfer.name
dan@danny.cz
debfx@fobos.de
eike@sf-mail.de
exo@tty.sk
fritz@fritz-elfert.de
gene@czarc.net
gordon@dragonsdawn.net
heathpetersen@kandre.com
ibaldo@adinet.com.uy
igor47@moomers.org
infos@nafets.de
intrigeri@boum.org
james410@cowgill.org.uk
james@shubin.ca
jasper@humppa.nl
jeremy@goop.org
jk@ozlabs.org
jwm@horde.net
klaus@ethgen.de
lacos@caesar.elte.hu
lenaic@lhuard.fr.eu.org
libvirt@dunquino.com
lists@egidy.de
marti@juffo.org
max@rfc2324.org
michael@ellerman.id.au
mike@very.puzzling.org
n0ano@n0ano.com
neil@aldur.co.uk
nobody@nowhere.ws
peter@kieser.ca
pieter@hollants.com
raimue@codingfarm.de
richard@nod.at
rmy@tigress.co.uk
ruben@rubenkerkhof.com
rufo@rufoa.com
slawek@kaplonski.pl
soulxu@soulxu-thinkpad-t410.(none)
stybla@turnovfree.net
tai@rakugaki.org
thomas@scripty.at
v.tolstov@selfip.ru
ville.skytta@iki.fi
vincent@bernat.im
wido@widodh.nl
wiedi@frubar.net
wongc-redhat@hoku.net
xschen@tnsoft.com.cn
yurchor@ukr.net

View File

@@ -155,7 +155,7 @@
also implicitly stating that they have the legal right to make the
contribution, if doing so on behalf of a broader organization /
company. Most of the project's code is distributed under the GNU
Lesser General Public License, version 2.1 or later. Details of the
Lesser General Public License, version 2 or later. Details of the
exact license under which contributions will be presumed to be
covered are found in the source repositories, or website in question.
</p>

View File

@@ -826,39 +826,6 @@
}
</pre>
<h2><a id="conditions">Conditional expressions</a></h2>
<p>For readability reasons new code should avoid shortening comparisons
to 0 for numeric types. Boolean and pointer comparisions may be
shortened. All long forms are okay:
</p>
<pre>
virFooPtr foos = NULL;
size nfoos = 0;
bool hasFoos = false;
GOOD:
if (!foos)
if (!hasFoos)
if (nfoos == 0)
if (foos == NULL)
if (hasFoos == true)
BAD:
if (!nfoos)
if (nfoos)
</pre>
<p>New code should avoid the ternary operator as much as possible.
Specifically it must never span more than one line or nest:
</p>
<pre>
BAD:
char *foo = baz ?
virDoSomethingReallyComplex(driver, vm, something, baz->foo) :
NULL;
char *foo = bar ? bar->baz ? bar->baz->foo : "nobaz" : "nobar";
</pre>
<h2><a id="preprocessor">Preprocessor</a></h2>
<p>Macros defined with an ALL_CAPS name should generally be
@@ -1317,34 +1284,6 @@ BAD:
does for snprintf.
</p>
<h2><a id="errors">Error message format</a></h2>
<p>
Error messages visible to the user should be short and descriptive. All
error messages are translated using gettext and thus must be wrapped in
<code>_()</code> macro. To simplify the translation work, the error message
must not be concatenated from various parts. To simplify searching for
the error message in the code the strings should not be broken even
if they result into a line longer than 80 columns and any formatting
modifier should be enclosed by quotes or other obvious separator.
If a string used with <code>%s</code> can be NULL the NULLSTR macro must
be used.
</p>
<pre>
GOOD: virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to connect to remote host '%s'"), hostname)
BAD: virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to %s to remote host '%s'"),
"connect", hostname);
BAD: virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to connect "
"to remote host '%s'),
hostname);
</pre>
<h2><a id="goto">Use of goto</a></h2>
<p>

View File

@@ -91,8 +91,10 @@
&lt;/network&gt;
&lt;/hookData&gt;</pre>
<p>In the case of an network port being created / deleted, the network
XML will be followed with the full XML description of the port:</p>
<p>In the case of an interface
being plugged/unplugged to/from the network, the network XML will be
followed with the full XML description of the domain containing the
interface that is being plugged/unplugged:</p>
<pre>&lt;hookData&gt;
&lt;network&gt;
@@ -100,11 +102,11 @@
&lt;uuid&gt;afca425a-2c3a-420c-b2fb-dd7b4950d722&lt;/uuid&gt;
...
&lt;/network&gt;
&lt;networkport&gt;
&lt;uuid&gt;5d744f21-ba4a-4d6e-bdb2-30a35ff3207d&lt;/uuid&gt;
...
&lt;plug type='direct' dev='ens3' mode='vepa'/&gt;
&lt;/networkport&gt;
&lt;domain type='$domain_type' id='$domain_id'&gt;
&lt;name&gt;$domain_name&lt;/name&gt;
&lt;uuid&gt;afca425a-2c3a-420c-b2fb-dd7b4950d722&lt;/uuid&gt;
...
&lt;/domain&gt;
&lt;/hookData&gt;</pre>
<p>Please note that this approach is different from other cases such as
@@ -294,15 +296,15 @@
<pre>/etc/libvirt/hooks/network network_name stopped end -</pre></li>
<li>Later, when network is started and there's an interface from a
domain to be plugged into the network, the hook script is called as:<br/>
<pre>/etc/libvirt/hooks/network network_name port-created begin -</pre>
<pre>/etc/libvirt/hooks/network network_name plugged begin -</pre>
Please note, that in this case, the script is passed both network and
port XMLs on its stdin.</li>
domain XMLs on its stdin.</li>
<li>When network is updated, the hook script is called as:<br/>
<pre>/etc/libvirt/hooks/network network_name updated begin -</pre></li>
<li>When the domain from previous case is shutting down, the interface
is unplugged. This leads to another script invocation:<br/>
<pre>/etc/libvirt/hooks/network network_name port-deleted begin -</pre>
And again, as in previous case, both network and port XMLs are passed
<pre>/etc/libvirt/hooks/network network_name unplugged begin -</pre>
And again, as in previous case, both network and domain XMLs are passed
onto script's stdin.</li>
</ul>

View File

@@ -234,39 +234,29 @@ foreach my $src (@srcs) {
}
} else {
if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*(?:-\s*(\d+\.\d+\.\d+))?\s*\*/\s*)?$!) {
if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*\*/\s*)?$!) {
my $api = $1;
my $meth = $2;
my $vers = $3;
my $deleted = $4;
next if $api eq "no" || $api eq "name";
if ($meth eq "NULL" && !defined $deleted) {
die "Method impl for $api is NULL, but no deleted version is provided";
}
if ($meth ne "NULL" && defined $deleted) {
die "Method impl for $api is non-NULL, but deleted version is provided";
}
die "Method $meth in $src is missing version" unless defined $vers || $api eq "connectURIProbe";
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|URIProbe)/;
die "Found unexpected method $api in $ingrp\n";
}
$groups{$ingrp}->{drivers}->{$impl}->{$api} = {};
$groups{$ingrp}->{drivers}->{$impl}->{$api}->{vers} = $vers;
$groups{$ingrp}->{drivers}->{$impl}->{$api}->{deleted} = $deleted;
$groups{$ingrp}->{drivers}->{$impl}->{$api} = $vers;
if ($api eq "domainMigratePrepare" ||
$api eq "domainMigratePrepare2" ||
$api eq "domainMigratePrepare3") {
if (!$groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"}) {
$groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"} = {};
$groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"}->{vers} = $vers;
}
$groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"} = $vers
unless $groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"};
}
} elsif ($line =~ /}/) {
@@ -290,7 +280,7 @@ $groups{virHypervisorDriver}->{apis}->{"domainMigrate"} = "virDomainMigrate";
my $openAuthVers = (0 * 1000 * 1000) + (4 * 1000) + 0;
foreach my $drv (keys %{$groups{"virHypervisorDriver"}->{drivers}}) {
my $openVersStr = $groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpen"}->{vers};
my $openVersStr = $groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpen"};
my $openVers;
if ($openVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
$openVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
@@ -300,16 +290,14 @@ foreach my $drv (keys %{$groups{"virHypervisorDriver"}->{drivers}}) {
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpenReadOnly"} =
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpen"};
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpenAuth"} = {};
# 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{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpenAuth"}->{vers} = $openVersStr;
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpenAuth"} = $openVersStr;
} else {
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpenAuth"}->{vers} = "0.4.0";
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"connectOpenAuth"} = "0.4.0";
}
}
@@ -321,23 +309,21 @@ $groups{virHypervisorDriver}->{apis}->{"domainCreateLinux"} = "virDomainCreateLi
my $createAPIVers = (0 * 1000 * 1000) + (0 * 1000) + 3;
foreach my $drv (keys %{$groups{"virHypervisorDriver"}->{drivers}}) {
my $createVersStr = $groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateXML"}->{vers};
my $createVersStr = $groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateXML"};
next unless defined $createVersStr;
my $createVers;
if ($createVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
$createVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
}
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = {};
# virCreateLinux is always 0.0.3 if the driver existed
# before this time, otherwise it matches the version of
# the driver's virCreateXML entry
if ($createVersStr eq "Y" ||
$createVers >= $createAPIVers) {
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateLinux"}->{vers} = $createVersStr;
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = $createVersStr;
} else {
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateLinux"}->{vers} = "0.0.3";
$groups{"virHypervisorDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = "0.0.3";
}
}
@@ -356,15 +342,13 @@ print <<EOF;
<p>
This page documents which <a href="html/">libvirt calls</a> work on
which libvirt drivers / hypervisors, and which version the API appeared
in. If a hypervisor driver later dropped support for the API, the version
when it was removed is also mentioned (highlighted in
<span class="removedhv">dark red</span>).
in.
</p>
EOF
foreach my $grp (sort { $a cmp $b } keys %groups) {
print "<h2><a id=\"$grp\">", $groupheaders{$grp}, "</a></h2>\n";
print "<h2><a name=\"$grp\">", $groupheaders{$grp}, "</a></h2>\n";
print <<EOF;
<table class="top_table">
<thead>
@@ -411,16 +395,11 @@ EOF
EOF
foreach my $drv (sort {$a cmp $b } keys %{$groups{$grp}->{drivers}}) {
print "<td>";
if (exists $groups{$grp}->{drivers}->{$drv}->{$field}) {
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{vers}) {
print $groups{$grp}->{drivers}->{$drv}->{$field}->{vers};
}
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{deleted}) {
print " - <span class=\"removedhv\">", $groups{$grp}->{drivers}->{$drv}->{$field}->{deleted}, "</span>";
}
print "<td>", $groups{$grp}->{drivers}->{$drv}->{$field}, "</td>\n";
} else {
print "<td></td>\n";
}
print "</td>\n";
}
print <<EOF;

View File

@@ -2,9 +2,20 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="js/jquery-3.1.1.min.js"> </script>
<script type="text/javascript" src="js/moment.min.js"> </script>
<script type="text/javascript" src="js/jquery.rss.min.js"> </script>
<script type="text/javascript">
<!--
window.addEventListener("load", function() { fetchRSS() });
jQuery(function($) {
$("#planet").rss("http://planet.virt-tools.org/atom.xml", {
ssl: true,
layoutTemplate: '<dl>{entries}</dl>',
entryTemplate: '<dt><a href="{url}">{title}</a></dt><dd>by {author} on {date}</li>',
dateFormat: 'DD MMM YYYY'
})
})
// -->
</script>
</head>
@@ -55,11 +66,9 @@
<a href="formatstorageencryption.html">storage encryption</a>,
<a href="formatcaps.html">capabilities</a>,
<a href="formatdomaincaps.html">domain capabilities</a>,
<a href="formatstoragecaps.html">storage pool capabilities</a>,
<a href="formatnode.html">node devices</a>,
<a href="formatsecret.html">secrets</a>,
<a href="formatsnapshot.html">snapshots</a>,
<a href="formatcheckpoint.html">checkpoints</a></dd>
<a href="formatsnapshot.html">snapshots</a></dd>
<dt><a href="http://wiki.libvirt.org">Wiki</a></dt>
<dd>Read further community contributed content</dd>
</dl>

1266
docs/index.py Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -426,7 +426,7 @@ dprintf(logfd, "%s: ", timestamp);
VIR_FREE(timestamp);
virCommandWriteArgLog(cmd, logfd);
string = virCommandToString(cmd, false);
string = virCommandToString(cmd);
if (string)
VIR_DEBUG("about to run %s", string);
VIR_FREE(string);

View File

@@ -539,6 +539,13 @@ C &lt;-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | &lt;-- S (reply)
be part of the underlying server.
</dd>
<dt><code>virNetServerMDNSPtr</code> (virnetservermdns.h)</dt>
<dd>The virNetServerMDNS APIs are used to advertise a server
across the local network, enabling clients to automatically
detect the existence of remote services. This is done by
interfacing with the Avahi mDNS advertisement service.
</dd>
<dt><code>virNetServerClientPtr</code> (virnetserverclient.h)</dt>
<dd>The virNetServerClient APIs are used to manage I/O related
to a single client network connection. It handles initial

4
docs/js/jquery-3.1.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

11
docs/js/jquery.rss.min.js vendored Normal file
View File

@@ -0,0 +1,11 @@
(function(d){var e=function(a,b,c,f){this.target=a;this.url=b;this.html=[];this.effectQueue=[];this.options=d.extend({ssl:!1,host:"www.feedrapp.info",limit:null,key:null,layoutTemplate:"<ul>{entries}</ul>",entryTemplate:'<li><a href="{url}">[{author}@{date}] {title}</a><br/>{shortBodyPlain}</li>',tokens:{},outputMode:"json",dateFormat:"dddd MMM Do",dateLocale:"en",effect:"show",offsetStart:!1,offsetEnd:!1,error:function(){console.log("jQuery RSS: url doesn't link to RSS-Feed")},onData:function(){},
success:function(){}},c||{});this.options.ssl&&"www.feedrapp.info"===this.options.host&&(this.options.host="feedrapp.herokuapp.com");this.callback=f||this.options.success};e.htmlTags="doctype,html,head,title,base,link,meta,style,script,noscript,body,article,nav,aside,section,header,footer,h1-h6,hgroup,address,p,hr,pre,blockquote,ol,ul,li,dl,dt,dd,figure,figcaption,div,table,caption,thead,tbody,tfoot,tr,th,td,col,colgroup,form,fieldset,legend,label,input,button,select,datalist,optgroup,option,textarea,keygen,output,progress,meter,details,summary,command,menu,del,ins,img,iframe,embed,object,param,video,audio,source,canvas,track,map,area,a,em,strong,i,b,u,s,small,abbr,q,cite,dfn,sub,sup,time,code,kbd,samp,var,mark,bdi,bdo,ruby,rt,rp,span,br,wbr".split(",");
e.prototype.load=function(a){var b="http"+(this.options.ssl?"s":"")+"://"+this.options.host+"?callback=?&q="+encodeURIComponent(this.url);this.options.offsetStart&&this.options.offsetEnd&&(this.options.limit=this.options.offsetEnd);null!==this.options.limit&&(b+="&num="+this.options.limit);null!==this.options.key&&(b+="&key="+this.options.key);d.getJSON(b,a)};e.prototype.render=function(){var a=this;this.load(function(b){try{a.feed=b.responseData.feed,a.entries=b.responseData.feed.entries}catch(c){return a.entries=
[],a.feed=null,a.options.error.call(a)}b=a.generateHTMLForEntries();a.target.append(b.layout);if(0!==b.entries.length){d.isFunction(a.options.onData)&&a.options.onData.call(a);var f=d(b.layout).is("entries")?b.layout:d("entries",b.layout);a.appendEntriesAndApplyEffects(f,b.entries)}0<a.effectQueue.length?a.executeEffectQueue(a.callback):d.isFunction(a.callback)&&a.callback.call(a)})};e.prototype.appendEntriesAndApplyEffects=function(a,b){var c=this;d.each(b,function(b,e){var d=c.wrapContent(e);"show"===
c.options.effect?a.before(d):(d.css({display:"none"}),a.before(d),c.applyEffect(d,c.options.effect))});a.remove()};e.prototype.generateHTMLForEntries=function(){var a=this,b={entries:[],layout:null};d(this.entries).each(function(){var c=a.options.offsetStart,f=a.options.offsetEnd;c&&f?index>=c&&index<=f&&a.isRelevant(this,b.entries)&&(c=a.evaluateStringForEntry(a.options.entryTemplate,this),b.entries.push(c)):a.isRelevant(this,b.entries)&&(c=a.evaluateStringForEntry(a.options.entryTemplate,this),
b.entries.push(c))});b.layout=this.options.entryTemplate?this.wrapContent(this.options.layoutTemplate.replace("{entries}","<entries></entries>")):this.wrapContent("<div><entries></entries></div>");return b};e.prototype.wrapContent=function(a){return 0!==d.trim(a).indexOf("<")?d("<div>"+a+"</div>"):d(a)};e.prototype.applyEffect=function(a,b,c){switch(b){case "slide":a.slideDown("slow",c);break;case "slideFast":a.slideDown(c);break;case "slideSynced":this.effectQueue.push({element:a,effect:"slide"});
break;case "slideFastSynced":this.effectQueue.push({element:a,effect:"slideFast"})}};e.prototype.executeEffectQueue=function(a){var b=this;this.effectQueue.reverse();var c=function(){var f=b.effectQueue.pop();f?b.applyEffect(f.element,f.effect,c):a&&a()};c()};e.prototype.evaluateStringForEntry=function(a,b){var c=a,f=this;d(a.match(/(\{.*?\})/g)).each(function(){var a=this.toString();c=c.replace(a,f.getValueForToken(a,b))});return c};e.prototype.isRelevant=function(a,b){var c=this.getTokenMap(a);
return this.options.filter?this.options.filterLimit&&this.options.filterLimit===b.length?!1:this.options.filter(a,c):!0};e.prototype.getFormattedDate=function(a){if(this.options.dateFormatFunction)return this.options.dateFormatFunction(a);return"undefined"!==typeof moment?(a=moment(new Date(a)),a=a.locale?a.locale(this.options.dateLocale):a.lang(this.options.dateLocale),a.format(this.options.dateFormat)):a};e.prototype.getTokenMap=function(a){if(!this.feedTokens){var b=JSON.parse(JSON.stringify(this.feed));
delete b.entries;this.feedTokens=b}return d.extend({feed:this.feedTokens,url:a.link,author:a.author,date:this.getFormattedDate(a.publishedDate),title:a.title,body:a.content,shortBody:a.contentSnippet,bodyPlain:function(a){for(var a=a.content.replace(/<script[\\r\\\s\S]*<\/script>/mgi,"").replace(/<\/?[^>]+>/gi,""),b=0;b<e.htmlTags.length;b++)a=a.replace(RegExp("<"+e.htmlTags[b],"gi"),"");return a}(a),shortBodyPlain:a.contentSnippet.replace(/<\/?[^>]+>/gi,""),index:d.inArray(a,this.entries),totalEntries:this.entries.length,
teaserImage:function(a){try{return a.content.match(/(<img.*?>)/gi)[0]}catch(b){return""}}(a),teaserImageUrl:function(a){try{return a.content.match(/(<img.*?>)/gi)[0].match(/src="(.*?)"/)[1]}catch(b){return""}}(a)},this.options.tokens)};e.prototype.getValueForToken=function(a,b){var c=this.getTokenMap(b),d=a.replace(/[\{\}]/g,""),d=c[d];if("undefined"!==typeof d)return"function"===typeof d?d(b,c):d;throw Error("Unknown token: "+a+", url:"+this.url);};d.fn.rss=function(a,b,c){(new e(this,a,b,c)).render();
return this}})(jQuery);

View File

@@ -1,141 +0,0 @@
"use strict";
function pageload() {
window.addEventListener("scroll", function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop;
var shrinkOn = 94;
var home = document.getElementById("home");
var links = document.getElementById("jumplinks");
var search = document.getElementById("search");
var body = document.getElementById("body");
if (distanceY > shrinkOn) {
if (home.className != "navhide") {
body.className = "navhide";
home.className = "navhide";
links.className = "navhide";
search.className = "navhide";
}
} else {
if (home.className == "navhide") {
body.className = "";
home.className = "";
links.className = "";
search.className = "";
}
}
});
/* Setting this class makes the advanced search options visible */
var advancedSearch = document.getElementById("advancedsearch");
advancedSearch.className = "advancedsearch";
var simpleSearch = document.getElementById("simplesearch");
simpleSearch.addEventListener("submit", advancedsearch);
}
function advancedsearch(e) {
e.preventDefault();
e.stopPropagation();
var form = document.createElement("form");
form.setAttribute("method", "get");
var newq = document.createElement("input");
newq.setAttribute("type", "hidden");
form.appendChild(newq);
var q = document.getElementById("searchq");
var whats = document.getElementsByName("what");
var what = "website";
for (var i = 0; i < whats.length; i++) {
if (whats[i].checked) {
what = whats[i].value;
break;
}
}
if (what == "website") {
form.setAttribute("action", "https://google.com/search");
newq.setAttribute("name", "q");
newq.value = "site:libvirt.org " + q.value;
} else if (what == "wiki") {
form.setAttribute("action", "https://wiki.libvirt.org/index.php");
newq.setAttribute("name", "search");
newq.value = q.value;
} else if (what == "devs") {
form.setAttribute("action", "https://google.com/search");
newq.setAttribute("name", "q");
newq.value = "site:redhat.com/archives/libvir-list " + q.value;
} else if (what == "users") {
form.setAttribute("action", "https://google.com/search");
newq.setAttribute("name", "q");
newq.value = "site:redhat.com/archives/libvirt-users " + q.value;
}
document.body.appendChild(form);
form.submit();
return false;
}
function fetchRSS() {
if (document.location.protocol == "file:")
return;
var planet = document.getElementById("planet");
if (planet === null)
return;
var req = new XMLHttpRequest();
req.open("GET", "https://planet.virt-tools.org/atom.xml");
req.setRequestHeader("Accept", "application/atom+xml, text/xml");
req.onerror = function(e) {
if (this.statusText != "")
console.error(this);
};
req.onload = function(e) {
if (this.readyState !== 4)
return;
if (this.status != 200) {
console.error(this.statusText);
return;
}
if (this.responseXML === null) {
console.error("Atom response is not an XML");
return;
}
var dl = document.createElement("dl");
var dateOpts = { day: "numeric", month: "short", year: "numeric"};
var entries = this.responseXML.querySelectorAll("feed > entry:not(:nth-of-type(1n+5))");
entries.forEach(function(e) {
var name = e.querySelector("author > name").textContent;
var title = e.querySelector("title").textContent;
var updated = e.querySelector("updated").textContent;
var link = e.querySelector("link").attributes.href.textContent;
var a = document.createElement("a");
a.href = link;
a.innerText = title;
var dt = document.createElement("dt");
dt.appendChild(a);
dl.appendChild(dt);
var date = new Date(updated);
date = date.toLocaleDateString("default", dateOpts);
var dd = document.createElement("dd");
dd.innerText = ` by ${name} on ${date}`;
dl.appendChild(dd);
});
planet.appendChild(dl);
};
req.send();
}

7
docs/js/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body class="docs">
<h2>Knowledge base</h2>
<div class="panel">
<dl>
<dt><a href="kbase/locking.html">Disk locking</a></dt>
<dd>Ensuring exclusive guest access to disks with
<a href="kbase/locking-lockd.html">virtlockd</a> or
<a href="kbase/locking-sanlock.html">Sanlock</a></dd>
<dt><a href="kbase/secureusage.html">Secure usage</a></dt>
<dd>Secure usage of the libvirt APIs</dd>
<dt><a href="kbase/launch_security_sev.html">Launch security</a></dt>
<dd>Securely launching VMs with AMD SEV</dd>
<dt><a href="kbase/domainstatecapture.html">Domain state
capture</a></dt>
<dd>Comparison between different methods of capturing domain
state</dd>
</dl>
</div>
<br class="clear"/>
</body>
</html>

View File

@@ -1,303 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Domain state capture using Libvirt</h1>
<ul id="toc"></ul>
<p>
In order to aid application developers to choose which
operations best suit their needs, this page compares the
different means for capturing state related to a domain managed
by libvirt.
</p>
<p>
The information here is primarily geared towards capturing the
state of an active domain. Capturing the state of an inactive
domain essentially amounts to copying the contents of guest
disks, followed by a fresh boot of the same domain configuration
with disks restored back to that saved state.
</p>
<h2><a id="definitions">State capture trade-offs</a></h2>
<p>One of the features made possible with virtual machines is live
migration -- transferring all state related to the guest from
one host to another with minimal interruption to the guest's
activity. In this case, state includes domain memory (including
register and device contents), and domain storage (whether the
guest's view of the disks are backed by local storage on the
host, or by the hypervisor accessing shared storage over a
network). A clever observer will then note that if all state is
available for live migration, then there is nothing stopping a
user from saving some or all of that state at a given point of
time in order to be able to later rewind guest execution back to
the state it previously had. The astute reader will also realize
that state capture at any level requires that the data must be
stored and managed by some mechanism. This processing might fit
in a single file, or more likely require a chain of related
files, and may require synchronization with third-party tools
built around managing the amount of data resulting from
capturing the state of multiple guests that each use multiple
disks.
</p>
<p>
There are several libvirt APIs associated with capturing the
state of a guest, which can later be used to rewind that guest
to the conditions it was in earlier. The following is a list of
trade-offs and differences between the various facets that
affect capturing domain state for active domains:
</p>
<dl>
<dt>Duration</dt>
<dd>Capturing state can be a lengthy process, so while the
captured state ideally represents an atomic point in time
corresponding to something the guest was actually executing,
capturing state tends to focus on minimizing guest downtime
while performing the rest of the state capture in parallel
with guest execution. Some interfaces require up-front
preparation (the state captured is not complete until the API
ends, which may be some time after the command was first
started), while other interfaces track the state when the
command was first issued, regardless of the time spent in
capturing the rest of the state. Also, time spent in state
capture may be longer than the time required for live
migration, when state must be duplicated rather than shared.
</dd>
<dt>Amount of state</dt>
<dd>For an online guest, there is a choice between capturing the
guest's memory (all that is needed during live migration when
the storage is already shared between source and destination),
the guest's disk state (all that is needed if there are no
pending guest I/O transactions that would be lost without the
corresponding memory state), or both together. Reverting to
partial state may still be viable, but typically, booting from
captured disk state without corresponding memory is comparable
to rebooting a machine that had power cut before I/O could be
flushed. Guests may need to use proper journaling methods to
avoid problems when booting from partial state.
</dd>
<dt>Quiescing of data</dt>
<dd>Even if a guest has no pending I/O, capturing disk state may
catch the guest at a time when the contents of the disk are
inconsistent. Cooperating with the guest to perform data
quiescing is an optional step to ensure that captured disk
state is fully consistent without requiring additional memory
state, rather than just crash-consistent. But guest
cooperation may also have time constraints, where the guest
can rightfully panic if there is too much downtime while I/O
is frozen.
</dd>
<dt>Quantity of files</dt>
<dd>When capturing state, some approaches store all state within
the same file (internal), while others expand a chain of
related files that must be used together (external), for more
files that a management application must track.
</dd>
<dt>Impact to guest definition</dt>
<dd>Capturing state may require temporary changes to the guest
definition, such as associating new files into the domain
definition. While state capture should never impact the
running guest, a change to the domain's active XML may have
impact on other host operations being performed on the domain.
</dd>
<dt>Third-party integration</dt>
<dd>When capturing state, there are tradeoffs to how much of the
process must be done directly by the hypervisor, and how much
can be off-loaded to third-party software. Since capturing
state is not instantaneous, it is essential that any
third-party integration see consistent data even if the
running guest continues to modify that data after the point in
time of the capture.</dd>
<dt>Full vs. incremental</dt>
<dd>When periodically repeating the action of state capture, it
is useful to minimize the amount of state that must be
captured by exploiting the relation to a previous capture,
such as focusing only on the portions of the disk that the
guest has modified in the meantime. Some approaches are able
to take advantage of checkpoints to provide an incremental
backup, while others are only capable of a full backup even if
that means re-capturing unchanged portions of the disk.</dd>
<dt>Local vs. remote</dt>
<dd>Domains that completely use remote storage may only need
some mechanism to keep track of guest memory state while using
external means to manage storage. Still, hypervisor and guest
cooperation to ensure points in time when no I/O is in flight
across the network can be important for properly capturing
disk state.</dd>
<dt>Network latency</dt>
<dd>Whether it's domain storage or saving domain state into
remote storage, network latency has an impact on snapshot
data. Having dedicated network capacity, bandwidth, or quality
of service levels may play a role, as well as planning for how
much of the backup process needs to be local.</dd>
</dl>
<p>
An example of the various facets in action is migration of a
running guest. In order for the guest to be able to resume on
the destination at the same place it left off at the source, the
hypervisor has to get to a point where execution on the source
is stopped, the last remaining changes occurring since the
migration started are then transferred, and the guest is started
on the target. The management software thus must keep track of
the starting point and any changes since the starting
point. These last changes are often referred to as dirty page
tracking or dirty disk block bitmaps. At some point in time
during the migration, the management software must freeze the
source guest, transfer the dirty data, and then start the guest
on the target. This period of time must be minimal. To minimize
overall migration time, one is advised to use a dedicated
network connection with a high quality of service. Alternatively
saving the current state of the running guest can just be a
point in time type operation which doesn't require updating the
"last vestiges" of state prior to writing out the saved state
file. The state file is the point in time of whatever is current
and may contain incomplete data which if used to restart the
guest could cause confusion or problems because some operation
wasn't completed depending upon where in time the operation was
commenced.
</p>
<h2><a id="apis">State capture APIs</a></h2>
<p>With those definitions, the following libvirt APIs related to
state capture have these properties:</p>
<dl>
<dt><a href="html/libvirt-libvirt-domain.html#virDomainManagedSave"><code>virDomainManagedSave</code></a></dt>
<dd>This API saves guest memory, with libvirt managing all of
the saved state, then stops the guest. While stopped, the
disks can be copied by a third party. However, since any
subsequent restart of the guest by libvirt API will restore
the memory state (which typically only works if the disk state
is unchanged in the meantime), and since it is not possible to
get at the memory state that libvirt is managing, this is not
viable as a means for rolling back to earlier saved states,
but is rather more suited to situations such as suspending a
guest prior to rebooting the host in order to resume the guest
when the host is back up. This API also has a drawback of
potentially long guest downtime, and therefore does not lend
itself well to live backups.</dd>
<dt><a href="html/libvirt-libvirt-domain.html#virDomainSave"><code>virDomainSave</code></a></dt>
<dd>This API is similar to virDomainManagedSave(), but moves the
burden on managing the stored memory state to the user. As
such, the user can now couple saved state with copies of the
disks to perform a revert to an arbitrary earlier saved state.
However, changing who manages the memory state does not change
the drawback of potentially long guest downtime when capturing
state.</dd>
<dt><a href="html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotCreateXML"><code>virDomainSnapshotCreateXML</code></a></dt>
<dd>This API wraps several approaches for capturing guest state,
with a general premise of creating a snapshot (where the
current guest resources are frozen in time and a new wrapper
layer is opened for tracking subsequent guest changes). It
can operate on both offline and running guests, can choose
whether to capture the state of memory, disk, or both when
used on a running guest, and can choose between internal and
external storage for captured state. However, it is geared
towards post-event captures (when capturing both memory and
disk state, the disk state is not captured until all memory
state has been collected first). Using QEMU as the
hypervisor, internal snapshots currently have lengthy downtime
that is incompatible with freezing guest I/O, but external
snapshots are quick when memory contents are not also saved.
Since creating an external snapshot changes which disk image
resource is in use by the guest, this API can be coupled
with <a href="html/libvirt-libvirt-domain.html#virDomainBlockCommit"><code>virDomainBlockCommit()</code></a>
to restore things back to the guest using its original disk
image, where a third-party tool can read the backing file
prior to the live commit. See also
the <a href="formatsnapshot.html">XML details</a> used with
this command.</dd>
<dt><a href="html/libvirt-libvirt-domain.html#virDomainFSFreeze"><code>virDomainFSFreeze</code></a>, <a href="html/libvirt-libvirt-domain.html#virDomainFSThaw"><code>virDomainFSThaw</code></a></dt>
<dd>This pair of APIs does not directly capture guest state, but
can be used to coordinate with a trusted live guest that state
capture is about to happen, and therefore guest I/O should be
quiesced so that the state capture is fully consistent, rather
than merely crash consistent. Some APIs are able to
automatically perform a freeze and thaw via a flags parameter,
rather than having to make separate calls to these
functions. Also, note that freezing guest I/O is only possible
with trusted guests running a guest agent, and that some
guests place maximum time limits on how long I/O can be
frozen.</dd>
<dt><a href="html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointCreateXML"><code>virDomainCheckpointCreateXML</code></a></dt>
<dd>This API does not actually capture guest state, rather it
makes it possible to track which portions of guest disks have
changed between a checkpoint and the current live execution of
the guest. However, while it is possible use this API to
create checkpoints in isolation, it is more typical to create
a checkpoint as a side-effect of starting a new incremental
backup with <code>virDomainBackupBegin()</code> or at the
creation of an external snapshot
with <code>virDomainSnapshotCreateXML2()</code>, since a
second incremental backup is most useful when using the
checkpoint created during the first. See also
the <a href="formatcheckpoint.html">XML details</a> used with
this command.</dd>
<dt><a href="html/libvirt-libvirt-domain.html#virDomainBackupBegin"><code>virDomainBackupBegin</code></a>, <a href="html/libvirt-libvirt-domain.html#virDomainBackupEnd"><code>virDomainBackupEnd</code></a></dt>
<dd>This API wraps approaches for capturing the state of disks
of a running guest, but does not track accompanying guest
memory state. The capture is consistent to the start of the
operation, where the captured state is stored independently
from the disk image in use with the guest and where it can be
easily integrated with a third-party for capturing the disk
state. Since the backup operation is stored externally from
the guest resources, there is no need to commit data back in
at the completion of the operation. When coupled with
checkpoints, this can be used to capture incremental backups
instead of full.</dd>
</dl>
<h2><a id="examples">Examples</a></h2>
<p>The following two sequences both accomplish the task of
capturing the disk state of a running guest, then wrapping
things up so that the guest is still running with the same file
as its disk image as before the sequence of operations began.
The difference between the two sequences boils down to the
impact of an unexpected interruption made at any point in the
middle of the sequence: with such an interruption, the first
example leaves the guest tied to a temporary wrapper file rather
than the original disk, and requires manual clean up of the
domain definition; while the second example has no impact to the
domain definition.</p>
<p>1. Backup via temporary snapshot
<pre>
virDomainFSFreeze()
virDomainSnapshotCreateXML(VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)
virDomainFSThaw()
third-party copy the backing file to backup storage # most time spent here
virDomainBlockCommit(VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) per disk
wait for commit ready event per disk
virDomainBlockJobAbort() per disk
</pre></p>
<p>2. Direct backup
<pre>
virDomainFSFreeze()
virDomainBackupBegin()
virDomainFSThaw()
wait for push mode event, or pull data over NBD # most time spent here
virDomainBackupEnd()
</pre></p>
</body>
</html>

View File

@@ -1,521 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Launch security with AMD SEV</h1>
<ul id="toc"></ul>
<p>
Storage encryption in modern public cloud computing is a common practice.
However, from the point of view of a user of these cloud workloads, a
significant amount of trust needs to be put in the cloud platform security as
well as integrity (was the hypervisor tampered?). For this reason there's ever
rising demand for securing data in use, i.e. memory encryption.
One of the solutions addressing this matter is AMD SEV.
</p>
<h2>AMD SEV</h2>
<p>
SEV (Secure Encrypted Virtualization) is a feature extension of AMD's SME (Secure
Memory Encryption) intended for KVM virtual machines which is supported
primarily on AMD's EPYC CPU line. In contrast to SME, SEV uses a unique memory encryption
key for each VM. The whole encryption of memory pages is completely transparent
to the hypervisor and happens inside dedicated hardware in the on-die memory controller.
Each controller includes a high-performance Advanced Encryption Standard
(AES) engine that encrypts data when it is written to DRAM and decrypts it
when read.
For more details about the technology itself, you can visit
<a href="https://developer.amd.com/sev/">AMD's developer portal</a>.
</p>
<h2><a id="Host">Enabling SEV on the host</a></h2>
<p>
Before VMs can make use of the SEV feature you need to make sure your
AMD CPU does support SEV. You can check whether SEV is among the CPU
flags with:
</p>
<pre>
$ cat /proc/cpuinfo | grep sev
...
sme ssbd sev ibpb</pre>
<p>
Next step is to enable SEV in the kernel, because it is disabled by default.
This is done by putting the following onto the kernel command line:
</p>
<pre>
mem_encrypt=on kvm_amd.sev=1
</pre>
<p>
To make the changes persistent, append the above to the variable holding
parameters of the kernel command line in
<code>/etc/default/grub</code> to preserve SEV settings across reboots
</p>
<pre>
$ cat /etc/default/grub
...
GRUB_CMDLINE_LINUX="... mem_encrypt=on kvm_amd.sev=1"
$ grub2-mkconfig -o /boot/efi/EFI/&lt;distro&gt;/grub.cfg</pre>
<p>
<code>mem_encrypt=on</code> turns on the SME memory encryption feature on
the host which protects against the physical attack on the hypervisor
memory. The <code>kvm_amd.sev</code> parameter actually enables SEV in
the kvm module. It can be set on the command line alongside
<code>mem_encrypt</code> like shown above, or it can be put into a
module config under <code>/etc/modprobe.d/</code>
</p>
<pre>
$ cat /etc/modprobe.d/sev.conf
options kvm_amd sev=1
</pre>
<p>
After rebooting the host, you should see SEV being enabled in the kernel:
</p>
<pre>
$ cat /sys/module/kvm_amd/parameters/sev
1
</pre>
<h2><a id="Virt">Checking SEV support in the virt stack</a></h2>
<p>
<b>Note: All of the commands bellow need to be run with root privileges.</b>
</p>
<p>
First make sure you have the following packages in the specified versions:
</p>
<ul>
<li>
libvirt >= 4.5.0 (>5.1.0 recommended due to additional SEV bugfixes)
</li>
<li>
QEMU >= 2.12.0
</li>
</ul>
<p>
To confirm that the virtualization stack supports SEV, run the following:
</p>
<pre>
# virsh domcapabilities
&lt;domainCapabilities&gt;
...
&lt;features&gt;
...
&lt;sev supported='yes'&gt;
&lt;cbitpos&gt;47&lt;/cbitpos&gt;
&lt;reducedPhysBits&gt;1&lt;/reducedPhysBits&gt;
&lt;/sev&gt;
...
&lt;/features&gt;
&lt;/domainCapabilities&gt;</pre>
<p>
Note that if libvirt was already installed and libvirtd running before enabling SEV in the kernel followed by the host reboot you need to force libvirtd
to re-probe both the host and QEMU capabilities. First stop libvirtd:
</p>
<pre>
# systemctl stop libvirtd.service
</pre>
<p>
Now you need to clean the capabilities cache:
</p>
<pre>
# rm -f /var/cache/libvirt/qemu/capabilities/*
</pre>
<p>
If you now restart libvirtd, it will re-probe the capabilities and if
you now run:
</p>
<pre>
# virsh domcapabilities
</pre>
<p>
SEV should be listed as supported. If you still see:
</p>
<pre>
&lt;sev supported='no'/&gt;
</pre>
<p>
it means one of two things:
<ol>
<li>
libvirt does support SEV, but either QEMU or the host does not
</li>
<li>
you have libvirt &lt;=5.1.0 which suffered from getting a
<code>'Permission denied'</code> on <code>/dev/sev</code> because
of the default permissions on the character device which prevented
QEMU from opening it during capabilities probing - you can either
manually tweak the permissions so that QEMU has access to it or
preferably install libvirt 5.1.0 or higher
</li>
</ol>
</p>
<h2><a id="Configuration">VM Configuration</a></h2>
<p>
SEV is enabled in the XML by specifying the
<a href="https://libvirt.org/formatdomain.html#launchSecurity">&lt;launchSecurity&gt; </a> element. However, specifying <code>launchSecurity</code> isn't
enough to boot an SEV VM. Further configuration requirements are discussed
below.
</p>
<h3><a id="Machine">Machine type</a></h3>
<p>
Even though both Q35 and legacy PC machine types (for PC see also
"virtio") can be used with SEV, usage of the legacy PC machine type is
strongly discouraged, since depending on how your OVMF package was
built (e.g. including features like SecureBoot or SMM) Q35 may even be
required.
</p>
<h5>Q35</h5>
<pre>
...
&lt;os&gt;
&lt;type arch='x86_64' machine='pc-q35-3.0'&gt;hvm&lt;/type&gt;
...
&lt;/os&gt;
...</pre>
<h5>i440fx (discouraged)</h5>
<pre>
...
&lt;os&gt;
&lt;type arch='x86_64' machine='pc-i440fx-3.0'&gt;hvm&lt;/type&gt;
...
&lt;/os&gt;
...
</pre>
<h3><a id="Boot">Boot loader</a></h3>
<p>
SEV is only going to work with OVMF (UEFI), so you'll need to point libvirt to
the correct OVMF binary.
</p>
<pre>
...
&lt;os&gt;
&lt;type arch='x86_64' machine='pc-q35-3.0'&gt;hvm&lt;/type&gt;
&lt;loader readonly='yes' type='pflash'&gt;/usr/share/edk2/ovmf/OVMF_CODE.fd&lt;/loader&gt;
&lt;/os&gt;
...</pre>
<h3><a id="Memory">Memory</a></h3>
<p>
Internally, SEV expects that the encrypted memory pages won't be swapped out or move
around so the VM memory needs to be pinned in physical RAM which will be
handled by QEMU. Apart from that, certain memory regions allocated by QEMU
itself (UEFI pflash, device ROMs, video RAM, etc.) have to be encrypted as
well. This causes a conflict in how libvirt tries to protect the host.
By default, libvirt enforces a memory hard limit on each VM's cgroup in order
to protect the host from malicious QEMU to allocate and lock all the available
memory. This limit corresponds to the total memory allocation for the VM given
by <code>&lt;currentMemory&gt;</code> element. However, trying to account for the additional
memory regions QEMU allocates when calculating the limit in an automated manner
is non-deterministic. One way to resolve this is to set the hard limit manually.
<p>
Note: Figuring out the right number so that your guest boots and isn't killed is
challenging, but 256MiB extra memory over the total guest RAM should suffice for
most workloads and may serve as a good starting point.
For example, a domain with 4GB memory with a 256MiB extra hard limit would look
like this:
</p>
</p>
<pre>
# virsh edit &lt;domain&gt;
&lt;domain&gt;
...
&lt;currentMemory unit='KiB'&gt;4194304&lt;/currentMemory&gt;
&lt;memtune&gt;
&lt;hard_limit unit='KiB'&gt;4456448&lt;/hard_limit&gt;
&lt;/memtune&gt;
...
&lt;/domain&gt;</pre>
<p>
There's another, preferred method of taking care of the limits by
using the<code>&lt;memoryBacking&gt;</code> element along with the
<code>&lt;locked/&gt;</code> subelement:
</p>
<pre>
&lt;domain&gt;
...
&lt;memoryBacking&gt;
&lt;locked/&gt;
&lt;/memoryBacking&gt;
...
&lt;/domain&gt;</pre>
<p>
What that does is that it tells libvirt not to force any hard limit (well,
unlimited) upon the VM cgroup. The obvious advantage is that one doesn't need
to determine the hard limit for every single SEV-enabled VM. However, there is
a significant security-related drawback to this approach. Since no hard limit
is applied, a malicious QEMU could perform a DoS attack by locking all of the
host's available memory. The way to avoid this issue and to protect the host is
to enforce a bigger hard limit on the master cgroup containing all of the VMs
- on systemd this is <code>machine.slice</code>.
</p>
<pre>
# systemctl set-property machine.slice MemoryHigh=&lt;value&gt;</pre>
<p>
To put even stricter measures in place which would involve the OOM killer, use
<pre>
# systemctl set-property machine.slice MemoryMax=&lt;value&gt;</pre>
instead. Alternatively, you can create a systemd config (don't forget
to reload systemd configuration in this case):
<pre>
# cat &lt;&lt; EOF &gt; /etc/systemd/system.control/machine.slice.d/90-MemoryMax.conf
MemoryMax=&lt;value&gt;
EOF</pre>
The trade-off to keep in mind with the second approach is that the VMs
can still perform DoS on each other.
</p>
<h3><a id="Virtio">Virtio</a></h3>
<p>
In order to make virtio devices work, we need to enable emulated IOMMU
on the devices so that virtual DMA can work.
</p>
<pre>
# virsh edit &lt;domain&gt;
&lt;domain&gt;
...
&lt;controller type='virtio-serial' index='0'&gt;
&lt;driver iommu='on'/&gt;
&lt;/controller&gt;
&lt;controller type='scsi' index='0' model='virtio-scsi'&gt;
&lt;driver iommu='on'/&gt;
&lt;/controller&gt;
...
&lt;memballoon model='virtio'&gt;
&lt;driver iommu='on'/&gt;
&lt;/memballoon&gt;
&lt;rng model='virtio'&gt;
&lt;backend model='random'&gt;/dev/urandom&lt;/backend&gt;
&lt;driver iommu='on'/&gt;
&lt;/rng&gt;
...
&lt;domain&gt;</pre>
<p>
If you for some reason want to use the legacy PC machine type, further changes
to the virtio
configuration is required, because SEV will not work with Virtio &lt;1.0. In
libvirt, this is handled by using the virtio-non-transitional device model
(libvirt &gt;= 5.2.0 required).
<p>
Note: some devices like video devices don't
support non-transitional model, which means that virtio GPU cannot be used.
</p>
</p>
<pre>
&lt;domain&gt;
...
&lt;devices&gt;
...
&lt;memballoon model='virtio-non-transitional'&gt;
&lt;driver iommu='on'/&gt;
&lt;/memballoon&gt;
&lt;/devices&gt;
...
&lt;/domain&gt;</pre>
<h2><a id="Limitations">Limitations</a></h2>
<p>
Currently, the boot disk cannot be of type virtio-blk, instead, virtio-scsi
needs to be used if virtio is desired. This limitation is expected to be lifted
with future releases of kernel (the kernel used at the time of writing the
article is 5.0.14).
If you still cannot start an SEV VM, it could be because of wrong SELinux label on the <code>/dev/sev</code> device with selinux-policy &lt;3.14.2.40 which prevents QEMU from touching the device. This can be resolved by upgrading the package, tuning the selinux policy rules manually to allow svirt_t to access the device (see <code>audit2allow</code> on how to do that) or putting SELinux into permissive mode (discouraged).
</p>
<h2><a id="Examples">Full domain XML examples</a></h2>
<h5>Q35 machine</h5>
<pre>
&lt;domain type='kvm'&gt;
&lt;name&gt;sev-dummy&lt;/name&gt;
&lt;memory unit='KiB'&gt;4194304&lt;/memory&gt;
&lt;currentMemory unit='KiB'&gt;4194304&lt;/currentMemory&gt;
&lt;memoryBacking&gt;
&lt;locked/&gt;
&lt;/memoryBacking&gt;
&lt;vcpu placement='static'&gt;4&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='x86_64' machine='pc-q35-3.0'&gt;hvm&lt;/type&gt;
&lt;loader readonly='yes' type='pflash'&gt;/usr/share/edk2/ovmf/OVMF_CODE.fd&lt;/loader&gt;
&lt;nvram&gt;/var/lib/libvirt/qemu/nvram/sev-dummy_VARS.fd&lt;/nvram&gt;
&lt;/os&gt;
&lt;features&gt;
&lt;acpi/&gt;
&lt;apic/&gt;
&lt;vmport state='off'/&gt;
&lt;/features&gt;
&lt;cpu mode='host-model' check='partial'&gt;
&lt;model fallback='allow'/&gt;
&lt;/cpu&gt;
&lt;clock offset='utc'&gt;
&lt;timer name='rtc' tickpolicy='catchup'/&gt;
&lt;timer name='pit' tickpolicy='delay'/&gt;
&lt;timer name='hpet' present='no'/&gt;
&lt;/clock&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;pm&gt;
&lt;suspend-to-mem enabled='no'/&gt;
&lt;suspend-to-disk enabled='no'/&gt;
&lt;/pm&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/bin/qemu-kvm&lt;/emulator&gt;
&lt;disk type='file' device='disk'&gt;
&lt;driver name='qemu' type='qcow2'/&gt;
&lt;source file='/var/lib/libvirt/images/sev-dummy.qcow2'/&gt;
&lt;target dev='sda' bus='scsi'/&gt;
&lt;boot order='1'/&gt;
&lt;/disk&gt;
&lt;controller type='virtio-serial' index='0'&gt;
&lt;driver iommu='on'/&gt;
&lt;/controller&gt;
&lt;controller type='scsi' index='0' model='virtio-scsi'&gt;
&lt;driver iommu='on'/&gt;
&lt;/controller&gt;
&lt;interface type='network'&gt;
&lt;mac address='52:54:00:cc:56:90'/&gt;
&lt;source network='default'/&gt;
&lt;model type='virtio'/&gt;
&lt;driver iommu='on'/&gt;
&lt;/interface&gt;
&lt;graphics type='spice' autoport='yes'&gt;
&lt;listen type='address'/&gt;
&lt;gl enable='no'/&gt;
&lt;/graphics&gt;
&lt;video&gt;
&lt;model type='qxl'/&gt;
&lt;/video&gt;
&lt;memballoon model='virtio'&gt;
&lt;driver iommu='on'/&gt;
&lt;/memballoon&gt;
&lt;rng model='virtio'&gt;
&lt;driver iommu='on'/&gt;
&lt;/rng&gt;
&lt;/devices&gt;
&lt;launchSecurity type='sev'&gt;
&lt;cbitpos&gt;47&lt;/cbitpos&gt;
&lt;reducedPhysBits&gt;1&lt;/reducedPhysBits&gt;
&lt;policy&gt;0x0003&lt;/policy&gt;
&lt;/launchSecurity&gt;
&lt;/domain&gt;</pre>
<h5>PC-i440fx machine:</h5>
<pre>
&lt;domain type='kvm'&gt;
&lt;name&gt;sev-dummy-legacy&lt;/name&gt;
&lt;memory unit='KiB'&gt;4194304&lt;/memory&gt;
&lt;currentMemory unit='KiB'&gt;4194304&lt;/currentMemory&gt;
&lt;memtune&gt;
&lt;hard_limit unit='KiB'&gt;5242880&lt;/hard_limit&gt;
&lt;/memtune&gt;
&lt;vcpu placement='static'&gt;4&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='x86_64' machine='pc-i440fx-3.0'&gt;hvm&lt;/type&gt;
&lt;loader readonly='yes' type='pflash'&gt;/usr/share/edk2/ovmf/OVMF_CODE.fd&lt;/loader&gt;
&lt;nvram&gt;/var/lib/libvirt/qemu/nvram/sev-dummy_VARS.fd&lt;/nvram&gt;
&lt;boot dev='hd'/&gt;
&lt;/os&gt;
&lt;features&gt;
&lt;acpi/&gt;
&lt;apic/&gt;
&lt;vmport state='off'/&gt;
&lt;/features&gt;
&lt;cpu mode='host-model' check='partial'&gt;
&lt;model fallback='allow'/&gt;
&lt;/cpu&gt;
&lt;clock offset='utc'&gt;
&lt;timer name='rtc' tickpolicy='catchup'/&gt;
&lt;timer name='pit' tickpolicy='delay'/&gt;
&lt;timer name='hpet' present='no'/&gt;
&lt;/clock&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;pm&gt;
&lt;suspend-to-mem enabled='no'/&gt;
&lt;suspend-to-disk enabled='no'/&gt;
&lt;/pm&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/bin/qemu-kvm&lt;/emulator&gt;
&lt;disk type='file' device='disk'&gt;
&lt;driver name='qemu' type='qcow2'/&gt;
&lt;source file='/var/lib/libvirt/images/sev-dummy-seabios.qcow2'/&gt;
&lt;target dev='sda' bus='sata'/&gt;
&lt;/disk&gt;
&lt;interface type='network'&gt;
&lt;mac address='52:54:00:d8:96:c8'/&gt;
&lt;source network='default'/&gt;
&lt;model type='virtio-non-transitional'/&gt;
&lt;/interface&gt;
&lt;serial type='pty'&gt;
&lt;target type='isa-serial' port='0'&gt;
&lt;model name='isa-serial'/&gt;
&lt;/target&gt;
&lt;/serial&gt;
&lt;console type='pty'&gt;
&lt;target type='serial' port='0'/&gt;
&lt;/console&gt;
&lt;input type='tablet' bus='usb'&gt;
&lt;address type='usb' bus='0' port='1'/&gt;
&lt;/input&gt;
&lt;input type='mouse' bus='ps2'/&gt;
&lt;input type='keyboard' bus='ps2'/&gt;
&lt;graphics type='spice' autoport='yes'&gt;
&lt;listen type='address'/&gt;
&lt;gl enable='no'/&gt;
&lt;/graphics&gt;
&lt;video&gt;
&lt;model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/&gt;
&lt;/video&gt;
&lt;memballoon model='virtio-non-transitional'&gt;
&lt;driver iommu='on'/&gt;
&lt;/memballoon&gt;
&lt;rng model='virtio-non-transitional'&gt;
&lt;driver iommu='on'/&gt;
&lt;/rng&gt;
&lt;/devices&gt;
&lt;launchSecurity type='sev'&gt;
&lt;cbitpos&gt;47&lt;/cbitpos&gt;
&lt;reducedPhysBits&gt;1&lt;/reducedPhysBits&gt;
&lt;policy&gt;0x0003&lt;/policy&gt;
&lt;/launchSecurity&gt;
&lt;/domain&gt;</pre>
</body>
</html>

View File

@@ -100,15 +100,14 @@
margin-right: auto;
padding: 0px;
padding-bottom: 1em;
max-width: 95%;
width: 70em;
max-width: 60em;
}
body.index #content,
body.docs #content,
body.hvsupport #content
{
width: inherit;
max-width: inherit;
}
pre {
@@ -274,12 +273,6 @@ span.since {
font-weight: bold;
}
span.removed {
color: darkred;
font-style: italic;
font-weight: bold;
}
img.diagram {
background: rgb(230,230,230);
border: 2px dotted rgb(178,178,178);
@@ -400,7 +393,6 @@ table.acl {
table.acl tr, table.acl td {
padding: 0.3em;
border: 1px solid #ccc;
}
table.acl thead {
@@ -544,65 +536,3 @@ dl.mail dt a:hover {
color: rgb(255, 230, 0);
text-decoration: none;
}
td.enumvalue {
white-space: nowrap;
}
#advancedsearch {
display: none;
vertical-align: bottom;
position: absolute;
padding: 1em;
padding-top: 0em;
margin-top: 0em;
top: 100px;
right: 0px;
width: 13em;
text-align: left;
color: white;
background: rgb(0, 95, 97);
border-left: 3px solid rgb(60, 133, 124);
border-bottom: 3px solid rgb(60, 133, 124);
}
/* Use div.advancedsearch, not #advancedsearch because the
* 'advancedsearch' class is set dynamically when javascript
* loads. This ensures that the advancedsearch options are
* not displayed when javascript is disabled.
*/
#search:hover div.advancedsearch {
display: table;
}
#advancedsearch span {
display: block;
}
#advancedsearch input[type=radio] {
height: inherit;
display: inline;
}
#advancedsearch label {
display: inline;
}
.removedhv {
color: darkred;
}
ul.news-section-content {
margin-top: 0.5em;
}
ul.news-section-content li dl dt {
margin: 0;
}
ul.news-section-content li dl dd {
margin-left: 1em;
margin-right: 0;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

View File

@@ -15,7 +15,6 @@
margin: 0px;
background: white;
padding: 0px;
height: 2em;
}
#search form {
padding: 5px;
@@ -92,10 +91,4 @@
float: none;
margin-bottom: 2em;
}
#advancedsearch {
margin-top: 4em;
border: 0px;
background: white;
color: black;
}
}

View File

@@ -258,7 +258,7 @@
</xsl:call-template>
</span>
<xsl:text> </xsl:text>
<a id="{@name}"></a>
<a name="{@name}"></a>
<xsl:value-of select="@name"/>
<xsl:text>
</xsl:text>
@@ -281,34 +281,16 @@
</xsl:call-template>
</span>
<xsl:text> </xsl:text>
<a id="{$name}"><xsl:value-of select="$name"/></a>
<a name="{$name}"><xsl:value-of select="$name"/></a>
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="enumvalue">
<xsl:param name="value" select="@value"/>
<xsl:param name="valuehex" select="@value_hex"/>
<xsl:param name="valuebitshift" select="@value_bitshift"/>
<xsl:value-of select="@value"/>
<xsl:if test="$valuehex != '' or $valuebitshift != ''">
<xsl:text> (</xsl:text>
<xsl:if test="$valuehex != ''">
<xsl:value-of select="@value_hex"/>
</xsl:if>
<xsl:if test="$valuebitshift != ''">
<xsl:text>; 1 &lt;&lt; </xsl:text>
<xsl:value-of select="@value_bitshift"/>
</xsl:if>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="typedef[@type = 'enum']">
<xsl:variable name="name" select="string(@name)"/>
<h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<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>
@@ -320,11 +302,11 @@
<xsl:for-each select="/api/symbols/enum[@type = $name]">
<xsl:sort select="@value" data-type="number" order="ascending"/>
<tr>
<td><a id="{@name}"><xsl:value-of select="@name"/></a></td>
<td><a name="{@name}"><xsl:value-of select="@name"/></a></td>
<td><xsl:text> = </xsl:text></td>
<xsl:choose>
<xsl:when test="@info != ''">
<td class="enumvalue"><xsl:call-template name="enumvalue"/></td>
<td><xsl:value-of select="@value"/></td>
<td>
<div class="comment">
<xsl:call-template name="dumptext">
@@ -334,7 +316,7 @@
</td>
</xsl:when>
<xsl:otherwise>
<td colspan="2" class="enumvalue"><xsl:call-template name="enumvalue"/></td>
<td colspan="2"><xsl:value-of select="@value"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
@@ -357,7 +339,7 @@
</xsl:template>
<xsl:template match="struct">
<h3><a id="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
<h3><a name="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
<div class="api">
<pre>
<span class="keyword">struct </span>
@@ -447,7 +429,7 @@
<xsl:template match="macro">
<xsl:variable name="name" select="string(@name)"/>
<h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<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 class="description">
<xsl:call-template name="formattext">
@@ -558,7 +540,7 @@
<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))"/>
<h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<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">
@@ -636,7 +618,7 @@
<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))"/>
<h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api">
<span class="type">
<xsl:call-template name="dumptext">
@@ -783,16 +765,16 @@
<h2>Description</h2>
<xsl:if test="count(exports[@type='macro']) > 0">
<h3><a id="macros">Macros</a></h3>
<h3><a name="macros">Macros</a></h3>
<xsl:apply-templates select="exports[@type='macro']">
<xsl:sort select='@symbol'/>
</xsl:apply-templates>
</xsl:if>
<h3><a id="types">Types</a></h3>
<h3><a name="types">Types</a></h3>
<xsl:apply-templates select="exports[@type='typedef']">
<xsl:sort select='@symbol'/>
</xsl:apply-templates>
<h3><a id="functions">Functions</a></h3>
<h3><a name="functions">Functions</a></h3>
<xsl:apply-templates select="exports[@type='function']">
<xsl:sort select='@symbol'/>
</xsl:apply-templates>

View File

@@ -2041,7 +2041,7 @@
build: avoid compiler warning on shadowed name (Jean-Baptiste Rouault),<br/>
tests: link against libxml2 (Guido Günther),<br/>
tests: build viridentitytest only WITH_ATTR. (Jincheng Miao),<br/>
maint: Correctly detect whether "gluster" cli tool is accessible (Peter Krempa),<br/>
maint: Correctly detect wether "gluster" cli tool is accessible (Peter Krempa),<br/>
libvirt-guests: avoid bashism (Guido Günther),<br/>
Use the force flag for mkfs -t xfs (Ján Tomko)<br/>
</li>

View File

@@ -15,8 +15,7 @@
<xsl:text>
==============================================================================
Older libvirt releases didn't have proper release notes: if you are interested
in changes between them, you should check out docs/news-*.html or the full git
log (see instructions in ChangeLog).
in changes between them, you should check out ChangeLog* and docs/news-*.html.
</xsl:text>
</xsl:template>

View File

@@ -1,7 +1,5 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- This XSLT stylesheet can be applied to the XML version of the release
@@ -41,17 +39,12 @@
<!-- Release -->
<xsl:template match="release">
<h3>
<a>
<xsl:attribute name="id">
<xsl:value-of select="@version"/>
</xsl:attribute>
<strong>
<xsl:value-of select="@version"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="@date"/>
<xsl:text>)</xsl:text>
</strong>
</a>
<strong>
<xsl:value-of select="@version"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="@date"/>
<xsl:text>)</xsl:text>
</strong>
</h3>
<ul>
<xsl:apply-templates select="section"/>
@@ -65,7 +58,7 @@
<xsl:value-of select="@title"/>
</strong>
<xsl:if test="*">
<ul class="news-section-content">
<ul>
<xsl:apply-templates select="change"/>
</ul>
</xsl:if>
@@ -75,14 +68,8 @@
<!-- Change -->
<xsl:template match="change">
<li>
<dl>
<dt>
<xsl:apply-templates select="summary"/>
</dt>
<dd>
<xsl:apply-templates select="description"/>
</dd>
</dl>
<xsl:apply-templates select="summary"/>
<xsl:apply-templates select="description"/>
</li>
</xsl:template>
@@ -93,6 +80,7 @@
<!-- Change description -->
<xsl:template match="description">
<br/>
<xsl:apply-templates/>
</xsl:template>

File diff suppressed because it is too large Load Diff

View File

@@ -99,11 +99,40 @@
<meta name="description" content="libvirt, virtualization, virtualization API"/>
<xsl:apply-templates select="/html:html/html:head/*" mode="content"/>
<script type="text/javascript" src="{$href_base}js/main.js">
<xsl:comment>// forces non-empty element</xsl:comment>
<script type="text/javascript">
<xsl:comment>
<![CDATA[
function init() {
window.addEventListener('scroll', function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
shrinkOn = 94
home = document.getElementById("home");
links = document.getElementById("jumplinks");
search = document.getElementById("search");
body = document.getElementById("body");
if (distanceY > shrinkOn) {
if (home.className != "navhide") {
body.className = "navhide"
home.className = "navhide"
links.className = "navhide"
search.className = "navhide"
}
} else {
if (home.className == "navhide") {
body.className = ""
home.className = ""
links.className = ""
search.className = ""
}
}
});
}
window.onload = init();
]]>
</xsl:comment>
</script>
</head>
<body onload="pageload()">
<body>
<xsl:if test="html:html/html:body/@class">
<xsl:attribute name="class">
<xsl:value-of select="html:html/html:body/@class"/>
@@ -126,19 +155,12 @@
</ul>
</div>
<div id="search">
<form id="simplesearch" action="https://www.google.com/search" enctype="application/x-www-form-urlencoded" method="get">
<form action="{$href_base}search.php" enctype="application/x-www-form-urlencoded" method="get">
<div>
<input id="searchsite" name="sitesearch" type="hidden" value="libvirt.org"/>
<input id="searchq" name="q" type="text" size="12" value=""/>
<input name="query" type="text" size="12" value=""/>
<input name="submit" type="submit" value="Go"/>
</div>
</form>
<div id="advancedsearch">
<span><input type="radio" name="what" id="whatwebsite" checked="checked" value="website"/><label for="whatwebsite">Website</label></span>
<span><input type="radio" name="what" id="whatwiki" value="wiki"/><label for="whatwiki">Wiki</label></span>
<span><input type="radio" name="what" id="whatdevs" value="devs"/><label for="whatdevs">Developers list</label></span>
<span><input type="radio" name="what" id="whatusers" value="users"/><label for="whatusers">Users list</label></span>
</div>
</div>
</div>
<div id="footer">
@@ -153,6 +175,7 @@
<h3>Community</h3>
<ul>
<li><a href="https://twitter.com/hashtag/libvirt">twitter</a></li>
<li><a href="https://plus.google.com/communities/109522598353007505282">google+</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/libvirt">stackoverflow</a></li>
<li><a href="http://serverfault.com/questions/tagged/libvirt">serverfault</a></li>
</ul>

View File

@@ -99,12 +99,13 @@
</p>
<pre>
&lt;controller type='pci' model='pcie-to-pci-bridge'/&gt;</pre>
&lt;controller type='pci' model='dmi-to-pci-bridge'/&gt;
&lt;controller type='pci' model='pci-bridge'/&gt;</pre>
<p>
and you'll be able to hotplug up to 31 legacy PCI devices,
either emulated or assigned from the host, in the slots
from 0x01 to 0x1f of the <code>pcie-to-pci-bridge</code> controller.
from 0x01 to 0x1f of the <code>pci-bridge</code> controller.
</p>
<h3><a id="x86_64-i440fx">i440fx (pc) machine type</a></h3>

View File

@@ -39,7 +39,7 @@
<ul>
<li><a href="https://repology.org/metapackage/libvirt/versions">libvirt</a></li>
<li><a href="https://repology.org/metapackage/qemu/versions">qemu</a></li>
<li><a href="https://repology.org/metapackage/qemu-kvm/versions">qemu-kvm</a></li>
<li><a href="https://repology.org/metapackage/qemu/versions">qemu-kvm</a></li>
</ul>

View File

@@ -17,6 +17,9 @@
# 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:
# Andrea Bolognani <abologna@redhat.com>
from __future__ import print_function

View File

@@ -206,24 +206,6 @@ Note that parameter values must be
<td colspan="2"/>
<td> Example: <code>tls_priority=NORMAL:-VERS-SSL3.0</code> </td>
</tr>
<tr>
<td>
<code>mode</code>
</td>
<td> unix, ssh, libssh, libssh2 </td>
<td>
<dl>
<dt><code>auto</code></dt><dd>automatically determine the daemon</dd>
<dt><code>direct</code></dt><dd>connect to per-driver daemons</dd>
<dt><code>legacy</code></dt><dd>connect to libvirtd</dd>
</dl>
Can also be set in <code>libvirt.conf</code> as <code>remote_mode</code>
</td>
</tr>
<tr>
<td colspan="2"/>
<td> Example: <code>mode=direct</code> </td>
</tr>
<tr>
<td>
<code>command</code>
@@ -839,6 +821,23 @@ Blank lines and comments beginning with <code>#</code> are ignored.
<td> "16509" </td>
<td>
The port number or service name to listen on for unencrypted TCP connections.
</td>
</tr>
<tr>
<td> mdns_adv <i>[0|1]</i> </td>
<td> 0 (advertise with mDNS) </td>
<td>
If set to 1 then the virtualization service will be advertised over
mDNS to hosts on the local LAN segment.
</td>
</tr>
<tr>
<td> mdns_name <i>"name"</i> </td>
<td> "Virtualization Host HOSTNAME" </td>
<td>
The name to advertise for this host with Avahi mDNS. The default
includes the machine's short hostname. This must be unique to the
local LAN segment.
</td>
</tr>
<tr>

View File

@@ -2,7 +2,7 @@
<!-- network-related definitions used in multiple grammars -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!-- Our unsignedInt doesn't allow a leading "+" in its lexical form -->
<!-- Our unsignedInt doesn"t allow a leading "+" in its lexical form -->
<define name="unsignedInt">
<data type="unsignedInt">
<param name="pattern">[0-9]+</param>
@@ -65,17 +65,6 @@
</data>
</choice>
</define>
<define name="uint32">
<choice>
<data type="string">
<param name="pattern">(0x)?[0-9a-fA-F]{1,8}</param>
</data>
<data type="unsignedInt">
<param name="minInclusive">0</param>
<param name="maxInclusive">4294967295</param>
</data>
</choice>
</define>
<define name="UUID">
<choice>
@@ -122,22 +111,6 @@
</attribute>
</optional>
</define>
<define name="zpciaddress">
<optional>
<element name="zpci">
<optional>
<attribute name="uid">
<ref name="uint16"/>
</attribute>
</optional>
<optional>
<attribute name="fid">
<ref name="uint32"/>
</attribute>
</optional>
</element>
</optional>
</define>
<!-- a 6 byte MAC address in ASCII-hex format, eg "12:34:56:78:9A:BC" -->
<!-- The lowest bit of the 1st byte is the "multicast" bit. a -->
@@ -279,12 +252,6 @@
</data>
</define>
<define name="zoneName">
<data type="string">
<param name="pattern">[a-zA-Z0-9_\-]+</param>
</data>
</define>
<define name="filePath">
<data type="string">
<param name="pattern">.+</param>
@@ -324,7 +291,7 @@
</define>
<define name="pciDomain">
<ref name="uint32"/>
<ref name="uint16"/>
</define>
<define name="pciBus">
<ref name="uint8"/>
@@ -412,7 +379,6 @@
<choice>
<value>aarch64</value>
<value>alpha</value>
<value>armv6l</value>
<value>armv7l</value>
<value>cris</value>
<value>i686</value>

View File

@@ -316,9 +316,6 @@
</zeroOrMore>
</element>
</oneOrMore>
<optional>
<ref name='cpuMonitor'/>
</optional>
</element>
</define>
@@ -350,7 +347,7 @@
<optional>
<attribute name='min'>
<ref name='unsignedInt'/>
</attribute>
</attribute>
</optional>
<attribute name='maxAllocs'>
<ref name='unsignedInt'/>
@@ -359,41 +356,9 @@
</zeroOrMore>
</element>
</oneOrMore>
<optional>
<ref name='cpuMonitor'/>
</optional>
</element>
</define>
<define name='cpuMonitor'>
<element name='monitor'>
<optional>
<attribute name='level'>
<ref name='unsignedInt'/>
</attribute>
<attribute name='reuseThreshold'>
<ref name='unsignedInt'/>
</attribute>
</optional>
<attribute name='maxMonitors'>
<ref name='unsignedInt'/>
</attribute>
<oneOrMore>
<element name='feature'>
<attribute name='name'>
<ref name='monitorFeature'/>
</attribute>
</element>
</oneOrMore>
</element>
</define>
<define name='monitorFeature'>
<data type='string'>
<param name='pattern'>(llc_|mbm_)[a-zA-Z0-9\-_]+</param>
</data>
</define>
<define name='guestcaps'>
<element name='guest'>
<ref name='ostype'/>
@@ -412,7 +377,7 @@
but is also used by phyp driver -->
<value>hvm</value> <!-- unmodified OS -->
<value>exe</value> <!-- For container based virt -->
<value>uml</value> <!-- user mode linux; NOT USED ANYMORE -->
<value>uml</value> <!-- user mode linux -->
</choice>
</element>
</define>
@@ -484,7 +449,7 @@
<value>kqemu</value>
<value>kvm</value>
<value>xen</value>
<value>uml</value> <!-- NOT USED ANYMORE -->
<value>uml</value>
<value>lxc</value>
<value>openvz</value>
<value>test</value>

View File

@@ -77,7 +77,6 @@
<element name='os'>
<interleave>
<ref name='supported'/>
<ref name='enum'/>
<optional>
<ref name='loader'/>
</optional>
@@ -143,21 +142,12 @@
<define name='devices'>
<element name='devices'>
<optional>
<interleave>
<ref name='disk'/>
</optional>
<optional>
<ref name='graphics'/>
</optional>
<optional>
<ref name='video'/>
</optional>
<optional>
<ref name='hostdev'/>
</optional>
<optional>
<ref name='rng'/>
</optional>
</interleave>
</element>
</define>
@@ -189,27 +179,14 @@
</element>
</define>
<define name='rng'>
<element name='rng'>
<ref name='supported'/>
<ref name='enum'/>
</element>
</define>
<define name='features'>
<element name='features'>
<optional>
<interleave>
<ref name='gic'/>
</optional>
<optional>
<ref name='vmcoreinfo'/>
</optional>
<optional>
<ref name='vmgenid'/>
</optional>
<optional>
<ref name='sev'/>
</optional>
</interleave>
</element>
</define>

View File

@@ -1,94 +0,0 @@
<?xml version='1.0'?>
<!-- A Relax NG schema for the libvirt domain checkpoint properties XML format -->
<grammar xmlns='http://relaxng.org/ns/structure/1.0' datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'>
<start>
<ref name='domaincheckpoint'/>
</start>
<include href='domaincommon.rng'/>
<define name='domaincheckpoint'>
<element name='domaincheckpoint'>
<interleave>
<optional>
<element name='name'>
<ref name='checkpointName'/>
</element>
</optional>
<optional>
<element name='description'>
<text/>
</element>
</optional>
<optional>
<element name='creationTime'>
<ref name='unsignedLong'/>
</element>
</optional>
<optional>
<element name='disks'>
<oneOrMore>
<ref name='diskcheckpoint'/>
</oneOrMore>
</element>
</optional>
<optional>
<!-- Nested grammar ensures that any of our overrides of
storagecommon/domaincommon defines do not conflict
with any domain.rng overrides. -->
<grammar>
<include href='domain.rng'/>
</grammar>
</optional>
<optional>
<element name='parent'>
<element name='name'>
<ref name='checkpointName'/>
</element>
</element>
</optional>
</interleave>
</element>
</define>
<define name='diskcheckpoint'>
<element name='disk'>
<attribute name='name'>
<choice>
<ref name='diskTarget'/>
<ref name='absFilePath'/>
</choice>
</attribute>
<choice>
<attribute name='checkpoint'>
<value>no</value>
</attribute>
<group>
<optional>
<attribute name='checkpoint'>
<value>bitmap</value>
</attribute>
</optional>
<optional>
<attribute name='bitmap'>
<text/>
</attribute>
</optional>
<optional>
<attribute name='size'>
<ref name='unsignedLong'/>
</attribute>
</optional>
</group>
</choice>
</element>
</define>
<define name='checkpointName'>
<data type='string'>
<!-- Notably: no leading '.' and no embedded '/' or newline -->
<param name='pattern'>[a-zA-Z0-9_\-][a-zA-Z0-9_\-.]*</param>
</data>
</define>
</grammar>

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