Compare commits

..

58 Commits

Author SHA1 Message Date
Cole Robinson 22f996f8f4 Adjust for Xen dropping 32bit arches
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-11 18:23:11 -04:00
Daniel P. Berrangé da598118cf Fix crash undefining VM without loader (rhbz#2060412)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-03-03 17:54:17 +00:00
Cole Robinson da34e517db libvirt-8.1.0-1
Update to version 8.1.0
2022-03-01 08:50:53 -05:00
Richard W.M. Jones 7b17ccd035 Additional fix for building with new libxslt 2022-02-22 19:20:58 +00:00
Richard W.M. Jones 908a2f2a46 Include upstream patch which fixes virt-install bug. 2022-02-22 18:56:30 +00:00
Fedora Release Engineering acf19787de - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 17:34:26 +00:00
Cole Robinson c269619b9a libvirt-8.0.0-1
Update to version 8.0.0
2022-01-14 09:47:22 -05:00
Richard W.M. Jones 3f6336f446 Bump release and rebuild for new xen 2022-01-11 15:09:05 +00:00
Daniel P. Berrangé a552a10ec8 Update to 7.10.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-01 11:17:47 +00:00
Daniel P. Berrangé bfb8157052 Update to 7.9.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-02 11:01:17 +00:00
Richard W.M. Jones edb5200d83 Bump and rebuild for fixed glusterfs on arm (RHBZ#2018182) 2021-10-28 16:52:27 +01:00
Daniel P. Berrangé fe3f90dedd Update to 7.8.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-10-01 13:15:51 +01:00
Daniel P. Berrangé 437df85540 Update to 7.7.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-02 16:51:33 +01:00
Daniel P. Berrangé 2d6cbe6672 Fix unit file deps and qemu-img test compat
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-31 16:18:29 +01:00
Daniel P. Berrangé 97a323d7c2 Fix repeated word in scriptlet name
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-31 12:36:11 +01:00
Daniel P. Berrangé cb839d3dfc Fix conditionals for %post scripts
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-05 10:16:12 +01:00
Daniel P. Berrangé dc6b512f3c switch to use modular daemons by default
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 18:01:17 +01:00
Daniel P. Berrangé ac122f4525 Update to 7.6.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-02 11:51:56 +01:00
Richard W.M. Jones 7744acbb6b Fix -Dwerror=false
Libvirt builds were failing because of:

../src/util/virconf.c: In function ‘virConfGetValueStringList’:
../src/util/virconf.c:950:13: error: Not available before 2.60 [-Werror]
  950 |         G_GNUC_FALLTHROUGH;
      |             ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

-Werror was being passed to GCC.

meson -Dwerror=false was being used which is supposed to disable
-Werror, but did not do so.

Apparently because of git being used to manage patches, libvirt thinks
it is being built from git so we need to use:

 -Dwerror=false -Dgit_werror=disabled

to really kill off -Werror.
2021-07-28 11:39:57 +01:00
Richard W.M. Jones 3807f07c15 Add fix for discard + copy-on-read affecting virt-v2v (RHBZ#1986509) 2021-07-28 10:38:30 +01:00
Fedora Release Engineering e484fdc92b - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 12:41:24 +00:00
Cole Robinson 6752fe8c9e libvirt-7.5.0-1
Update to version 7.5.0
2021-07-01 11:49:25 -04:00
Cole Robinson 15f52369ae libvirt-7.4.0-2
Rebuild for xen 4.14
2021-06-07 20:09:26 -04:00
Cole Robinson 65a0e26138 libvirt-7.4.0-1
Update to version 7.4.0
2021-06-01 09:41:31 -04:00
Daniel P. Berrangé 497e096592 Updatet to 7.3.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-04 11:54:16 +01:00
Cole Robinson 03a98aaf59 libvirt-7.2.0-1
Update to version 7.2.0
2021-04-05 12:51:44 -04:00
Richard W.M. Jones 5845f1efec Fix previous commit message, no change. 2021-03-09 13:37:30 +00:00
Richard W.M. Jones a8d01eb9d7 Bump and rebuild for libwsman_client.so.4 2021-03-09 13:26:35 +00:00
Cole Robinson 6d76ba5956 Fix 32bit compilation
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-03-01 13:16:14 -05:00
Cole Robinson a11202d9e2 libvirt-7.1.0-1
Update to version 7.1.0
2021-03-01 10:11:49 -05:00
Cole Robinson bbfa59c8da Increase meson test timeout to fix builds on s390x copr
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-02-03 14:23:33 -05:00
Laine Stump b97ad8956c Disable netcf backend for interface driver
Signed-off-by: Laine Stump <laine@redhat.com>
2021-02-02 12:47:35 -05:00
Fedora Release Engineering f9639a0012 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 18:16:33 +00:00
Daniel P. Berrangé c71e60c76c Rebase to 7.0.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-15 17:44:42 +00:00
Daniel P. Berrangé 9764121247 Cull 2019 vintage changelogs
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-05 18:12:21 +00:00
Cole Robinson a18ed3c492 Rebuild for wireshark soname bump
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-12-04 10:25:53 -05:00
Richard W.M. Jones 9e2eeb32e3 Build libvirt-daemon-kvm for riscv64. 2020-12-04 11:38:09 +00:00
Cole Robinson 8bf91f5d22 libvirt-6.10.0-1
Update to version 6.10.0
2020-12-01 10:16:26 -05:00
Daniel P. Berrangé 91d8eff569 Re-apply reverted fix for disabling glusterfs, curl, openswman and libiscsi
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-04 09:13:29 +00:00
Cole Robinson a761ea338f libvirt-6.9.0-1
Update to version 6.9.0
2020-11-03 11:22:45 -05:00
Daniel P. Berrangé 7eef88add4 Really fix disabling glusterfs, curl, openwsman and libiscsi
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-02 12:50:07 +00:00
Daniel P. Berrangé 0c88a64234 Fix name of meson option for disabling glusterfs
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-02 11:09:26 +00:00
Daniel P. Berrangé c2f3be1f4d Fix stat() mocking for new glibc
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-10-30 15:36:08 +00:00
Daniel P. Berrangé 18b1c9d77e Fix disablement of libssh/libssh2 & remove obsolete conditions
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-10-28 14:52:45 +00:00
Cole Robinson 4528832026 Fix glib errors in virsystemdtest
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-10-02 16:34:07 -04:00
Cole Robinson 037cd36ba2 libvirt-6.8.0-1
Update to version 6.8.0
2020-10-01 13:08:10 -04:00
Daniel P. Berrangé b94fb6a393 Fix QEMU start when KVM is not loaded (rhbz#1875327)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-04 14:05:21 +01:00
Cole Robinson b0c05ac2ae libvirt-6.7.0-1
Update to version 6.7.0
2020-09-01 10:36:57 -04:00
Merlin Mathesius 15c305caf3 Fix so no platforms depend upon ceph for 32-bit architectures
Include upstream patches to fix GCC 10 warnings

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2020-08-21 11:28:09 -05:00
Daniel P. Berrangé bc1b3e59a7 Fix creation of pools on non-btrfs (rhbz#1870197)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-21 11:47:16 +01:00
Daniel P. Berrangé 3c4492c415 Add a reminder to re-enable LTO in next release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-07 17:30:14 +01:00
Cole Robinson fecc0295a2 libvirt-6.6.0-1
Update to version 6.6.0
2020-08-04 10:35:23 -04:00
Daniel P. Berrangé 325dc837c6 Disable LTO to avoid LD_PRELOAD breakage
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-03 15:31:10 +01:00
Fedora Release Engineering 5a45cb7f0d - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 05:51:41 +00:00
Cole Robinson 21269530e8 libvirt-6.5.0-1
Update to version 6.5.0
2020-07-03 10:01:57 -04:00
Cole Robinson fc18e983e7 libvirt-6.4.0-1
Update to version 6.4.0
2020-06-02 13:43:43 -04:00
Cole Robinson 4a7cc743a9 libvirt-6.3.0-1
Update to version 6.3.0
2020-05-05 19:33:44 -04:00
Cole Robinson 4398397311 libvirt-6.2.0-1
Update to version 6.2.0
2020-04-02 16:10:01 -04:00
8 changed files with 801 additions and 1048 deletions
@@ -0,0 +1,48 @@
From 823a62ec8aac4fb75e6e281164f3eb56ae47597c Mon Sep 17 00:00:00 2001
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Tue, 1 Mar 2022 18:47:59 +0100
Subject: [PATCH] qemu: segmentation fault in virtqemud executing
qemuDomainUndefineFlags
Commit 5adfb3472342741c443ac91dee0abb18b5a3d038 causes a segmentation fault.
Stack trace of thread 664419:
#0 0x000003ff62ec553c in qemuDomainUndefineFlags (dom=0x3ff6c002810, flags=<optimized out>) at ../src/qemu/qemu_driver.c:6618
#1 0x000003ff876a7e5c in virDomainUndefineFlags (domain=domain@entry=0x3ff6c002810, flags=<optimized out>) at ../src/libvirt-domain.c:6519
#2 0x000002aa2b64a808 in remoteDispatchDomainUndefineFlags (server=0x2aa2c3d7880, msg=0x2aa2c3d2770, args=<optimized out>, rerr=0x3ff8287b950, client=<optimized out>)
at src/remote/remote_daemon_dispatch_stubs.h:13080
#3 remoteDispatchDomainUndefineFlagsHelper (server=0x2aa2c3d7880, client=<optimized out>, msg=0x2aa2c3d2770, rerr=0x3ff8287b950, args=<optimized out>, ret=0x0)
at src/remote/remote_daemon_dispatch_stubs.h:13059
#4 0x000003ff8758bbf4 in virNetServerProgramDispatchCall (msg=0x2aa2c3d2770, client=0x2aa2c3e3050, server=0x2aa2c3d7880, prog=0x2aa2c3d8010)
at ../src/rpc/virnetserverprogram.c:428
#5 virNetServerProgramDispatch (prog=0x2aa2c3d8010, server=server@entry=0x2aa2c3d7880, client=0x2aa2c3e3050, msg=0x2aa2c3d2770) at ../src/rpc/virnetserverprogram.c:302
#6 0x000003ff8758c260 in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0x2aa2c3d7880) at ../src/rpc/virnetserver.c:140
#7 virNetServerHandleJob (jobOpaque=0x2aa2c3e2d30, opaque=0x2aa2c3d7880) at ../src/rpc/virnetserver.c:160
#8 0x000003ff874c49aa in virThreadPoolWorker (opaque=<optimized out>) at ../src/util/virthreadpool.c:164
#9 0x000003ff874c3f62 in virThreadHelper (data=<optimized out>) at ../src/util/virthread.c:256
#10 0x000003ff86c1cf8c in start_thread () from /lib64/libc.so.6
#11 0x000003ff86c9650e in thread_start () from /lib64/libc.so.6
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bcd9bdb436..8337eed510 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6615,7 +6615,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
}
}
- if (vm->def->os.loader->nvram) {
+ if (vm->def->os.loader && vm->def->os.loader->nvram) {
nvram_path = g_strdup(vm->def->os.loader->nvram);
} else if (vm->def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) {
qemuDomainNVRAMPathFormat(cfg, vm->def, &nvram_path);
--
2.34.1
@@ -1,36 +0,0 @@
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 9 Mar 2020 16:40:57 +0100
Subject: [PATCH] virDomainDiskTranslateSourcePool: Check for disk type
correctly
When rewriting the virDomainDiskTranslateSourcePool() function in
v6.1.0-rc1~184 a typo was introduced. Previously, we allowed
startup policy only for those volumes which translated to
VIR_STORAGE_TYPE_FILE. But starting with the referenced commit,
the value we checked for was changed to VIR_STORAGE_VOL_FILE
which comes from a different enum and has a different value too.
This is wrong, because virStorageSourceGetActualType() returns a
value from the original enum.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1811728
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 3918dbd84e4951b43f93fbf50ef52be00274850c)
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 17867eeece..fd2e8f4eb5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31746,7 +31746,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
}
if (def->startupPolicy != 0 &&
- virStorageSourceGetActualType(def->src) != VIR_STORAGE_VOL_FILE) {
+ virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("'startupPolicy' is only valid for "
"'file' type volume"));
@@ -1,55 +0,0 @@
From: Laine Stump <laine@redhat.com>
Date: Thu, 7 May 2020 22:32:59 -0400
Subject: [PATCH] network: make it safe to call networkSetupPrivateChains()
multiple times
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
networkSetupPrivateChains() is currently called only once per run of
libvirtd, so it can assume that errInitV4 and errInitV6 are empty/null
when it is called. In preparation for potentially calling this
function multiple times during one run, this patch moves the reset of
errInitV[46] to the top of the function, to assure no memory is
leaked.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit de110f110fb917a31b9f33ad8e4b3c1d3284766a)
---
src/network/bridge_driver_linux.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_linux.c
index 7bbde5c6a9..80bd2409e1 100644
--- a/src/network/bridge_driver_linux.c
+++ b/src/network/bridge_driver_linux.c
@@ -48,6 +48,10 @@ static void networkSetupPrivateChains(void)
VIR_DEBUG("Setting up global firewall chains");
createdChains = false;
+ virFreeError(errInitV4);
+ errInitV4 = NULL;
+ virFreeError(errInitV6);
+ errInitV6 = NULL;
rc = iptablesSetupPrivateChains(VIR_FIREWALL_LAYER_IPV4);
if (rc < 0) {
@@ -56,8 +60,6 @@ static void networkSetupPrivateChains(void)
errInitV4 = virSaveLastError();
virResetLastError();
} else {
- virFreeError(errInitV4);
- errInitV4 = NULL;
if (rc) {
VIR_DEBUG("Created global IPv4 chains");
createdChains = true;
@@ -73,8 +75,6 @@ static void networkSetupPrivateChains(void)
errInitV6 = virSaveLastError();
virResetLastError();
} else {
- virFreeError(errInitV6);
- errInitV6 = NULL;
if (rc) {
VIR_DEBUG("Created global IPv6 chains");
createdChains = true;
@@ -1,265 +0,0 @@
From: Laine Stump <laine@redhat.com>
Date: Thu, 7 May 2020 21:54:39 -0400
Subject: [PATCH] network: force re-creation of iptables private chains on
firewalld restart
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When firewalld is stopped, it removes *all* iptables rules and chains,
including those added by libvirt. Since restarting firewalld means
stopping and then starting it, any time it is restarted, libvirt needs
to recreate all the private iptables chains it uses, along with all
the rules it adds.
We already have code in place to call networkReloadFirewallRules() any
time we're notified of a firewalld start, and
networkReloadFirewallRules() will call
networkPreReloadFirewallRules(), which calls
networkSetupPrivateChains(); unfortunately that last call is called
using virOnce(), meaning that it will only be called the first time
through networkPreReloadFirewallRules() after libvirtd starts - so of
course when firewalld is later restarted, the call to
networkSetupPrivateChains() is skipped.
The neat and tidy way to fix this would be if there was a standard way
to reset a pthread_once_t object so that the next time virOnce was
called, it would think the function hadn't been called, and call it
again. Unfortunately, there isn't any official way of doing that (we
*could* just fill it with 0 and hope for the best, but that doesn't
seem very safe.
So instead, this patch just adds a static variable called
chainInitDone, which is set to true after networkSetupPrivateChains()
is called for the first time, and then during calls to
networkPreReloadFirewallRules(), if chainInitDone is set, we call
networkSetupPrivateChains() directly instead of via virOnce().
It may seem unsafe to directly call a function that is meant to be
called only once, but I think in this case we're safe - there's
nothing in the function that is inherently "once only" - it doesn't
initialize anything that can't safely be re-initialized (as long as
two threads don't try to do it at the same time), and it only happens
when responding to a dbus message that firewalld has been started (and
I don't think it's possible for us to be processing two of those at
once), and even then only if the initial call to the function has
already been completed (so we're safe if we receive a firewalld
restart call at a time when we haven't yet called it, or even if
another thread is already in the process of executing it. The only
problematic bit I can think of is if another thread is in the process
of adding an iptable rule at the time we're executing this function,
but 1) none of those threads will be trying to add chains, and 2) if
there was a concurrency problem with other threads adding iptables
rules while firewalld was being restarted, it would still be a problem
even without this change.
This is yet another patch that fixes an occurrence of this error:
COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --insert LIBVIRT_INP --in-interface virbr0 --protocol tcp --destination-port 67 --jump ACCEPT' failed: iptables: No chain/target/match by that name.
In particular, this resolves: https://bugzilla.redhat.com/1813830
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit f5418b427e7d2f26803880309478de9103680826)
---
src/network/bridge_driver.c | 16 ++++---
src/network/bridge_driver_linux.c | 69 ++++++++++++++++++----------
src/network/bridge_driver_nop.c | 3 +-
src/network/bridge_driver_platform.h | 2 +-
4 files changed, 58 insertions(+), 32 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 369e80a889..aaf14defe4 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -273,7 +273,9 @@ static int
networkShutdownNetworkExternal(virNetworkObjPtr obj);
static void
-networkReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup);
+networkReloadFirewallRules(virNetworkDriverStatePtr driver,
+ bool startup,
+ bool force);
static void
networkRefreshDaemons(virNetworkDriverStatePtr driver);
@@ -689,7 +691,7 @@ firewalld_dbus_filter_bridge(DBusConnection *connection G_GNUC_UNUSED,
if (reload) {
VIR_DEBUG("Reload in bridge_driver because of firewalld.");
- networkReloadFirewallRules(driver, false);
+ networkReloadFirewallRules(driver, false, true);
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -798,7 +800,7 @@ networkStateInitialize(bool privileged,
virNetworkObjListPrune(network_driver->networks,
VIR_CONNECT_LIST_NETWORKS_INACTIVE |
VIR_CONNECT_LIST_NETWORKS_TRANSIENT);
- networkReloadFirewallRules(network_driver, true);
+ networkReloadFirewallRules(network_driver, true, false);
networkRefreshDaemons(network_driver);
if (virDriverShouldAutostart(network_driver->stateDir, &autostart) < 0)
@@ -868,7 +870,7 @@ networkStateReload(void)
network_driver->networkConfigDir,
network_driver->networkAutostartDir,
network_driver->xmlopt);
- networkReloadFirewallRules(network_driver, false);
+ networkReloadFirewallRules(network_driver, false, false);
networkRefreshDaemons(network_driver);
virNetworkObjListForEach(network_driver->networks,
networkAutostartConfig,
@@ -2236,14 +2238,16 @@ networkReloadFirewallRulesHelper(virNetworkObjPtr obj,
static void
-networkReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup)
+networkReloadFirewallRules(virNetworkDriverStatePtr driver,
+ bool startup,
+ bool force)
{
VIR_INFO("Reloading iptables rules");
/* Ideally we'd not even register the driver when unprivilegd
* but until we untangle the virt driver that's not viable */
if (!driver->privileged)
return;
- networkPreReloadFirewallRules(driver, startup);
+ networkPreReloadFirewallRules(driver, startup, force);
virNetworkObjListForEach(driver->networks,
networkReloadFirewallRulesHelper,
NULL);
diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_linux.c
index 80bd2409e1..b0bd207250 100644
--- a/src/network/bridge_driver_linux.c
+++ b/src/network/bridge_driver_linux.c
@@ -36,11 +36,14 @@ VIR_LOG_INIT("network.bridge_driver_linux");
#define PROC_NET_ROUTE "/proc/net/route"
static virOnceControl createdOnce;
-static bool createdChains;
+static bool chainInitDone; /* true iff networkSetupPrivateChains was ever called */
+static bool createdChains; /* true iff networkSetupPrivateChains created chains during most recent call */
static virErrorPtr errInitV4;
static virErrorPtr errInitV6;
-/* Only call via virOnce */
+/* Usually only called via virOnce, but can also be called directly in
+ * response to firewalld reload (if chainInitDone == true)
+ */
static void networkSetupPrivateChains(void)
{
int rc;
@@ -82,6 +85,8 @@ static void networkSetupPrivateChains(void)
VIR_DEBUG("Global IPv6 chains already exist");
}
}
+
+ chainInitDone = true;
}
@@ -111,7 +116,10 @@ networkHasRunningNetworks(virNetworkDriverStatePtr driver)
}
-void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup)
+void
+networkPreReloadFirewallRules(virNetworkDriverStatePtr driver,
+ bool startup,
+ bool force)
{
/*
* If there are any running networks, we need to
@@ -130,29 +138,42 @@ void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup
* of starting the network though as that makes them
* more likely to be seen by a human
*/
- if (!networkHasRunningNetworks(driver)) {
- VIR_DEBUG("Delayed global rule setup as no networks are running");
- return;
- }
+ if (chainInitDone && force) {
+ /* The Private chains have already been initialized once
+ * during this run of libvirtd, so 1) we can't do it again via
+ * virOnce(), and 2) we need to re-add the private chains even
+ * if there are currently no running networks, because the
+ * next time a network is started, libvirt will expect that
+ * the chains have already been added. So we call directly
+ * instead of via virOnce().
+ */
+ networkSetupPrivateChains();
- ignore_value(virOnce(&createdOnce, networkSetupPrivateChains));
+ } else {
+ if (!networkHasRunningNetworks(driver)) {
+ VIR_DEBUG("Delayed global rule setup as no networks are running");
+ return;
+ }
- /*
- * If this is initial startup, and we just created the
- * top level private chains we either
- *
- * - upgraded from old libvirt
- * - freshly booted from clean state
- *
- * In the first case we must delete the old rules from
- * the built-in chains, instead of our new private chains.
- * In the second case it doesn't matter, since no existing
- * rules will be present. Thus we can safely just tell it
- * to always delete from the builin chain
- */
- if (startup && createdChains) {
- VIR_DEBUG("Requesting cleanup of legacy firewall rules");
- iptablesSetDeletePrivate(false);
+ ignore_value(virOnce(&createdOnce, networkSetupPrivateChains));
+
+ /*
+ * If this is initial startup, and we just created the
+ * top level private chains we either
+ *
+ * - upgraded from old libvirt
+ * - freshly booted from clean state
+ *
+ * In the first case we must delete the old rules from
+ * the built-in chains, instead of our new private chains.
+ * In the second case it doesn't matter, since no existing
+ * rules will be present. Thus we can safely just tell it
+ * to always delete from the builin chain
+ */
+ if (startup && createdChains) {
+ VIR_DEBUG("Requesting cleanup of legacy firewall rules");
+ iptablesSetDeletePrivate(false);
+ }
}
}
diff --git a/src/network/bridge_driver_nop.c b/src/network/bridge_driver_nop.c
index 08d737511f..db89c10023 100644
--- a/src/network/bridge_driver_nop.c
+++ b/src/network/bridge_driver_nop.c
@@ -20,7 +20,8 @@
#include <config.h>
void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver G_GNUC_UNUSED,
- bool startup G_GNUC_UNUSED)
+ bool startup G_GNUC_UNUSED,
+ bool force G_GNUC_UNUSED)
{
}
diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driver_platform.h
index 169417a6c0..48ab52c160 100644
--- a/src/network/bridge_driver_platform.h
+++ b/src/network/bridge_driver_platform.h
@@ -62,7 +62,7 @@ struct _virNetworkDriverState {
typedef struct _virNetworkDriverState virNetworkDriverState;
typedef virNetworkDriverState *virNetworkDriverStatePtr;
-void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup);
+void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup, bool force);
void networkPostReloadFirewallRules(bool startup);
int networkCheckRouteCollision(virNetworkDefPtr def);
@@ -1,100 +0,0 @@
From: Laine Stump <laine@redhat.com>
Date: Fri, 1 May 2020 00:05:50 -0400
Subject: [PATCH] systemd: start libvirtd after firewalld/iptables services
When a system has enabled the iptables/ip6tables services rather than
firewalld, there is no explicit ordering of the start of those
services vs. libvirtd. This creates a problem when libvirtd.service is
started before ip[6]tables, as the latter, when it finally is started,
will remove all of the iptables rules that had previously been added
by libvirt, including the custom chains where libvirt's rules are
kept. This results in an error message similar to the following when a
user subsequently tries to start a new libvirt network:
"Error while activating network: Call to virNetworkCreate failed:
internal error: Failed to apply firewall rules
/usr/sbin/ip6tables -w --table filter --insert LIBVIRT_FWO \
--in-interface virbr2 --jump REJECT:
ip6tables: No chain/target/match by that name."
(Prior to logging this error, it also would have caused failure to
forward (or block) traffic in some cases, e.g. for guests on a NATed
network, since libvirt's rules to forward/block had all been deleted
and libvirt didn't know about it, so it couldn't fix the problem)
When this happens, the problem can be remedied by simply restarting
libvirtd.service (which has the side-effect of reloading all
libvirt-generated firewall rules)
Instead, we can just explicitly stating in the libvirtd.service file
that libvirtd.service should start after ip6tables.service and
ip6tables.service, eliminating the race condition that leads to the
error.
There is also nothing (that I can see) in the systemd .service files
to guarantee that firewalld.service will be started (if enabled) prior
to libvirtd.service. The same error scenario given above would occur
if libvirtd.service started before firewalld.service. Even before
that, though libvirtd would have detected that firewalld.service was
disabled, and then turn off all firewalld support. So, for example,
firewalld's libvirt zone wouldn't be used, and most likely traffic
from guests would therefore be blocked (all with no external
indication of the source of the problem other than a debug-level log
when libvirtd was started saying that firewalld wasn't in use); also
libvirtd wouldn't notice when firewalld reloaded its rules (which also
simultaneously deletes all of libvirt's rules).
I'm not aware of any reports that have been traced back to
libvirtd.service starting before firewalld.service, but have seen that
error reported multiple times, and also don't see an existing
dependency that would guarantee firewalld.service starts before
libvirtd.service, so it's possible it's been happening and we just
haven't gotten to the bottom of it.
This patch adds an After= line to the libvirtd.service file for each
of iptables.service, ip6tables.service, and firewalld.servicee, which
should guarantee that libvirtd.service isn't started until systemd has
started whichever of the others is enabled.
This race was diagnosed, and patch proposed, by Jason Montleon in
https://bugzilla.redhat.com/1723698 . At the time (April 2019) danpb
agreed with him that this change to libvirtd.service was a reasonable
thing to do, but I guess everyone thought someone else was going to
post a patch, so in the end nobody did.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 0756415f147dda15a417bd79eef9a62027d176e6)
---
src/network/virtnetworkd.service.in | 3 +++
src/remote/libvirtd.service.in | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/network/virtnetworkd.service.in b/src/network/virtnetworkd.service.in
index 656e8b4f84..56182e1693 100644
--- a/src/network/virtnetworkd.service.in
+++ b/src/network/virtnetworkd.service.in
@@ -5,6 +5,9 @@ Requires=virtnetworkd.socket
Requires=virtnetworkd-ro.socket
Requires=virtnetworkd-admin.socket
After=network.target
+After=firewalld.service
+After=iptables.service
+After=ip6tables.service
After=dbus.service
After=apparmor.service
After=local-fs.target
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
index 90b2cad5b0..cc0d4e3693 100644
--- a/src/remote/libvirtd.service.in
+++ b/src/remote/libvirtd.service.in
@@ -11,6 +11,9 @@ Wants=libvirtd-admin.socket
Wants=systemd-machined.service
Before=libvirt-guests.service
After=network.target
+After=firewalld.service
+After=iptables.service
+After=ip6tables.service
After=dbus.service
After=iscsid.service
After=apparmor.service
@@ -1,43 +0,0 @@
From: Jim Fehlig <jfehlig@suse.com>
Date: Fri, 3 Apr 2020 15:51:48 -0600
Subject: [PATCH] libxl: fix crash when initializing driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 54a401af478 split out DriverConfigInit from DriverConfigNew, but
then called it a bit late from libxlStateInitialize. The cfg is used in
libxlDriverConfigLoadFile and when uninitialized results in a crash.
Calling DriverConfigInit immediately after DriverConfigNew fixes the
crash.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 88011ed280c4f946a7b8e7ffcea2335eb075de60)
---
src/libxl/libxl_driver.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f2387e2a20..c4fb791fa0 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -703,14 +703,14 @@ libxlStateInitialize(bool privileged,
if (!(cfg = libxlDriverConfigNew()))
goto error;
+ if (libxlDriverConfigInit(cfg) < 0)
+ goto error;
+
driverConf = g_strdup_printf("%s/libxl.conf", cfg->configBaseDir);
if (libxlDriverConfigLoadFile(cfg, driverConf) < 0)
goto error;
- if (libxlDriverConfigInit(cfg) < 0)
- goto error;
-
/* Register the callbacks providing access to libvirt's event loop */
libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->ctx);
+752 -548
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
SHA512 (libvirt-6.1.0.tar.xz) = 17a2641f300a4a05149261bae74ac856e9a2511a259146595d2e2412c4a0601d88369b0544ba86edc80e433a47cf828317d8de38c6ec86a1b3efaca75294a606
SHA512 (libvirt-8.1.0.tar.xz) = 5db227b78f48e35f917030eeb45ce9d0f7e868c5ce75da496ca06fad175ad6b026173b2fb78415c0103a61af24aec78d89bcebdf60b817d8ff6e84dc926faa97