[libvirt] [go PATCH 10/37] secret: move wrapper functions out of compat header

Daniel P. Berrangé berrange at redhat.com
Mon Jul 16 13:23:56 UTC 2018


Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 secret_compat.go         | 47 ----------------------------------------
 secret_compat.h          |  3 ---
 secret_events_wrapper.go | 11 ++++++++++
 secret_events_wrapper.h  |  6 +++--
 4 files changed, 15 insertions(+), 52 deletions(-)
 delete mode 100644 secret_compat.go

diff --git a/secret_compat.go b/secret_compat.go
deleted file mode 100644
index 4444f6b..0000000
--- a/secret_compat.go
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of the libvirt-go project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * Copyright (c) 2013 Alex Zorin
- * Copyright (C) 2016 Red Hat, Inc.
- *
- */
-
-package libvirt
-
-/*
-#cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <assert.h>
-#include "secret_compat.h"
-
-int virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn,
-					      int callbackID)
-{
-#if LIBVIR_VERSION_NUMBER < 3000000
-    assert(0); // Caller should have checked version
-#else
-    return virConnectSecretEventDeregisterAny(conn, callbackID);
-#endif
-}
-
-
-*/
-import "C"
diff --git a/secret_compat.h b/secret_compat.h
index d1e1b8a..ba38c68 100644
--- a/secret_compat.h
+++ b/secret_compat.h
@@ -52,9 +52,6 @@ typedef void (*virConnectSecretEventGenericCallback)(virConnectPtr conn,
 						     void *opaque);
 #endif
 
-int virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn,
-					     int callbackID);
-
 /* 2.2.1 */
 
 #ifndef VIR_SECRET_USAGE_TYPE_TLS
diff --git a/secret_events_wrapper.go b/secret_events_wrapper.go
index 3366065..6e1ef21 100644
--- a/secret_events_wrapper.go
+++ b/secret_events_wrapper.go
@@ -61,5 +61,16 @@ int virConnectSecretEventRegisterAnyWrapper(virConnectPtr c,  virSecretPtr d,
 #endif
 }
 
+int virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn,
+					      int callbackID)
+{
+#if LIBVIR_VERSION_NUMBER < 3000000
+    assert(0); // Caller should have checked version
+#else
+    return virConnectSecretEventDeregisterAny(conn, callbackID);
+#endif
+}
+
+
 */
 import "C"
diff --git a/secret_events_wrapper.h b/secret_events_wrapper.h
index 1b5b527..f388542 100644
--- a/secret_events_wrapper.h
+++ b/secret_events_wrapper.h
@@ -28,13 +28,15 @@
 #define LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__
 
 void secretEventLifecycleCallbackHelper(virConnectPtr c, virSecretPtr d,
-				      int event, int detail, void* data);
+                                     int event, int detail, void* data);
 void secretEventGenericCallbackHelper(virConnectPtr c, virSecretPtr d,
-				    void* data);
+                                   void* data);
 
 int virConnectSecretEventRegisterAnyWrapper(virConnectPtr c,  virSecretPtr d,
                                          int eventID, virConnectSecretEventGenericCallback cb,
                                          long goCallbackId);
 
+int virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn,
+                                              int callbackID);
 
 #endif /* LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__ */
-- 
2.17.1




More information about the libvir-list mailing list