[PATCH 10/10] virclosecallbacks: Don't pass opqaue pointer to callback invocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove the argument from the function prototypes and the callback
handler.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/bhyve/bhyve_driver.c           | 2 +-
 src/bhyve/bhyve_process.c          | 3 +--
 src/hypervisor/virclosecallbacks.c | 5 ++---
 src/hypervisor/virclosecallbacks.h | 6 ++----
 src/lxc/lxc_driver.c               | 2 +-
 src/lxc/lxc_process.c              | 3 +--
 src/qemu/qemu_driver.c             | 2 +-
 src/qemu/qemu_migration.c          | 3 +--
 src/qemu/qemu_process.c            | 3 +--
 9 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 51973ae670..09ba52483a 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -207,7 +207,7 @@ bhyveConnectClose(virConnectPtr conn)
 {
     struct _bhyveConn *privconn = conn->privateData;

-    virCloseCallbacksRun(privconn->closeCallbacks, conn, privconn->domains, privconn);
+    virCloseCallbacksRun(privconn->closeCallbacks, conn, privconn->domains);
     conn->privateData = NULL;

     return 0;
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index 40c97cb6ca..18002b559b 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -56,8 +56,7 @@ VIR_LOG_INIT("bhyve.bhyve_process");

 static void
 bhyveProcessAutoDestroy(virDomainObj *vm,
-                        virConnectPtr conn G_GNUC_UNUSED,
-                        void *opaque G_GNUC_UNUSED)
+                        virConnectPtr conn G_GNUC_UNUSED)
 {
     bhyveDomainObjPrivate *priv = vm->privateData;
     struct _bhyveConn *driver = priv->driver;
diff --git a/src/hypervisor/virclosecallbacks.c b/src/hypervisor/virclosecallbacks.c
index 84a61b002a..c533e695f1 100644
--- a/src/hypervisor/virclosecallbacks.c
+++ b/src/hypervisor/virclosecallbacks.c
@@ -284,8 +284,7 @@ virCloseCallbacksGetForConn(virCloseCallbacks *closeCallbacks,
 void
 virCloseCallbacksRun(virCloseCallbacks *closeCallbacks,
                      virConnectPtr conn,
-                     virDomainObjList *domains,
-                     void *opaque)
+                     virDomainObjList *domains)
 {
     virCloseCallbacksList *list;
     size_t i;
@@ -329,7 +328,7 @@ virCloseCallbacksRun(virCloseCallbacks *closeCallbacks,
          *
          * Call the callback function and end the API usage. */
         virObjectUnref(vm);
-        list->entries[i].callback(vm, conn, opaque);
+        list->entries[i].callback(vm, conn);
         virDomainObjEndAPI(&vm);
     }
     VIR_FREE(list->entries);
diff --git a/src/hypervisor/virclosecallbacks.h b/src/hypervisor/virclosecallbacks.h
index 138e0eb689..5a56dea292 100644
--- a/src/hypervisor/virclosecallbacks.h
+++ b/src/hypervisor/virclosecallbacks.h
@@ -25,8 +25,7 @@
 typedef struct _virCloseCallbacks virCloseCallbacks;

 typedef void (*virCloseCallback)(virDomainObj *vm,
-                                 virConnectPtr conn,
-                                 void *opaque);
+                                 virConnectPtr conn);

 virCloseCallbacks *
 virCloseCallbacksNew(void);
@@ -52,5 +51,4 @@ virCloseCallbacksGetConn(virCloseCallbacks *closeCallbacks,
 void
 virCloseCallbacksRun(virCloseCallbacks *closeCallbacks,
                      virConnectPtr conn,
-                     virDomainObjList *domains,
-                     void *opaque);
+                     virDomainObjList *domains);
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index a42299eeea..31de677b88 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -169,7 +169,7 @@ static int lxcConnectClose(virConnectPtr conn)
 {
     virLXCDriver *driver = conn->privateData;

-    virCloseCallbacksRun(driver->closeCallbacks, conn, driver->domains, driver);
+    virCloseCallbacksRun(driver->closeCallbacks, conn, driver->domains);
     conn->privateData = NULL;
     return 0;
 }
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 368adaea7e..9722d8e1de 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -62,8 +62,7 @@ VIR_LOG_INIT("lxc.lxc_process");

 static void
 lxcProcessAutoDestroy(virDomainObj *dom,
-                      virConnectPtr conn,
-                      void *opaque G_GNUC_UNUSED)
+                      virConnectPtr conn)
 {
     virObjectEvent *event = NULL;
     virLXCDomainObjPrivate *priv = dom->privateData;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 702fd0239c..1d39af1891 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1161,7 +1161,7 @@ static int qemuConnectClose(virConnectPtr conn)
     virQEMUDriver *driver = conn->privateData;

     /* Get rid of callbacks registered for this conn */
-    virCloseCallbacksRun(driver->closeCallbacks, conn, driver->domains, driver);
+    virCloseCallbacksRun(driver->closeCallbacks, conn, driver->domains);

     conn->privateData = NULL;

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 7de0929a36..438f2bc999 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2163,8 +2163,7 @@ qemuMigrationDstRun(virQEMUDriver *driver,
  */
 static void
 qemuMigrationSrcCleanup(virDomainObj *vm,
-                        virConnectPtr conn,
-                        void *opaque G_GNUC_UNUSED)
+                        virConnectPtr conn)
 {
     qemuDomainObjPrivate *priv = vm->privateData;
     virQEMUDriver *driver = priv->driver;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a66ca9aa60..da7f2ccaa0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8386,8 +8386,7 @@ void qemuProcessStop(virQEMUDriver *driver,

 static void
 qemuProcessAutoDestroy(virDomainObj *dom,
-                       virConnectPtr conn,
-                       void *opaque G_GNUC_UNUSED)
+                       virConnectPtr conn)
 {
     qemuDomainObjPrivate *priv = dom->privateData;
     virQEMUDriver *driver = priv->driver;
-- 
2.35.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux