[libvirt] [PATCH 00/14] nwfilter: refactor the driver to make it independent of virt drivers
by Daniel P. Berrangé
Today the nwfilter driver is entangled with the virt drivers in both
directions. At various times when rebuilding filters nwfilter will call
out to the virt driver to iterate over running guest's NICs. This has
caused very complicated lock ordering rules to be required. If we are to
split the virt drivers out into separate daemons we need to get rid of
this coupling since we don't want the separate daemons calling each
other, as that risks deadlock if all of the RPC workers are busy.
The obvious way to solve this is to have the nwfilter driver remember
all the filters it has active, avoiding the need to iterate over running
guests.
NB, these patches are all ready for review, but the last patch really
should not be merged at this time. I need to do more work to be able to
serialize the filter state to disk, so the nwfilter driver can keep track
of it across daemon restarts. All except the last patch should be ok to
merge though.
Daniel P. Berrangé (14):
nwfilter: remove pointless virNWFilterHashTable struct
nwfilter: remove methods that are trivial wrappers for virHash APIs
nwfilter: remove virNWFilterHashTable typedefs entirely
nwfilter: make virNWFilterIPAddrLearnReq type private
nwfilter: remove obsolete code related to firewalld
nwfilter: fix leaking of filter parameters upon error
nwfilter: introduce virNWFilterBinding to decouple from virDomainNet
nwfilter: pass vm name in when instantiating filters
nwfilter: convert the gentech driver code to use virNWFilterBinding
nwfilter: convert IP address learning code to virNWFilterBinding
nwfilter: convert DHCP address snooping code to virNWFilterBinding
nwfilter: report an error if nic needs filtering by no driver is
present
nwfilter: keep track of active filter bindings
nwfilter: remove virt driver callback layer for rebuilding filters
src/conf/domain_conf.c | 8 +-
src/conf/domain_conf.h | 2 +-
src/conf/domain_nwfilter.c | 14 +-
src/conf/domain_nwfilter.h | 6 +-
src/conf/nwfilter_conf.c | 224 ++++++++---------
src/conf/nwfilter_conf.h | 67 ++---
src/conf/nwfilter_ipaddrmap.c | 15 +-
src/conf/nwfilter_params.c | 127 +++-------
src/conf/nwfilter_params.h | 33 +--
src/conf/virnwfilterobj.c | 4 +-
src/conf/virnwfilterobj.h | 4 +-
src/libvirt_private.syms | 8 +-
src/lxc/lxc_driver.c | 28 ---
src/lxc/lxc_process.c | 2 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 153 +++++-------
src/nwfilter/nwfilter_dhcpsnoop.h | 7 +-
src/nwfilter/nwfilter_driver.c | 97 +++++---
src/nwfilter/nwfilter_driver.h | 2 -
src/nwfilter/nwfilter_gentech_driver.c | 432 ++++++++++++++++++---------------
src/nwfilter/nwfilter_gentech_driver.h | 28 +--
src/nwfilter/nwfilter_learnipaddr.c | 113 ++++-----
src/nwfilter/nwfilter_learnipaddr.h | 25 +-
src/nwfilter/nwfilter_tech_driver.h | 2 +-
src/qemu/qemu_driver.c | 25 --
src/qemu/qemu_hotplug.c | 6 +-
src/qemu/qemu_interface.c | 4 +-
src/qemu/qemu_process.c | 2 +-
src/uml/uml_conf.c | 2 +-
src/uml/uml_driver.c | 29 ---
tests/nwfilterxml2firewalltest.c | 36 +--
30 files changed, 642 insertions(+), 863 deletions(-)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH v3 0/3] Support tpm-crb TPM interface for QEMU
by Stefan Berger
This patch series adds support for the recently added tpm-crb TPM
interface for QEMU (2.12).
Stefan
Stefan Berger (3):
tpm: Enable TPM CRB interface in the domain XML and test it
qemu: Extend the capabilities with tpm-crb device
tests: add test case for tpm-crb QEMU device command line
docs/formatdomain.html.in | 6 +++-
docs/schemas/domaincommon.rng | 5 +++-
src/conf/domain_conf.c | 5 ++--
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 5 ++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 16 +++++++++-
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemuxml2argvdata/tpm-passthrough-crb.args | 26 ++++++++++++++++
tests/qemuxml2argvdata/tpm-passthrough-crb.xml | 32 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
tests/qemuxml2xmloutdata/tpm-passthrough-crb.xml | 36 +++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
13 files changed, 131 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/tpm-passthrough-crb.args
create mode 100644 tests/qemuxml2argvdata/tpm-passthrough-crb.xml
create mode 100644 tests/qemuxml2xmloutdata/tpm-passthrough-crb.xml
--
2.5.5
6 years, 11 months
[libvirt] [perl PATCH] maint: Drop autobuild.sh
by Andrea Bolognani
The Test-AutoBuild project, that this script is supposed
to be used with, hasn't seen any activity in ~7 years;
these days, libvirt-perl CI builds are happening on the
Jenkins-based CentOS CI environment under the libvirt
umbrella[1], and in that context the script is not used
at all.
[1] https://ci.centos.org/view/libvirt/
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
autobuild.sh | 74 ------------------------------------------------------------
1 file changed, 74 deletions(-)
delete mode 100755 autobuild.sh
diff --git a/autobuild.sh b/autobuild.sh
deleted file mode 100755
index 8a6d102..0000000
--- a/autobuild.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-#
-# This script is used to Test::AutoBuild (http://www.autobuild.org)
-# to perform automated builds of the Sys-Virt module
-
-NAME=Sys-Virt
-
-set -e
-
-test -n "$1" && RESULTS=$1 || RESULTS=results.log
-: ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
-
-make -k realclean ||:
-rm -rf MANIFEST blib pm_to_blib
-
-export TEST_MAINTAINER=1
-
-perl Makefile.PL PREFIX=$AUTOBUILD_INSTALL_ROOT
-
-rm -f MANIFEST
-
-# Build the RPM.
-make
-make manifest
-
-if [ -z "$USE_COVER" ]; then
- perl -MDevel::Cover -e '' 1>/dev/null 2>&1 && USE_COVER=1 || USE_COVER=0
-fi
-
-if [ -z "$SKIP_TESTS" -o "$SKIP_TESTS" = "0" ]; then
- if [ "$USE_COVER" = "1" ]; then
- cover -delete
- export HARNESS_PERL_SWITCHES=-MDevel::Cover
- fi
-
- # set -o pipefail is a bashism; this use of exec is the POSIX alternative
- exec 3>&1
- st=$(
- exec 4>&1 >&3
- { make test 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS"
- )
- exec 3>&-
- test "$st" = 0
-
- if [ "$USE_COVER" = "1" ]; then
- cover
- mkdir blib/coverage
- cp -a cover_db/*.html cover_db/*.css blib/coverage
- mv blib/coverage/coverage.html blib/coverage/index.html
- fi
-fi
-
-make install
-
-rm -f $NAME-*.tar.gz
-make dist
-
-if [ -f /usr/bin/rpmbuild ]; then
- if [ -n "$AUTOBUILD_COUNTER" ]; then
- EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
- else
- NOW=`date +"%s"`
- EXTRA_RELEASE=".$USER$NOW"
- fi
- rpmbuild --nodeps -ta --define "extra_release $EXTRA_RELEASE" --clean $NAME-*.tar.gz
-fi
-
-# Skip debian pkg for now
-exit 0
-
-if [ -f /usr/bin/fakeroot ]; then
- fakeroot debian/rules clean
- fakeroot debian/rules DESTDIR=$HOME/packages/debian binary
-fi
--
2.14.3
6 years, 11 months
[libvirt] [python PATCH] maint: Drop autobuild.sh
by Andrea Bolognani
The Test-AutoBuild project, that this script is supposed
to be used with, hasn't seen any activity in ~7 years;
these days, libvirt-python CI builds are happening on the
Jenkins-based CentOS CI environment under the libvirt
umbrella[1], and in that context the script is not used
at all.
[1] https://ci.centos.org/view/libvirt/
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
autobuild.sh | 30 ------------------------------
1 file changed, 30 deletions(-)
delete mode 100755 autobuild.sh
diff --git a/autobuild.sh b/autobuild.sh
deleted file mode 100755
index 5dffe96..0000000
--- a/autobuild.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-set -ve
-
-: ${AUTOBUILD_INSTALL_ROOT="$HOME/builder"}
-
-rm -rf MANIFEST dist build
-
-
-python2 setup.py sdist
-
-python2 setup.py build
-python2 setup.py test
-python2 setup.py install --root="$AUTOBUILD_INSTALL_ROOT"
-
-if test -f /usr/bin/python3 ; then
- python3 setup.py build
- python3 setup.py test
- python3 setup.py install --root="$AUTOBUILD_INSTALL_ROOT"
-fi
-
-type -p /usr/bin/rpmbuild > /dev/null 2>&1 || exit 0
-
-if [ -n "$AUTOBUILD_COUNTER" ]; then
- EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
-else
- NOW=`date +"%s"`
- EXTRA_RELEASE=".$USER$NOW"
-fi
-rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean dist/*.tar.gz
--
2.14.3
6 years, 11 months
[libvirt] [jenkins-ci PATCH 0/4] Introduce Fedora 28; drop Fedora 26
by Andrea Bolognani
It's that time of the year again :)
Andrea Bolognani (4):
guests: Add libvirt-fedora-28
projects: Add libvirt-fedora-28
projects: Remove libvirt-fedora-26
guests: Remove libvirt-fedora-26
.../host_vars/{libvirt-fedora-26 => libvirt-fedora-28}/install.yml | 2 +-
guests/host_vars/{libvirt-fedora-26 => libvirt-fedora-28}/main.yml | 0
guests/inventory | 2 +-
jobs/defaults.yaml | 4 ++--
projects/libvirt-dbus.yaml | 4 ++--
projects/libvirt-sandbox.yaml | 4 ++--
projects/libvirt-tck.yaml | 4 ++--
projects/libvirt.yaml | 4 ++--
projects/virt-manager.yaml | 6 +++---
9 files changed, 15 insertions(+), 15 deletions(-)
rename guests/host_vars/{libvirt-fedora-26 => libvirt-fedora-28}/install.yml (74%)
rename guests/host_vars/{libvirt-fedora-26 => libvirt-fedora-28}/main.yml (100%)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH v3 0/9] tests: Fix 'make check' on FreeBSD
by Andrea Bolognani
Changes from [v2]:
* introduce a wrapper around canonicalize_file_name() instead of
moving to realpath();
* fix more usages of mode_t with va_arg().
Changes from [v1]:
* drop the virnetsockettest changes, since the relationship
between the errors seen on FreeBSD and IPv4 clients connecting
to IPv6 sockets has turned out to be just a red herring;
* fix the mocking instead of dropping test cases that don't work
without it.
[v2] https://www.redhat.com/archives/libvir-list/2018-April/msg02685.html
[v1] https://www.redhat.com/archives/libvir-list/2018-April/msg02611.html
Andrea Bolognani (9):
util: Introduce virFileCanonicalizePath()
tests: Mock virFileCanonicalizePath()
all: Use virFileCanonicalizePath() instead of canonicalize_file_name()
tests: Stop mocking canonicalize_file_name()
syntax-check: Prohibit canonicalize_file_name()
tests: Fix mode_t usage with va_arg()
tests: Build virpcimock on non-Linux
tests: Extend NUMA mocking
tests: Drop DO_TEST_LINUX()
cfg.mk | 10 ++++
src/libvirt_private.syms | 1 +
src/storage/storage_backend_fs.c | 2 +-
src/util/virfile.c | 15 +++++-
src/util/virfile.h | 1 +
src/util/virpci.c | 2 +-
tests/nssmock.c | 2 +-
tests/qemuxml2argvmock.c | 38 ++++++++++----
tests/qemuxml2argvtest.c | 46 ++++++-----------
tests/vircgroupmock.c | 2 +-
tests/virpcimock.c | 104 ++++++++++++++++++++++-----------------
tests/virstoragetest.c | 10 ++--
tests/virtestmock.c | 8 +--
13 files changed, 141 insertions(+), 100 deletions(-)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH] storagefile: conditional build of virStorageFileLoadBackendModule
by Daniel P. Berrangé
The virStorageFileLoadBackendModule method is only used if either
fs or gluster storage is built in, which doesn't happen on mingw
leading to warning of an unused static function.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as mingw build fix
src/util/virstoragefilebackend.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/virstoragefilebackend.c b/src/util/virstoragefilebackend.c
index ac087dabac..eb3055ed67 100644
--- a/src/util/virstoragefilebackend.c
+++ b/src/util/virstoragefilebackend.c
@@ -45,7 +45,9 @@ VIR_LOG_INIT("storage.storage_source_backend");
static virStorageFileBackendPtr virStorageFileBackends[VIR_STORAGE_BACKENDS_MAX];
static size_t virStorageFileBackendsCount;
-#define STORAGE_FILE_MODULE_DIR LIBDIR "/libvirt/storage-file"
+#if WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER
+
+# define STORAGE_FILE_MODULE_DIR LIBDIR "/libvirt/storage-file"
static int
virStorageFileLoadBackendModule(const char *name,
@@ -69,7 +71,7 @@ virStorageFileLoadBackendModule(const char *name,
return ret;
}
-
+#endif /* WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER */
static int virStorageFileBackendOnceInit(void)
{
--
2.14.3
6 years, 11 months
[libvirt] [dbus RFC PATCH 0/6] Remove all enum->string and string->enum code
by Katerina Koukiou
As mentioned in the patches commit message...
Converting ENUMS to str can be user friendly though
it can be problematic between libvirt versions.
In particular when some translated type will introduce a
new constant to the ENUM libvirt-dbus will fail with:
size of array ‘_GStaticAssertCompileTimeAssertion_5’ is negative
Since it's not main use case of livirt-dbus API to be invoked
interactively by user, having all ENUM types passed as
unsigned int is preferable to avoid the previous issue.
Katerina Koukiou (6):
Abandon usage of all *TypeToString functions in domain.c
Abandon usage of all *TypeToString functions in connect.c
Abandon usage of all *TypeToString functions in network.c
Change DomainEvent argument from string to unsigned int
Change NetworkEvent argument from string to unsigned int
Remove virtDBusUtilEnum{From,From}String functions
data/org.libvirt.Connect.xml | 6 +-
data/org.libvirt.Domain.xml | 14 ++--
data/org.libvirt.Network.xml | 6 +-
src/connect.c | 18 +----
src/domain.c | 172 ++++---------------------------------------
src/events.c | 40 +---------
src/network.c | 66 +----------------
src/util.c | 27 -------
src/util.h | 28 -------
tests/libvirttest.py | 20 +++++
tests/test_connect.py | 24 ++++--
tests/test_domain.py | 36 ++++++---
tests/test_network.py | 20 +++--
13 files changed, 107 insertions(+), 370 deletions(-)
--
2.15.0
6 years, 11 months
[libvirt] [qemu RFC v3 0/3] qapi: add "firmware.json"
by Laszlo Ersek
This version seeks to address the RFCv2 feedback. Changes are noted per
patch.
Cc: "Daniel P. Berrange" <berrange(a)redhat.com>
Cc: David Gibson <dgibson(a)redhat.com>
Cc: Eric Blake <eblake(a)redhat.com>
Cc: Gerd Hoffmann <kraxel(a)redhat.com>
Cc: Kashyap Chamarthy <kchamart(a)redhat.com>
Cc: Markus Armbruster <armbru(a)redhat.com>
Cc: Paolo Bonzini <pbonzini(a)redhat.com>
Cc: Thomas Huth <thuth(a)redhat.com>
Thanks,
Laszlo
Laszlo Ersek (3):
qapi: add SysEmuTarget to "common.json"
qapi: change the type of TargetInfo.arch from string to enum
SysEmuTarget
qapi: add "firmware.json"
Makefile | 9 +
Makefile.objs | 4 +
qapi/common.json | 19 ++
qapi/firmware.json | 554 ++++++++++++++++++++++++++++++++++++++++++++++++++
qapi/misc.json | 6 +-
qapi/qapi-schema.json | 1 +
arch_init.c | 18 +-
qmp.c | 5 +
.gitignore | 4 +
9 files changed, 617 insertions(+), 3 deletions(-)
create mode 100644 qapi/firmware.json
--
2.14.1.3.gb7cf6e02401b
6 years, 11 months
[libvirt] [PATCH] tests: unlink libxl-driver.log
by Daniel P. Berrangé
The libxlxml2domconfigtest causes a libxl-driver.log file to be created
which breaks make distchck if libxl is enabled. Delete the log file at
the end of the test.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix for make distcheck
tests/libxlxml2domconfigtest.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c
index d9287b59a8..0d2a7385e5 100644
--- a/tests/libxlxml2domconfigtest.c
+++ b/tests/libxlxml2domconfigtest.c
@@ -211,6 +211,8 @@ mymain(void)
DO_TEST("multiple-ip");
DO_TEST("fullvirt-cpuid");
+ unlink("libxl-driver.log");
+
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.14.3
6 years, 11 months