119c2d
From 7bcd75ca73d8eda05fafa8342309a8fd058cd326 Mon Sep 17 00:00:00 2001
119c2d
Message-Id: <7bcd75ca73d8eda05fafa8342309a8fd058cd326@dist-git>
119c2d
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
119c2d
Date: Thu, 24 Feb 2022 19:02:32 +0000
119c2d
Subject: [PATCH] qemu,lxc: remove use to nwfilter update lock
119c2d
MIME-Version: 1.0
119c2d
Content-Type: text/plain; charset=UTF-8
119c2d
Content-Transfer-Encoding: 8bit
119c2d
119c2d
Now that the virNWFilterBinding APIs are using the nwfilter
119c2d
update lock directly, there is no need for the virt drivers
119c2d
to do it themselves.
119c2d
119c2d
Reviewed-by: Laine Stump <laine@redhat.com>
119c2d
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
119c2d
(cherry picked from commit 5f8b090f421cd6a6c46f44905431491e2d3cf8f5)
119c2d
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2044379
119c2d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
119c2d
---
119c2d
 src/lxc/lxc_driver.c      |  6 ------
119c2d
 src/qemu/qemu_driver.c    | 18 ------------------
119c2d
 src/qemu/qemu_migration.c |  3 ---
119c2d
 src/qemu/qemu_process.c   |  4 ----
119c2d
 4 files changed, 31 deletions(-)
119c2d
119c2d
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
119c2d
index 7bc39120ee..e581c62668 100644
119c2d
--- a/src/lxc/lxc_driver.c
119c2d
+++ b/src/lxc/lxc_driver.c
119c2d
@@ -971,8 +971,6 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom,
119c2d
 
119c2d
     virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, -1);
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (!(vm = lxcDomObjFromDomain(dom)))
119c2d
         goto cleanup;
119c2d
 
119c2d
@@ -1014,7 +1012,6 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom,
119c2d
  cleanup:
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
     virObjectEventStateQueue(driver->domainEventState, event);
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return ret;
119c2d
 }
119c2d
 
119c2d
@@ -1080,8 +1077,6 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
119c2d
     if (flags & VIR_DOMAIN_START_VALIDATE)
119c2d
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (!(caps = virLXCDriverGetCapabilities(driver, false)))
119c2d
         goto cleanup;
119c2d
 
119c2d
@@ -1138,7 +1133,6 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
119c2d
  cleanup:
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
     virObjectEventStateQueue(driver->domainEventState, event);
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return dom;
119c2d
 }
119c2d
 
119c2d
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
119c2d
index d3d76c003f..00a86b6c7c 100644
119c2d
--- a/src/qemu/qemu_driver.c
119c2d
+++ b/src/qemu/qemu_driver.c
119c2d
@@ -1603,8 +1603,6 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
119c2d
     if (flags & VIR_DOMAIN_START_AUTODESTROY)
119c2d
         start_flags |= VIR_QEMU_PROCESS_START_AUTODESTROY;
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (!(def = virDomainDefParseString(xml, driver->xmlopt,
119c2d
                                         NULL, parse_flags)))
119c2d
         goto cleanup;
119c2d
@@ -1658,7 +1656,6 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
     virObjectEventStateQueue(driver->domainEventState, event);
119c2d
     virObjectEventStateQueue(driver->domainEventState, event2);
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return dom;
119c2d
 }
119c2d
 
119c2d
@@ -5773,8 +5770,6 @@ qemuDomainRestoreFlags(virConnectPtr conn,
119c2d
                   VIR_DOMAIN_SAVE_PAUSED, -1);
119c2d
 
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     fd = qemuSaveImageOpen(driver, NULL, path, &def, &data,
119c2d
                            (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE) != 0,
119c2d
                            &wrapperFd, false, false);
119c2d
@@ -5846,7 +5841,6 @@ qemuDomainRestoreFlags(virConnectPtr conn,
119c2d
     if (vm && ret < 0)
119c2d
         qemuDomainRemoveInactiveJob(driver, vm);
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return ret;
119c2d
 }
119c2d
 
119c2d
@@ -6395,8 +6389,6 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
119c2d
                   VIR_DOMAIN_START_BYPASS_CACHE |
119c2d
                   VIR_DOMAIN_START_FORCE_BOOT, -1);
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (!(vm = qemuDomainObjFromDomain(dom)))
119c2d
         goto cleanup;
119c2d
 
119c2d
@@ -6425,7 +6417,6 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
119c2d
 
119c2d
  cleanup:
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return ret;
119c2d
 }
119c2d
 
119c2d
@@ -7811,8 +7802,6 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
119c2d
     virDomainObj *vm = NULL;
119c2d
     int ret = -1;
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (!(vm = qemuDomainObjFromDomain(dom)))
119c2d
         goto cleanup;
119c2d
 
119c2d
@@ -7835,7 +7824,6 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
119c2d
 
119c2d
  cleanup:
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return ret;
119c2d
 }
119c2d
 
119c2d
@@ -7865,8 +7853,6 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
119c2d
                   VIR_DOMAIN_AFFECT_CONFIG |
119c2d
                   VIR_DOMAIN_DEVICE_MODIFY_FORCE, -1);
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     cfg = virQEMUDriverGetConfig(driver);
119c2d
 
119c2d
     if (!(vm = qemuDomainObjFromDomain(dom)))
119c2d
@@ -7943,7 +7929,6 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
119c2d
     if (dev != dev_copy)
119c2d
         virDomainDeviceDefFree(dev_copy);
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return ret;
119c2d
 }
119c2d
 
119c2d
@@ -13644,8 +13629,6 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
119c2d
     virDomainObj *vm = NULL;
119c2d
     int ret = -1;
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (!(vm = qemuDomObjFromSnapshot(snapshot)))
119c2d
         goto cleanup;
119c2d
 
119c2d
@@ -13656,7 +13639,6 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
119c2d
 
119c2d
  cleanup:
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     return ret;
119c2d
 }
119c2d
 
119c2d
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
119c2d
index 2635ef1162..358cb9c3b5 100644
119c2d
--- a/src/qemu/qemu_migration.c
119c2d
+++ b/src/qemu/qemu_migration.c
119c2d
@@ -2779,8 +2779,6 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
119c2d
     int rv;
119c2d
     g_autofree char *tlsAlias = NULL;
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     if (flags & VIR_MIGRATE_OFFLINE) {
119c2d
         if (flags & (VIR_MIGRATE_NON_SHARED_DISK |
119c2d
                      VIR_MIGRATE_NON_SHARED_INC)) {
119c2d
@@ -3101,7 +3099,6 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
119c2d
     virDomainObjEndAPI(&vm;;
119c2d
     virObjectEventStateQueue(driver->domainEventState, event);
119c2d
     qemuMigrationCookieFree(mig);
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     virErrorRestore(&origErr);
119c2d
     return ret;
119c2d
 
119c2d
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
119c2d
index 5c6657a876..914f9bef8b 100644
119c2d
--- a/src/qemu/qemu_process.c
119c2d
+++ b/src/qemu/qemu_process.c
119c2d
@@ -8986,7 +8986,6 @@ qemuProcessReconnect(void *opaque)
119c2d
             qemuDomainRemoveInactiveJob(driver, obj);
119c2d
     }
119c2d
     virDomainObjEndAPI(&obj);
119c2d
-    virNWFilterUnlockFilterUpdates();
119c2d
     virIdentitySetCurrent(NULL);
119c2d
     return;
119c2d
 
119c2d
@@ -9038,8 +9037,6 @@ qemuProcessReconnectHelper(virDomainObj *obj,
119c2d
     data->obj = obj;
119c2d
     data->identity = virIdentityGetCurrent();
119c2d
 
119c2d
-    virNWFilterReadLockFilterUpdates();
119c2d
-
119c2d
     /* this lock and reference will be eventually transferred to the thread
119c2d
      * that handles the reconnect */
119c2d
     virObjectLock(obj);
119c2d
@@ -9062,7 +9059,6 @@ qemuProcessReconnectHelper(virDomainObj *obj,
119c2d
         qemuDomainRemoveInactiveJobLocked(src->driver, obj);
119c2d
 
119c2d
         virDomainObjEndAPI(&obj);
119c2d
-        virNWFilterUnlockFilterUpdates();
119c2d
         g_clear_object(&data->identity);
119c2d
         VIR_FREE(data);
119c2d
         return -1;
119c2d
-- 
119c2d
2.35.1
119c2d